This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/compressible/steadyUniversalFoam/createThermo.H

52 lines
1.3 KiB
C++
Raw Normal View History

Info<< "Reading thermophysical properties\n" << endl;
volScalarField* pPtr = NULL;
volScalarField* hPtr = NULL;
const volScalarField* TPtr = NULL;
volScalarField* psisPtr = NULL;
basicThermo* thermoPtr = NULL;
Switch compressible;
{
dictionary pimple = mesh.solutionDict().subDict("PIMPLE");
compressible = Switch(pimple.lookup("compressible"));
if (compressible)
{
thermoPtr =
(
basicPsiThermo::New(mesh)
).ptr();
pPtr = &(thermoPtr->p());
hPtr = &(thermoPtr->h());
TPtr = &(thermoPtr->T());
psisPtr = new volScalarField
(
"psi",
thermoPtr->psi()/thermoPtr->Cp()*thermoPtr->Cv()
);
}
else
{
thermoPtr =
(
basicRhoThermo::New(mesh)
).ptr();
pPtr = &(thermoPtr->p());
hPtr = &(thermoPtr->h());
TPtr = &(thermoPtr->T());
psisPtr = const_cast<volScalarField*>(&(thermoPtr->psi()));
}
}
basicThermo& thermo = *thermoPtr;
volScalarField& p = *pPtr;
volScalarField& h = *hPtr;
const volScalarField& T = *TPtr;
volScalarField& psis = *psisPtr;