From d97db565c4dbcffeadca8ef62bee978983cd899f Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 25 Oct 2019 16:33:47 +0100 Subject: [PATCH] thermophysicalModels: Removed the unnecessary pressure argument to patch and cellSet property evaluation functions The pressure provided to the patch and cellSet property evaluation functions is always that stored by the thermodynamics package as is the composition which is provided internally; given that these functions are used in boundary conditions to estimate changes in heat flux corresponding to changes in temperature only there is no need for another pressure to be provided. In order that the pressure and composition treatment are consistent and to maintain that during future rationalisation of the handling of composition it makes sense to remove this unnecessary pressure argument. --- .../twoPhaseMixtureThermo.C | 47 +++----- .../twoPhaseMixtureThermo.H | 11 -- .../multiphaseMixtureThermo.C | 47 +++----- .../multiphaseMixtureThermo.H | 11 -- ...allBoilingWallFunctionFvPatchScalarField.C | 4 +- ...convectiveHeatTransferFvPatchScalarField.C | 3 +- .../temperatureCoupledBase.C | 3 +- .../fixedTemperatureConstraint.C | 6 +- .../limitTemperature/limitTemperature.C | 16 ++- .../thermalBaffle/thermalBaffleI.H | 4 +- ...ableBaffleMassFractionFvPatchScalarField.C | 6 +- .../basic/basicThermo/basicThermo.C | 16 --- .../basic/basicThermo/basicThermo.H | 67 +---------- .../energyJump/energyJumpFvPatchScalarField.C | 3 +- .../energyJumpAMIFvPatchScalarField.C | 3 +- .../fixedEnergyFvPatchScalarField.C | 5 +- .../gradientEnergyFvPatchScalarField.C | 7 +- .../mixedEnergyFvPatchScalarField.C | 11 +- .../basic/fluidThermo/fluidThermo.C | 20 +++- .../basic/fluidThermo/fluidThermo.H | 66 +++++++++++ .../basic/heThermo/heThermo.C | 62 ++++------ .../basic/heThermo/heThermo.H | 11 -- .../fixedUnburntEnthalpyFvPatchScalarField.C | 5 +- ...radientUnburntEnthalpyFvPatchScalarField.C | 9 +- .../mixedUnburntEnthalpyFvPatchScalarField.C | 11 +- .../mixtures/SpecieMixture/SpecieMixture.H | 2 - .../psiuReactionThermo/heheuPsiThermo.C | 6 +- .../psiuReactionThermo/heheuPsiThermo.H | 2 - .../psiuReactionThermo/psiuReactionThermo.H | 2 - .../solidThermo/Make/files | 3 +- .../heSolidThermo.C | 0 .../heSolidThermo.H | 0 .../heSolidThermos.C} | 14 +-- .../makeHeSolidThermo.H} | 6 +- .../solidPressureThermo/solidPressureThermo.C | 82 +++++++++++++ .../solidPressureThermo/solidPressureThermo.H | 110 ++++++++++++++++++ .../solidThermo/solidThermo/solidThermo.H | 14 ++- 37 files changed, 404 insertions(+), 291 deletions(-) rename src/thermophysicalModels/solidThermo/{solidThermo => heSolidThermo}/heSolidThermo.C (100%) rename src/thermophysicalModels/solidThermo/{solidThermo => heSolidThermo}/heSolidThermo.H (100%) rename src/thermophysicalModels/solidThermo/{solidThermo/solidThermos.C => heSolidThermo/heSolidThermos.C} (91%) rename src/thermophysicalModels/solidThermo/{solidThermo/makeSolidThermo.H => heSolidThermo/makeHeSolidThermo.H} (98%) create mode 100644 src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.C create mode 100644 src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.H diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C index 7dc6ec7929..b7b1907bc8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C @@ -154,27 +154,25 @@ Foam::tmp Foam::twoPhaseMixtureThermo::he Foam::tmp Foam::twoPhaseMixtureThermo::he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const { return - scalarField(alpha1(), cells)*thermo1_->he(p, T, cells) - + scalarField(alpha2(), cells)*thermo2_->he(p, T, cells); + scalarField(alpha1(), cells)*thermo1_->he(T, cells) + + scalarField(alpha2(), cells)*thermo2_->he(T, cells); } Foam::tmp Foam::twoPhaseMixtureThermo::he ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->he(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->he(T, patchi); } @@ -196,27 +194,25 @@ Foam::tmp Foam::twoPhaseMixtureThermo::ha Foam::tmp Foam::twoPhaseMixtureThermo::ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const { return - scalarField(alpha1(), cells)*thermo1_->ha(p, T, cells) - + scalarField(alpha2(), cells)*thermo2_->ha(p, T, cells); + scalarField(alpha1(), cells)*thermo1_->ha(T, cells) + + scalarField(alpha2(), cells)*thermo2_->ha(T, cells); } Foam::tmp Foam::twoPhaseMixtureThermo::ha ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->ha(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->ha(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->ha(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->ha(T, patchi); } @@ -229,7 +225,6 @@ Foam::tmp Foam::twoPhaseMixtureThermo::hc() const Foam::tmp Foam::twoPhaseMixtureThermo::THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, const labelList& cells ) const @@ -242,7 +237,6 @@ Foam::tmp Foam::twoPhaseMixtureThermo::THE Foam::tmp Foam::twoPhaseMixtureThermo::THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, const label patchi ) const @@ -260,14 +254,13 @@ Foam::tmp Foam::twoPhaseMixtureThermo::Cp() const Foam::tmp Foam::twoPhaseMixtureThermo::Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->Cp(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cp(T, patchi); } @@ -279,14 +272,13 @@ Foam::tmp Foam::twoPhaseMixtureThermo::Cv() const Foam::tmp Foam::twoPhaseMixtureThermo::Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->Cv(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cv(T, patchi); } @@ -298,14 +290,13 @@ Foam::tmp Foam::twoPhaseMixtureThermo::gamma() const Foam::tmp Foam::twoPhaseMixtureThermo::gamma ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->gamma(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->gamma(T, patchi); } @@ -317,14 +308,13 @@ Foam::tmp Foam::twoPhaseMixtureThermo::Cpv() const Foam::tmp Foam::twoPhaseMixtureThermo::Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->Cpv(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->Cpv(T, patchi); } @@ -338,14 +328,13 @@ Foam::tmp Foam::twoPhaseMixtureThermo::CpByCpv() const Foam::tmp Foam::twoPhaseMixtureThermo::CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const { return - alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi) - + alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi); + alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(T, patchi) + + alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(T, patchi); } diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index 35d383162a..ce55186207 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -153,7 +153,6 @@ public: //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -161,7 +160,6 @@ public: //- Enthalpy/Internal energy for patch [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -180,7 +178,6 @@ public: //- Absolute enthalpy for cell-set [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -188,7 +185,6 @@ public: //- Absolute enthalpy for patch [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -200,7 +196,6 @@ public: virtual tmp THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, // starting temperature const labelList& cells ) const; @@ -209,7 +204,6 @@ public: virtual tmp THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, // starting temperature const label patchi ) const; @@ -223,7 +217,6 @@ public: //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -234,7 +227,6 @@ public: //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -245,7 +237,6 @@ public: //- Gamma = Cp/Cv for patch [] virtual tmp gamma ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -256,7 +247,6 @@ public: //- Heat capacity at constant pressure/volume for patch [J/kg/K] virtual tmp Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -267,7 +257,6 @@ public: //- Heat capacity ratio for patch [] virtual tmp CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const; diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index f26e471b90..7ae7c3f373 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -214,7 +214,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::he Foam::tmp Foam::multiphaseMixtureThermo::he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const @@ -223,13 +222,13 @@ Foam::tmp Foam::multiphaseMixtureThermo::he tmp the ( - scalarField(phasei(), cells)*phasei().thermo().he(p, T, cells) + scalarField(phasei(), cells)*phasei().thermo().he(T, cells) ); for (++phasei; phasei != phases_.end(); ++phasei) { the.ref() += - scalarField(phasei(), cells)*phasei().thermo().he(p, T, cells); + scalarField(phasei(), cells)*phasei().thermo().he(T, cells); } return the; @@ -238,7 +237,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::he Foam::tmp Foam::multiphaseMixtureThermo::he ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -247,13 +245,13 @@ Foam::tmp Foam::multiphaseMixtureThermo::he tmp the ( - phasei().boundaryField()[patchi]*phasei().thermo().he(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().he(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { the.ref() += - phasei().boundaryField()[patchi]*phasei().thermo().he(p, T, patchi); + phasei().boundaryField()[patchi]*phasei().thermo().he(T, patchi); } return the; @@ -296,7 +294,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::ha Foam::tmp Foam::multiphaseMixtureThermo::ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const @@ -305,13 +302,13 @@ Foam::tmp Foam::multiphaseMixtureThermo::ha tmp the ( - scalarField(phasei(), cells)*phasei().thermo().ha(p, T, cells) + scalarField(phasei(), cells)*phasei().thermo().ha(T, cells) ); for (++phasei; phasei != phases_.end(); ++phasei) { the.ref() += - scalarField(phasei(), cells)*phasei().thermo().ha(p, T, cells); + scalarField(phasei(), cells)*phasei().thermo().ha(T, cells); } return the; @@ -320,7 +317,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::ha Foam::tmp Foam::multiphaseMixtureThermo::ha ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -329,13 +325,13 @@ Foam::tmp Foam::multiphaseMixtureThermo::ha tmp the ( - phasei().boundaryField()[patchi]*phasei().thermo().ha(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().ha(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { the.ref() += - phasei().boundaryField()[patchi]*phasei().thermo().ha(p, T, patchi); + phasei().boundaryField()[patchi]*phasei().thermo().ha(T, patchi); } return the; @@ -360,7 +356,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::hc() const Foam::tmp Foam::multiphaseMixtureThermo::THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, const labelList& cells ) const @@ -373,7 +368,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::THE Foam::tmp Foam::multiphaseMixtureThermo::THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, const label patchi ) const @@ -437,7 +431,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cp() const Foam::tmp Foam::multiphaseMixtureThermo::Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -446,13 +439,13 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cp tmp tCp ( - phasei().boundaryField()[patchi]*phasei().thermo().Cp(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().Cp(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { tCp.ref() += - phasei().boundaryField()[patchi]*phasei().thermo().Cp(p, T, patchi); + phasei().boundaryField()[patchi]*phasei().thermo().Cp(T, patchi); } return tCp; @@ -476,7 +469,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cv() const Foam::tmp Foam::multiphaseMixtureThermo::Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -485,13 +477,13 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cv tmp tCv ( - phasei().boundaryField()[patchi]*phasei().thermo().Cv(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().Cv(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { tCv.ref() += - phasei().boundaryField()[patchi]*phasei().thermo().Cv(p, T, patchi); + phasei().boundaryField()[patchi]*phasei().thermo().Cv(T, patchi); } return tCv; @@ -515,7 +507,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::gamma() const Foam::tmp Foam::multiphaseMixtureThermo::gamma ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -524,14 +515,14 @@ Foam::tmp Foam::multiphaseMixtureThermo::gamma tmp tgamma ( - phasei().boundaryField()[patchi]*phasei().thermo().gamma(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().gamma(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { tgamma.ref() += phasei().boundaryField()[patchi] - *phasei().thermo().gamma(p, T, patchi); + *phasei().thermo().gamma(T, patchi); } return tgamma; @@ -555,7 +546,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cpv() const Foam::tmp Foam::multiphaseMixtureThermo::Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -564,14 +554,14 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cpv tmp tCpv ( - phasei().boundaryField()[patchi]*phasei().thermo().Cpv(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().Cpv(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { tCpv.ref() += phasei().boundaryField()[patchi] - *phasei().thermo().Cpv(p, T, patchi); + *phasei().thermo().Cpv(T, patchi); } return tCpv; @@ -595,7 +585,6 @@ Foam::tmp Foam::multiphaseMixtureThermo::CpByCpv() const Foam::tmp Foam::multiphaseMixtureThermo::CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -604,14 +593,14 @@ Foam::tmp Foam::multiphaseMixtureThermo::CpByCpv tmp tCpByCpv ( - phasei().boundaryField()[patchi]*phasei().thermo().CpByCpv(p, T, patchi) + phasei().boundaryField()[patchi]*phasei().thermo().CpByCpv(T, patchi) ); for (++phasei; phasei != phases_.end(); ++phasei) { tCpByCpv.ref() += phasei().boundaryField()[patchi] - *phasei().thermo().CpByCpv(p, T, patchi); + *phasei().thermo().CpByCpv(T, patchi); } return tCpByCpv; diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 85685c28cc..47225c3c54 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -278,7 +278,6 @@ public: //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -286,7 +285,6 @@ public: //- Enthalpy/Internal energy for patch [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -305,7 +303,6 @@ public: //- Absolute enthalpy for cell-set [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -313,7 +310,6 @@ public: //- Absolute enthalpy for patch [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -325,7 +321,6 @@ public: virtual tmp THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, // starting temperature const labelList& cells ) const; @@ -334,7 +329,6 @@ public: virtual tmp THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, // starting temperature const label patchi ) const; @@ -354,7 +348,6 @@ public: //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -365,7 +358,6 @@ public: //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -376,7 +368,6 @@ public: //- Gamma = Cp/Cv for patch [] virtual tmp gamma ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -387,7 +378,6 @@ public: //- Heat capacity at constant pressure/volume for patch [J/kg/K] virtual tmp Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -398,7 +388,6 @@ public: //- Heat capacity ratio for patch [] virtual tmp CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index afef358c40..a250da8dc2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -428,8 +428,8 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const scalarField L ( vapor.thermo().he().member() == "e" - ? vapor.thermo().he(pw, Tsatc, patchi) + pw/rhoVaporw - hw - : vapor.thermo().he(pw, Tsatc, patchi) - hw + ? vapor.thermo().he(Tsatc, patchi) + pw/rhoVaporw - hw + : vapor.thermo().he(Tsatc, patchi) - hw ); // Liquid phase fraction at the wall diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C index b2193c56a0..fbfc790dd9 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C @@ -129,8 +129,7 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs() const vectorField& Uc = turbModel.U(); const vectorField& Uw = turbModel.U().boundaryField()[patchi]; const scalarField& Tw = turbModel.transport().T().boundaryField()[patchi]; - const scalarField& pw = turbModel.transport().p().boundaryField()[patchi]; - const scalarField Cpw(turbModel.transport().Cp(pw, Tw, patchi)); + const scalarField Cpw(turbModel.transport().Cp(Tw, patchi)); const scalarField kappaw(Cpw*alphaEffw); const scalarField Pr(muw*Cpw/kappaw); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 28caea2179..ee71406162 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -108,8 +108,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa alphaAniName_ ); - const scalarField& pp = thermo.p().boundaryField()[patchi]; - const symmTensorField kappa(alphaAni*thermo.Cp(pp, Tp, patchi)); + const symmTensorField kappa(alphaAni*thermo.Cp(Tp, patchi)); const vectorField n(patch_.nf()); return n & kappa & n; diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C index fec77e643a..fd3aea1193 100644 --- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C +++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,7 +123,7 @@ void Foam::fv::fixedTemperatureConstraint::constrain { const scalar t = mesh_.time().value(); scalarField Tuni(cells_.size(), Tuniform_->value(t)); - eqn.setValues(cells_, thermo.he(thermo.p(), Tuni, cells_)); + eqn.setValues(cells_, thermo.he(Tuni, cells_)); break; } @@ -133,7 +133,7 @@ void Foam::fv::fixedTemperatureConstraint::constrain mesh().lookupObject(TName_); scalarField Tlkp(T, cells_); - eqn.setValues(cells_, thermo.he(thermo.p(), Tlkp, cells_)); + eqn.setValues(cells_, thermo.he(Tlkp, cells_)); break; } diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.C b/src/fvOptions/corrections/limitTemperature/limitTemperature.C index 915bd0fb5a..d8d9a03094 100644 --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.C +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,8 +103,8 @@ void Foam::fv::limitTemperature::correct(volScalarField& he) scalarField Tmin(cells_.size(), Tmin_); scalarField Tmax(cells_.size(), Tmax_); - scalarField heMin(thermo.he(thermo.p(), Tmin, cells_)); - scalarField heMax(thermo.he(thermo.p(), Tmax, cells_)); + scalarField heMin(thermo.he(Tmin, cells_)); + scalarField heMax(thermo.he(Tmax, cells_)); scalarField& hec = he.primitiveFieldRef(); @@ -125,13 +125,11 @@ void Foam::fv::limitTemperature::correct(volScalarField& he) if (!hep.fixesValue()) { - const scalarField& pp = thermo.p().boundaryField()[patchi]; + scalarField Tminp(hep.size(), Tmin_); + scalarField Tmaxp(hep.size(), Tmax_); - scalarField Tminp(pp.size(), Tmin_); - scalarField Tmaxp(pp.size(), Tmax_); - - scalarField heMinp(thermo.he(pp, Tminp, patchi)); - scalarField heMaxp(thermo.he(pp, Tmaxp, patchi)); + scalarField heMinp(thermo.he(Tminp, patchi)); + scalarField heMaxp(thermo.he(Tmaxp, patchi)); forAll(hep, facei) { diff --git a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffleI.H b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffleI.H index b736e15fef..2aaf37108a 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffleI.H +++ b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffleI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ inline tmp thermalBaffle::he const label patchi ) const { - return thermo_->he(p, T, patchi); + return thermo_->he(T, patchi); } diff --git a/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C b/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C index 2f018d4ced..cce3766e06 100644 --- a/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C +++ b/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C @@ -65,7 +65,7 @@ Foam::semiPermeableBaffleMassFractionFvPatchScalarField::composition const objectRegistry& db ) { - const word& name = basicThermo::dictName; + const word& name = fluidThermo::dictName; if (db.foundObject(name)) { @@ -239,8 +239,8 @@ Foam::semiPermeableBaffleMassFractionFvPatchScalarField::phiY() const { const basicSpecieMixture& mixture = composition(db()); const scalar Wi(mixture.Wi(mixture.species()[YName])); - const basicThermo& thermo = - db().lookupObject(basicThermo::dictName); + const fluidThermo& thermo = + db().lookupObject(fluidThermo::dictName); psic *= thermo.W(patch().index())/Wi; diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index b30e462b88..815fb57b01 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -172,8 +172,6 @@ Foam::basicThermo::basicThermo phaseName_(phaseName), - p_(lookupOrConstruct(mesh, "p")), - T_ ( IOobject @@ -227,8 +225,6 @@ Foam::basicThermo::basicThermo phaseName_(phaseName), - p_(lookupOrConstruct(mesh, "p")), - T_ ( IOobject @@ -470,18 +466,6 @@ Foam::wordList Foam::basicThermo::splitThermoName } -Foam::volScalarField& Foam::basicThermo::p() -{ - return p_; -} - - -const Foam::volScalarField& Foam::basicThermo::p() const -{ - return p_; -} - - const Foam::volScalarField& Foam::basicThermo::T() const { return T_; diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index e908ce1cc1..eabb84ca22 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -65,15 +65,13 @@ protected: // Fields - //- Pressure [Pa] - volScalarField& p_; - //- Temperature [K] volScalarField T_; //- Laminar thermal diffusivity [kg/m/s] volScalarField alpha_; + //- Should the dpdt term be included in the enthalpy equation Switch dpdt_; @@ -271,13 +269,6 @@ public: // Access to thermodynamic state variables - //- Pressure [Pa] - // Non-const access allowed for transport equations - virtual volScalarField& p(); - - //- Pressure [Pa] - virtual const volScalarField& p() const; - //- Density [kg/m^3] virtual tmp rho() const = 0; @@ -302,7 +293,6 @@ public: //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const = 0; @@ -310,7 +300,6 @@ public: //- Enthalpy/Internal energy for patch [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -329,7 +318,6 @@ public: //- Absolute enthalpy for cell-set [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const = 0; @@ -337,7 +325,6 @@ public: //- Absolute enthalpy for patch [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -349,7 +336,6 @@ public: virtual tmp THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, // starting temperature const labelList& cells ) const = 0; @@ -358,7 +344,6 @@ public: virtual tmp THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, // starting temperature const label patchi ) const = 0; @@ -379,7 +364,6 @@ public: //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -390,18 +374,6 @@ public: //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp Cv ( - const scalarField& p, - const scalarField& T, - const label patchi - ) const = 0; - - //- Gamma = Cp/Cv [] - virtual tmp gamma() const = 0; - - //- Gamma = Cp/Cv for patch [] - virtual tmp gamma - ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -412,7 +384,6 @@ public: //- Heat capacity at constant pressure/volume for patch [J/kg/K] virtual tmp Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -423,17 +394,10 @@ public: //- Heat capacity ratio for patch [] virtual tmp CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; - //- Molecular weight [kg/kmol] - virtual tmp W() const = 0; - - //- Molecular weight for patch [kg/kmol] - virtual tmp W(const label patchi) const = 0; - // Access to transport state variables @@ -465,35 +429,6 @@ public: //- Thermal diffusivity for energy of mixture for patch [kg/m/s] virtual tmp alphahe(const label patchi) const = 0; - //- Effective thermal turbulent diffusivity for temperature - // of mixture [W/m/K] - virtual tmp kappaEff - ( - const volScalarField& - ) const = 0; - - //- Effective thermal turbulent diffusivity for temperature - // of mixture for patch [W/m/K] - virtual tmp kappaEff - ( - const scalarField& alphat, - const label patchi - ) const = 0; - - //- Effective thermal turbulent diffusivity of mixture [kg/m/s] - virtual tmp alphaEff - ( - const volScalarField& alphat - ) const = 0; - - //- Effective thermal turbulent diffusivity of mixture - // for patch [kg/m/s] - virtual tmp alphaEff - ( - const scalarField& alphat, - const label patchi - ) const = 0; - //- Read thermophysical properties dictionary virtual bool read(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C index be1bc92136..4447006db5 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C @@ -108,7 +108,6 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() const basicThermo& thermo = basicThermo::lookupThermo(*this); label patchID = patch().index(); - const scalarField& pp = thermo.p().boundaryField()[patchID]; const fixedJumpFvPatchScalarField& TbPatch = refCast ( @@ -123,7 +122,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() const labelUList& faceCells = this->patch().faceCells(); - jump_ = thermo.he(pp, Tbp.jump(), faceCells); + jump_ = thermo.he(Tbp.jump(), faceCells); } fixedJumpFvPatchField::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C index 1e3a9c0a8a..3dbe2b04e4 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C @@ -108,7 +108,6 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() const basicThermo& thermo = basicThermo::lookupThermo(*this); label patchID = patch().index(); - const scalarField& pp = thermo.p().boundaryField()[patchID]; const fixedJumpAMIFvPatchScalarField& TbPatch = refCast ( @@ -123,7 +122,7 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() const labelUList& faceCells = this->patch().faceCells(); - jump_ = thermo.he(pp, Tbp.jump(), faceCells); + jump_ = thermo.he(Tbp.jump(), faceCells); } fixedJumpAMIFvPatchField::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C index fa470a8bc6..74b04047ce 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,11 +100,10 @@ void Foam::fixedEnergyFvPatchScalarField::updateCoeffs() const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); - const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(thermo.T().boundaryField()[patchi]); Tw.evaluate(); - operator==(thermo.he(pw, Tw, patchi)); + operator==(thermo.he(Tw, patchi)); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C index 7619197784..163f02f32d 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C @@ -100,17 +100,16 @@ void Foam::gradientEnergyFvPatchScalarField::updateCoeffs() const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); - const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(thermo.T().boundaryField()[patchi]); Tw.evaluate(); - gradient() = thermo.Cpv(pw, Tw, patchi)*Tw.snGrad() + gradient() = thermo.Cpv(Tw, patchi)*Tw.snGrad() + patch().deltaCoeffs()* ( - thermo.he(pw, Tw, patchi) - - thermo.he(pw, Tw, patch().faceCells()) + thermo.he(Tw, patchi) + - thermo.he(Tw, patch().faceCells()) ); fixedGradientFvPatchScalarField::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C index 1d5599de11..0b2db4b428 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,6 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs() const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); - const scalarField& pw = thermo.p().boundaryField()[patchi]; mixedFvPatchScalarField& Tw = refCast ( const_cast(thermo.T().boundaryField()[patchi]) @@ -114,13 +113,13 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs() Tw.evaluate(); valueFraction() = Tw.valueFraction(); - refValue() = thermo.he(pw, Tw.refValue(), patchi); + refValue() = thermo.he(Tw.refValue(), patchi); refGrad() = - thermo.Cpv(pw, Tw, patchi)*Tw.refGrad() + thermo.Cpv(Tw, patchi)*Tw.refGrad() + patch().deltaCoeffs()* ( - thermo.he(pw, Tw, patchi) - - thermo.he(pw, Tw, patch().faceCells()) + thermo.he(Tw, patchi) + - thermo.he(Tw, patch().faceCells()) ); mixedFvPatchScalarField::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C index a1434ae42b..7985acb038 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,8 @@ namespace Foam Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const word& phaseName) : - basicThermo(mesh, phaseName) + basicThermo(mesh, phaseName), + p_(lookupOrConstruct(mesh, "p")) {} @@ -50,7 +51,8 @@ Foam::fluidThermo::fluidThermo const word& phaseName ) : - basicThermo(mesh, dict, phaseName) + basicThermo(mesh, dict, phaseName), + p_(lookupOrConstruct(mesh, "p")) {} @@ -74,6 +76,18 @@ Foam::fluidThermo::~fluidThermo() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::volScalarField& Foam::fluidThermo::p() +{ + return p_; +} + + +const Foam::volScalarField& Foam::fluidThermo::p() const +{ + return p_; +} + + Foam::tmp Foam::fluidThermo::nu() const { return mu()/rho(); diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H index a52ff513d2..c31ad0c6e5 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H @@ -53,6 +53,14 @@ class fluidThermo public compressibleTransportModel { +protected: + + // Fields + + //- Pressure [Pa] + volScalarField& p_; + + public: //- Runtime type information @@ -103,6 +111,13 @@ public: // Access to thermodynamic state variables + //- Pressure [Pa] + // Non-const access allowed for transport equations + virtual volScalarField& p(); + + //- Pressure [Pa] + virtual const volScalarField& p() const; + //- Add the given density correction to the density field. // Used to update the density field following pressure solution virtual void correctRho(const volScalarField& deltaRho) = 0; @@ -111,6 +126,25 @@ public: virtual const volScalarField& psi() const = 0; + // Fields derived from thermodynamic state variables + + //- Gamma = Cp/Cv [] + virtual tmp gamma() const = 0; + + //- Gamma = Cp/Cv for patch [] + virtual tmp gamma + ( + const scalarField& T, + const label patchi + ) const = 0; + + //- Molecular weight [kg/kmol] + virtual tmp W() const = 0; + + //- Molecular weight for patch [kg/kmol] + virtual tmp W(const label patchi) const = 0; + + // Access to transport state variables //- Dynamic viscosity of mixture [kg/m/s] @@ -124,6 +158,38 @@ public: //- Kinematic viscosity of mixture for patch [m^2/s] virtual tmp nu(const label patchi) const; + + + // Fields derived from transport state variables + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff + ( + const volScalarField& + ) const = 0; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [W/m/K] + virtual tmp kappaEff + ( + const scalarField& alphat, + const label patchi + ) const = 0; + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff + ( + const volScalarField& alphat + ) const = 0; + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff + ( + const scalarField& alphat, + const label patchi + ) const = 0; }; diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index fe01421575..97a733f8ee 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -33,7 +33,7 @@ template void Foam::heThermo::init() { scalarField& heCells = he_.primitiveFieldRef(); - const scalarField& pCells = this->p_; + const scalarField& pCells = this->p(); const scalarField& TCells = this->T_; forAll(heCells, celli) @@ -48,7 +48,6 @@ void Foam::heThermo::init() { heBf[patchi] == he ( - this->p_.boundaryField()[patchi], this->T_.boundaryField()[patchi], patchi ); @@ -74,14 +73,14 @@ Foam::heThermo::volScalarFieldProperty volScalarField::New ( IOobject::groupName(psiName, this->group()), - this->p_.mesh(), + this->T_.mesh(), psiDim ) ); volScalarField& psi = tPsi.ref(); - forAll(this->p_, celli) + forAll(this->T_, celli) { psi[celli] = (this->cellMixture(celli).*psiMethod)(args[celli] ...); } @@ -92,7 +91,7 @@ Foam::heThermo::volScalarFieldProperty { fvPatchScalarField& pPsi = psiBf[patchi]; - forAll(this->p_.boundaryField()[patchi], facei) + forAll(this->T_.boundaryField()[patchi], facei) { pPsi[facei] = (this->patchFaceMixture(patchi, facei).*psiMethod) @@ -144,11 +143,11 @@ Foam::heThermo::patchFieldProperty { tmp tPsi ( - new scalarField(this->p_.boundaryField()[patchi].size()) + new scalarField(this->T_.boundaryField()[patchi].size()) ); scalarField& psi = tPsi.ref(); - forAll(this->p_.boundaryField()[patchi], facei) + forAll(this->T_.boundaryField()[patchi], facei) { psi[facei] = (this->patchFaceMixture(patchi, facei).*psiMethod)(args[facei] ...); @@ -281,7 +280,6 @@ Foam::tmp Foam::heThermo::he template Foam::tmp Foam::heThermo::he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const @@ -290,7 +288,7 @@ Foam::tmp Foam::heThermo::he ( &MixtureType::thermoType::HE, cells, - p, + UIndirectList(this->p(), cells), T ); } @@ -299,7 +297,6 @@ Foam::tmp Foam::heThermo::he template Foam::tmp Foam::heThermo::he ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -308,7 +305,7 @@ Foam::tmp Foam::heThermo::he ( &MixtureType::thermoType::HE, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -323,7 +320,7 @@ Foam::heThermo::ha() const "ha", dimEnergy/dimMass, &MixtureType::thermoType::Ha, - this->p_, + this->p(), this->T_ ); } @@ -350,7 +347,6 @@ Foam::tmp Foam::heThermo::ha template Foam::tmp Foam::heThermo::ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const @@ -359,7 +355,7 @@ Foam::tmp Foam::heThermo::ha ( &MixtureType::thermoType::Ha, cells, - p, + UIndirectList(this->p(), cells), T ); } @@ -368,7 +364,6 @@ Foam::tmp Foam::heThermo::ha template Foam::tmp Foam::heThermo::ha ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -377,7 +372,7 @@ Foam::tmp Foam::heThermo::ha ( &MixtureType::thermoType::Ha, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -399,7 +394,6 @@ Foam::heThermo::hc() const template Foam::tmp Foam::heThermo::Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -408,7 +402,7 @@ Foam::tmp Foam::heThermo::Cp ( &MixtureType::thermoType::Cp, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -423,7 +417,7 @@ Foam::heThermo::Cp() const "Cp", dimEnergy/dimMass/dimTemperature, &MixtureType::thermoType::Cp, - this->p_, + this->p(), this->T_ ); } @@ -433,7 +427,6 @@ template Foam::tmp Foam::heThermo::Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -442,7 +435,7 @@ Foam::heThermo::Cv ( &MixtureType::thermoType::Cv, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -457,7 +450,7 @@ Foam::heThermo::Cv() const "Cv", dimEnergy/dimMass/dimTemperature, &MixtureType::thermoType::Cv, - this->p_, + this->p(), this->T_ ); } @@ -466,7 +459,6 @@ Foam::heThermo::Cv() const template Foam::tmp Foam::heThermo::gamma ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -475,7 +467,7 @@ Foam::tmp Foam::heThermo::gamma ( &MixtureType::thermoType::gamma, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -490,7 +482,7 @@ Foam::heThermo::gamma() const "gamma", dimless, &MixtureType::thermoType::gamma, - this->p_, + this->p(), this->T_ ); } @@ -499,7 +491,6 @@ Foam::heThermo::gamma() const template Foam::tmp Foam::heThermo::Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -508,7 +499,7 @@ Foam::tmp Foam::heThermo::Cpv ( &MixtureType::thermoType::Cpv, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -523,7 +514,7 @@ Foam::heThermo::Cpv() const "Cpv", dimEnergy/dimMass/dimTemperature, &MixtureType::thermoType::Cpv, - this->p_, + this->p(), this->T_ ); } @@ -532,7 +523,6 @@ Foam::heThermo::Cpv() const template Foam::tmp Foam::heThermo::CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const @@ -541,7 +531,7 @@ Foam::tmp Foam::heThermo::CpByCpv ( &MixtureType::thermoType::CpByCpv, patchi, - p, + this->p().boundaryField()[patchi], T ); } @@ -556,7 +546,7 @@ Foam::heThermo::CpByCpv() const "CpByCpv", dimless, &MixtureType::thermoType::CpByCpv, - this->p_, + this->p(), this->T_ ); } @@ -566,7 +556,6 @@ template Foam::tmp Foam::heThermo::THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, const labelList& cells ) const @@ -576,7 +565,7 @@ Foam::tmp Foam::heThermo::THE &MixtureType::thermoType::THE, cells, h, - p, + UIndirectList(this->p(), cells), T0 ); } @@ -586,7 +575,6 @@ template Foam::tmp Foam::heThermo::THE ( const scalarField& h, - const scalarField& p, const scalarField& T0, const label patchi ) const @@ -596,7 +584,7 @@ Foam::tmp Foam::heThermo::THE &MixtureType::thermoType::THE, patchi, h, - p, + this->p().boundaryField()[patchi], T0 ); } @@ -650,7 +638,6 @@ Foam::tmp Foam::heThermo::kappa return Cp ( - this->p_.boundaryField()[patchi], this->T_.boundaryField()[patchi], patchi )*this->alpha_.boundaryField()[patchi]; @@ -676,7 +663,6 @@ Foam::heThermo::alphahe(const label patchi) const return this->CpByCpv ( - this->p_.boundaryField()[patchi], this->T_.boundaryField()[patchi], patchi ) @@ -710,7 +696,6 @@ Foam::heThermo::kappaEff return Cp ( - this->p_.boundaryField()[patchi], this->T_.boundaryField()[patchi], patchi ) @@ -744,7 +729,6 @@ Foam::heThermo::alphaEff return this->CpByCpv ( - this->p_.boundaryField()[patchi], this->T_.boundaryField()[patchi], patchi ) diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index e3a085a528..0dec4360ad 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -195,7 +195,6 @@ public: //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -203,7 +202,6 @@ public: //- Enthalpy/Internal energy for patch [J/kg] virtual tmp he ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -222,7 +220,6 @@ public: //- Absolute enthalpy for patch [J/kg/K] virtual tmp ha ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -230,7 +227,6 @@ public: //- Absolute enthalpy for cell-set [J/kg] virtual tmp ha ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -242,7 +238,6 @@ public: virtual tmp THE ( const scalarField& he, - const scalarField& p, const scalarField& T0, // starting temperature const labelList& cells ) const; @@ -251,7 +246,6 @@ public: virtual tmp THE ( const scalarField& he, - const scalarField& p, const scalarField& T0, // starting temperature const label patchi ) const; @@ -259,7 +253,6 @@ public: //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -270,7 +263,6 @@ public: //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -284,7 +276,6 @@ public: //- Gamma = Cp/Cv for patch [] virtual tmp gamma ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -292,7 +283,6 @@ public: //- Heat capacity at constant pressure/volume for patch [J/kg/K] virtual tmp Cpv ( - const scalarField& p, const scalarField& T, const label patchi ) const; @@ -306,7 +296,6 @@ public: //- Heat capacity ratio for patch [] virtual tmp CpByCpv ( - const scalarField& p, const scalarField& T, const label patchi ) const; diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C index 9590c5488f..a052b82250 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,11 +105,10 @@ void Foam::fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(thermo.Tu().boundaryField()[patchi]); Tw.evaluate(); - operator==(thermo.heu(pw, Tw, patchi)); + operator==(thermo.heu(Tw, patchi)); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C index 9b1a7559a7..52e7bed90f 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,17 +104,16 @@ void Foam::gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(thermo.Tu().boundaryField()[patchi]); Tw.evaluate(); - gradient() = thermo.Cp(pw, Tw, patchi)*Tw.snGrad() + gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad() + patch().deltaCoeffs()* ( - thermo.heu(pw, Tw, patchi) - - thermo.heu(pw, Tw, patch().faceCells()) + thermo.heu(Tw, patchi) + - thermo.heu(Tw, patch().faceCells()) ); fixedGradientFvPatchScalarField::updateCoeffs(); diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C index dc442853a2..92a335b724 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,7 +108,6 @@ void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const scalarField& pw = thermo.p().boundaryField()[patchi]; mixedFvPatchScalarField& Tw = refCast ( const_cast(thermo.Tu().boundaryField()[patchi]) @@ -117,12 +116,12 @@ void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() Tw.evaluate(); valueFraction() = Tw.valueFraction(); - refValue() = thermo.heu(pw, Tw.refValue(), patchi); - refGrad() = thermo.Cp(pw, Tw, patchi)*Tw.refGrad() + refValue() = thermo.heu(Tw.refValue(), patchi); + refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad() + patch().deltaCoeffs()* ( - thermo.heu(pw, Tw, patchi) - - thermo.heu(pw, Tw, patch().faceCells()) + thermo.heu(Tw, patchi) + - thermo.heu(Tw, patch().faceCells()) ); mixedFvPatchScalarField::updateCoeffs(); diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H index f745a0848e..a81d27c986 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H @@ -243,7 +243,6 @@ public: //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -254,7 +253,6 @@ public: //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp Cv ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C index 1a292e8fca..75b8e02ce4 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -247,12 +247,12 @@ template Foam::tmp Foam::heheuPsiThermo::heu ( - const scalarField& p, const scalarField& Tu, const labelList& cells ) const { tmp theu(new scalarField(Tu.size())); + const scalarField& p = this->p(); scalarField& heu = theu.ref(); forAll(Tu, celli) @@ -268,12 +268,12 @@ template Foam::tmp Foam::heheuPsiThermo::heu ( - const scalarField& p, const scalarField& Tu, const label patchi ) const { tmp theu(new scalarField(Tu.size())); + const scalarField& p = this->p().boundaryField()[patchi]; scalarField& heu = theu.ref(); forAll(Tu, facei) diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H index 6491b0ce77..ddef3d56c9 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H @@ -120,7 +120,6 @@ public: //- Unburnt gas enthalpy for cell-set [J/kg] virtual tmp heu ( - const scalarField& p, const scalarField& T, const labelList& cells ) const; @@ -128,7 +127,6 @@ public: //- Unburnt gas enthalpy for patch [J/kg] virtual tmp heu ( - const scalarField& p, const scalarField& T, const label patchi ) const; diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H index 1568b0869b..f824a3f83e 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H @@ -122,7 +122,6 @@ public: //- Unburnt gas enthalpy for cell-set [J/kg] virtual tmp heu ( - const scalarField& p, const scalarField& T, const labelList& cells ) const = 0; @@ -130,7 +129,6 @@ public: //- Unburnt gas enthalpy for patch [J/kg] virtual tmp heu ( - const scalarField& p, const scalarField& T, const label patchi ) const = 0; diff --git a/src/thermophysicalModels/solidThermo/Make/files b/src/thermophysicalModels/solidThermo/Make/files index ab79d43bd5..dd9bfa008b 100644 --- a/src/thermophysicalModels/solidThermo/Make/files +++ b/src/thermophysicalModels/solidThermo/Make/files @@ -1,4 +1,5 @@ solidThermo/solidThermo.C -solidThermo/solidThermos.C +solidPressureThermo/solidPressureThermo.C +heSolidThermo/heSolidThermos.C LIB = $(FOAM_LIBBIN)/libsolidThermo diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C b/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermo.C similarity index 100% rename from src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C rename to src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermo.C diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H b/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermo.H similarity index 100% rename from src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H rename to src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermo.H diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C b/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C similarity index 91% rename from src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C rename to src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C index 66adf12102..1fa7a2e5f1 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C +++ b/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,8 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "makeSolidThermo.H" -#include "solidThermo.H" +#include "makeHeSolidThermo.H" +#include "solidPressureThermo.H" #include "heSolidThermo.H" #include "specie.H" @@ -52,7 +52,7 @@ namespace Foam makeSolidThermo ( - solidThermo, + solidPressureThermo, heSolidThermo, pureMixture, constIsoSolidTransport, @@ -64,7 +64,7 @@ makeSolidThermo makeSolidThermo ( - solidThermo, + solidPressureThermo, heSolidThermo, pureMixture, constAnIsoSolidTransport, @@ -76,7 +76,7 @@ makeSolidThermo makeSolidThermo ( - solidThermo, + solidPressureThermo, heSolidThermo, pureMixture, exponentialSolidTransport, @@ -88,7 +88,7 @@ makeSolidThermo makeSolidThermoPhysicsType ( - solidThermo, + solidPressureThermo, heSolidThermo, pureMixture, hTransportThermoPoly8SolidThermoPhysics diff --git a/src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H b/src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H similarity index 98% rename from src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H rename to src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H index 68b7e00c29..6a6abb926a 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,8 +29,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef makeSolidThermo_H -#define makeSolidThermo_H +#ifndef makeHeSolidThermo_H +#define makeHeSolidThermo_H #include "addToRunTimeSelectionTable.H" diff --git a/src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.C b/src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.C new file mode 100644 index 0000000000..6dee6ab983 --- /dev/null +++ b/src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "solidPressureThermo.H" +#include "fvMesh.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(solidPressureThermo, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidPressureThermo::solidPressureThermo +( + const fvMesh& mesh, + const word& phaseName +) +: + solidThermo(mesh, phaseName), + p_(lookupOrConstruct(mesh, "p")) +{} + + +Foam::solidPressureThermo::solidPressureThermo +( + const fvMesh& mesh, + const dictionary& dict, + const word& phaseName +) +: + solidThermo(mesh, dict, phaseName), + p_(lookupOrConstruct(mesh, "p")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::solidPressureThermo::~solidPressureThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::volScalarField& Foam::solidPressureThermo::p() const +{ + return p_; +} + + +Foam::volScalarField& Foam::solidPressureThermo::p() +{ + return p_; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.H b/src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.H new file mode 100644 index 0000000000..f984e88415 --- /dev/null +++ b/src/thermophysicalModels/solidThermo/solidPressureThermo/solidPressureThermo.H @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::solidPressureThermo + +Description + Fundamental solid thermodynamic properties including pressure. + +SourceFiles + solidPressureThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solidPressureThermo_H +#define solidPressureThermo_H + +#include "solidThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solidPressureThermo Declaration +\*---------------------------------------------------------------------------*/ + +class solidPressureThermo +: + public solidThermo +{ + +protected: + + // Fields + + //- Pressure [Pa] + volScalarField& p_; + + +public: + + //- Runtime type information + TypeName("solidPressureThermo"); + + // Constructors + + //- Construct from mesh and phase name + solidPressureThermo + ( + const fvMesh&, + const word& phaseName + ); + + //- Construct from mesh, dictionary and phase name + solidPressureThermo + ( + const fvMesh&, + const dictionary& dict, + const word& phaseName + ); + + + //- Destructor + virtual ~solidPressureThermo(); + + + // Member Functions + + // Access to thermodynamic state variables + + //- Pressure [Pa] + // Non-const access allowed for transport equations + virtual volScalarField& p(); + + //- Pressure [Pa] + virtual const volScalarField& p() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index 6fadcd1824..715c461e78 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -108,7 +108,7 @@ public: static autoPtr New ( const fvMesh&, - const word& phaseName=word::null + const word& phaseName = word::null ); //- Return a pointer to a new solidThermo created from @@ -117,7 +117,7 @@ public: ( const fvMesh&, const dictionary&, - const word& phaseName=word::null + const word& phaseName = word::null ); @@ -127,6 +127,16 @@ public: // Member Functions + // Access to thermodynamic state variables + + //- Pressure [Pa] + // Non-const access allowed for transport equations + virtual volScalarField& p() = 0; + + //- Pressure [Pa] + virtual const volScalarField& p() const = 0; + + // Fields derived from thermodynamic state variables //- Density [kg/m^3]