Skip to content
Snippets Groups Projects
Commit 0417e181 authored by Henry's avatar Henry
Browse files

rhoPimpleDyMFoam: Updated to use Uf rather than phiAbs for ddtCorr

parent d2cefa9b
Branches
Tags
No related merge requests found
......@@ -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);
......
......@@ -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"
......
......@@ -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
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment