sonicFoam: change internal energy equation formulation to conserve total energy

This commit is contained in:
Henry
2012-09-12 15:36:39 +01:00
parent 4d0620eaa6
commit 7eef5af786
16 changed files with 2056 additions and 62 deletions

View File

@ -6,3 +6,4 @@ fvVectorMatrix UEqn
);
solve(UEqn == -fvc::grad(p));
K = 0.5*magSqr(U);

View File

@ -49,3 +49,6 @@
thermo
)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -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();

View File

@ -39,3 +39,4 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);

View File

@ -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"
}