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

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

View File

@ -42,7 +42,7 @@ SourceFiles
#include "volFields.H"
#include "dictionary.H"
#include "hashedWordList.H"
#include "rhoMulticomponentThermo.H"
#include "rhoFluidMulticomponentThermo.H"
#include "runTimeSelectionTables.H"
#include "sidedPhaseInterface.H"
#include "SidedInterfacialModel.H"
@ -68,10 +68,10 @@ class interfaceCompositionModel
const dimensionedScalar Le_;
//- 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
const rhoThermo& otherThermo_;
const rhoFluidThermo& otherThermo_;
public:
@ -130,13 +130,13 @@ public:
inline const hashedWordList& species() const;
//- Return the thermo
inline const rhoMulticomponentThermo& thermo() const;
inline const rhoFluidMulticomponentThermo& thermo() const;
//- Return the other thermo
inline const rhoThermo& otherThermo() const;
inline const rhoFluidThermo& otherThermo() const;
//- Return the other multicomponent thermo
inline const rhoMulticomponentThermo&
inline const rhoFluidMulticomponentThermo&
otherMulticomponentThermo() const;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -300,10 +300,10 @@ public:
virtual inline const volScalarField& alpha2() const;
//- Return the thermo for phase 1
virtual inline const rhoThermo& thermo1() const;
virtual inline const rhoFluidThermo& thermo1() const;
//- Return the thermo for phase 2
virtual inline const rhoThermo& thermo2() const;
virtual inline const rhoFluidThermo& thermo2() const;
//- Return the density of phase 1
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();
}
inline const Foam::rhoThermo& Foam::phaseInterface::thermo2() const
inline const Foam::rhoFluidThermo& Foam::phaseInterface::thermo2() const
{
return phase2().thermo();
}

View File

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

View File

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

View File

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

View File

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

View File

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