diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 16c37a1ee9..b1db01014d 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -123,14 +123,7 @@ int main(int argc, char *argv[]) if (correctPhi) { - // Calculate absolute flux - // from the mapped surface velocity - phi = mesh.Sf() & Uf(); - #include "correctPhi.H" - - // Make the fluxes relative to the mesh motion - fvc::makeRelative(phi, U); } mixture.correct(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterFoam/correctPhi.H index d658a9d4a6..2c4ea62aa8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/correctPhi.H +++ b/applications/solvers/multiphase/compressibleInterFoam/correctPhi.H @@ -1,3 +1,7 @@ +// Calculate absolute flux +// from the mapped surface velocity +phi = mesh.Sf() & Uf(); + CorrectPhi ( U, @@ -10,3 +14,6 @@ CorrectPhi ); #include "continuityErrs.H" + +// Make the fluxes relative to the mesh motion +fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFieldRefs.H b/applications/solvers/multiphase/compressibleInterFoam/createFieldRefs.H index fc0db78f7d..3080d67b02 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFieldRefs.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFieldRefs.H @@ -11,3 +11,20 @@ const volScalarField& psi1 = mixture.thermo1().psi(); const volScalarField& psi2 = mixture.thermo2().psi(); tmp rAU; + +if (correctPhi) +{ + rAU = new volScalarField + ( + IOobject + ( + "rAU", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar(dimTime/dimDensity, 1) + ); +} diff --git a/applications/solvers/multiphase/interFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/correctPhi.H index 3c4d320762..8a4682c882 100644 --- a/applications/solvers/multiphase/interFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/correctPhi.H @@ -1,3 +1,7 @@ +// Calculate absolute flux +// from the mapped surface velocity +phi = mesh.Sf() & Uf(); + if (divU.valid()) { CorrectPhi @@ -26,3 +30,6 @@ else } #include "continuityErrs.H" + +// Make the flux relative to the mesh motion +fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 462ebfacec..e28a9cde47 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -135,14 +135,7 @@ int main(int argc, char *argv[]) if (correctPhi) { - // Calculate absolute flux - // from the mapped surface velocity - phi = mesh.Sf() & Uf(); - #include "correctPhi.H" - - // Make the flux relative to the mesh motion - fvc::makeRelative(phi, U); } mixture.correct();