Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry Weller
2023-07-27 10:58:46 +01:00
221 changed files with 5317 additions and 4794 deletions

View File

@ -100,12 +100,12 @@ Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::Henry::Yf
return
k_[index]
*otherComposition().Y(speciesName)
*otherMulticomponentThermo().Y(speciesName)
*otherThermo().rho()/thermo().rho();
}
else
{
return YSolvent_*composition().Y(speciesName);
return YSolvent_*thermo().Y(speciesName);
}
}

View File

@ -110,11 +110,11 @@ void Foam::interfaceCompositionModels::Raoult::update(const volScalarField& Tf)
iter()->update(Tf);
YNonVapour_ -=
otherComposition().Y(iter.key())
otherMulticomponentThermo().Y(iter.key())
*iter()->Yf(iter.key(), Tf);
YNonVapourPrime_ -=
otherComposition().Y(iter.key())
otherMulticomponentThermo().Y(iter.key())
*iter()->YfPrime(iter.key(), Tf);
}
}
@ -129,12 +129,12 @@ Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::Raoult::Yf
if (species().found(speciesName))
{
return
otherComposition().Y(speciesName)
otherMulticomponentThermo().Y(speciesName)
*speciesModels_[speciesName]->Yf(speciesName, Tf);
}
else
{
return composition().Y(speciesName)*YNonVapour_;
return thermo().Y(speciesName)*YNonVapour_;
}
}
@ -149,12 +149,12 @@ Foam::interfaceCompositionModels::Raoult::YfPrime
if (species().found(speciesName))
{
return
otherComposition().Y(speciesName)
otherMulticomponentThermo().Y(speciesName)
*speciesModels_[speciesName]->YfPrime(speciesName, Tf);
}
else
{
return composition().Y(speciesName)*YNonVapourPrime_;
return thermo().Y(speciesName)*YNonVapourPrime_;
}
}

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())
{}
@ -74,9 +74,9 @@ Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModel::dY
const volScalarField& Tf
) const
{
const label speciei = composition().species()[speciesName];
const label speciei = thermo().species()[speciesName];
return Yf(speciesName, Tf) - composition().Y()[speciei];
return Yf(speciesName, Tf) - thermo().Y()[speciei];
}
@ -95,16 +95,16 @@ Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModel::D
const word& speciesName
) const
{
const label speciei = composition().species()[speciesName];
const label speciei = thermo().species()[speciesName];
const volScalarField& p(thermo_.p());
const volScalarField& T(thermo_.T());
return volScalarField::New
(
IOobject::groupName("D" + speciesName, interface_.name()),
composition().kappa(speciei, p, T)
/composition().Cp(speciei, p, T)
/composition().rho(speciei, p, T)
thermo().kappai(speciei, p, T)
/thermo().Cpi(speciei, p, T)
/thermo().rhoi(speciei, p, T)
/Le_
);
}

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,19 +130,14 @@ public:
inline const hashedWordList& species() const;
//- Return the thermo
inline const rhoMulticomponentThermo& thermo() const;
//- Return the composition
inline const basicSpecieMixture& composition() const;
inline const rhoFluidMulticomponentThermo& thermo() const;
//- Return the other thermo
inline const rhoThermo& otherThermo() const;
inline const rhoFluidThermo& otherThermo() const;
//- Return whether the other side has a multi-specie composition
inline bool otherHasComposition() const;
//- Return the other composition
inline const basicSpecieMixture& otherComposition() const;
//- Return the other multicomponent thermo
inline const rhoFluidMulticomponentThermo&
otherMulticomponentThermo() const;
// Evaluation

View File

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

View File

@ -87,8 +87,8 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid
species1Name_ = species()[0];
species2Name_ = species()[1];
species1Index_ = composition().species()[species1Name_];
species2Index_ = composition().species()[species2Name_];
species1Index_ = thermo().species()[species1Name_];
species2Index_ = thermo().species()[species2Name_];
alpha12_ = dimensionedScalar
(
@ -171,25 +171,25 @@ void Foam::interfaceCompositionModels::nonRandomTwoLiquid::update
const volScalarField X1
(
composition().Y(species1Index_)
thermo().Y(species1Index_)
*W
/dimensionedScalar
(
"W",
dimMass/dimMoles,
composition().Wi(species1Index_)
thermo().Wi(species1Index_)
)
);
const volScalarField X2
(
composition().Y(species2Index_)
thermo().Y(species2Index_)
*W
/dimensionedScalar
(
"W",
dimMass/dimMoles,
composition().Wi(species2Index_)
thermo().Wi(species2Index_)
)
);
@ -233,21 +233,21 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::Yf
if (speciesName == species1Name_)
{
return
otherComposition().Y(speciesName)
otherMulticomponentThermo().Y(speciesName)
*speciesModel1_->Yf(speciesName, Tf)
*gamma1_;
}
else if (speciesName == species2Name_)
{
return
otherComposition().Y(speciesName)
otherMulticomponentThermo().Y(speciesName)
*speciesModel2_->Yf(speciesName, Tf)
*gamma2_;
}
else
{
return
composition().Y(speciesName)
thermo().Y(speciesName)
*(scalar(1) - Yf(species1Name_, Tf) - Yf(species2Name_, Tf));
}
}
@ -263,21 +263,21 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::YfPrime
if (speciesName == species1Name_)
{
return
otherComposition().Y(speciesName)
otherMulticomponentThermo().Y(speciesName)
*speciesModel1_->YfPrime(speciesName, Tf)
*gamma1_;
}
else if (speciesName == species2Name_)
{
return
otherComposition().Y(speciesName)
otherMulticomponentThermo().Y(speciesName)
*speciesModel2_->YfPrime(speciesName, Tf)
*gamma2_;
}
else
{
return
- composition().Y(speciesName)
- thermo().Y(speciesName)
*(YfPrime(species1Name_, Tf) + YfPrime(species2Name_, Tf));
}
}

View File

@ -52,7 +52,7 @@ Foam::interfaceCompositionModels::saturated::wRatioByP() const
(
"W",
dimMass/dimMoles,
composition().Wi(saturatedIndex_)
thermo().Wi(saturatedIndex_)
);
return Wi/thermo().W()/thermo().p();
@ -69,7 +69,7 @@ Foam::interfaceCompositionModels::saturated::saturated
:
interfaceCompositionModel(dict, interface),
saturatedName_(species()[0]),
saturatedIndex_(composition().species()[saturatedName_]),
saturatedIndex_(thermo().species()[saturatedName_]),
saturationModel_(saturationPressureModel::New("pSat", dict))
{
if (species().size() != 1)
@ -108,12 +108,12 @@ Foam::tmp<Foam::volScalarField> Foam::interfaceCompositionModels::saturated::Yf
}
else
{
const label speciesIndex = composition().species()[speciesName];
const label speciesIndex = thermo().species()[speciesName];
return
composition().Y()[speciesIndex]
thermo().Y()[speciesIndex]
*(scalar(1) - wRatioByP()*saturationModel_->pSat(Tf))
/max(scalar(1) - composition().Y()[saturatedIndex_], small);
/max(scalar(1) - thermo().Y()[saturatedIndex_], small);
}
}
@ -131,12 +131,12 @@ Foam::interfaceCompositionModels::saturated::YfPrime
}
else
{
const label speciesIndex = composition().species()[speciesName];
const label speciesIndex = thermo().species()[speciesName];
return
- composition().Y()[speciesIndex]
- thermo().Y()[speciesIndex]
*wRatioByP()*saturationModel_->pSatPrime(Tf)
/max(scalar(1) - composition().Y()[saturatedIndex_], small);
/max(scalar(1) - thermo().Y()[saturatedIndex_], small);
}
}

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 basicSpecieMixture* compositionPtr1 =
isA<rhoMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1).composition()
: static_cast<const basicSpecieMixture*>(nullptr);
const basicSpecieMixture* compositionPtr2 =
isA<rhoMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2).composition()
: static_cast<const basicSpecieMixture*>(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());
@ -118,21 +118,21 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
// Specie indices
const label speciei1 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
mcThermoPtr2 ? mcThermoPtr2->species()[specie] : -1;
// Enthalpies
const volScalarField hsi1
(
compositionPtr1
? compositionPtr1->Hs(speciei1, thermo1.p(), thermo1.T())
mcThermoPtr1
? mcThermoPtr1->hsi(speciei1, thermo1.p(), thermo1.T())
: tmp<volScalarField>(hs1)
);
const volScalarField hsi2
(
compositionPtr2
? compositionPtr2->Hs(speciei2, thermo2.p(), thermo2.T())
mcThermoPtr2
? mcThermoPtr2->hsi(speciei2, thermo2.p(), thermo2.T())
: tmp<volScalarField>(hs2)
);
@ -141,12 +141,12 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
if (residualY_ > 0)
{
tYi1 =
compositionPtr1
? max(compositionPtr1->Y(speciei1), residualY_)
mcThermoPtr1
? max(mcThermoPtr1->Y(speciei1), residualY_)
: volScalarField::New("Yi1", this->mesh(), one);
tYi2 =
compositionPtr2
? max(compositionPtr2->Y(speciei2), residualY_)
mcThermoPtr2
? max(mcThermoPtr2->Y(speciei2), residualY_)
: volScalarField::New("Yi2", this->mesh(), one);
}
@ -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 basicSpecieMixture* compositionPtr1 =
isA<rhoMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1).composition()
: static_cast<const basicSpecieMixture*>(nullptr);
const basicSpecieMixture* compositionPtr2 =
isA<rhoMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2).composition()
: static_cast<const basicSpecieMixture*>(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());
@ -336,21 +336,21 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefsWithoutL
// Specie indices
const label speciei1 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
mcThermoPtr2 ? mcThermoPtr2->species()[specie] : -1;
// Interface enthalpies
const volScalarField hsfi1
(
compositionPtr1
? compositionPtr1->Hs(speciei1, thermo1.p(), Tf)
mcThermoPtr1
? mcThermoPtr1->hsi(speciei1, thermo1.p(), Tf)
: tmp<volScalarField>(hsf1)
);
const volScalarField hsfi2
(
compositionPtr2
? compositionPtr2->Hs(speciei2, thermo2.p(), Tf)
mcThermoPtr2
? mcThermoPtr2->hsi(speciei2, thermo2.p(), Tf)
: tmp<volScalarField>(hsf2)
);
@ -359,12 +359,12 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefsWithoutL
if (this->residualY_ > 0)
{
tYi1 =
compositionPtr1
? max(compositionPtr1->Y(speciei1), this->residualY_)
mcThermoPtr1
? max(mcThermoPtr1->Y(speciei1), this->residualY_)
: volScalarField::New("Yi1", this->mesh(), one);
tYi2 =
compositionPtr2
? max(compositionPtr2->Y(speciei2), this->residualY_)
mcThermoPtr2
? max(mcThermoPtr2->Y(speciei2), this->residualY_)
: volScalarField::New("Yi2", this->mesh(), one);
}
@ -383,14 +383,14 @@ void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefsWithoutL
// Bulk enthalpies
const volScalarField hsi1
(
compositionPtr1
? compositionPtr1->Hs(speciei1, thermo1.p(), thermo1.T())
mcThermoPtr1
? mcThermoPtr1->hsi(speciei1, thermo1.p(), thermo1.T())
: thermo1.hs()
);
const volScalarField hsi2
(
compositionPtr2
? compositionPtr2->Hs(speciei2, thermo2.p(), thermo2.T())
mcThermoPtr2
? mcThermoPtr2->hsi(speciei2, thermo2.p(), thermo2.T())
: thermo2.hs()
);
@ -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,32 +595,32 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
const latentHeatScheme scheme
) const
{
const rhoThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo();
const basicSpecieMixture* compositionPtr1 =
isA<rhoMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1).composition()
: static_cast<const basicSpecieMixture*>(nullptr);
const basicSpecieMixture* compositionPtr2 =
isA<rhoMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2).composition()
: static_cast<const basicSpecieMixture*>(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 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
mcThermoPtr2 ? mcThermoPtr2->species()[specie] : -1;
// Interface enthalpies
const volScalarField hafi1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, thermo1.p(), Tf)
mcThermoPtr1
? mcThermoPtr1->hai(speciei1, thermo1.p(), Tf)
: thermo1.ha(thermo1.p(), Tf)
);
const volScalarField hafi2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, thermo2.p(), Tf)
mcThermoPtr2
? mcThermoPtr2->hai(speciei2, thermo2.p(), Tf)
: thermo2.ha(thermo1.p(), Tf)
);
@ -635,14 +635,14 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
// Bulk enthalpies
const volScalarField hai1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, thermo1.p(), thermo1.T())
mcThermoPtr1
? mcThermoPtr1->hai(speciei1, thermo1.p(), thermo1.T())
: thermo1.ha()
);
const volScalarField hai2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, thermo2.p(), thermo2.T())
mcThermoPtr2
? mcThermoPtr2->hai(speciei2, thermo2.p(), thermo2.T())
: thermo2.ha()
);
@ -668,20 +668,20 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
const latentHeatScheme scheme
) const
{
const rhoThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo();
const basicSpecieMixture* compositionPtr1 =
isA<rhoMulticomponentThermo>(thermo1)
? &refCast<const rhoMulticomponentThermo>(thermo1).composition()
: static_cast<const basicSpecieMixture*>(nullptr);
const basicSpecieMixture* compositionPtr2 =
isA<rhoMulticomponentThermo>(thermo2)
? &refCast<const rhoMulticomponentThermo>(thermo2).composition()
: static_cast<const basicSpecieMixture*>(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 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
mcThermoPtr1 ? mcThermoPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
mcThermoPtr2 ? mcThermoPtr2->species()[specie] : -1;
const scalarField p1(UIndirectList<scalar>(thermo1.p(), cells));
const scalarField p2(UIndirectList<scalar>(thermo2.p(), cells));
@ -689,14 +689,14 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
// Interface enthalpies
const scalarField hafi1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, p1, Tf)
mcThermoPtr1
? mcThermoPtr1->hai(speciei1, p1, Tf)
: thermo1.ha(Tf, cells)
);
const scalarField hafi2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, p2, Tf)
mcThermoPtr2
? mcThermoPtr2->hai(speciei2, p2, Tf)
: thermo2.ha(Tf, cells)
);
@ -714,14 +714,14 @@ Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
// Bulk enthalpies
const scalarField hai1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, p1, T1)
mcThermoPtr1
? mcThermoPtr1->hai(speciei1, p1, T1)
: thermo1.ha(T1, cells)
);
const scalarField hai2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, p2, T2)
mcThermoPtr2
? mcThermoPtr2->hai(speciei2, p2, T2)
: thermo2.ha(T2, cells)
);

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

@ -48,11 +48,11 @@ Foam::MulticomponentPhaseModel<BasePhaseModel>::MulticomponentPhaseModel
:
BasePhaseModel(fluid, phaseName, referencePhase, index)
{
PtrList<volScalarField>& Y = this->thermo_->composition().Y();
PtrList<volScalarField>& Y = this->thermo_->Y();
forAll(Y, i)
{
if (this->thermo_->composition().solve(i))
if (this->thermo_->solveSpecie(i))
{
const label j = YActive_.size();
YActive_.resize(j + 1);
@ -74,7 +74,7 @@ Foam::MulticomponentPhaseModel<BasePhaseModel>::~MulticomponentPhaseModel()
template<class BasePhaseModel>
void Foam::MulticomponentPhaseModel<BasePhaseModel>::correctSpecies()
{
this->thermo_->composition().normalise();
this->thermo_->normaliseY();
BasePhaseModel::correctSpecies();
}
@ -121,7 +121,7 @@ template<class BasePhaseModel>
const Foam::PtrList<Foam::volScalarField>&
Foam::MulticomponentPhaseModel<BasePhaseModel>::Y() const
{
return this->thermo_->composition().Y();
return this->thermo_->Y();
}
@ -129,7 +129,7 @@ template<class BasePhaseModel>
const Foam::volScalarField&
Foam::MulticomponentPhaseModel<BasePhaseModel>::Y(const word& name) const
{
return this->thermo_->composition().Y(name);
return this->thermo_->Y(name);
}
@ -137,7 +137,7 @@ template<class BasePhaseModel>
Foam::PtrList<Foam::volScalarField>&
Foam::MulticomponentPhaseModel<BasePhaseModel>::YRef()
{
return this->thermo_->composition().Y();
return this->thermo_->Y();
}

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
>
>
>
>