32 template<
class MixtureType,
class BasicThermoType>
33 template<
class Mixture,
class Method,
class ... Args>
48 IOobject::groupName(psiName, this->
group()),
56 auto Yslicer = this->Yslicer();
60 auto composition = this->cellComposition(Yslicer, celli);
63 ((this->*mixture)(composition).*psiMethod)(
args[celli] ...);
73 this->patchFaceComposition(Yslicer,
patchi, patchFacei);
75 psiBf[
patchi][patchFacei] =
76 ((this->*mixture)(composition).*psiMethod)
87 template<
class MixtureType,
class BasicThermoType>
88 template<
class Mixture,
class Method,
class ... Args>
104 auto Yslicer = this->Yslicer();
108 auto composition = this->cellComposition(Yslicer,
cells[i]);
110 psi[i] = ((this->*mixture)(composition).*psiMethod)(
args[i] ...);
117 template<
class MixtureType,
class BasicThermoType>
118 template<
class Mixture,
class Method,
class ... Args>
134 auto Yslicer = this->Yslicer();
139 this->patchFaceComposition(Yslicer,
patchi, patchFacei);
142 ((this->*mixture)(composition).*psiMethod)(
args[patchFacei] ...);
149 template<
class MixtureType,
class BasicThermoType>
150 template<
class Mixture,
class Method,
class ... Args>
165 auto Yslicer = this->Yslicer(source);
170 this->sourceCellComposition(Yslicer, i);
173 ((this->*mixture)(composition).*psiMethod)(
args[i] ...);
180 template<
class MixtureType,
class BasicThermoType>
192 template<
class MixtureType,
class BasicThermoType>
200 return psi.primitiveField();
204 template<
class MixtureType,
class BasicThermoType>
212 if (isA<gradientEnergyFvPatchScalarField>(hBf[
patchi]))
214 refCast<gradientEnergyFvPatchScalarField>(hBf[
patchi]).gradient()
215 = hBf[
patchi].fvPatchField::snGrad();
217 else if (isA<mixedEnergyFvPatchScalarField>(hBf[
patchi]))
219 refCast<mixedEnergyFvPatchScalarField>(hBf[
patchi]).refGrad()
220 = hBf[
patchi].fvPatchField::snGrad();
228 template<
class MixtureType,
class BasicThermoType>
232 const word& phaseName
236 MixtureType(properties()),
237 BasicThermoType(properties(),
mixture(), mesh, phaseName),
243 BasicThermoType::phasePropertyName
245 MixtureType::thermoType::heName(),
253 volScalarFieldProperty
257 &MixtureType::thermoMixture,
258 &MixtureType::thermoMixtureType::
he,
262 this->heBoundaryTypes(),
263 this->heBoundaryBaseTypes(),
264 this->heSourcesTypes()
271 BasicThermoType::phasePropertyName(
"Cp", phaseName),
283 BasicThermoType::phasePropertyName(
"Cv", phaseName),
297 template<
class MixtureType,
class BasicThermoType>
304 template<
class MixtureType,
class BasicThermoType>
308 return volScalarFieldProperty
312 &MixtureType::thermoMixture,
318 template<
class MixtureType,
class BasicThermoType>
325 return patchFieldProperty
327 &MixtureType::thermoMixture,
334 template<
class MixtureType,
class BasicThermoType>
338 if (MixtureType::thermoType::enthalpy())
349 template<
class MixtureType,
class BasicThermoType>
357 return volScalarFieldProperty
361 &MixtureType::thermoMixture,
369 template<
class MixtureType,
class BasicThermoType>
377 return cellSetProperty
379 &MixtureType::thermoMixture,
382 cellSetScalarList(this->p_,
cells),
388 template<
class MixtureType,
class BasicThermoType>
396 return patchFieldProperty
398 &MixtureType::thermoMixture,
401 this->p_.boundaryField()[
patchi],
407 template<
class MixtureType,
class BasicThermoType>
415 return fieldSourceProperty
417 &MixtureType::thermoMixture,
420 cellSetScalarList(this->p_, source.
cells()),
426 template<
class MixtureType,
class BasicThermoType>
430 return volScalarFieldProperty
434 &MixtureType::thermoMixture,
442 template<
class MixtureType,
class BasicThermoType>
450 return volScalarFieldProperty
454 &MixtureType::thermoMixture,
462 template<
class MixtureType,
class BasicThermoType>
470 return cellSetProperty
472 &MixtureType::thermoMixture,
475 cellSetScalarList(this->p_,
cells),
481 template<
class MixtureType,
class BasicThermoType>
489 return patchFieldProperty
491 &MixtureType::thermoMixture,
494 this->p_.boundaryField()[
patchi],
500 template<
class MixtureType,
class BasicThermoType>
504 return volScalarFieldProperty
508 &MixtureType::thermoMixture,
516 template<
class MixtureType,
class BasicThermoType>
524 return volScalarFieldProperty
528 &MixtureType::thermoMixture,
536 template<
class MixtureType,
class BasicThermoType>
544 return cellSetProperty
546 &MixtureType::thermoMixture,
549 cellSetScalarList(this->p_,
cells),
555 template<
class MixtureType,
class BasicThermoType>
563 return patchFieldProperty
565 &MixtureType::thermoMixture,
568 this->p_.boundaryField()[
patchi],
574 template<
class MixtureType,
class BasicThermoType>
582 return patchFieldProperty
584 &MixtureType::thermoMixture,
587 this->p_.boundaryField()[
patchi],
593 template<
class MixtureType,
class BasicThermoType>
601 return patchFieldProperty
603 &MixtureType::thermoMixture,
606 this->p_.boundaryField()[
patchi],
612 template<
class MixtureType,
class BasicThermoType>
620 if (MixtureType::thermoType::enthalpy())
631 template<
class MixtureType,
class BasicThermoType>
640 return volScalarFieldProperty
644 &MixtureType::thermoMixture,
645 &MixtureType::thermoMixtureType::The,
653 template<
class MixtureType,
class BasicThermoType>
662 return cellSetProperty
664 &MixtureType::thermoMixture,
665 &MixtureType::thermoMixtureType::The,
668 cellSetScalarList(this->p_,
cells),
674 template<
class MixtureType,
class BasicThermoType>
683 return patchFieldProperty
685 &MixtureType::thermoMixture,
686 &MixtureType::thermoMixtureType::The,
689 this->p_.boundaryField()[
patchi],
695 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 > fieldSourceProperty(Mixture mixture, Method psiMethod, const fvSource &source, const Args &... args) const
Return a scalarField of the given property for a source.
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.
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.
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.
virtual bool read()
Read thermophysical properties dictionary.
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.
virtual labelUList cells() const =0
Return the cells that the source applies to.
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.
volScalarField scalarField(fieldObject, mesh)
const volScalarField & psi
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
const char *const group
Group name for atomic constants.
const dimensionedScalar h
Planck constant.
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 dimEnergy
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimTemperature
const dimensionSet dimMoles
const dimensionSet dimMass
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const scalarList W(::W(thermo))
Foam::argList args(argc, argv)