diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index 1d70a0f354b1ab8a11fdd5ecd6978e0a3effb5d6..40cf109457916f765b7b56e4ebb1414e900862bf 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -22,7 +22,7 @@ if (pimple.transonic()) fvc::interpolate(psi) *( (fvc::interpolate(rho*HbyA) & mesh.Sf()) - + rhorAUf*fvc::ddtCorr(rho, U, phiAbs) + + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) )/fvc::interpolate(rho) ); @@ -55,7 +55,7 @@ else ( "phiHbyA", (fvc::interpolate(rho*HbyA) & mesh.Sf()) - + rhorAUf*fvc::ddtCorr(rho, U, phiAbs) + + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C index dac6980917aca96776c2088fb8fc953a24948602..aae32851863f83ce2f6cb9128fa6b7946a1377a9 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C @@ -56,13 +56,10 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "createFvOptions.H" #include "createPcorrTypes.H" + #include "createRhoUf.H" #include "CourantNo.H" #include "setInitialDeltaT.H" - // Create old-time absolute flux for ddtCorr - surfaceScalarField phiAbs("phiAbs", phi); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -72,12 +69,6 @@ int main(int argc, char *argv[]) #include "readControls.H" #include "compressibleCourantNo.H" - // Make the fluxes absolute before mesh-motion - fvc::makeAbsolute(phi, rho, U); - - // Update absolute flux for ddtCorr - phiAbs = phi; - #include "setDeltaT.H" runTime++; @@ -86,20 +77,23 @@ int main(int argc, char *argv[]) { // Store divrhoU from the previous time-step/mesh for the correctPhi - volScalarField divrhoU(fvc::div(phi)); + volScalarField divrhoU(fvc::div(fvc::absolute(phi, rho, U))); // Do any mesh changes mesh.update(); if (mesh.changing() && correctPhi) { + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & rhoUf; + #include "correctPhi.H" + + // Make the fluxes relative to the mesh-motion + fvc::makeRelative(phi, rho, U); } } - // Make the fluxes relative to the mesh-motion - fvc::makeRelative(phi, rho, U); - if (mesh.changing() && checkMeshCourantNo) { #include "meshCourantNo.H" diff --git a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C index f3bf760877b531ae6a0a83309afd2d7f6b90d56b..4d578cc59d198cdcc182d5ce8117f71bda433636 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C @@ -174,7 +174,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute { if (tphi().mesh().moving()) { - return tphi + fvc::meshPhi(rho, U); + return tphi + fvc::interpolate(rho)*fvc::meshPhi(rho, U); } else {