35 template<
class BasicThermo,
class MixtureType>
43 if (isA<gradientEnergyFvPatchScalarField>(hBf[patchi]))
45 refCast<gradientEnergyFvPatchScalarField>(hBf[patchi]).gradient()
46 = hBf[patchi].fvPatchField::snGrad();
48 else if (isA<mixedEnergyFvPatchScalarField>(hBf[patchi]))
50 refCast<mixedEnergyFvPatchScalarField>(hBf[patchi]).refGrad()
51 = hBf[patchi].fvPatchField::snGrad();
57 template<
class BasicThermo,
class MixtureType>
72 this->cellMixture(celli).HE(pCells[celli], TCells[celli]);
75 volScalarField::Boundary& heBf =
he.boundaryFieldRef();
79 heBf[patchi] == this->
he 82 T.boundaryField()[patchi],
86 heBf[patchi].useImplicit(
T.boundaryField()[patchi].useImplicit());
89 this->heBoundaryCorrection(
he);
94 init(
p.oldTime(),
T.oldTime(),
he.oldTime());
101 template<
class BasicThermo,
class MixtureType>
105 const word& phaseName
108 BasicThermo(
mesh, phaseName),
109 MixtureType(*this,
mesh, phaseName),
115 BasicThermo::phasePropertyName
117 MixtureType::thermoType::heName()
126 this->heBoundaryTypes(),
127 this->heBoundaryBaseTypes()
130 init(this->p_, this->T_, he_);
134 template<
class BasicThermo,
class MixtureType>
139 const word& phaseName
143 MixtureType(*this,
mesh, phaseName),
149 BasicThermo::phasePropertyName
151 MixtureType::thermoType::heName()
160 this->heBoundaryTypes(),
161 this->heBoundaryBaseTypes()
164 init(this->p_, this->T_, he_);
168 template<
class BasicThermo,
class MixtureType>
172 const word& phaseName,
173 const word& dictionaryName
176 BasicThermo(
mesh, phaseName, dictionaryName),
177 MixtureType(*this,
mesh, phaseName),
183 BasicThermo::phasePropertyName
185 MixtureType::thermoType::heName()
194 this->heBoundaryTypes(),
195 this->heBoundaryBaseTypes()
198 init(this->p_, this->T_, he_);
205 template<
class BasicThermo,
class MixtureType>
212 template<
class BasicThermo,
class MixtureType>
228 mesh.time().timeName(),
232 IOobject::NO_REGISTER
247 this->cellMixture(celli).HE(pCells[celli], TCells[celli]);
250 volScalarField::Boundary& heBf =
he.boundaryFieldRef();
261 this->patchFaceMixture(patchi, facei).HE(
pp[facei], Tp[facei]);
269 template<
class BasicThermo,
class MixtureType>
282 he[celli] = this->cellMixture(
cells[celli]).HE(
p[celli],
T[celli]);
289 template<
class BasicThermo,
class MixtureType>
303 this->patchFaceMixture(patchi, facei).HE(
p[facei],
T[facei]);
310 template<
class BasicThermo,
class MixtureType>
323 mesh.time().timeName(),
327 IOobject::NO_REGISTER
339 hcCells[celli] = this->cellMixture(celli).Hc();
350 hcp[facei] = this->patchFaceMixture(patchi, facei).Hc();
358 template<
class BasicThermo,
class MixtureType>
372 this->patchFaceMixture(patchi, facei).Cp(
p[facei],
T[facei]);
379 template<
class BasicThermo,
class MixtureType>
389 auto&
Cp =
tCp.ref();
393 const label celli =
cells[i];
394 Cp[i] = this->cellMixture(celli).Cp(
p[i],
T[i]);
401 template<
class BasicThermo,
class MixtureType>
414 mesh.time().timeName(),
418 IOobject::NO_REGISTER
430 this->cellMixture(celli).Cp(this->p_[celli], this->T_[celli]);
433 volScalarField::Boundary& cpBf =
cp.boundaryFieldRef();
444 this->patchFaceMixture(patchi, facei).Cp(
pp[facei], pT[facei]);
452 template<
class BasicThermo,
class MixtureType>
467 this->patchFaceMixture(patchi, facei).Cv(
p[facei],
T[facei]);
474 template<
class BasicThermo,
class MixtureType>
484 auto&
rho = tRho.ref();
488 const label celli =
cells[i];
489 rho[i] = this->cellMixture(celli).rho(
p[i],
T[i]);
496 template<
class BasicThermo,
class MixtureType>
509 mesh.time().timeName(),
513 IOobject::NO_REGISTER
525 this->cellMixture(celli).Cv(this->p_[celli], this->T_[celli]);
528 volScalarField::Boundary& cvBf = cv.boundaryFieldRef();
534 this->p_.boundaryField()[patchi],
535 this->T_.boundaryField()[patchi],
544 template<
class BasicThermo,
class MixtureType>
558 this->patchFaceMixture(patchi, facei).gamma(
p[facei],
T[facei]);
565 template<
class BasicThermo,
class MixtureType>
578 mesh.time().timeName(),
582 IOobject::NO_REGISTER
594 this->cellMixture(celli).gamma(this->p_[celli], this->T_[celli]);
597 volScalarField::Boundary& gammaBf =
gamma.boundaryFieldRef();
607 pgamma[facei] = this->patchFaceMixture(patchi, facei).gamma
619 template<
class BasicThermo,
class MixtureType>
633 this->patchFaceMixture(patchi, facei).Cpv(
p[facei],
T[facei]);
640 template<
class BasicThermo,
class MixtureType>
653 mesh.time().timeName(),
657 IOobject::NO_REGISTER
669 this->cellMixture(celli).Cpv(this->p_[celli], this->T_[celli]);
672 volScalarField::Boundary& CpvBf = Cpv.boundaryFieldRef();
683 this->patchFaceMixture(patchi, facei).Cpv(
pp[facei], pT[facei]);
691 template<
class BasicThermo,
class MixtureType>
705 this->patchFaceMixture(patchi, facei).CpByCpv(
p[facei],
T[facei]);
712 template<
class BasicThermo,
class MixtureType>
725 mesh.time().timeName(),
729 IOobject::NO_REGISTER
740 CpByCpv[celli] = this->cellMixture(celli).CpByCpv
747 volScalarField::Boundary& CpByCpvBf =
748 CpByCpv.boundaryFieldRef();
758 pCpByCpv[facei] = this->patchFaceMixture(patchi, facei).CpByCpv
770 template<
class BasicThermo,
class MixtureType>
785 this->cellMixture(
cells[celli]).THE(
h[celli],
p[celli],
T0[celli]);
792 template<
class BasicThermo,
class MixtureType>
806 T[facei] = this->patchFaceMixture
810 ).THE(
h[facei],
p[facei],
T0[facei]);
817 template<
class BasicThermo,
class MixtureType>
831 mesh.time().timeName(),
835 IOobject::NO_REGISTER
847 WCells[celli] = this->cellMixture(celli).W();
850 volScalarField::Boundary& WBf = W.boundaryFieldRef();
857 Wp[facei] = this->patchFaceMixture(patchi, facei).W();
865 template<
class BasicThermo,
class MixtureType>
875 template<
class BasicThermo,
class MixtureType>
884 this->p_.boundaryField()[patchi],
885 this->T_.boundaryField()[patchi],
887 )*this->alpha_.boundaryField()[patchi];
891 template<
class BasicThermo,
class MixtureType>
901 template<
class BasicThermo,
class MixtureType>
908 this->p_.boundaryField()[patchi],
909 this->T_.boundaryField()[patchi],
912 *this->alpha_.boundaryField()[patchi];
916 template<
class BasicThermo,
class MixtureType>
929 template<
class BasicThermo,
class MixtureType>
940 this->p_.boundaryField()[patchi],
941 this->T_.boundaryField()[patchi],
945 this->alpha_.boundaryField()[patchi]
951 template<
class BasicThermo,
class MixtureType>
964 template<
class BasicThermo,
class MixtureType>
975 this->p_.boundaryField()[patchi],
976 this->T_.boundaryField()[patchi],
980 this->alpha_.boundaryField()[patchi]
986 template<
class BasicThermo,
class MixtureType>
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
virtual tmp< scalarField > THE(const scalarField &he, const scalarField &p, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.
virtual tmp< volScalarField > gamma() const
Gamma = Cp/Cv [].
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const tmp< volScalarField > & tCp
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
virtual ~heThermo()
Destructor.
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const volScalarField & Cv
const dimensionSet dimless
Dimensionless.
virtual volScalarField & he()
Enthalpy/Internal energy [J/kg].
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
virtual tmp< scalarField > rhoEoS(const scalarField &p, const scalarField &T, const labelList &cells) const
Density from pressure and temperature.
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [kg/m/s].
const volScalarField & cp
const volScalarField & Cp
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
const dimensionSet dimEnergy
const dimensionedScalar h
Planck constant.
virtual bool read()
Read thermophysical properties dictionary.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
virtual tmp< volScalarField > kappaEff(const volScalarField &) const
Effective thermal diffusivity for temperature.
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
Enthalpy/Internal energy for a mixture.
Mesh data needed to do the Finite Volume discretisation.
const tmp< volScalarField > & tCv
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
A class for managing temporary objects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
void heBoundaryCorrection(volScalarField &he)
Correct the enthalpy/internal energy field boundaries.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
virtual tmp< volScalarField > W() const
Molecular weight [kg/kmol].