mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
sonicFoam: change internal energy equation formulation to conserve total energy
This commit is contained in:
@ -6,3 +6,4 @@ fvVectorMatrix UEqn
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
@ -49,3 +49,6 @@
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
+ fvm::div(phi, e)
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
==
|
||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||
- (fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho)))
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
|
||||
@ -39,3 +39,4 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
|
||||
U = HbyA - rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
@ -56,16 +56,12 @@ int main(int argc, char *argv[])
|
||||
#include "compressibleCourantNo.H"
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
#include "eEqn.H"
|
||||
|
||||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
{
|
||||
#include "eEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user