From 0417e181e946d7cd2e688e472a64ab7e0342fc60 Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Thu, 12 Sep 2013 14:58:27 +0100 Subject: [PATCH] rhoPimpleDyMFoam: Updated to use Uf rather than phiAbs for ddtCorr --- .../rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H | 4 ++-- .../rhoPimpleDyMFoam/rhoPimpleDyMFoam.C | 22 +++++++------------ .../finiteVolume/fvc/fvcMeshPhi.C | 2 +- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index 1d70a0f354b..40cf1094579 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 dac6980917a..aae32851863 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 f3bf760877b..4d578cc59d1 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 { -- GitLab