Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / compressible / sonicDyMFoam / eEqn.H
blob5a45964375f4274ba6127e8243ac612da2d69ecf
2     fvScalarMatrix eEqn
3     (
4         fvm::ddt(rho, e)
5       + fvm::div(phi, e)
6       - fvm::laplacian(turbulence->alphaEff(), e)
7      ==
8       - fvm::SuSp
9         (
10             p*fvc::div
11             (
12                 phi/fvc::interpolate(rho)
13               + fvc::meshPhi(rho, U)
14             )/e,
15             e
16         )
17         // viscous heating?
18     );
20     if (oCorr == nOuterCorr - 1)
21     {
22         if (mesh.solutionDict().relax("eFinal"))
23         {
24             eEqn.relax(mesh.solutionDict().relaxationFactor("eFinal"));
25         }
26         else
27         {
28             eEqn.relax(1);
29         }
30     }
31     else
32     {
33         eEqn.relax();
34     }
36     eEqn.solve();
38     // Bound the energy using TMin and TMax
39     {
40         dimensionedScalar Tstd("Tstd", dimTemperature, specie::Tstd());
42         volScalarField Cv = thermo.Cv();
43         volScalarField R = thermo.Cp() - Cv;
45         e = Foam::min(e, TMax*Cv + R*Tstd);
46         e = Foam::max(e, TMin*Cv + R*Tstd);
47         e.correctBoundaryConditions();
48     }
50     thermo.correct();
52     // Recalculate compressibility
53     psis = thermo.psi()/thermo.Cp()*thermo.Cv();
55     // Recalculate density
56     rho = thermo.rho();
57     rho.correctBoundaryConditions();