32 template<
class MixtureType,
class BasicThermoType>
33 template<
class Mixture,
class Method,
class ... Args>
48 IOobject::groupName(psiName, this->
group()),
55 auto Yslicer = this->Yslicer();
59 auto composition = this->cellComposition(Yslicer, celli);
62 ((this->*mixture)(composition).*psiMethod)(
args[celli] ...);
72 this->patchFaceComposition(Yslicer,
patchi, patchFacei);
74 psiBf[
patchi][patchFacei] =
75 ((this->*mixture)(composition).*psiMethod)
86 template<
class MixtureType,
class BasicThermoType>
87 template<
class Method,
class ... Args>
101 IOobject::groupName(psiName, this->
group()),
108 auto Yslicer = this->Yslicer();
112 auto composition = this->cellComposition(Yslicer, celli);
114 psi[celli] = (this->*mixtureMethod)(composition,
args ...);
124 this->patchFaceComposition(Yslicer,
patchi, patchFacei);
126 psiBf[
patchi][patchFacei] =
127 (this->*mixtureMethod)
139 template<
class MixtureType,
class BasicThermoType>
140 template<
class Mixture,
class Method,
class ... Args>
155 IOobject::groupName(psiName, this->
group()),
162 auto Yslicer = this->Yslicer();
166 auto composition = this->cellComposition(Yslicer, celli);
169 ((this->*mixture)(composition).*psiMethod)(
args[celli] ...);
176 template<
class MixtureType,
class BasicThermoType>
177 template<
class Mixture,
class Method,
class ... Args>
193 auto Yslicer = this->Yslicer();
197 auto composition = this->cellComposition(Yslicer,
cells[i]);
199 psi[i] = ((this->*mixture)(composition).*psiMethod)(
args[i] ...);
206 template<
class MixtureType,
class BasicThermoType>
207 template<
class Mixture,
class Method,
class ... Args>
223 auto Yslicer = this->Yslicer();
228 this->patchFaceComposition(Yslicer,
patchi, patchFacei);
231 ((this->*mixture)(composition).*psiMethod)(
args[patchFacei] ...);
238 template<
class MixtureType,
class BasicThermoType>
239 template<
class Mixture,
class Method,
class ... Args>
256 IOobject::groupName(psiName, this->
group()),
263 auto Yslicer = this->Yslicer(model, source);
267 auto composition = this->sourceCellComposition(Yslicer, celli);
270 ((this->*mixture)(composition).*psiMethod)(
args[celli] ...);
277 template<
class MixtureType,
class BasicThermoType>
278 template<
class Mixture,
class Method,
class ... Args>
293 auto Yslicer = this->Yslicer(model, source,
cells);
298 this->sourceCellComposition(Yslicer, i);
301 ((this->*mixture)(composition).*psiMethod)(
args[i] ...);
308 template<
class MixtureType,
class BasicThermoType>
320 template<
class MixtureType,
class BasicThermoType>
324 const uniformGeometricScalarField&
psi,
328 return psi.primitiveField();
332 template<
class MixtureType,
class BasicThermoType>
342 if (isA<gradientEnergyFvPatchScalarField>(hBf[
patchi]))
344 refCast<gradientEnergyFvPatchScalarField>(hBf[
patchi]).gradient() =
345 hBf[
patchi].fvPatchField::snGrad();
347 else if (isA<mixedEnergyFvPatchScalarField>(hBf[
patchi]))
349 refCast<mixedEnergyFvPatchScalarField>(hBf[
patchi]).refGrad() =
350 hBf[
patchi].fvPatchField::snGrad();
358 template<
class MixtureType,
class BasicThermoType>
362 const word& phaseName
366 MixtureType(properties()),
370 static_cast<const MixtureType&>(*this),
379 BasicThermoType::phasePropertyName
381 MixtureType::thermoType::heName(),
389 volScalarFieldProperty
393 &MixtureType::thermoMixture,
394 &MixtureType::thermoMixtureType::he,
398 this->heBoundaryTypes(),
399 this->heBoundaryBaseTypes(),
400 this->heSourcesTypes(),
401 this->T_.sources().errorLocation()
408 BasicThermoType::phasePropertyName(
"Cp", phaseName),
420 BasicThermoType::phasePropertyName(
"Cv", phaseName),
434 template<
class MixtureType,
class BasicThermoType>
441 template<
class MixtureType,
class BasicThermoType>
445 return volScalarFieldProperty
449 &MixtureType::thermoMixture,
455 template<
class MixtureType,
class BasicThermoType>
462 return patchFieldProperty
464 &MixtureType::thermoMixture,
471 template<
class MixtureType,
class BasicThermoType>
475 if (MixtureType::thermoType::enthalpy())
486 template<
class MixtureType,
class BasicThermoType>
494 return volScalarFieldProperty
498 &MixtureType::thermoMixture,
499 &MixtureType::thermoMixtureType::he,
506 template<
class MixtureType,
class BasicThermoType>
514 return volInternalScalarFieldProperty
518 &MixtureType::thermoMixture,
519 &MixtureType::thermoMixtureType::he,
526 template<
class MixtureType,
class BasicThermoType>
534 return cellSetProperty
536 &MixtureType::thermoMixture,
537 &MixtureType::thermoMixtureType::he,
539 cellSetScalarList(this->p_,
cells),
545 template<
class MixtureType,
class BasicThermoType>
553 return patchFieldProperty
555 &MixtureType::thermoMixture,
556 &MixtureType::thermoMixtureType::he,
558 this->p_.boundaryField()[
patchi],
564 template<
class MixtureType,
class BasicThermoType>
573 return fieldSourceProperty
577 &MixtureType::thermoMixture,
578 &MixtureType::thermoMixtureType::he,
581 this->p_.internalField(),
587 template<
class MixtureType,
class BasicThermoType>
597 return fieldSourceProperty
599 &MixtureType::thermoMixture,
600 &MixtureType::thermoMixtureType::he,
604 cellSetScalarList(this->p_,
cells),
610 template<
class MixtureType,
class BasicThermoType>
614 return volScalarFieldProperty
618 &MixtureType::thermoMixture,
626 template<
class MixtureType,
class BasicThermoType>
634 return volScalarFieldProperty
638 &MixtureType::thermoMixture,
646 template<
class MixtureType,
class BasicThermoType>
654 return volInternalScalarFieldProperty
658 &MixtureType::thermoMixture,
666 template<
class MixtureType,
class BasicThermoType>
674 return cellSetProperty
676 &MixtureType::thermoMixture,
679 cellSetScalarList(this->p_,
cells),
685 template<
class MixtureType,
class BasicThermoType>
693 return patchFieldProperty
695 &MixtureType::thermoMixture,
698 this->p_.boundaryField()[
patchi],
704 template<
class MixtureType,
class BasicThermoType>
708 return volScalarFieldProperty
712 &MixtureType::thermoMixture,
720 template<
class MixtureType,
class BasicThermoType>
728 return volScalarFieldProperty
732 &MixtureType::thermoMixture,
740 template<
class MixtureType,
class BasicThermoType>
748 return volInternalScalarFieldProperty
752 &MixtureType::thermoMixture,
760 template<
class MixtureType,
class BasicThermoType>
768 return cellSetProperty
770 &MixtureType::thermoMixture,
773 cellSetScalarList(this->p_,
cells),
779 template<
class MixtureType,
class BasicThermoType>
787 return patchFieldProperty
789 &MixtureType::thermoMixture,
792 this->p_.boundaryField()[
patchi],
798 template<
class MixtureType,
class BasicThermoType>
806 return patchFieldProperty
808 &MixtureType::thermoMixture,
811 this->p_.boundaryField()[
patchi],
817 template<
class MixtureType,
class BasicThermoType>
825 return patchFieldProperty
827 &MixtureType::thermoMixture,
830 this->p_.boundaryField()[
patchi],
836 template<
class MixtureType,
class BasicThermoType>
844 if (MixtureType::thermoType::enthalpy())
855 template<
class MixtureType,
class BasicThermoType>
864 return volScalarFieldProperty
868 &MixtureType::thermoMixture,
869 &MixtureType::thermoMixtureType::The,
877 template<
class MixtureType,
class BasicThermoType>
886 return cellSetProperty
888 &MixtureType::thermoMixture,
889 &MixtureType::thermoMixtureType::The,
892 cellSetScalarList(this->p_,
cells),
898 template<
class MixtureType,
class BasicThermoType>
907 return patchFieldProperty
909 &MixtureType::thermoMixture,
910 &MixtureType::thermoMixtureType::The,
913 this->p_.boundaryField()[
patchi],
919 template<
class MixtureType,
class BasicThermoType>
scalar hs(const scalar p, const scalar T) const
scalar Cp(const scalar p, const scalar T) const
scalar ha(const scalar p, const scalar T) const
scalar Cv(const scalar p, const scalar T) const
#define forAll(list, i)
Loop across all elements in list.
BasicThermo(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
virtual const volScalarField & Cv() const
Heat capacity at constant volume [J/kg/K].
virtual tmp< volScalarField > W() const
Molecular weight [kg/kmol].
virtual const volScalarField & Cp() const
Heat capacity at constant pressure [J/kg/K].
tmp< volScalarField > volScalarFieldProperty(const word &psiName, const dimensionSet &psiDim, Mixture mixture, Method psiMethod, const Args &... args) const
Return a volScalarField of the given property.
tmp< scalarField > cellSetProperty(Mixture mixture, Method psiMethod, const labelList &cells, const Args &... args) const
Return a scalarField of the given property on a cell set.
tmp< volScalarField > volScalarFieldMixtureProperty(const word &psiName, const dimensionSet &psiDim, Method mixtureMethod, const Args &... args) const
Return a volScalarField of the given property of the mixture.
static UIndirectList< scalar > cellSetScalarList(const volScalarField &psi, const labelUList &cells)
Return an indirect list of a field for the given set of cells.
virtual tmp< volScalarField > ha() const
Absolute enthalpy [J/kg/K].
virtual const volScalarField & he() const
Enthalpy/Internal energy [J/kg].
volScalarField he_
Energy field.
tmp< scalarField > patchFieldProperty(Mixture mixture, Method psiMethod, const label patchi, const Args &... args) const
Return a scalarField of the given property on a patch.
tmp< volScalarField::Internal > fieldSourceProperty(const word &psiName, const dimensionSet &psiDim, Mixture mixture, Method psiMethod, const fvSource &model, const volScalarField::Internal &source, const Args &... args) const
Return a scalarField of the given property for a source.
void heBoundaryCorrection(volScalarField &he)
Correct the enthalpy/internal energy field boundaries.
virtual const volScalarField & Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
virtual ~BasicThermo()
Destructor.
virtual tmp< volScalarField > hs() const
Sensible enthalpy [J/kg/K].
virtual tmp< volScalarField > The(const volScalarField &h, const volScalarField &p, const volScalarField &T0) const
Temperature from enthalpy/internal energy.
tmp< volScalarField::Internal > volInternalScalarFieldProperty(const word &psiName, const dimensionSet &psiDim, Mixture mixture, Method psiMethod, const Args &... args) const
Return a volScalarField::Internal of the given property.
virtual bool read()
Read thermophysical properties dictionary.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricBoundaryField class.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A List with indirect addressing.
Dimension set for the base types.
Mesh data needed to do the Finite Volume discretisation.
Base class for finite volume sources.
A base class for physical properties.
virtual bool read()
Read physicalProperties dictionary.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField scalarField(fieldObject, mesh)
const volScalarField & psi
const char *const group
Group name for atomic constants.
const dimensionedScalar h
Planck constant.
const dimensionSet & dimMoles
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimMass
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet & dimEnergy
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
const dimensionSet & dimTemperature
Foam::argList args(argc, argv)
const scalarList W(::W(thermo))