c0dc374d98
Conflicts: applications/solvers/compressible/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C applications/solvers/compressible/steadyCompressibleFoam/pEqn.H applications/solvers/compressible/steadyCompressibleMRFFoam/createFields.H applications/solvers/compressible/steadyCompressibleMRFFoam/pEqn.H applications/solvers/compressible/steadyCompressibleSRFFoam/createFields.H applications/solvers/compressible/steadyCompressibleSRFFoam/pEqn.H applications/solvers/coupled/MRFPorousFoam/createFields.H applications/solvers/coupled/pUCoupledFoam/createFields.H tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSolution tutorials/compressible/steadyCompressibleFoam/transonicBump/system/fvSchemes tutorials/compressible/steadyCompressibleSRFFoam/bentBlade/system/fvSchemes tutorials/compressible/steadyCompressibleSRFFoam/simpleBlade/system/fvSchemes tutorials/coupled/conjugateHeatFoam/conjugateCavity/system/fvSchemes tutorials/coupled/conjugateHeatSimpleFoam/conjugateCavity/system/fvSchemes tutorials/equationReader/equationReaderDemo/pitzDaily/system/fvSchemes tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSchemes tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSchemes tutorials/incompressible/pUCoupledFoam/backwardFacingStepLaminar/system/fvSchemes tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/system/fvSchemes tutorials/incompressible/pUCoupledFoam/cavity/system/fvSchemes tutorials/viscoelastic/viscoelasticFluidFoam/XPP_SE/system/fvSchemes
47 lines
1 KiB
C
47 lines
1 KiB
C
{
|
|
fvScalarMatrix eEqn
|
|
(
|
|
fvm::ddt(rho, e)
|
|
+ fvm::div(phi, e)
|
|
- fvm::laplacian(turbulence->alphaEff(), e)
|
|
==
|
|
- fvm::SuSp
|
|
(
|
|
p*fvc::div
|
|
(
|
|
phi/fvc::interpolate(rho)
|
|
+ fvc::meshPhi(rho, U)
|
|
)/e,
|
|
e
|
|
)
|
|
// viscous heating?
|
|
);
|
|
|
|
eEqn.relax
|
|
(
|
|
mesh.solutionDict().relaxationFactor(e.select(pimple.finalIter()))
|
|
);
|
|
|
|
eEqn.solve();
|
|
|
|
// Bound the energy using TMin and TMax
|
|
{
|
|
dimensionedScalar Tstd("Tstd", dimTemperature, specie::Tstd());
|
|
|
|
volScalarField Cv = thermo.Cv();
|
|
volScalarField R = thermo.Cp() - Cv;
|
|
|
|
e = Foam::min(e, TMax*Cv + R*Tstd);
|
|
e = Foam::max(e, TMin*Cv + R*Tstd);
|
|
e.correctBoundaryConditions();
|
|
}
|
|
|
|
thermo.correct();
|
|
|
|
// Recalculate compressibility
|
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
|
|
|
// Recalculate density
|
|
rho = thermo.rho();
|
|
rho.correctBoundaryConditions();
|
|
}
|