diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 84e30e31a4767807499e91b55180f838ab3639e3..e2fc874b5ef6ba930a1c85a745cf2032891c6e86 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -112,7 +112,7 @@ Foam::basicThermo::basicThermo ( IOobject ( - phasePropertyName("alpha"), + phasePropertyName("thermo:alpha"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -167,7 +167,7 @@ Foam::basicThermo::basicThermo ( IOobject ( - phasePropertyName("alpha"), + phasePropertyName("thermo:alpha"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -237,7 +237,7 @@ const Foam::basicThermo& Foam::basicThermo::lookupThermo void Foam::basicThermo::validate ( - const word& app, + const string& app, const word& a ) const { @@ -252,7 +252,7 @@ void Foam::basicThermo::validate void Foam::basicThermo::validate ( - const word& app, + const string& app, const word& a, const word& b ) const @@ -275,7 +275,7 @@ void Foam::basicThermo::validate void Foam::basicThermo::validate ( - const word& app, + const string& app, const word& a, const word& b, const word& c @@ -301,7 +301,7 @@ void Foam::basicThermo::validate void Foam::basicThermo::validate ( - const word& app, + const string& app, const word& a, const word& b, const word& c, diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 659b6f35ca03512a0d98f5ddef38f37a3e69add7..e652c30ee6cc3216a0227160a9450e99e5223f78 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -185,7 +185,7 @@ public: // with energy forms supported by the application void validate ( - const word& app, + const string& app, const word& ) const; @@ -193,7 +193,7 @@ public: // with energy forms supported by the application void validate ( - const word& app, + const string& app, const word&, const word& ) const; @@ -202,7 +202,7 @@ public: // with energy forms supported by the application void validate ( - const word& app, + const string& app, const word&, const word&, const word& @@ -212,7 +212,7 @@ public: // with energy forms supported by the application void validate ( - const word& app, + const string& app, const word&, const word&, const word&, @@ -263,6 +263,14 @@ public: //- Enthalpy/Internal energy [J/kg] virtual const volScalarField& he() const = 0; + //- Enthalpy/Internal energy + // for given pressure and temperature [J/kg] + virtual tmp<volScalarField> he + ( + const volScalarField& p, + const volScalarField& T + ) const = 0; + //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp<scalarField> he ( diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index 8efaf0f5d50ee60a97cb1bbda81fe132b39c3ce1..29634e276936910be17d608bcbe43871a05a4471 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -174,7 +174,10 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo ( IOobject ( - BasicThermo::phasePropertyName(MixtureType::thermoType::heName()), + BasicThermo::phasePropertyName + ( + MixtureType::thermoType::heName() + ), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -205,7 +208,10 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo ( IOobject ( - BasicThermo::phasePropertyName(MixtureType::thermoType::heName()), + BasicThermo::phasePropertyName + ( + MixtureType::thermoType::heName() + ), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -230,6 +236,60 @@ Foam::heThermo<BasicThermo, MixtureType>::~heThermo() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class BasicThermo, class MixtureType> +Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::he +( + const volScalarField& p, + const volScalarField& T +) const +{ + const fvMesh& mesh = this->T_.mesh(); + + tmp<volScalarField> the + ( + new volScalarField + ( + IOobject + ( + "he", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + he_.dimensions() + ) + ); + + volScalarField& he = the(); + scalarField& heCells = he.internalField(); + const scalarField& pCells = p.internalField(); + const scalarField& TCells = T.internalField(); + + forAll(heCells, celli) + { + heCells[celli] = + this->cellMixture(celli).HE(pCells[celli], TCells[celli]); + } + + forAll(he.boundaryField(), patchi) + { + scalarField& hep = he.boundaryField()[patchi]; + const scalarField& pp = p.boundaryField()[patchi]; + const scalarField& Tp = T.boundaryField()[patchi]; + + forAll(hep, facei) + { + hep[facei] = + this->patchFaceMixture(patchi, facei).HE(pp[facei], Tp[facei]); + } + } + + return the; +} + + template<class BasicThermo, class MixtureType> Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he ( diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index ef9919a99cdb5b3a303780d45045ccfcfe5bd176..f77d017e1396afd3840611449829eb89fbc6653a 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -161,6 +161,14 @@ public: // Fields derived from thermodynamic state variables + //- Enthalpy/Internal energy + // for given pressure and temperature [J/kg] + virtual tmp<volScalarField> he + ( + const volScalarField& p, + const volScalarField& T + ) const; + //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp<scalarField> he ( diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.C b/src/thermophysicalModels/basic/psiThermo/psiThermo.C index fd4bc962c903bcda157391c428df833b492191d0..dd69890313406b8e9ca182b9d0510aab991766e0 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.C @@ -44,7 +44,7 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName) ( IOobject ( - phasePropertyName("psi"), + phasePropertyName("thermo:psi"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -58,7 +58,7 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName) ( IOobject ( - phasePropertyName("mu"), + phasePropertyName("thermo:mu"), mesh.time().timeName(), mesh, IOobject::NO_READ, diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C index 4aa7835caca575346ea7341ee3346b8140a173d5..d34186eea9ee534ceec2376b91acba11c92c8466 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C @@ -43,7 +43,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName) ( IOobject ( - phasePropertyName("rhoThermo"), + phasePropertyName("thermo:rho"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -57,7 +57,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName) ( IOobject ( - phasePropertyName("psi"), + phasePropertyName("thermo:psi"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -71,7 +71,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName) ( IOobject ( - phasePropertyName("mu"), + phasePropertyName("thermo:mu"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -95,7 +95,7 @@ Foam::rhoThermo::rhoThermo ( IOobject ( - phasePropertyName("rhoThermo"), + phasePropertyName("thermo:rho"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -109,7 +109,7 @@ Foam::rhoThermo::rhoThermo ( IOobject ( - phasePropertyName("psi"), + phasePropertyName("thermo:psi"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -123,7 +123,7 @@ Foam::rhoThermo::rhoThermo ( IOobject ( - phasePropertyName("mu"), + phasePropertyName("thermo:mu"), mesh.time().timeName(), mesh, IOobject::NO_READ, diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C index fcfc3437dd35810afbc88e6f4160879852e23236..beaa43b7350ab95fb0ed3a57535931dbaf2fc7bf 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C @@ -30,6 +30,7 @@ License #include "perfectGas.H" #include "incompressiblePerfectGas.H" #include "rhoConst.H" +#include "perfectFluid.H" #include "hConstThermo.H" #include "janafThermo.H" #include "sensibleEnthalpy.H" @@ -101,6 +102,18 @@ makeThermo specie ); +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleEnthalpy, + hConstThermo, + perfectFluid, + specie +); + makeThermo ( rhoThermo, @@ -200,6 +213,18 @@ makeThermo specie ); +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + hConstThermo, + perfectFluid, + specie +); + makeThermo ( rhoThermo, diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C index 102414e3fbb6ce0618a581b7e83546c07f4860f5..2e12bcf213d0ba2e82b213b55be0891956d95c6c 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C @@ -50,7 +50,7 @@ Foam::solidThermo::solidThermo ( IOobject ( - "rhoThermo", + phasePropertyName("thermo:rho"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -74,7 +74,7 @@ Foam::solidThermo::solidThermo ( IOobject ( - "rhoThermo", + phasePropertyName("thermo:rho"), mesh.time().timeName(), mesh, IOobject::NO_READ,