solidThermo: Add rhoThermo interface

The old fluid-specific rhoThermo has been split into a non-fluid
specific part which is still called rhoThermo, and a fluid-specific part
called rhoFluidThermo. The rhoThermo interface has been added to the
solidThermo model. This permits models and solvers that access the
density to operate on both solid and fluid thermophysical models.
This commit is contained in:
Will Bainbridge
2023-07-26 15:42:16 +01:00
parent 65f3050b35
commit 4acddc6ab0
54 changed files with 528 additions and 444 deletions

View File

@ -66,7 +66,7 @@ Foam::compressibleVoFphase::compressibleVoFphase
Tp.write(); Tp.write();
} }
thermo_ = rhoThermo::New(mesh, name); thermo_ = rhoFluidThermo::New(mesh, name);
thermo_->validate(name, "e"); thermo_->validate(name, "e");
} }

View File

@ -43,7 +43,7 @@ See also
#define compressibleVoFphase_H #define compressibleVoFphase_H
#include "VoFphase.H" #include "VoFphase.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,7 +61,7 @@ class compressibleVoFphase
// Private Data // Private Data
//- Phase thermo //- Phase thermo
autoPtr<rhoThermo> thermo_; autoPtr<rhoFluidThermo> thermo_;
//- Phase mass-fraction //- Phase mass-fraction
volScalarField Alpha_; volScalarField Alpha_;
@ -115,14 +115,14 @@ public:
// Member Functions // Member Functions
//- Return const-access to phase rhoThermo //- Return const-access to phase rhoFluidThermo
const rhoThermo& thermo() const const rhoFluidThermo& thermo() const
{ {
return thermo_(); return thermo_();
} }
//- Return access to phase rhoThermo //- Return access to phase rhoFluidThermo
rhoThermo& thermo() rhoFluidThermo& thermo()
{ {
return thermo_(); return thermo_();
} }

View File

@ -79,7 +79,7 @@ void Foam::solvers::compressibleMultiphaseVoF::pressureCorrector()
forAll(phases, phasei) forAll(phases, phasei)
{ {
const compressibleVoFphase& phase = phases[phasei]; const compressibleVoFphase& phase = phases[phasei];
const rhoThermo& thermo = phase.thermo(); const rhoFluidThermo& thermo = phase.thermo();
const volScalarField& rho = phases[phasei].thermo().rho(); const volScalarField& rho = phases[phasei].thermo().rho();
p_rghEqnComps.set p_rghEqnComps.set

View File

@ -143,8 +143,8 @@ Foam::compressibleTwoPhaseVoFMixture::compressibleTwoPhaseVoFMixture
// Avoid any thread-writing problems. // Avoid any thread-writing problems.
// fileHandler().flush(); // fileHandler().flush();
thermo1_ = rhoThermo::New(mesh, phase1Name()); thermo1_ = rhoFluidThermo::New(mesh, phase1Name());
thermo2_ = rhoThermo::New(mesh, phase2Name()); thermo2_ = rhoFluidThermo::New(mesh, phase2Name());
// thermo1_->validate(phase1Name(), "e"); // thermo1_->validate(phase1Name(), "e");
// thermo2_->validate(phase2Name(), "e"); // thermo2_->validate(phase2Name(), "e");

View File

@ -25,7 +25,7 @@ Class
Foam::compressibleTwoPhaseVoFMixture Foam::compressibleTwoPhaseVoFMixture
Description Description
Class to represent a mixture of two rhoThermo-based phases Class to represent a mixture of two rhoFluidThermo-based phases
SourceFiles SourceFiles
compressibleTwoPhaseVoFMixture.C compressibleTwoPhaseVoFMixture.C
@ -37,7 +37,7 @@ SourceFiles
#include "twoPhaseVoFMixture.H" #include "twoPhaseVoFMixture.H"
#include "compressibleTwoPhases.H" #include "compressibleTwoPhases.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,10 +67,10 @@ class compressibleTwoPhaseVoFMixture
volScalarField T_; volScalarField T_;
//- Thermo-package of phase 1 //- Thermo-package of phase 1
autoPtr<rhoThermo> thermo1_; autoPtr<rhoFluidThermo> thermo1_;
//- Thermo-package of phase 2 //- Thermo-package of phase 2
autoPtr<rhoThermo> thermo2_; autoPtr<rhoFluidThermo> thermo2_;
//- Mixture density //- Mixture density
volScalarField rho_; volScalarField rho_;
@ -126,25 +126,25 @@ public:
} }
//- Return the thermo for phase 1 //- Return the thermo for phase 1
const rhoThermo& thermo1() const const rhoFluidThermo& thermo1() const
{ {
return thermo1_(); return thermo1_();
} }
//- Return the thermo for phase 2 //- Return the thermo for phase 2
const rhoThermo& thermo2() const const rhoFluidThermo& thermo2() const
{ {
return thermo2_(); return thermo2_();
} }
//- Return the thermo for phase 1 //- Return the thermo for phase 1
rhoThermo& thermo1() rhoFluidThermo& thermo1()
{ {
return thermo1_(); return thermo1_();
} }
//- Return the thermo for phase 2 //- Return the thermo for phase 2
rhoThermo& thermo2() rhoFluidThermo& thermo2()
{ {
return thermo2_(); return thermo2_();
} }

View File

@ -86,7 +86,7 @@ class VoFFilmTransfer
word phaseName_; word phaseName_;
//- Reference to the transferred phase thermo //- Reference to the transferred phase thermo
const rhoThermo& thermo_; const rhoFluidThermo& thermo_;
//- Reference to the transferred phase volume fraction //- Reference to the transferred phase volume fraction
const volScalarField& alpha_; const volScalarField& alpha_;

View File

@ -241,7 +241,7 @@ Foam::wordList Foam::solvers::isothermalFilm::alphaTypes() const
Foam::solvers::isothermalFilm::isothermalFilm Foam::solvers::isothermalFilm::isothermalFilm
( (
fvMesh& mesh, fvMesh& mesh,
autoPtr<rhoThermo> thermoPtr autoPtr<rhoFluidThermo> thermoPtr
) )
: :
solver(mesh), solver(mesh),
@ -411,7 +411,7 @@ Foam::solvers::isothermalFilm::isothermalFilm
Foam::solvers::isothermalFilm::isothermalFilm(fvMesh& mesh) Foam::solvers::isothermalFilm::isothermalFilm(fvMesh& mesh)
: :
isothermalFilm(mesh, rhoThermo::New(mesh)) isothermalFilm(mesh, rhoFluidThermo::New(mesh))
{} {}

View File

@ -46,7 +46,7 @@ See also
#define isothermalFilm_H #define isothermalFilm_H
#include "solver.H" #include "solver.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
#include "filmCompressibleMomentumTransportModel.H" #include "filmCompressibleMomentumTransportModel.H"
#include "uniformDimensionedFields.H" #include "uniformDimensionedFields.H"
@ -93,10 +93,10 @@ protected:
// Thermophysical properties // Thermophysical properties
//- Pointer to the fluid thermophysical properties //- Pointer to the fluid thermophysical properties
autoPtr<rhoThermo> thermoPtr_; autoPtr<rhoFluidThermo> thermoPtr_;
//- Reference to the fluid thermophysical properties //- Reference to the fluid thermophysical properties
rhoThermo& thermo_; rhoFluidThermo& thermo_;
//- The thermodynamic pressure field //- The thermodynamic pressure field
volScalarField& p; volScalarField& p;
@ -270,7 +270,7 @@ public:
const volScalarField& alpha; const volScalarField& alpha;
//- Reference to the fluid thermophysical properties //- Reference to the fluid thermophysical properties
const rhoThermo& thermo; const rhoFluidThermo& thermo;
//- Reference to the thermodynamic density field //- Reference to the thermodynamic density field
const volScalarField& rho; const volScalarField& rho;
@ -302,7 +302,7 @@ public:
// Constructors // Constructors
//- Construct from region mesh and thermophysical properties //- Construct from region mesh and thermophysical properties
isothermalFilm(fvMesh& mesh, autoPtr<rhoThermo>); isothermalFilm(fvMesh& mesh, autoPtr<rhoFluidThermo>);
//- Construct from region mesh //- Construct from region mesh
isothermalFilm(fvMesh& mesh); isothermalFilm(fvMesh& mesh);

View File

@ -26,7 +26,7 @@ License
#include "interfaceCompositionModel.H" #include "interfaceCompositionModel.H"
#include "phaseModel.H" #include "phaseModel.H"
#include "phaseSystem.H" #include "phaseSystem.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ Foam::interfaceCompositionModel::interfaceCompositionModel
Le_("Le", dimless, dict), Le_("Le", dimless, dict),
thermo_ thermo_
( (
refCast<const rhoMulticomponentThermo>(interface_.phase().thermo()) refCast<const rhoFluidMulticomponentThermo>(interface_.phase().thermo())
), ),
otherThermo_(interface_.otherPhase().thermo()) otherThermo_(interface_.otherPhase().thermo())
{} {}

View File

@ -42,7 +42,7 @@ SourceFiles
#include "volFields.H" #include "volFields.H"
#include "dictionary.H" #include "dictionary.H"
#include "hashedWordList.H" #include "hashedWordList.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#include "sidedPhaseInterface.H" #include "sidedPhaseInterface.H"
#include "SidedInterfacialModel.H" #include "SidedInterfacialModel.H"
@ -68,10 +68,10 @@ class interfaceCompositionModel
const dimensionedScalar Le_; const dimensionedScalar Le_;
//- Multi-component thermo model for this side of the interface //- Multi-component thermo model for this side of the interface
const rhoMulticomponentThermo& thermo_; const rhoFluidMulticomponentThermo& thermo_;
//- General thermo model for the other side of the interface //- General thermo model for the other side of the interface
const rhoThermo& otherThermo_; const rhoFluidThermo& otherThermo_;
public: public:
@ -130,13 +130,13 @@ public:
inline const hashedWordList& species() const; inline const hashedWordList& species() const;
//- Return the thermo //- Return the thermo
inline const rhoMulticomponentThermo& thermo() const; inline const rhoFluidMulticomponentThermo& thermo() const;
//- Return the other thermo //- Return the other thermo
inline const rhoThermo& otherThermo() const; inline const rhoFluidThermo& otherThermo() const;
//- Return the other multicomponent thermo //- Return the other multicomponent thermo
inline const rhoMulticomponentThermo& inline const rhoFluidMulticomponentThermo&
otherMulticomponentThermo() const; otherMulticomponentThermo() const;

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "interfaceCompositionModel.H" #include "interfaceCompositionModel.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -41,23 +41,23 @@ const Foam::hashedWordList& Foam::interfaceCompositionModel::species() const
} }
const Foam::rhoMulticomponentThermo& const Foam::rhoFluidMulticomponentThermo&
Foam::interfaceCompositionModel::thermo() const Foam::interfaceCompositionModel::thermo() const
{ {
return thermo_; return thermo_;
} }
const Foam::rhoThermo& Foam::interfaceCompositionModel::otherThermo() const const Foam::rhoFluidThermo& Foam::interfaceCompositionModel::otherThermo() const
{ {
return otherThermo_; return otherThermo_;
} }
const Foam::rhoMulticomponentThermo& const Foam::rhoFluidMulticomponentThermo&
Foam::interfaceCompositionModel::otherMulticomponentThermo() const Foam::interfaceCompositionModel::otherMulticomponentThermo() const
{ {
return refCast<const rhoMulticomponentThermo>(otherThermo_); return refCast<const rhoFluidMulticomponentThermo>(otherThermo_);
} }

View File

@ -25,7 +25,7 @@ License
#include "HeatTransferPhaseSystem.H" #include "HeatTransferPhaseSystem.H"
#include "fvmSup.H" #include "fvmSup.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -47,8 +47,8 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefs
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
const volScalarField& he1 = thermo1.he(); const volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he(); const volScalarField& he2 = thermo2.he();
const volScalarField hs1(thermo1.hs()); const volScalarField hs1(thermo1.hs());
@ -89,16 +89,16 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
const rhoMulticomponentThermo* mcThermoPtr1 = const rhoFluidMulticomponentThermo* mcThermoPtr1 =
isA<rhoMulticomponentThermo>(thermo1) isA<rhoFluidMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1) ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const rhoMulticomponentThermo* mcThermoPtr2 = const rhoFluidMulticomponentThermo* mcThermoPtr2 =
isA<rhoMulticomponentThermo>(thermo2) isA<rhoFluidMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2) ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const volScalarField& he1 = thermo1.he(); const volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he(); const volScalarField& he2 = thermo2.he();
const volScalarField hs1(thermo1.hs()); const volScalarField hs1(thermo1.hs());
@ -195,8 +195,8 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefsWithoutL
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
const volScalarField& he1 = thermo1.he(); const volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he(); const volScalarField& he2 = thermo2.he();
const volScalarField K1(phase1.K()); const volScalarField K1(phase1.K());
@ -305,16 +305,16 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefsWithoutL
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
const rhoMulticomponentThermo* mcThermoPtr1 = const rhoFluidMulticomponentThermo* mcThermoPtr1 =
isA<rhoMulticomponentThermo>(thermo1) isA<rhoFluidMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1) ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const rhoMulticomponentThermo* mcThermoPtr2 = const rhoFluidMulticomponentThermo* mcThermoPtr2 =
isA<rhoMulticomponentThermo>(thermo2) isA<rhoFluidMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2) ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const volScalarField& he1 = thermo1.he(); const volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he(); const volScalarField& he2 = thermo2.he();
const volScalarField K1(phase1.K()); const volScalarField K1(phase1.K());
@ -512,8 +512,8 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::L
const latentHeatScheme scheme const latentHeatScheme scheme
) const ) const
{ {
const rhoThermo& thermo1 = interface.phase1().thermo(); const rhoFluidThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo(); const rhoFluidThermo& thermo2 = interface.phase2().thermo();
// Interface enthalpies // Interface enthalpies
const volScalarField haf1(thermo1.ha(thermo1.p(), Tf)); const volScalarField haf1(thermo1.ha(thermo1.p(), Tf));
@ -552,8 +552,8 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::L
const latentHeatScheme scheme const latentHeatScheme scheme
) const ) const
{ {
const rhoThermo& thermo1 = interface.phase1().thermo(); const rhoFluidThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo(); const rhoFluidThermo& thermo2 = interface.phase2().thermo();
// Interface enthalpies // Interface enthalpies
const scalarField haf1(thermo1.ha(Tf, cells)); const scalarField haf1(thermo1.ha(Tf, cells));
@ -595,16 +595,16 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
const latentHeatScheme scheme const latentHeatScheme scheme
) const ) const
{ {
const rhoThermo& thermo1 = interface.phase1().thermo(); const rhoFluidThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo(); const rhoFluidThermo& thermo2 = interface.phase2().thermo();
const rhoMulticomponentThermo* mcThermoPtr1 = const rhoFluidMulticomponentThermo* mcThermoPtr1 =
isA<rhoMulticomponentThermo>(thermo1) isA<rhoFluidMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1) ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const rhoMulticomponentThermo* mcThermoPtr2 = const rhoFluidMulticomponentThermo* mcThermoPtr2 =
isA<rhoMulticomponentThermo>(thermo2) isA<rhoFluidMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2) ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const label speciei1 = const label speciei1 =
mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1; mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1;
const label speciei2 = const label speciei2 =
@ -668,16 +668,16 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
const latentHeatScheme scheme const latentHeatScheme scheme
) const ) const
{ {
const rhoThermo& thermo1 = interface.phase1().thermo(); const rhoFluidThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo(); const rhoFluidThermo& thermo2 = interface.phase2().thermo();
const rhoMulticomponentThermo* mcThermoPtr1 = const rhoFluidMulticomponentThermo* mcThermoPtr1 =
isA<rhoMulticomponentThermo>(thermo1) isA<rhoFluidMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1) ? &refCast<const rhoFluidMulticomponentThermo>(thermo1)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const rhoMulticomponentThermo* mcThermoPtr2 = const rhoFluidMulticomponentThermo* mcThermoPtr2 =
isA<rhoMulticomponentThermo>(thermo2) isA<rhoFluidMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2) ? &refCast<const rhoFluidMulticomponentThermo>(thermo2)
: static_cast<const rhoMulticomponentThermo*>(nullptr); : static_cast<const rhoFluidMulticomponentThermo*>(nullptr);
const label speciei1 = const label speciei1 =
mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1; mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1;
const label speciei2 = const label speciei2 =

View File

@ -26,7 +26,7 @@ License
#include "TwoResistanceHeatTransferPhaseSystem.H" #include "TwoResistanceHeatTransferPhaseSystem.H"
#include "heatTransferModel.H" #include "heatTransferModel.H"
#include "fvmSup.H" #include "fvmSup.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -59,8 +59,8 @@ void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefs
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
// Transfer coefficients // Transfer coefficients
const sidedBlendedHeatTransferModel& heatTransferModel = const sidedBlendedHeatTransferModel& heatTransferModel =
@ -124,8 +124,8 @@ void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
// Transfer coefficients // Transfer coefficients
const sidedBlendedHeatTransferModel& heatTransferModel = const sidedBlendedHeatTransferModel& heatTransferModel =

View File

@ -31,7 +31,7 @@ License
#include "compressibleMomentumTransportModel.H" #include "compressibleMomentumTransportModel.H"
#include "phaseCompressibleMomentumTransportModel.H" #include "phaseCompressibleMomentumTransportModel.H"
#include "interfaceSaturationTemperatureModel.H" #include "interfaceSaturationTemperatureModel.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"

View File

@ -237,9 +237,9 @@ Foam::heatTransferModels::wallBoilingHeatTransfer::K
const phaseModel& vapour = fluid.phases()[vapourPhaseName_]; const phaseModel& vapour = fluid.phases()[vapourPhaseName_];
const phaseModel& solid = interface_.dispersed(); const phaseModel& solid = interface_.dispersed();
const rhoThermo& lThermo = liquid.thermo(); const rhoFluidThermo& lThermo = liquid.thermo();
const rhoThermo& vThermo = vapour.thermo(); const rhoFluidThermo& vThermo = vapour.thermo();
const rhoThermo& sThermo = solid.thermo(); const rhoFluidThermo& sThermo = solid.thermo();
// Estimate the surface temperature from the surrounding temperature and // Estimate the surface temperature from the surrounding temperature and
// heat transfer coefficients. Note that a lagged value of K is used in // heat transfer coefficients. Note that a lagged value of K is used in

View File

@ -28,7 +28,7 @@ License
#include "alphatPhaseChangeWallFunctionBase.H" #include "alphatPhaseChangeWallFunctionBase.H"
#include "fvcVolumeIntegrate.H" #include "fvcVolumeIntegrate.H"
#include "fvmSup.H" #include "fvmSup.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
#include "wallBoilingHeatTransfer.H" #include "wallBoilingHeatTransfer.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -562,8 +562,8 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctInterfaceThermo()
const phaseInterface& interface = saturationModelIter()->interface(); const phaseInterface& interface = saturationModelIter()->interface();
const phaseModel& phase1 = interface.phase1(); const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2(); const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo(); const rhoFluidThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo(); const rhoFluidThermo& thermo2 = phase2.thermo();
const volScalarField& T1(thermo1.T()); const volScalarField& T1(thermo1.T());
const volScalarField& T2(thermo2.T()); const volScalarField& T2(thermo2.T());

View File

@ -300,10 +300,10 @@ public:
virtual inline const volScalarField& alpha2() const; virtual inline const volScalarField& alpha2() const;
//- Return the thermo for phase 1 //- Return the thermo for phase 1
virtual inline const rhoThermo& thermo1() const; virtual inline const rhoFluidThermo& thermo1() const;
//- Return the thermo for phase 2 //- Return the thermo for phase 2
virtual inline const rhoThermo& thermo2() const; virtual inline const rhoFluidThermo& thermo2() const;
//- Return the density of phase 1 //- Return the density of phase 1
virtual inline const volScalarField& rho1() const; virtual inline const volScalarField& rho1() const;

View File

@ -39,13 +39,13 @@ inline const Foam::volScalarField& Foam::phaseInterface::alpha2() const
} }
inline const Foam::rhoThermo& Foam::phaseInterface::thermo1() const inline const Foam::rhoFluidThermo& Foam::phaseInterface::thermo1() const
{ {
return phase1().thermo(); return phase1().thermo();
} }
inline const Foam::rhoThermo& Foam::phaseInterface::thermo2() const inline const Foam::rhoFluidThermo& Foam::phaseInterface::thermo2() const
{ {
return phase2().thermo(); return phase2().thermo();
} }

View File

@ -62,13 +62,13 @@ template<class ThermoModel>
struct MovingPhaseModelTransportThermoModel; struct MovingPhaseModelTransportThermoModel;
template<> template<>
struct MovingPhaseModelTransportThermoModel<rhoThermo> struct MovingPhaseModelTransportThermoModel<rhoFluidThermo>
{ {
typedef fluidThermo type; typedef fluidThermo type;
}; };
template<> template<>
struct MovingPhaseModelTransportThermoModel<rhoMulticomponentThermo> struct MovingPhaseModelTransportThermoModel<rhoFluidMulticomponentThermo>
{ {
typedef fluidMulticomponentThermo type; typedef fluidMulticomponentThermo type;
}; };

View File

@ -74,7 +74,7 @@ bool Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::isochoric() const
template<class BasePhaseModel, class ThermoModel> template<class BasePhaseModel, class ThermoModel>
const Foam::rhoThermo& const Foam::rhoFluidThermo&
Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::thermo() const Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::thermo() const
{ {
return thermo_(); return thermo_();
@ -82,7 +82,7 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::thermo() const
template<class BasePhaseModel, class ThermoModel> template<class BasePhaseModel, class ThermoModel>
Foam::rhoThermo& Foam::rhoFluidThermo&
Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::thermo() Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::thermo()
{ {
return thermo_(); return thermo_();

View File

@ -46,7 +46,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
class rhoThermo; class rhoFluidThermo;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class ThermoPhaseModel Declaration Class ThermoPhaseModel Declaration
@ -97,10 +97,10 @@ public:
virtual bool isochoric() const; virtual bool isochoric() const;
//- Return the thermophysical model //- Return the thermophysical model
virtual const rhoThermo& thermo() const; virtual const rhoFluidThermo& thermo() const;
//- Access the thermophysical model //- Access the thermophysical model
virtual rhoThermo& thermo(); virtual rhoFluidThermo& thermo();
//- Return the density field //- Return the density field
virtual const volScalarField& rho() const; virtual const volScalarField& rho() const;

View File

@ -37,7 +37,7 @@ SourceFiles
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fvMatricesFwd.H" #include "fvMatricesFwd.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -255,10 +255,10 @@ public:
// Thermo // Thermo
//- Return the thermophysical model //- Return the thermophysical model
virtual const rhoThermo& thermo() const = 0; virtual const rhoFluidThermo& thermo() const = 0;
//- Access the thermophysical model //- Access the thermophysical model
virtual rhoThermo& thermo() = 0; virtual rhoFluidThermo& thermo() = 0;
//- Return the density field //- Return the density field
virtual const volScalarField& rho() const = 0; virtual const volScalarField& rho() const = 0;

View File

@ -25,8 +25,8 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
#include "combustionModel.H" #include "combustionModel.H"
@ -54,7 +54,11 @@ namespace Foam
< <
MovingPhaseModel MovingPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidThermo
>
> >
> >
> >
@ -78,7 +82,11 @@ namespace Foam
< <
StationaryPhaseModel StationaryPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidThermo
>
> >
> >
> >
@ -102,7 +110,11 @@ namespace Foam
< <
MovingPhaseModel MovingPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidThermo
>
> >
> >
> >
@ -126,7 +138,11 @@ namespace Foam
< <
StationaryPhaseModel StationaryPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidThermo
>
> >
> >
> >
@ -150,7 +166,11 @@ namespace Foam
< <
MovingPhaseModel MovingPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoMulticomponentThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidMulticomponentThermo
>
> >
> >
> >
@ -184,7 +204,11 @@ namespace Foam
< <
MovingPhaseModel MovingPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoMulticomponentThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidMulticomponentThermo
>
> >
> >
> >
@ -208,7 +232,11 @@ namespace Foam
< <
MovingPhaseModel MovingPhaseModel
< <
ThermoPhaseModel<phaseModel, rhoMulticomponentThermo> ThermoPhaseModel
<
phaseModel,
rhoFluidMulticomponentThermo
>
> >
> >
> >

View File

@ -22,7 +22,7 @@ type
typeRenamed typeRenamed
( (
hePsiThermo psiMulticomponentThermo hePsiThermo psiMulticomponentThermo
heRhoThermo rhoMulticomponentThermo heRhoThermo rhoFluidMulticomponentThermo
); );
energy energy

View File

@ -22,7 +22,7 @@ type
typeRenamed typeRenamed
( (
hePsiThermo psiThermo hePsiThermo psiThermo
heRhoThermo rhoThermo heRhoThermo rhoFluidThermo
); );
energy energy

View File

@ -3,14 +3,16 @@ basicThermo/BasicThermoName.C
pureThermo/pureThermo.C pureThermo/pureThermo.C
rhoThermo/rhoThermo.C
fluidThermo/fluidThermo.C fluidThermo/fluidThermo.C
fluidThermo/hydrostaticInitialisation.C fluidThermo/hydrostaticInitialisation.C
psiThermo/psiThermo.C psiThermo/psiThermo.C
psiThermo/psiThermos.C psiThermo/psiThermos.C
rhoThermo/rhoThermo.C rhoFluidThermo/rhoFluidThermo.C
rhoThermo/rhoThermos.C rhoFluidThermo/rhoFluidThermos.C
liquidThermo/liquidThermo.C liquidThermo/liquidThermo.C
liquidThermo/liquidThermos.C liquidThermo/liquidThermos.C

View File

@ -39,7 +39,7 @@ SourceFiles
#define liquidThermo_H #define liquidThermo_H
#include "LiquidThermo.H" #include "LiquidThermo.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +52,7 @@ namespace Foam
class liquidThermo class liquidThermo
: :
virtual public rhoThermo virtual public rhoFluidThermo
{ {
public: public:
@ -67,7 +67,7 @@ public:
//- The derived type //- The derived type
template<class MixtureType> template<class MixtureType>
using DerivedThermoType = using DerivedThermoType =
LiquidThermo<RhoThermo<BasicThermo<MixtureType, composite>>>; LiquidThermo<RhoFluidThermo<BasicThermo<MixtureType, composite>>>;
//- Runtime type information //- Runtime type information
@ -114,8 +114,8 @@ class liquidThermo::composite
: :
public basicThermo::implementation, public basicThermo::implementation,
public pureThermo, public pureThermo,
public fluidThermo::implementation,
public rhoThermo::implementation, public rhoThermo::implementation,
public fluidThermo::implementation,
public liquidThermo public liquidThermo
{ {
public: public:
@ -133,8 +133,8 @@ public:
) )
: :
basicThermo::implementation(dict, mesh, phaseName), basicThermo::implementation(dict, mesh, phaseName),
fluidThermo::implementation(dict, mesh, phaseName), rhoThermo::implementation(dict, mesh, phaseName),
rhoThermo::implementation(dict, mesh, phaseName) fluidThermo::implementation(dict, mesh, phaseName)
{} {}
}; };

View File

@ -42,7 +42,7 @@ License
\ \
addThermo(basicThermo, liquidThermo, pureMixture, ThermoPhysics); \ addThermo(basicThermo, liquidThermo, pureMixture, ThermoPhysics); \
addThermo(fluidThermo, liquidThermo, pureMixture, ThermoPhysics); \ addThermo(fluidThermo, liquidThermo, pureMixture, ThermoPhysics); \
addThermo(rhoThermo, liquidThermo, pureMixture, ThermoPhysics); \ addThermo(rhoFluidThermo, liquidThermo, pureMixture, ThermoPhysics); \
addThermo(liquidThermo, liquidThermo, pureMixture, ThermoPhysics) addThermo(liquidThermo, liquidThermo, pureMixture, ThermoPhysics)
namespace Foam namespace Foam

View File

@ -75,6 +75,12 @@ void Foam::psiThermo::correctRho(const Foam::volScalarField& deltaRho)
{} {}
Foam::tmp<Foam::volScalarField> Foam::psiThermo::renameRho()
{
return rho();
}
Foam::tmp<Foam::volScalarField> Foam::psiThermo::implementation::rho() const Foam::tmp<Foam::volScalarField> Foam::psiThermo::implementation::rho() const
{ {
return p()*psi(); return p()*psi();
@ -90,10 +96,4 @@ Foam::tmp<Foam::scalarField> Foam::psiThermo::implementation::rho
} }
Foam::tmp<Foam::volScalarField> Foam::psiThermo::implementation::renameRho()
{
return rho();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -39,8 +39,8 @@ SourceFiles
#define psiThermo_H #define psiThermo_H
#include "PsiThermo.H" #include "PsiThermo.H"
#include "fluidThermo.H"
#include "pureThermo.H" #include "pureThermo.H"
#include "fluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -110,11 +110,6 @@ public:
// Fields derived from thermodynamic state variables // Fields derived from thermodynamic state variables
//- Add the given density correction to the density field.
// Used to update the density field following pressure solution.
// For psiThermo does nothing.
virtual void correctRho(const volScalarField& deltaRho);
//- Density [kg/m^3] - uses current value of pressure //- Density [kg/m^3] - uses current value of pressure
virtual tmp<volScalarField> rho() const = 0; virtual tmp<volScalarField> rho() const = 0;
@ -123,7 +118,12 @@ public:
//- Return the thermodynamic density field [kg/m^3] //- Return the thermodynamic density field [kg/m^3]
// This is used by solvers which create a separate continuity rho // This is used by solvers which create a separate continuity rho
virtual tmp<volScalarField> renameRho() = 0; virtual tmp<volScalarField> renameRho();
//- Add the given density correction to the density field.
// Used to update the density field following pressure solution.
// For psiThermo does nothing.
virtual void correctRho(const volScalarField& deltaRho);
}; };
@ -135,7 +135,6 @@ class psiThermo::implementation
: :
virtual public psiThermo virtual public psiThermo
{ {
public: public:
// Constructors // Constructors
@ -161,10 +160,6 @@ public:
//- Density for patch [kg/m^3] //- Density for patch [kg/m^3]
virtual tmp<scalarField> rho(const label patchi) const; virtual tmp<scalarField> rho(const label patchi) const;
//- Return the thermodynamic density field [kg/m^3]
// This is used by solvers which create a separate continuity rho
virtual tmp<volScalarField> renameRho();
// Member Operators // Member Operators

View File

@ -23,12 +23,12 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "RhoThermo.H" #include "RhoFluidThermo.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class BaseThermo> template<class BaseThermo>
void Foam::RhoThermo<BaseThermo>::calculate() void Foam::RhoFluidThermo<BaseThermo>::calculate()
{ {
const scalarField& hCells = this->he(); const scalarField& hCells = this->he();
const scalarField& pCells = this->p_; const scalarField& pCells = this->p_;
@ -163,7 +163,7 @@ void Foam::RhoThermo<BaseThermo>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BaseThermo> template<class BaseThermo>
Foam::RhoThermo<BaseThermo>::RhoThermo Foam::RhoFluidThermo<BaseThermo>::RhoFluidThermo
( (
const fvMesh& mesh, const fvMesh& mesh,
const word& phaseName const word& phaseName
@ -178,14 +178,14 @@ Foam::RhoThermo<BaseThermo>::RhoThermo
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BaseThermo> template<class BaseThermo>
Foam::RhoThermo<BaseThermo>::~RhoThermo() Foam::RhoFluidThermo<BaseThermo>::~RhoFluidThermo()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BaseThermo> template<class BaseThermo>
void Foam::RhoThermo<BaseThermo>::correct() void Foam::RhoFluidThermo<BaseThermo>::correct()
{ {
if (BaseThermo::debug) if (BaseThermo::debug)
{ {

View File

@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::RhoThermo Foam::RhoFluidThermo
Description Description
Thermo implementation based on density Thermo implementation based on density
SourceFiles SourceFiles
RhoThermo.C RhoFluidThermo.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef RhoThermo_H #ifndef RhoFluidThermo_H
#define RhoThermo_H #define RhoFluidThermo_H
#include "BasicThermo.H" #include "BasicThermo.H"
@ -43,11 +43,11 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class RhoThermo Declaration Class RhoFluidThermo Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class BaseThermo> template<class BaseThermo>
class RhoThermo class RhoFluidThermo
: :
public BaseThermo public BaseThermo
{ {
@ -62,14 +62,14 @@ public:
// Constructors // Constructors
//- Construct from mesh and phase name //- Construct from mesh and phase name
RhoThermo(const fvMesh&, const word& phaseName); RhoFluidThermo(const fvMesh&, const word& phaseName);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
RhoThermo(const RhoThermo<BaseThermo>&) = delete; RhoFluidThermo(const RhoFluidThermo<BaseThermo>&) = delete;
//- Destructor //- Destructor
virtual ~RhoThermo(); virtual ~RhoFluidThermo();
// Member Functions // Member Functions
@ -81,7 +81,7 @@ public:
// Member Operators // Member Operators
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const RhoThermo<BaseThermo>&) = delete; void operator=(const RhoFluidThermo<BaseThermo>&) = delete;
}; };
@ -92,7 +92,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
#include "RhoThermo.C" #include "RhoFluidThermo.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "rhoFluidThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(rhoFluidThermo, 0);
defineRunTimeSelectionTable(rhoFluidThermo, fvMesh);
}
const Foam::word Foam::rhoFluidThermo::derivedThermoName("heRhoThermo");
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::rhoFluidThermo> Foam::rhoFluidThermo::New
(
const fvMesh& mesh,
const word& phaseName
)
{
return basicThermo::New<rhoFluidThermo>(mesh, phaseName);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::rhoFluidThermo::~rhoFluidThermo()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::rhoFluidThermo::renameRho()
{
rho().rename(phasePropertyName(Foam::typedName<rhoFluidThermo>("rho")));
return rho();
}
void Foam::rhoFluidThermo::correctRho(const volScalarField& deltaRho)
{
rho() += deltaRho;
}
// ************************************************************************* //

View File

@ -0,0 +1,163 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 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 <http://www.gnu.org/licenses/>.
Class
Foam::rhoFluidThermo
Description
Base-class for fluid thermodynamic properties based on density.
See also
Foam::basicThermo
SourceFiles
rhoFluidThermo.C
\*---------------------------------------------------------------------------*/
#ifndef rhoFluidThermo_H
#define rhoFluidThermo_H
#include "RhoFluidThermo.H"
#include "pureThermo.H"
#include "rhoThermo.H"
#include "fluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class rhoFluidThermo Declaration
\*---------------------------------------------------------------------------*/
class rhoFluidThermo
:
virtual public rhoThermo,
virtual public fluidThermo
{
public:
// Public Classes
//- Forward declare the composite class
class composite;
// Public Typedefs
//- The derived type
template<class MixtureType>
using DerivedThermoType =
RhoFluidThermo<BasicThermo<MixtureType, composite>>;
//- The derived name
static const word derivedThermoName;
//- Runtime type information
TypeName("rhoFluidThermo");
//- Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
rhoFluidThermo,
fvMesh,
(const fvMesh& mesh, const word& phaseName),
(mesh, phaseName)
);
// Selectors
//- Standard selection based on fvMesh
static autoPtr<rhoFluidThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor
virtual ~rhoFluidThermo();
// Member Functions
// Fields derived from thermodynamic state variables
//- Rename and return the thermodynamic density field [kg/m^3]
// This is used by solvers which create a separate continuity rho
virtual tmp<volScalarField> renameRho();
//- Add the given density correction to the density field.
// Used to update the density field following pressure solution
virtual void correctRho(const volScalarField& deltaRho);
};
/*---------------------------------------------------------------------------*\
Class rhoFluidThermo::composite Declaration
\*---------------------------------------------------------------------------*/
class rhoFluidThermo::composite
:
public basicThermo::implementation,
public pureThermo,
public rhoThermo::implementation,
public fluidThermo::implementation,
public rhoFluidThermo
{
public:
// Constructors
//- Construct from dictionary, mesh and phase name
template<class MixtureType>
composite
(
const dictionary& dict,
const MixtureType& mixture,
const fvMesh& mesh,
const word& phaseName
)
:
basicThermo::implementation(dict, mesh, phaseName),
rhoThermo::implementation(dict, mesh, phaseName),
fluidThermo::implementation(dict, mesh, phaseName)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "rhoThermo.H" #include "rhoFluidThermo.H"
#include "pureMixture.H" #include "pureMixture.H"
@ -37,9 +37,9 @@ License
namespace Foam namespace Foam
{ {
forGases(makeFluidThermo, rhoThermo, pureMixture); forGases(makeFluidThermo, rhoFluidThermo, pureMixture);
forLiquids(makeFluidThermo, rhoThermo, pureMixture); forLiquids(makeFluidThermo, rhoFluidThermo, pureMixture);
forTabulated(makeFluidThermo, rhoThermo, pureMixture); forTabulated(makeFluidThermo, rhoFluidThermo, pureMixture);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,17 +25,6 @@ License
#include "rhoThermo.H" #include "rhoThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(rhoThermo, 0);
defineRunTimeSelectionTable(rhoThermo, fvMesh);
}
const Foam::word Foam::rhoThermo::derivedThermoName("heRhoThermo");
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rhoThermo::implementation::implementation Foam::rhoThermo::implementation::implementation
@ -61,18 +50,6 @@ Foam::rhoThermo::implementation::implementation
{} {}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::rhoThermo> Foam::rhoThermo::New
(
const fvMesh& mesh,
const word& phaseName
)
{
return basicThermo::New<rhoThermo>(mesh, phaseName);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::rhoThermo::~rhoThermo() Foam::rhoThermo::~rhoThermo()
@ -85,7 +62,8 @@ Foam::rhoThermo::implementation::~implementation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::rhoThermo::implementation::rho() const Foam::tmp<Foam::volScalarField>
Foam::rhoThermo::implementation::rho() const
{ {
return rho_; return rho_;
} }
@ -100,23 +78,10 @@ Foam::tmp<Foam::scalarField> Foam::rhoThermo::implementation::rho
} }
Foam::tmp<Foam::volScalarField> Foam::rhoThermo::implementation::renameRho()
{
rho_.rename(phasePropertyName(Foam::typedName<rhoThermo>("rho")));
return rho_;
}
Foam::volScalarField& Foam::rhoThermo::implementation::rho() Foam::volScalarField& Foam::rhoThermo::implementation::rho()
{ {
return rho_; return rho_;
} }
void Foam::rhoThermo::implementation::correctRho(const volScalarField& deltaRho)
{
rho_ += deltaRho;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,7 +25,7 @@ Class
Foam::rhoThermo Foam::rhoThermo
Description Description
Base-class for fluid thermodynamic properties based on density. Base-class for thermodynamic properties based on density.
See also See also
Foam::basicThermo Foam::basicThermo
@ -38,9 +38,7 @@ SourceFiles
#ifndef rhoThermo_H #ifndef rhoThermo_H
#define rhoThermo_H #define rhoThermo_H
#include "RhoThermo.H" #include "basicThermo.H"
#include "fluidThermo.H"
#include "pureThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,7 +51,7 @@ namespace Foam
class rhoThermo class rhoThermo
: :
virtual public fluidThermo virtual public basicThermo
{ {
public: public:
@ -62,45 +60,6 @@ public:
//- Forward declare the implementation class //- Forward declare the implementation class
class implementation; class implementation;
//- Forward declare the composite class
class composite;
// Public Typedefs
//- The derived type
template<class MixtureType>
using DerivedThermoType =
RhoThermo<BasicThermo<MixtureType, composite>>;
//- The derived name
static const word derivedThermoName;
//- Runtime type information
TypeName("rhoThermo");
//- Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
rhoThermo,
fvMesh,
(const fvMesh& mesh, const word& phaseName),
(mesh, phaseName)
);
// Selectors
//- Standard selection based on fvMesh
static autoPtr<rhoThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor
virtual ~rhoThermo(); virtual ~rhoThermo();
@ -116,16 +75,8 @@ public:
//- Density for patch [kg/m^3] //- Density for patch [kg/m^3]
virtual tmp<scalarField> rho(const label patchi) const = 0; virtual tmp<scalarField> rho(const label patchi) const = 0;
//- Rename and return the thermodynamic density field [kg/m^3]
// This is used by solvers which create a separate continuity rho
virtual tmp<volScalarField> renameRho() = 0;
//- Return non-const access to the local density field [kg/m^3] //- Return non-const access to the local density field [kg/m^3]
virtual volScalarField& rho() = 0; virtual volScalarField& rho() = 0;
//- 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;
}; };
@ -142,7 +93,6 @@ protected:
// Protected data // Protected data
//- Density field [kg/m^3] //- Density field [kg/m^3]
// Named 'rho' to avoid (potential) conflict with solver density
volScalarField rho_; volScalarField rho_;
@ -171,17 +121,9 @@ public:
//- Density for patch [kg/m^3] //- Density for patch [kg/m^3]
virtual tmp<scalarField> rho(const label patchi) const; virtual tmp<scalarField> rho(const label patchi) const;
//- Rename and return the thermodynamic density field [kg/m^3]
// This is used by solvers which create a separate continuity rho
virtual tmp<volScalarField> renameRho();
//- Return non-const access to the local density field [kg/m^3] //- Return non-const access to the local density field [kg/m^3]
virtual volScalarField& rho(); virtual volScalarField& rho();
//- Add the given density correction to the density field.
// Used to update the density field following pressure solution
virtual void correctRho(const volScalarField& deltaRho);
// Member Operators // Member Operators
@ -190,38 +132,6 @@ public:
}; };
/*---------------------------------------------------------------------------*\
Class rhoThermo::composite Declaration
\*---------------------------------------------------------------------------*/
class rhoThermo::composite
:
public basicThermo::implementation,
public pureThermo,
public fluidThermo::implementation,
public rhoThermo::implementation
{
public:
// Constructors
//- Construct from dictionary, mesh and phase name
template<class MixtureType>
composite
(
const dictionary& dict,
const MixtureType& mixture,
const fvMesh& mesh,
const word& phaseName
)
:
basicThermo::implementation(dict, mesh, phaseName),
fluidThermo::implementation(dict, mesh, phaseName),
rhoThermo::implementation(dict, mesh, phaseName)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -8,8 +8,8 @@ psiMulticomponentThermo/psiMulticomponentThermos.C
psiuMulticomponentThermo/psiuMulticomponentThermo.C psiuMulticomponentThermo/psiuMulticomponentThermo.C
psiuMulticomponentThermo/psiuMulticomponentThermos.C psiuMulticomponentThermo/psiuMulticomponentThermos.C
rhoMulticomponentThermo/rhoMulticomponentThermo.C rhoFluidMulticomponentThermo/rhoFluidMulticomponentThermo.C
rhoMulticomponentThermo/rhoMulticomponentThermos.C rhoFluidMulticomponentThermo/rhoFluidMulticomponentThermos.C
derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C
derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C

View File

@ -23,32 +23,33 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(rhoMulticomponentThermo, 0); defineTypeNameAndDebug(rhoFluidMulticomponentThermo, 0);
defineRunTimeSelectionTable(rhoMulticomponentThermo, fvMesh); defineRunTimeSelectionTable(rhoFluidMulticomponentThermo, fvMesh);
} }
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::rhoMulticomponentThermo> Foam::rhoMulticomponentThermo::New Foam::autoPtr<Foam::rhoFluidMulticomponentThermo>
Foam::rhoFluidMulticomponentThermo::New
( (
const fvMesh& mesh, const fvMesh& mesh,
const word& phaseName const word& phaseName
) )
{ {
return basicThermo::New<rhoMulticomponentThermo>(mesh, phaseName); return basicThermo::New<rhoFluidMulticomponentThermo>(mesh, phaseName);
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::rhoMulticomponentThermo::~rhoMulticomponentThermo() Foam::rhoFluidMulticomponentThermo::~rhoFluidMulticomponentThermo()
{} {}

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::rhoMulticomponentThermo Foam::rhoFluidMulticomponentThermo
Description Description
Base-class for multi-component fluid thermodynamic properties based on Base-class for multi-component fluid thermodynamic properties based on
@ -32,14 +32,14 @@ See also
Foam::basicThermo Foam::basicThermo
SourceFiles SourceFiles
rhoMulticomponentThermo.C rhoFluidMulticomponentThermo.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef rhoMulticomponentThermo_H #ifndef rhoFluidMulticomponentThermo_H
#define rhoMulticomponentThermo_H #define rhoFluidMulticomponentThermo_H
#include "rhoThermo.H" #include "rhoFluidThermo.H"
#include "fluidMulticomponentThermo.H" #include "fluidMulticomponentThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,12 +48,12 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class rhoMulticomponentThermo Declaration Class rhoFluidMulticomponentThermo Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class rhoMulticomponentThermo class rhoFluidMulticomponentThermo
: :
virtual public rhoThermo, virtual public rhoFluidThermo,
virtual public fluidMulticomponentThermo virtual public fluidMulticomponentThermo
{ {
public: public:
@ -73,7 +73,7 @@ public:
< <
MulticomponentThermo MulticomponentThermo
< <
RhoThermo RhoFluidThermo
< <
BasicThermo<MixtureType, composite> BasicThermo<MixtureType, composite>
> >
@ -82,14 +82,14 @@ public:
//- Runtime type information //- Runtime type information
TypeName("rhoMulticomponentThermo"); TypeName("rhoFluidMulticomponentThermo");
//- Declare run-time constructor selection tables //- Declare run-time constructor selection tables
declareRunTimeSelectionTable declareRunTimeSelectionTable
( (
autoPtr, autoPtr,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
fvMesh, fvMesh,
(const fvMesh& mesh, const word& phaseName), (const fvMesh& mesh, const word& phaseName),
(mesh, phaseName) (mesh, phaseName)
@ -99,7 +99,7 @@ public:
// Selectors // Selectors
//- Standard selection based on fvMesh //- Standard selection based on fvMesh
static autoPtr<rhoMulticomponentThermo> New static autoPtr<rhoFluidMulticomponentThermo> New
( (
const fvMesh&, const fvMesh&,
const word& phaseName=word::null const word& phaseName=word::null
@ -107,21 +107,21 @@ public:
//- Destructor //- Destructor
virtual ~rhoMulticomponentThermo(); virtual ~rhoFluidMulticomponentThermo();
}; };
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class rhoMulticomponentThermo::composite Declaration Class rhoFluidMulticomponentThermo::composite Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class rhoMulticomponentThermo::composite class rhoFluidMulticomponentThermo::composite
: :
public basicThermo::implementation, public basicThermo::implementation,
public fluidThermo::implementation,
public rhoThermo::implementation, public rhoThermo::implementation,
public fluidThermo::implementation,
public multicomponentThermo::implementation, public multicomponentThermo::implementation,
public rhoMulticomponentThermo public rhoFluidMulticomponentThermo
{ {
public: public:
@ -138,8 +138,8 @@ public:
) )
: :
basicThermo::implementation(dict, mesh, phaseName), basicThermo::implementation(dict, mesh, phaseName),
fluidThermo::implementation(dict, mesh, phaseName),
rhoThermo::implementation(dict, mesh, phaseName), rhoThermo::implementation(dict, mesh, phaseName),
fluidThermo::implementation(dict, mesh, phaseName),
multicomponentThermo::implementation multicomponentThermo::implementation
( (
dict, dict,

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "rhoMulticomponentThermo.H" #include "rhoFluidMulticomponentThermo.H"
#include "coefficientMulticomponentMixture.H" #include "coefficientMulticomponentMixture.H"
#include "coefficientWilkeMulticomponentMixture.H" #include "coefficientWilkeMulticomponentMixture.H"
@ -43,56 +43,56 @@ namespace Foam
forCoeffGases forCoeffGases
( (
makeFluidMulticomponentThermos, makeFluidMulticomponentThermos,
rhoThermo, rhoFluidThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
coefficientMulticomponentMixture coefficientMulticomponentMixture
); );
forCoeffGases forCoeffGases
( (
makeFluidMulticomponentThermos, makeFluidMulticomponentThermos,
rhoThermo, rhoFluidThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
coefficientWilkeMulticomponentMixture coefficientWilkeMulticomponentMixture
); );
forGases forGases
( (
makeFluidMulticomponentThermo, makeFluidMulticomponentThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
singleComponentMixture singleComponentMixture
); );
forCoeffLiquids forCoeffLiquids
( (
makeFluidMulticomponentThermos, makeFluidMulticomponentThermos,
rhoThermo, rhoFluidThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
coefficientMulticomponentMixture coefficientMulticomponentMixture
); );
forLiquids forLiquids
( (
makeFluidMulticomponentThermos, makeFluidMulticomponentThermos,
rhoThermo, rhoFluidThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
valueMulticomponentMixture valueMulticomponentMixture
); );
forLiquids forLiquids
( (
makeFluidMulticomponentThermo, makeFluidMulticomponentThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
singleComponentMixture singleComponentMixture
); );
forTabulated forTabulated
( (
makeFluidMulticomponentThermos, makeFluidMulticomponentThermos,
rhoThermo, rhoFluidThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
valueMulticomponentMixture valueMulticomponentMixture
); );
forTabulated forTabulated
( (
makeFluidMulticomponentThermo, makeFluidMulticomponentThermo,
rhoMulticomponentThermo, rhoFluidMulticomponentThermo,
singleComponentMixture singleComponentMixture
); );
} }

View File

@ -57,19 +57,6 @@ Foam::solidThermo::implementation::implementation
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
dimensionedScalar(phasePropertyName("p", phaseName), dimPressure, NaN) dimensionedScalar(phasePropertyName("p", phaseName), dimPressure, NaN)
),
rho_
(
IOobject
(
phasePropertyName("rho", phaseName),
mesh.time().name(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimDensity
) )
{} {}
@ -96,27 +83,4 @@ Foam::solidThermo::implementation::~implementation()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::solidThermo::implementation::rho() const
{
return rho_;
}
Foam::tmp<Foam::scalarField> Foam::solidThermo::implementation::rho
(
const label patchi
) const
{
return rho_.boundaryField()[patchi];
}
Foam::volScalarField& Foam::solidThermo::implementation::rho()
{
return rho_;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -38,8 +38,9 @@ SourceFiles
#ifndef solidThermo_H #ifndef solidThermo_H
#define solidThermo_H #define solidThermo_H
#include "pureThermo.H"
#include "SolidThermo.H" #include "SolidThermo.H"
#include "pureThermo.H"
#include "rhoThermo.H"
#include "uniformGeometricFields.H" #include "uniformGeometricFields.H"
#include "fvScalarMatrix.H" #include "fvScalarMatrix.H"
@ -54,7 +55,8 @@ namespace Foam
class solidThermo class solidThermo
: :
virtual public basicThermo virtual public basicThermo,
virtual public rhoThermo
{ {
public: public:
@ -109,15 +111,6 @@ public:
// Member Functions // Member Functions
//- Density [kg/m^3]
virtual tmp<volScalarField> rho() const = 0;
//- Density for patch [kg/m^3]
virtual tmp<scalarField> rho(const label patchi) const = 0;
//- Return non-const access to the local density field [kg/m^3]
virtual volScalarField& rho() = 0;
//- Return true if thermal conductivity is isotropic //- Return true if thermal conductivity is isotropic
virtual bool isotropic() const = 0; virtual bool isotropic() const = 0;
@ -148,9 +141,6 @@ protected:
// code will exit. // code will exit.
uniformGeometricScalarField p_; uniformGeometricScalarField p_;
//- Density field [kg/m^3]
volScalarField rho_;
public: public:
@ -162,18 +152,6 @@ public:
//- Destructor //- Destructor
virtual ~implementation(); virtual ~implementation();
// Member Functions
//- Density [kg/m^3]
virtual tmp<volScalarField> rho() const;
//- Density for patch [kg/m^3]
virtual tmp<scalarField> rho(const label patchi) const;
//- Return non-const access to the local density field [kg/m^3]
virtual volScalarField& rho();
}; };
@ -185,6 +163,7 @@ class solidThermo::composite
: :
public basicThermo::implementation, public basicThermo::implementation,
public pureThermo, public pureThermo,
public rhoThermo::implementation,
public solidThermo::implementation public solidThermo::implementation
{ {
public: public:
@ -200,6 +179,7 @@ public:
) )
: :
basicThermo::implementation(dict, mesh, phaseName), basicThermo::implementation(dict, mesh, phaseName),
rhoThermo::implementation(dict, mesh, phaseName),
solidThermo::implementation(dict, mesh, phaseName) solidThermo::implementation(dict, mesh, phaseName)
{} {}

View File

@ -71,7 +71,10 @@ Foam::compressible::cavitationModels::Saito::Saito
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField::Internal> Foam::tmp<Foam::volScalarField::Internal>
Foam::compressible::cavitationModels::Saito::fT(const rhoThermo& thermo) const Foam::compressible::cavitationModels::Saito::fT
(
const rhoFluidThermo& thermo
) const
{ {
return sqrt(2*pi*(RR/thermo.W()()())*thermo.T()()); return sqrt(2*pi*(RR/thermo.W()()())*thermo.T()());
} }

View File

@ -107,7 +107,7 @@ class Saito
// Private Member functions // Private Member functions
//- Return the function of temperature //- Return the function of temperature
tmp<volScalarField::Internal> fT(const rhoThermo& thermo) const; tmp<volScalarField::Internal> fT(const rhoFluidThermo& thermo) const;
public: public:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,13 +94,13 @@ protected:
} }
//- Return the liquid thermo //- Return the liquid thermo
inline const rhoThermo& thermol() const inline const rhoFluidThermo& thermol() const
{ {
return phases_.thermo(liquidIndex_); return phases_.thermo(liquidIndex_);
} }
//- Return the vapour thermo //- Return the vapour thermo
inline const rhoThermo& thermov() const inline const rhoFluidThermo& thermov() const
{ {
return phases_.thermo(!liquidIndex_); return phases_.thermo(!liquidIndex_);
} }

View File

@ -25,7 +25,7 @@ Class
Foam::compressibleTwoPhaseMixture Foam::compressibleTwoPhaseMixture
Description Description
Interface to two rhoThermo-based phases Interface to two rhoFluidThermo-based phases
SourceFiles SourceFiles
compressibleTwoPhases.C compressibleTwoPhases.C
@ -36,7 +36,7 @@ SourceFiles
#define compressibleTwoPhases_H #define compressibleTwoPhases_H
#include "twoPhases.H" #include "twoPhases.H"
#include "rhoThermo.H" #include "rhoFluidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -72,13 +72,13 @@ public:
// Member Functions // Member Functions
//- Return the thermo for phase 1 //- Return the thermo for phase 1
virtual const rhoThermo& thermo1() const = 0; virtual const rhoFluidThermo& thermo1() const = 0;
//- Return the thermo for phase 2 //- Return the thermo for phase 2
virtual const rhoThermo& thermo2() const = 0; virtual const rhoFluidThermo& thermo2() const = 0;
//- Return the density of a given phase //- Return the density of a given phase
inline const rhoThermo& thermo(const bool index) const inline const rhoFluidThermo& thermo(const bool index) const
{ {
return index ? thermo2() : thermo1(); return index ? thermo2() : thermo1();
} }

View File

@ -23,11 +23,11 @@ codeOptions
codeInclude codeInclude
#{ #{
#include "rhoThermo.H" #include "rhoFluidThermo.H"
namespace Foam namespace Foam
{ {
tmp<volScalarField> ea(const rhoThermo& thermo) tmp<volScalarField> ea(const rhoFluidThermo& thermo)
{ {
tmp<volScalarField> tEa = thermo.he() + thermo.hc(); tmp<volScalarField> tEa = thermo.he() + thermo.hc();
@ -70,10 +70,10 @@ codeRead
mesh().lookupObject<volScalarField>("alpha.gas"); mesh().lookupObject<volScalarField>("alpha.gas");
const volScalarField& alphaLiq = const volScalarField& alphaLiq =
mesh().lookupObject<volScalarField>("alpha.liquid"); mesh().lookupObject<volScalarField>("alpha.liquid");
const rhoThermo& thermoGas = const rhoFluidThermo& thermoGas =
mesh().lookupObject<rhoThermo>("physicalProperties.gas"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.gas");
const rhoThermo& thermoLiq = const rhoFluidThermo& thermoLiq =
mesh().lookupObject<rhoThermo>("physicalProperties.liquid"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.liquid");
*mass0Gas = alphaGas*thermoGas.rho(); *mass0Gas = alphaGas*thermoGas.rho();
*mass0Liq = alphaLiq*thermoLiq.rho(); *mass0Liq = alphaLiq*thermoLiq.rho();
@ -124,10 +124,10 @@ codeExecute
mesh().lookupObject<volScalarField>("alpha.gas"); mesh().lookupObject<volScalarField>("alpha.gas");
const volScalarField& alphaLiq = const volScalarField& alphaLiq =
mesh().lookupObject<volScalarField>("alpha.liquid"); mesh().lookupObject<volScalarField>("alpha.liquid");
const rhoThermo& thermoGas = const rhoFluidThermo& thermoGas =
mesh().lookupObject<rhoThermo>("physicalProperties.gas"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.gas");
const rhoThermo& thermoLiq = const rhoFluidThermo& thermoLiq =
mesh().lookupObject<rhoThermo>("physicalProperties.liquid"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.liquid");
dMassGas = alphaGas*thermoGas.rho() - mass0Gas; dMassGas = alphaGas*thermoGas.rho() - mass0Gas;
dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq; dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq;

View File

@ -23,11 +23,11 @@ codeOptions
codeInclude codeInclude
#{ #{
#include "rhoThermo.H" #include "rhoFluidThermo.H"
namespace Foam namespace Foam
{ {
tmp<volScalarField> ea(const rhoThermo& thermo) tmp<volScalarField> ea(const rhoFluidThermo& thermo)
{ {
tmp<volScalarField> tEa = thermo.he() + thermo.hc(); tmp<volScalarField> tEa = thermo.he() + thermo.hc();
@ -70,10 +70,10 @@ codeRead
mesh().lookupObject<volScalarField>("alpha.gas"); mesh().lookupObject<volScalarField>("alpha.gas");
const volScalarField& alphaLiq = const volScalarField& alphaLiq =
mesh().lookupObject<volScalarField>("alpha.liquid"); mesh().lookupObject<volScalarField>("alpha.liquid");
const rhoThermo& thermoGas = const rhoFluidThermo& thermoGas =
mesh().lookupObject<rhoThermo>("physicalProperties.gas"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.gas");
const rhoThermo& thermoLiq = const rhoFluidThermo& thermoLiq =
mesh().lookupObject<rhoThermo>("physicalProperties.liquid"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.liquid");
*mass0Gas = alphaGas*thermoGas.rho(); *mass0Gas = alphaGas*thermoGas.rho();
*mass0Liq = alphaLiq*thermoLiq.rho(); *mass0Liq = alphaLiq*thermoLiq.rho();
@ -124,10 +124,10 @@ codeExecute
mesh().lookupObject<volScalarField>("alpha.gas"); mesh().lookupObject<volScalarField>("alpha.gas");
const volScalarField& alphaLiq = const volScalarField& alphaLiq =
mesh().lookupObject<volScalarField>("alpha.liquid"); mesh().lookupObject<volScalarField>("alpha.liquid");
const rhoThermo& thermoGas = const rhoFluidThermo& thermoGas =
mesh().lookupObject<rhoThermo>("physicalProperties.gas"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.gas");
const rhoThermo& thermoLiq = const rhoFluidThermo& thermoLiq =
mesh().lookupObject<rhoThermo>("physicalProperties.liquid"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.liquid");
dMassGas = alphaGas*thermoGas.rho() - mass0Gas; dMassGas = alphaGas*thermoGas.rho() - mass0Gas;
dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq; dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq;

View File

@ -23,11 +23,11 @@ codeOptions
codeInclude codeInclude
#{ #{
#include "rhoThermo.H" #include "rhoFluidThermo.H"
namespace Foam namespace Foam
{ {
tmp<volScalarField> ea(const rhoThermo& thermo) tmp<volScalarField> ea(const rhoFluidThermo& thermo)
{ {
tmp<volScalarField> tEa = thermo.he() + thermo.hc(); tmp<volScalarField> tEa = thermo.he() + thermo.hc();
@ -70,10 +70,10 @@ codeRead
mesh().lookupObject<volScalarField>("alpha.steam"); mesh().lookupObject<volScalarField>("alpha.steam");
const volScalarField& alphaLiq = const volScalarField& alphaLiq =
mesh().lookupObject<volScalarField>("alpha.water"); mesh().lookupObject<volScalarField>("alpha.water");
const rhoThermo& thermoGas = const rhoFluidThermo& thermoGas =
mesh().lookupObject<rhoThermo>("physicalProperties.steam"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.steam");
const rhoThermo& thermoLiq = const rhoFluidThermo& thermoLiq =
mesh().lookupObject<rhoThermo>("physicalProperties.water"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.water");
*mass0Gas = alphaGas*thermoGas.rho(); *mass0Gas = alphaGas*thermoGas.rho();
*mass0Liq = alphaLiq*thermoLiq.rho(); *mass0Liq = alphaLiq*thermoLiq.rho();
@ -124,10 +124,10 @@ codeExecute
mesh().lookupObject<volScalarField>("alpha.steam"); mesh().lookupObject<volScalarField>("alpha.steam");
const volScalarField& alphaLiq = const volScalarField& alphaLiq =
mesh().lookupObject<volScalarField>("alpha.water"); mesh().lookupObject<volScalarField>("alpha.water");
const rhoThermo& thermoGas = const rhoFluidThermo& thermoGas =
mesh().lookupObject<rhoThermo>("physicalProperties.steam"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.steam");
const rhoThermo& thermoLiq = const rhoFluidThermo& thermoLiq =
mesh().lookupObject<rhoThermo>("physicalProperties.water"); mesh().lookupObject<rhoFluidThermo>("physicalProperties.water");
dMassGas = alphaGas*thermoGas.rho() - mass0Gas; dMassGas = alphaGas*thermoGas.rho() - mass0Gas;
dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq; dMassLiq = alphaLiq*thermoLiq.rho() - mass0Liq;