Bugfix: regular formulation of enthalpy source terms

This commit is contained in:
Hrvoje Jasak 2016-02-05 17:48:36 +00:00
parent acb0ba58a4
commit f42adf48ab
4 changed files with 12 additions and 15 deletions

View file

@ -93,4 +93,4 @@
),
h
);
i -= 0.5*magSqr(Urot);
i == h - 0.5*(magSqr(Urot) - magSqr(Urel));

View file

@ -2,7 +2,12 @@
// Solve the enthalpy equation
T.storePrevIter();
surfaceScalarField faceU = phi/fvc::interpolate(rho);
// Calculate face velocity from flux
surfaceScalarField faceU
(
"faceU",
phi/fvc::interpolate(rho)
);
fvScalarMatrix hEqn
(

View file

@ -26,9 +26,10 @@
fvm::ddt(rho, i)
+ fvm::div(phi, i)
- fvm::laplacian(turbulence->alphaEff(), i)
// u & gradP term (steady-state formulation)
+ fvm::SuSp((fvc::div(faceU, p, "div(U,p)") - fvc::div(faceU)*p)/i, i)
==
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
fvc::div(faceU, p, "div(U,p)")
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(Urel))
);
@ -42,16 +43,6 @@
h = i + 0.5*magSqr(Urot);
h.correctBoundaryConditions();
// Bound the enthalpy using TMin and TMax
volScalarField Cp = thermo.Cp();
h = Foam::min(h, TMax*Cp);
h = Foam::max(h, TMin*Cp);
h.correctBoundaryConditions();
// Re-initialise rothalpy based on limited enthalpy
i = h - 0.5*magSqr(Urot);
thermo.correct();
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
}

View file

@ -4,9 +4,10 @@
surfaceScalarField psisf = fvc::interpolate(psis);
surfaceScalarField rhof = fvc::interpolate(rho);
// Needs to be outside of loop since p is changing, but psi and rho are not.
// Needs to be outside of loop since p is changing, but psi and rho are not
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
{
U = rUA*UEqn.H();