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

@ -94,9 +94,9 @@ if (ign.ignited())
Info<< "min(b) = " << min(b).value() << endl;
if (composition.contains("ft"))
if (thermo.containsSpecie("ft"))
{
volScalarField& ft = composition.Y("ft");
volScalarField& ft = thermo.Y("ft");
Info<< "Combustion progress = "
<< 100*(1.0 - b)().weightedAverage(mesh.V()*ft).value() << "%"

View File

@ -7,8 +7,6 @@ autoPtr<psiuMulticomponentThermo> pThermo
psiuMulticomponentThermo& thermo = pThermo();
thermo.validate(args.executable(), "ha", "ea");
basicCombustionMixture& composition = thermo.composition();
volScalarField rho
(
IOobject
@ -24,7 +22,7 @@ volScalarField rho
volScalarField& p = thermo.p();
volScalarField& b = composition.Y("b");
volScalarField& b = thermo.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
Info<< "\nReading field U\n" << endl;
@ -229,9 +227,9 @@ volScalarField St
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft"))
if (thermo.containsSpecie("ft"))
{
fields.add(composition.Y("ft"));
fields.add(thermo.Y("ft"));
}
fields.add(b);

View File

@ -1,6 +1,6 @@
if (composition.contains("ft"))
if (thermo.containsSpecie("ft"))
{
volScalarField& ft = composition.Y("ft");
volScalarField& ft = thermo.Y("ft");
solve
(

View File

@ -368,10 +368,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
Foam::tmp<Foam::volScalarField>
Foam::laminarFlameSpeedModels::SCOPE::Ma() const
{
if (psiuMulticomponentThermo_.composition().contains("ft"))
if (psiuMulticomponentThermo_.containsSpecie("ft"))
{
const volScalarField& ft =
psiuMulticomponentThermo_.composition().Y("ft");
const volScalarField& ft = psiuMulticomponentThermo_.Y("ft");
return Ma
(
@ -403,10 +402,9 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
Foam::tmp<Foam::volScalarField>
Foam::laminarFlameSpeedModels::SCOPE::operator()() const
{
if (psiuMulticomponentThermo_.composition().contains("ft"))
if (psiuMulticomponentThermo_.containsSpecie("ft"))
{
const volScalarField& ft =
psiuMulticomponentThermo_.composition().Y("ft");
const volScalarField& ft = psiuMulticomponentThermo_.Y("ft");
return Su0pTphi
(

View File

@ -51,9 +51,7 @@ Foam::solvers::XiFluid::XiFluid(fvMesh& mesh)
thermo_(refCast<psiuMulticomponentThermo>(isothermalFluid::thermo_)),
composition(thermo_.composition()),
b_(composition.Y("b")),
b_(thermo_.Y("b")),
unstrainedLaminarFlameSpeed(laminarFlameSpeed::New(thermo_)),
@ -144,9 +142,9 @@ Foam::solvers::XiFluid::XiFluid(fvMesh& mesh)
{
thermo.validate(type(), "ha", "ea");
if (composition.contains("ft"))
if (thermo_.containsSpecie("ft"))
{
fields.add(composition.Y("ft"));
fields.add(thermo_.Y("ft"));
}
fields.add(b);

View File

@ -106,11 +106,7 @@ protected:
// Composition
//- Reference to the combustion mixture
basicCombustionMixture& composition;
//- Reference to the combustion regress variable
// obtained from the combustion mixture
volScalarField& b_;
//- Set of fields used for the multivariate convection scheme

View File

@ -38,7 +38,7 @@ void Foam::solvers::XiFluid::ftSolve
const fv::convectionScheme<scalar>& mvConvection
)
{
volScalarField& ft = composition.Y("ft");
volScalarField& ft = thermo_.Y("ft");
fvScalarMatrix ftEqn
(
@ -569,7 +569,7 @@ void Foam::solvers::XiFluid::thermophysicalPredictor()
)
);
if (composition.contains("ft"))
if (thermo_.containsSpecie("ft"))
{
ftSolve(mvConvection());
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -241,7 +241,7 @@ Foam::wordList Foam::solvers::isothermalFilm::alphaTypes() const
Foam::solvers::isothermalFilm::isothermalFilm
(
fvMesh& mesh,
autoPtr<rhoThermo> thermoPtr
autoPtr<rhoFluidThermo> thermoPtr
)
:
solver(mesh),
@ -411,7 +411,7 @@ Foam::solvers::isothermalFilm::isothermalFilm
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
#include "solver.H"
#include "rhoThermo.H"
#include "rhoFluidThermo.H"
#include "filmCompressibleMomentumTransportModel.H"
#include "uniformDimensionedFields.H"
@ -93,10 +93,10 @@ protected:
// Thermophysical properties
//- Pointer to the fluid thermophysical properties
autoPtr<rhoThermo> thermoPtr_;
autoPtr<rhoFluidThermo> thermoPtr_;
//- Reference to the fluid thermophysical properties
rhoThermo& thermo_;
rhoFluidThermo& thermo_;
//- The thermodynamic pressure field
volScalarField& p;
@ -270,7 +270,7 @@ public:
const volScalarField& alpha;
//- Reference to the fluid thermophysical properties
const rhoThermo& thermo;
const rhoFluidThermo& thermo;
//- Reference to the thermodynamic density field
const volScalarField& rho;
@ -302,7 +302,7 @@ public:
// Constructors
//- Construct from region mesh and thermophysical properties
isothermalFilm(fvMesh& mesh, autoPtr<rhoThermo>);
isothermalFilm(fvMesh& mesh, autoPtr<rhoFluidThermo>);
//- Construct from region mesh
isothermalFilm(fvMesh& mesh);

View File

@ -51,9 +51,7 @@ Foam::solvers::multicomponentFluid::multicomponentFluid(fvMesh& mesh)
thermo_(refCast<fluidMulticomponentThermo>(isothermalFluid::thermo_)),
composition(thermo_.composition()),
Y_(composition.Y()),
Y_(thermo_.Y()),
reaction(combustionModel::New(thermo_, momentumTransport())),

View File

@ -86,7 +86,6 @@ protected:
// Composition
basicSpecieMixture& composition;
PtrList<volScalarField>& Y_;

View File

@ -106,7 +106,7 @@ void Foam::solvers::multicomponentFluid::setRDeltaT()
forAll(Y, i)
{
if (composition.solve(i))
if (thermo_.solveSpecie(i))
{
volScalarField& Yi = Y_[i];

View File

@ -45,7 +45,7 @@ void Foam::solvers::multicomponentFluid::thermophysicalPredictor()
forAll(Y, i)
{
if (composition.solve(i))
if (thermo_.solveSpecie(i))
{
volScalarField& Yi = Y_[i];
@ -69,7 +69,7 @@ void Foam::solvers::multicomponentFluid::thermophysicalPredictor()
}
}
composition.normalise();
thermo_.normaliseY();
volScalarField& he = thermo_.he();

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

View File

@ -1,5 +1,4 @@
basicChemistryModel& chemistry = pChemistry();
scalar dtChem = min(chemistry.deltaTChem()[0], runTime.deltaT().value());
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
PtrList<volScalarField>& Y = thermo.Y();
volScalarField& p = thermo.p();

View File

@ -28,13 +28,11 @@ namespace Foam
scalarList W(const fluidMulticomponentThermo& thermo)
{
const basicSpecieMixture& composition = thermo.composition();
scalarList W(composition.Y().size());
scalarList W(thermo.Y().size());
forAll(W, i)
{
W[i] = composition.Wi(i);
W[i] = thermo.Wi(i);
}
return W;
@ -49,13 +47,11 @@ scalar h0
const scalar T
)
{
const basicSpecieMixture& composition = thermo.composition();
scalar h0 = 0;
forAll(Y, i)
{
h0 += Y[i]*composition.Hs(i, p, T);
h0 += Y[i]*thermo.hsi(i, p, T);
}
return h0;

View File

@ -19,10 +19,10 @@ type
heRhoThermo
);
typeBase
typeRenamed
(
hePsiThermo psiMulticomponentThermo
heRhoThermo rhoMulticomponentThermo
heRhoThermo rhoFluidMulticomponentThermo
);
energy

View File

@ -23,13 +23,9 @@ License
\*---------------------------------------------------------------------------*/
#include "forThermo.H"
#include "makeMulticomponentThermo.H"
// Specie
#include "${specie}.H"
#include "thermo.H"
// EoS
#include "${equationOfState}.H"
@ -41,12 +37,15 @@ License
#include "${transport}Transport.H"
// psi/rho
#include "${typeBase}.H"
#include "${type}.H"
// Mixture
#include "${mixture}.H"
#include "thermo.H"
#include "typedefThermo.H"
#include "makeThermo.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
@ -75,19 +74,37 @@ extern "C"
namespace Foam
{
forThermo
typedefThermo
(
${transport}Transport,
${energy},
${thermo}Thermo,
${equationOfState},
${specie},
makeMulticomponentThermo,
${typeBase},
${specie}
);
defineThermo
(
${type},
${mixture}
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
addThermo
(
fluidMulticomponentThermo,
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
addThermo
(
${type},
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
}
// ************************************************************************* //

View File

@ -19,10 +19,10 @@ type
heRhoThermo
);
typeBase
typeRenamed
(
hePsiThermo psiThermo
heRhoThermo rhoThermo
heRhoThermo rhoFluidThermo
);
energy

View File

@ -23,13 +23,9 @@ License
\*---------------------------------------------------------------------------*/
#include "forThermo.H"
#include "makeThermo.H"
// Specie
#include "${specie}.H"
#include "thermo.H"
// EoS
#include "${equationOfState}.H"
@ -41,12 +37,15 @@ License
#include "${transport}Transport.H"
// psi/rho
#include "${typeBase}.H"
#include "${type}.H"
// Mixture
#include "${mixture}.H"
#include "thermo.H"
#include "typedefThermo.H"
#include "makeThermo.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
@ -75,17 +74,36 @@ extern "C"
namespace Foam
{
forThermo
typedefThermo
(
${transport}Transport,
${energy},
${thermo}Thermo,
${equationOfState},
${specie},
makeThermo,
${typeBase},
${specie}
);
defineThermo
(
${type},
${mixture}
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
addThermo
(
fluidThermo,
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
addThermo
(
${type},
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
}

View File

@ -18,7 +18,7 @@ type
hePsiThermo
);
typeBase
typeRenamed
(
hePsiThermo psiThermo
);

View File

@ -18,7 +18,7 @@ type
heheuPsiThermo
);
typeBase
typeRenamed
(
heheuPsiThermo psiuMulticomponentThermo
);

View File

@ -23,13 +23,9 @@ License
\*---------------------------------------------------------------------------*/
#include "forThermo.H"
#include "makeMulticomponentThermo.H"
// Specie
#include "${specie}.H"
#include "thermo.H"
// EoS
#include "${equationOfState}.H"
@ -41,12 +37,15 @@ License
#include "${transport}Transport.H"
// psi/rho
#include "${typeBase}.H"
#include "${type}.H"
// Mixture
#include "${mixture}.H"
#include "thermo.H"
#include "typedefThermo.H"
#include "makeThermo.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
@ -75,15 +74,28 @@ extern "C"
namespace Foam
{
forThermo
typedefThermo
(
${transport}Transport,
${energy},
${thermo}Thermo,
${equationOfState},
${specie},
makePsiuMulticomponentThermo,
${mixture}
${specie}
);
defineThermo
(
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
addThermo
(
${type},
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
}

View File

@ -18,7 +18,7 @@ type
heSolidThermo
);
typeBase
typeRenamed
(
heSolidThermo solidThermo
);

View File

@ -23,13 +23,9 @@ License
\*---------------------------------------------------------------------------*/
#include "forThermo.H"
#include "makeSolidThermo.H"
// Specie
#include "${specie}.H"
#include "thermo.H"
// EoS
#include "${equationOfState}.H"
@ -41,12 +37,15 @@ License
#include "${transport}Transport.H"
// psi/rho
#include "${typeBase}.H"
#include "${type}.H"
// Mixture
#include "${mixture}.H"
#include "thermo.H"
#include "typedefThermo.H"
#include "makeThermo.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
@ -75,17 +74,28 @@ extern "C"
namespace Foam
{
forThermo
typedefThermo
(
${transport}Transport,
${energy},
${thermo}Thermo,
${equationOfState},
${specie},
makeSolidThermo,
${typeBase},
${specie}
);
defineThermo
(
${type},
${mixture}
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
addThermo
(
${type},
${type},
${mixture},
${transport}Transport${energy}${thermo}Thermo${equationOfState}${specie}
);
}

View File

@ -99,13 +99,6 @@ void Foam::compileTemplate::setFilterVariable
}
dynCode.setFilterVariable(name, type);
const word typeBase(name + "Base");
if (context.dict().found(typeBase))
{
const HashTable<word> typeToBaseMap(context.dict().lookup(typeBase));
dynCode.setFilterVariable(typeBase, typeToBaseMap[type]);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,75 +32,66 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::IOerror::IOerror(const string& title)
Foam::IOerrorLocation::IOerrorLocation()
:
error(title),
ioFileName_("unknown"),
ioStartLineNumber_(-1),
ioEndLineNumber_(-1)
{}
Foam::IOerrorLocation::IOerrorLocation
(
const string& ioFileName,
const label ioStartLineNumber,
const label ioEndLineNumber
)
:
ioFileName_(ioFileName),
ioStartLineNumber_(ioStartLineNumber),
ioEndLineNumber_(ioEndLineNumber)
{}
Foam::IOerrorLocation::IOerrorLocation(const IOstream& ios)
:
ioFileName_(ios.name()),
ioStartLineNumber_(ios.lineNumber()),
ioEndLineNumber_(-1)
{}
Foam::IOerrorLocation::IOerrorLocation(const dictionary& dict)
:
ioFileName_(dict.name()),
ioStartLineNumber_(dict.startLineNumber()),
ioEndLineNumber_(dict.endLineNumber())
{}
Foam::IOerror::IOerror(const string& title)
:
error(title),
IOerrorLocation()
{}
Foam::OSstream& Foam::IOerror::operator()
(
const char* functionName,
const char* sourceFileName,
const int sourceFileLineNumber,
const string& ioFileName,
const label ioStartLineNumber,
const label ioEndLineNumber
const IOerrorLocation& location
)
{
error::operator()(functionName, sourceFileName, sourceFileLineNumber);
ioFileName_ = ioFileName;
ioStartLineNumber_ = ioStartLineNumber;
ioEndLineNumber_ = ioEndLineNumber;
IOerrorLocation::operator=(location);
return operator OSstream&();
}
Foam::OSstream& Foam::IOerror::operator()
(
const char* functionName,
const char* sourceFileName,
const int sourceFileLineNumber,
const IOstream& ioStream
)
{
return operator()
(
functionName,
sourceFileName,
sourceFileLineNumber,
ioStream.name(),
ioStream.lineNumber(),
-1
);
}
Foam::OSstream& Foam::IOerror::operator()
(
const char* functionName,
const char* sourceFileName,
const int sourceFileLineNumber,
const dictionary& dict
)
{
return operator()
(
functionName,
sourceFileName,
sourceFileLineNumber,
dict.name(),
dict.startLineNumber(),
dict.endLineNumber()
);
}
void Foam::IOerror::SafeFatalIOError
(
const char* functionName,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -181,21 +181,76 @@ Ostream& operator<<(Ostream&, const IOerror&);
/*---------------------------------------------------------------------------*\
Class IOerror Declaration
Class IOerrorLocation Declaration
\*---------------------------------------------------------------------------*/
//- Report an I/O error
class IOerror
:
public error
class IOerrorLocation
{
// Private Data
//- File name
string ioFileName_;
//- Start line number
label ioStartLineNumber_;
//- End Line number
label ioEndLineNumber_;
public:
// Constructors
//- Construct null
IOerrorLocation();
//- Construct from components
IOerrorLocation
(
const string& ioFileName,
const label ioStartLineNumber = -1,
const label ioEndLineNumber = -1
);
//- Construct from a stream
IOerrorLocation(const IOstream&);
//- Construct from a dictionary
IOerrorLocation(const dictionary&);
// Member Functions
//- Access the file name
inline const string& ioFileName() const
{
return ioFileName_;
}
//- Access the start line number
inline label ioStartLineNumber() const
{
return ioStartLineNumber_;
}
//- Access the end line number
inline label ioEndLineNumber() const
{
return ioEndLineNumber_;
}
};
/*---------------------------------------------------------------------------*\
Class IOerror Declaration
\*---------------------------------------------------------------------------*/
class IOerror
:
public error,
public IOerrorLocation
{
public:
// Constructors
@ -206,21 +261,6 @@ public:
// Member Functions
const string& ioFileName() const
{
return ioFileName_;
}
label ioStartLineNumber() const
{
return ioStartLineNumber_;
}
label ioEndLineNumber() const
{
return ioEndLineNumber_;
}
//- Convert to OSstream
// Prints basic message and returns OSstream for further info.
OSstream& operator()
@ -228,29 +268,7 @@ public:
const char* functionName,
const char* sourceFileName,
const int sourceFileLineNumber,
const string& ioFileName,
const label ioStartLineNumber = -1,
const label ioEndLineNumber = -1
);
//- Convert to OSstream
// Prints basic message and returns OSstream for further info.
OSstream& operator()
(
const char* functionName,
const char* sourceFileName,
const int sourceFileLineNumber,
const IOstream&
);
//- Convert to OSstream
// Prints basic message and returns OSstream for further info.
OSstream& operator()
(
const char* functionName,
const char* sourceFileName,
const int sourceFileLineNumber,
const dictionary&
const IOerrorLocation& location
);
//- Print basic message and exit. Uses cerr if streams not constructed

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -550,8 +550,7 @@ Foam::fileOperations::uncollatedFileOperation::readStream
"uncollatedFileOperation::readStream()",
__FILE__,
__LINE__,
fName,
0
IOerrorLocation(fName, 0)
) << "cannot open file"
<< exit(FatalIOError);
}

View File

@ -41,8 +41,7 @@ namespace Foam
template<class BasicThermophysicalTransportModel>
void Fickian<BasicThermophysicalTransportModel>::updateDm() const
{
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
@ -83,7 +82,7 @@ void Fickian<BasicThermophysicalTransportModel>::updateDm() const
(
"Wj",
Wm.dimensions(),
composition.Wi(j)
this->thermo().Wi(j)
)
*(
i < j
@ -100,7 +99,12 @@ void Fickian<BasicThermophysicalTransportModel>::updateDm() const
(
1/Wm
- Y[i]
/dimensionedScalar("Wi", Wm.dimensions(), composition.Wi(i))
/dimensionedScalar
(
"Wi",
Wm.dimensions(),
this->thermo().Wi(i)
)
)/max(sumXbyD, dimensionedScalar(sumXbyD.dimensions(), small))
);
}
@ -142,14 +146,14 @@ Fickian<BasicThermophysicalTransportModel>::Fickian
mixtureDiffusionCoefficients_(true),
DFuncs_(this->thermo().composition().species().size()),
DFuncs_(this->thermo().species().size()),
DmFuncs_(this->thermo().composition().species().size()),
DmFuncs_(this->thermo().species().size()),
DTFuncs_
(
this->coeffDict_.found("DT")
? this->thermo().composition().species().size()
? this->thermo().species().size()
: 0
)
{}
@ -165,8 +169,7 @@ bool Fickian<BasicThermophysicalTransportModel>::read()
BasicThermophysicalTransportModel::read()
)
{
const basicSpecieMixture& composition = this->thermo().composition();
const speciesTable& species = composition.species();
const speciesTable& species = this->thermo().species();
this->coeffDict_.lookup("mixtureDiffusionCoefficients")
>> mixtureDiffusionCoefficients_;
@ -273,13 +276,11 @@ tmp<volScalarField> Fickian<BasicThermophysicalTransportModel>::DEff
const volScalarField& Yi
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
return volScalarField::New
(
"DEff",
this->momentumTransport().rho()
*Dm()[composition.index(Yi)]
*Dm()[this->thermo().specieIndex(Yi)]
);
}
@ -291,11 +292,9 @@ tmp<scalarField> Fickian<BasicThermophysicalTransportModel>::DEff
const label patchi
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
return
this->momentumTransport().rho().boundaryField()[patchi]
*Dm()[composition.index(Yi)].boundaryField()[patchi];
*Dm()[this->thermo().specieIndex(Yi)].boundaryField()[patchi];
}
@ -316,8 +315,9 @@ tmp<surfaceScalarField> Fickian<BasicThermophysicalTransportModel>::q() const
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
if (Y.size())
{
@ -343,12 +343,9 @@ tmp<surfaceScalarField> Fickian<BasicThermophysicalTransportModel>::q() const
forAll(Y, i)
{
if (i != composition.defaultSpecie())
if (i != this->thermo().defaultSpecie())
{
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
@ -358,12 +355,9 @@ tmp<surfaceScalarField> Fickian<BasicThermophysicalTransportModel>::q() const
}
{
const label i = composition.defaultSpecie();
const label i = this->thermo().defaultSpecie();
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
sumJh -= sumJ*fvc::interpolate(hi);
}
@ -390,8 +384,9 @@ tmp<fvScalarMatrix> Fickian<BasicThermophysicalTransportModel>::divq
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
tmpDivq.ref() -=
fvm::laplacianCorrection(this->alpha()*this->alphaEff(), he);
@ -418,12 +413,9 @@ tmp<fvScalarMatrix> Fickian<BasicThermophysicalTransportModel>::divq
forAll(Y, i)
{
if (i != composition.defaultSpecie())
if (i != this->thermo().defaultSpecie())
{
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
@ -433,12 +425,9 @@ tmp<fvScalarMatrix> Fickian<BasicThermophysicalTransportModel>::divq
}
{
const label i = composition.defaultSpecie();
const label i = this->thermo().defaultSpecie();
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
sumJh -= sumJ*fvc::interpolate(hi);
}
@ -457,7 +446,6 @@ tmp<surfaceScalarField> Fickian<BasicThermophysicalTransportModel>::j
{
if (DTFuncs_.size())
{
const basicSpecieMixture& composition = this->thermo().composition();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
@ -467,7 +455,7 @@ tmp<surfaceScalarField> Fickian<BasicThermophysicalTransportModel>::j
(
evaluate
(
DTFuncs_[composition.index(Yi)],
DTFuncs_[this->thermo().specieIndex(Yi)],
dimDynamicViscosity,
p,
T
@ -490,7 +478,6 @@ tmp<fvScalarMatrix> Fickian<BasicThermophysicalTransportModel>::divj
{
if (DTFuncs_.size())
{
const basicSpecieMixture& composition = this->thermo().composition();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
@ -502,7 +489,7 @@ tmp<fvScalarMatrix> Fickian<BasicThermophysicalTransportModel>::divj
(
evaluate
(
DTFuncs_[composition.index(Yi)],
DTFuncs_[this->thermo().specieIndex(Yi)],
dimDynamicViscosity,
p,
T

View File

@ -42,8 +42,7 @@ template<class BasicThermophysicalTransportModel>
void MaxwellStefan<BasicThermophysicalTransportModel>::
transformDiffusionCoefficient() const
{
const basicSpecieMixture& composition = this->thermo().composition();
const label d = composition.defaultSpecie();
const label d = this->thermo().defaultSpecie();
// Calculate the molecular weight of the mixture and the mole fractions
scalar Wm = 0;
@ -110,8 +109,7 @@ template<class BasicThermophysicalTransportModel>
void MaxwellStefan<BasicThermophysicalTransportModel>::
transformDiffusionCoefficientFields() const
{
const basicSpecieMixture& composition = this->thermo().composition();
const label d = composition.defaultSpecie();
const label d = this->thermo().defaultSpecie();
// For each cell or patch face
forAll(*(YPtrs[0]), pi)
@ -166,13 +164,12 @@ void MaxwellStefan<BasicThermophysicalTransportModel>::transform
List<PtrList<volScalarField>>& Dij
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& Y0 = Y[0];
forAll(W, i)
{
// Map composition.Y() internal fields -> YPtrs
// Map this->thermo().Y() internal fields -> YPtrs
YPtrs[i] = &Y[i].primitiveField();
// Map Dii_ internal fields -> DijPtrs
@ -196,7 +193,7 @@ void MaxwellStefan<BasicThermophysicalTransportModel>::transform
{
forAll(W, i)
{
// Map composition.Y() patch fields -> YPtrs
// Map this->thermo().Y() patch fields -> YPtrs
YPtrs[i] = &Y[i].boundaryField()[patchi];
// Map Dii_ patch fields -> DijPtrs
@ -222,10 +219,9 @@ void MaxwellStefan<BasicThermophysicalTransportModel>::transform
template<class BasicThermophysicalTransportModel>
void MaxwellStefan<BasicThermophysicalTransportModel>::updateDii() const
{
const basicSpecieMixture& composition = this->thermo().composition();
const label d = composition.defaultSpecie();
const label d = this->thermo().defaultSpecie();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
const volScalarField& rho = this->momentumTransport().rho();
@ -363,16 +359,16 @@ MaxwellStefan<BasicThermophysicalTransportModel>::MaxwellStefan
UpdateableMeshObject(*this, thermo.mesh()),
DFuncs_(this->thermo().composition().species().size()),
DFuncs_(this->thermo().species().size()),
DTFuncs_
(
this->coeffDict_.found("DT")
? this->thermo().composition().species().size()
? this->thermo().species().size()
: 0
),
W(this->thermo().composition().species().size()),
W(this->thermo().species().size()),
YPtrs(W.size()),
DijPtrs(W.size()),
@ -385,12 +381,10 @@ MaxwellStefan<BasicThermophysicalTransportModel>::MaxwellStefan
invA(A.m()),
D(W.size())
{
const basicSpecieMixture& composition = this->thermo().composition();
// Set the molecular weights of the species
forAll(W, i)
{
W[i] = composition.Wi(i);
W[i] = this->thermo().Wi(i);
}
}
@ -405,8 +399,7 @@ bool MaxwellStefan<BasicThermophysicalTransportModel>::read()
BasicThermophysicalTransportModel::read()
)
{
const basicSpecieMixture& composition = this->thermo().composition();
const speciesTable& species = composition.species();
const speciesTable& species = this->thermo().species();
const dictionary& Ddict = this->coeffDict_.subDict("D");
@ -492,12 +485,10 @@ tmp<volScalarField> MaxwellStefan<BasicThermophysicalTransportModel>::DEff
const volScalarField& Yi
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
return volScalarField::New
(
"DEff",
this->momentumTransport().rho()*Dii()[composition.index(Yi)]
this->momentumTransport().rho()*Dii()[this->thermo().specieIndex(Yi)]
);
}
@ -509,11 +500,9 @@ tmp<scalarField> MaxwellStefan<BasicThermophysicalTransportModel>::DEff
const label patchi
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
return
this->momentumTransport().rho().boundaryField()[patchi]
*Dii()[composition.index(Yi)].boundaryField()[patchi];
*Dii()[this->thermo().specieIndex(Yi)].boundaryField()[patchi];
}
@ -535,10 +524,11 @@ MaxwellStefan<BasicThermophysicalTransportModel>::q() const
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const label d = composition.defaultSpecie();
const label d = this->thermo().defaultSpecie();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
if (Y.size())
{
@ -566,10 +556,7 @@ MaxwellStefan<BasicThermophysicalTransportModel>::q() const
{
if (i != d)
{
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
@ -581,10 +568,7 @@ MaxwellStefan<BasicThermophysicalTransportModel>::q() const
{
const label i = d;
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
sumJh -= sumJ*fvc::interpolate(hi);
}
@ -611,10 +595,11 @@ tmp<fvScalarMatrix> MaxwellStefan<BasicThermophysicalTransportModel>::divq
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const label d = composition.defaultSpecie();
const label d = this->thermo().defaultSpecie();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
const volScalarField& p = this->thermo().p();
const volScalarField& T = this->thermo().T();
tmpDivq.ref() -=
fvm::laplacianCorrection(this->alpha()*this->alphaEff(), he);
@ -643,10 +628,7 @@ tmp<fvScalarMatrix> MaxwellStefan<BasicThermophysicalTransportModel>::divq
{
if (i != d)
{
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
@ -658,10 +640,7 @@ tmp<fvScalarMatrix> MaxwellStefan<BasicThermophysicalTransportModel>::divq
{
const label i = d;
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
);
const volScalarField hi(this->thermo().hsi(i, p, T));
sumJh -= sumJ*fvc::interpolate(hi);
}
@ -678,12 +657,11 @@ tmp<surfaceScalarField> MaxwellStefan<BasicThermophysicalTransportModel>::j
const volScalarField& Yi
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
const label d = composition.defaultSpecie();
const label d = this->thermo().defaultSpecie();
if (composition.index(Yi) == d)
if (this->thermo().specieIndex(Yi) == d)
{
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
tmp<surfaceScalarField> tjd
(
@ -715,7 +693,7 @@ tmp<surfaceScalarField> MaxwellStefan<BasicThermophysicalTransportModel>::j
{
return
BasicThermophysicalTransportModel::j(Yi)
+ jexp()[composition.index(Yi)];
+ jexp()[this->thermo().specieIndex(Yi)];
}
}
@ -726,10 +704,9 @@ tmp<fvScalarMatrix> MaxwellStefan<BasicThermophysicalTransportModel>::divj
volScalarField& Yi
) const
{
const basicSpecieMixture& composition = this->thermo().composition();
return
BasicThermophysicalTransportModel::divj(Yi)
+ fvc::div(jexp()[composition.index(Yi)]*Yi.mesh().magSf());
+ fvc::div(jexp()[this->thermo().specieIndex(Yi)]*Yi.mesh().magSf());
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -102,8 +102,7 @@ nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::q() const
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
if (Y.size())
{
@ -121,7 +120,7 @@ nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::q() const
{
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
this->thermo().hsi(i, this->thermo().p(), this->thermo().T())
);
hGradY += fvc::interpolate(hi)*fvc::snGrad(Y[i]);
@ -158,8 +157,7 @@ nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::divq
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = this->thermo().Y();
tmpDivq.ref() -=
fvm::laplacianCorrection(this->alpha()*this->alphaEff(), he);
@ -178,7 +176,7 @@ nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::divq
{
const volScalarField hi
(
composition.Hs(i, this->thermo().p(), this->thermo().T())
this->thermo().hsi(i, this->thermo().p(), this->thermo().T())
);
hGradY += fvc::interpolate(hi)*fvc::snGrad(Y[i]);

View File

@ -211,7 +211,7 @@ Foam::combustionModels::EDC::R(volScalarField& Y) const
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
fvScalarMatrix& Su = tSu.ref();
const label speciei = this->thermo().composition().species()[Y.member()];
const label speciei = this->thermo().species()[Y.member()];
Su += chemistryPtr_->RR()[speciei];
return kappa_*tSu;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,9 +107,9 @@ void Foam::combustionModels::FSD::calculateSourceNorm()
const label fuelI = this->fuelIndex();
const volScalarField& YFuel = this->thermo().composition().Y()[fuelI];
const volScalarField& YFuel = this->thermo().Y()[fuelI];
const volScalarField& YO2 = this->thermo().composition().Y("O2");
const volScalarField& YO2 = this->thermo().Y("O2");
const dimensionedScalar s = this->s();
@ -298,7 +298,7 @@ void Foam::combustionModels::FSD::calculateSourceNorm()
forAll(productsIndex, j)
{
label specieI = productsIndex[j];
const volScalarField& Yp = this->thermo().composition().Y()[specieI];
const volScalarField& Yp = this->thermo().Y()[specieI];
products += Yp;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,12 +79,11 @@ void Foam::combustionModels::diffusion::correct()
const label fuelI = this->fuelIndex();
const volScalarField& YFuel = this->thermo().composition().Y()[fuelI];
const volScalarField& YFuel = this->thermo().Y()[fuelI];
if (this->thermo().composition().contains(oxidantName_))
if (this->thermo().containsSpecie(oxidantName_))
{
const volScalarField& YO2 =
this->thermo().composition().Y(oxidantName_);
const volScalarField& YO2 = this->thermo().Y(oxidantName_);
this->wFuel_ ==
C_*this->thermo().rho()*this->turbulence().nuEff()

View File

@ -176,9 +176,9 @@ Foam::functionObjects::adjustTimeStepToCombustion::maxDeltaT() const
dimensionedScalar(dimless/dimTime, 0)
)
);
forAll(thermo.composition().Y(), i)
forAll(thermo.Y(), i)
{
if (thermo.composition().solve(i))
if (thermo.solveSpecie(i))
{
rhoDotByRho += mag(combustion.R(i))/2/thermo.rho()();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -82,13 +82,13 @@ void Foam::combustionModels::infinitelyFastChemistry::correct()
const label fuelI = this->fuelIndex();
const volScalarField& YFuel = this->thermo().composition().Y()[fuelI];
const volScalarField& YFuel = this->thermo().Y()[fuelI];
const dimensionedScalar s = this->s();
if (this->thermo().composition().contains("O2"))
if (this->thermo().containsSpecie("O2"))
{
const volScalarField& YO2 = this->thermo().composition().Y("O2");
const volScalarField& YO2 = this->thermo().Y("O2");
this->wFuel_ ==
this->rho()/(this->mesh().time().deltaT()*C_)

View File

@ -140,7 +140,7 @@ Foam::combustionModels::laminar::R(volScalarField& Y) const
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));
fvScalarMatrix& Su = tSu.ref();
const label specieI = this->thermo().composition().species()[Y.member()];
const label specieI = this->thermo().species()[Y.member()];
Su += chemistryPtr_->RR()[specieI];
return tSu;

View File

@ -71,7 +71,7 @@ Foam::combustionModels::noCombustion::R(const label speciei) const
return
volScalarField::Internal::New
(
typedName("R_" + this->thermo().composition().Y()[speciei].name()),
typedName("R_" + this->thermo().Y()[speciei].name()),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, 0)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -87,8 +87,6 @@ Foam::radiationModels::sootModels::mixtureFraction::mixtureFraction
combustionModel::combustionPropertiesName
);
const basicSpecieMixture& mixture = combustion.mixture();
const reaction& singleReaction = combustion.singleReaction();
scalar totalMol = 0;
@ -108,15 +106,15 @@ Foam::radiationModels::sootModels::mixtureFraction::mixtureFraction
const label speciei = singleReaction.rhs()[i].index;
const scalar stoichCoeff = singleReaction.rhs()[i].stoichCoeff;
Xi[i] = mag(stoichCoeff)/totalMol;
Wm += Xi[i]*mixture.Wi(speciei);
Wm += Xi[i]*combustion.thermo().Wi(speciei);
}
scalarList Yprod0(mixture.species().size(), 0.0);
scalarList Yprod0(combustion.thermo().species().size(), 0.0);
forAll(singleReaction.rhs(), i)
{
const label speciei = singleReaction.rhs()[i].index;
Yprod0[speciei] = mixture.Wi(speciei)/Wm*Xi[i];
Yprod0[speciei] = combustion.thermo().Wi(speciei)/Wm*Xi[i];
}
const scalar XSoot = nuSoot_/totalMol;
@ -129,10 +127,11 @@ Foam::radiationModels::sootModels::mixtureFraction::mixtureFraction
if (mappingFieldName_ == "none")
{
const label index = singleReaction.rhs()[0].index;
mappingFieldName_ = mixture.Y(index).name();
mappingFieldName_ = combustion.thermo().Y(index).name();
}
const label mapFieldIndex = mixture.species()[mappingFieldName_];
const label mapFieldIndex =
combustion.thermo().species()[mappingFieldName_];
mapFieldMax_ = Yprod0[mapFieldIndex];
}

View File

@ -32,7 +32,7 @@ License
void Foam::combustionModels::singleStepCombustion::calculateqFuel()
{
const scalar Wu = mixture_.Wi(fuelIndex_);
const scalar Wu = thermo_.Wi(fuelIndex_);
forAll(reaction_.lhs(), i)
{
@ -40,7 +40,7 @@ void Foam::combustionModels::singleStepCombustion::calculateqFuel()
const scalar stoichCoeff = reaction_.lhs()[i].stoichCoeff;
specieStoichCoeffs_[speciei] = -stoichCoeff;
qFuel_.value() +=
mixture_.Hf(speciei)*mixture_.Wi(speciei)*stoichCoeff/Wu;
thermo_.hfi(speciei)*thermo_.Wi(speciei)*stoichCoeff/Wu;
}
forAll(reaction_.rhs(), i)
@ -49,7 +49,7 @@ void Foam::combustionModels::singleStepCombustion::calculateqFuel()
const scalar stoichCoeff = reaction_.rhs()[i].stoichCoeff;
specieStoichCoeffs_[speciei] = stoichCoeff;
qFuel_.value() -=
mixture_.Hf(speciei)*mixture_.Wi(speciei)*stoichCoeff/Wu;
thermo_.hfi(speciei)*thermo_.Wi(speciei)*stoichCoeff/Wu;
specieProd_[speciei] = -1;
}
@ -59,17 +59,17 @@ void Foam::combustionModels::singleStepCombustion::calculateqFuel()
void Foam::combustionModels::singleStepCombustion::massAndAirStoichRatios()
{
const label O2Index = mixture_.species()["O2"];
const scalar Wu = mixture_.Wi(fuelIndex_);
const label O2Index = thermo_.species()["O2"];
const scalar Wu = thermo_.Wi(fuelIndex_);
stoicRatio_ =
(
mixture_.Wi(mixture_.defaultSpecie())
*specieStoichCoeffs_[mixture_.defaultSpecie()]
+ mixture_.Wi(O2Index)*mag(specieStoichCoeffs_[O2Index])
thermo_.Wi(thermo_.defaultSpecie())
*specieStoichCoeffs_[thermo_.defaultSpecie()]
+ thermo_.Wi(O2Index)*mag(specieStoichCoeffs_[O2Index])
)/(Wu*mag(specieStoichCoeffs_[fuelIndex_]));
s_ = mixture_.Wi(O2Index)*mag(specieStoichCoeffs_[O2Index])
s_ = thermo_.Wi(O2Index)*mag(specieStoichCoeffs_[O2Index])
/(Wu*mag(specieStoichCoeffs_[fuelIndex_]));
Info << "stoichiometric air-fuel ratio: " << stoicRatio_.value() << endl;
@ -93,13 +93,13 @@ void Foam::combustionModels::singleStepCombustion::calculateMaxProducts()
{
const label speciei = reaction_.rhs()[i].index;
Xi[i] = mag(specieStoichCoeffs_[speciei])/totalMol;
Wm += Xi[i]*mixture_.Wi(speciei);
Wm += Xi[i]*thermo_.Wi(speciei);
}
forAll(reaction_.rhs(), i)
{
const label speciei = reaction_.rhs()[i].index;
Yprod0_[speciei] = mixture_.Wi(speciei)/Wm*Xi[i];
Yprod0_[speciei] = thermo_.Wi(speciei)/Wm*Xi[i];
}
Info << "Maximum products mass concentrations: " << nl;
@ -107,7 +107,7 @@ void Foam::combustionModels::singleStepCombustion::calculateMaxProducts()
{
if (Yprod0_[i] > 0)
{
Info<< " " << mixture_.species()[i] << ": " << Yprod0_[i] << nl;
Info<< " " << thermo_.species()[i] << ": " << Yprod0_[i] << nl;
}
}
@ -115,8 +115,8 @@ void Foam::combustionModels::singleStepCombustion::calculateMaxProducts()
forAll(specieStoichCoeffs_, i)
{
specieStoichCoeffs_[i] =
specieStoichCoeffs_[i]*mixture_.Wi(i)
/(mixture_.Wi(fuelIndex_)*mag(specieStoichCoeffs_[fuelIndex_]));
specieStoichCoeffs_[i]*thermo_.Wi(i)
/(thermo_.Wi(fuelIndex_)*mag(specieStoichCoeffs_[fuelIndex_]));
}
}
@ -132,15 +132,14 @@ Foam::combustionModels::singleStepCombustion::singleStepCombustion
)
:
combustionModel(modelType, thermo, turb, combustionProperties),
mixture_(dynamic_cast<const basicSpecieMixture&>(this->thermo())),
reaction_(mixture_.species(), this->subDict("reaction")),
reaction_(thermo_.species(), this->subDict("reaction")),
stoicRatio_(dimensionedScalar("stoicRatio", dimless, 0)),
s_(dimensionedScalar("s", dimless, 0)),
qFuel_(dimensionedScalar("qFuel", sqr(dimVelocity), 0)),
specieStoichCoeffs_(mixture_.species().size(), 0.0),
Yprod0_(mixture_.species().size(), 0.0),
specieStoichCoeffs_(thermo_.species().size(), 0.0),
Yprod0_(thermo_.species().size(), 0.0),
fres_(Yprod0_.size()),
fuelIndex_(mixture_.species()[thermo.properties().lookup("fuel")]),
fuelIndex_(thermo_.species()[thermo.properties().lookup("fuel")]),
specieProd_(Yprod0_.size(), 1),
wFuel_
(
@ -161,7 +160,7 @@ Foam::combustionModels::singleStepCombustion::singleStepCombustion
{
IOobject header
(
"fres_" + mixture_.species()[fresI],
"fres_" + thermo_.species()[fresI],
this->mesh().time().name(),
this->mesh()
);
@ -213,7 +212,7 @@ Foam::combustionModels::singleStepCombustion::R(const label speciei) const
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::singleStepCombustion::R(volScalarField& Y) const
{
const label specieI = mixture_.species()[Y.member()];
const label specieI = thermo_.species()[Y.member()];
volScalarField wSpecie
(
@ -240,7 +239,7 @@ Foam::combustionModels::singleStepCombustion::Qdot() const
{
const label fuelI = fuelIndex();
volScalarField& YFuel =
const_cast<volScalarField&>(this->thermo().composition().Y(fuelI));
const_cast<volScalarField&>(this->thermo().Y(fuelI));
return -qFuel()*(R(YFuel) & YFuel);
}
@ -261,9 +260,9 @@ bool Foam::combustionModels::singleStepCombustion::read()
void Foam::combustionModels::singleStepCombustion::fresCorrect()
{
const label O2Index = mixture_.species()["O2"];
const volScalarField& YFuel = mixture_.Y()[fuelIndex_];
const volScalarField& YO2 = mixture_.Y()[O2Index];
const label O2Index = thermo_.species()["O2"];
const volScalarField& YFuel = thermo_.Y()[fuelIndex_];
const volScalarField& YO2 = thermo_.Y()[O2Index];
// reactants
forAll(reaction_.lhs(), i)
@ -283,7 +282,7 @@ void Foam::combustionModels::singleStepCombustion::fresCorrect()
forAll(reaction_.rhs(), i)
{
const label speciei = reaction_.rhs()[i].index;
if (speciei != mixture_.defaultSpecie())
if (speciei != thermo_.defaultSpecie())
{
forAll(fres_[speciei], celli)
{

View File

@ -25,7 +25,7 @@ Class
Foam::combustionModels::singleStepCombustion
Description
Base class for combustion models using basicSpecieMixture.
Base class for single-step combustion models
SourceFiles
singleStepCombustion.C
@ -36,7 +36,6 @@ SourceFiles
#define singleStepCombustion_H
#include "combustionModel.H"
#include "basicSpecieMixture.H"
#include "reaction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,9 +57,6 @@ protected:
// Protected data
//- Reference to the mixture
const basicSpecieMixture& mixture_;
//- The single-step reaction
reaction reaction_;
@ -132,9 +128,6 @@ public:
// Access functions
//- Return the mixture
const basicSpecieMixture& mixture() const;
//- Return the single step reaction
inline const reaction& singleReaction() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,12 +34,6 @@ namespace combustionModels
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::basicSpecieMixture& singleStepCombustion::mixture() const
{
return mixture_;
}
inline const Foam::reaction& singleStepCombustion::singleReaction() const
{
return reaction_;

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "clouds.H"
#include "basicSpecieMixture.H"
#include "multicomponentThermo.H"
#include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H"
@ -167,16 +167,16 @@ Foam::wordList Foam::fv::clouds::addSupFields() const
fieldNames.append(carrierThermo.he().name());
if (isA<basicSpecieMixture>(carrierThermo))
if (isA<multicomponentThermo>(carrierThermo))
{
const basicSpecieMixture& composition =
refCast<const basicSpecieMixture>(carrierThermo);
const multicomponentThermo& carrierMcThermo =
refCast<const multicomponentThermo>(carrierThermo);
const PtrList<volScalarField>& Y = composition.Y();
const PtrList<volScalarField>& Y = carrierMcThermo.Y();
forAll(Y, i)
{
if (composition.solve(i))
if (carrierMcThermo.solveSpecie(i))
{
fieldNames.append(Y[i].name());
}
@ -262,21 +262,21 @@ void Foam::fv::clouds::addSup
{
eqn += cloudsPtr_().Sh(eqn.psi());
}
else if
(
isA<basicSpecieMixture>(carrierThermo)
&& refCast<const basicSpecieMixture>(carrierThermo).contains
(
eqn.psi().name()
)
)
else if (isA<multicomponentThermo>(carrierThermo))
{
eqn += cloudsPtr_().SYi
const multicomponentThermo& carrierMcThermo =
refCast<const multicomponentThermo>(carrierThermo);
if (carrierMcThermo.containsSpecie(eqn.psi().name()))
{
eqn +=
cloudsPtr_().SYi
(
refCast<const basicSpecieMixture>(carrierThermo).index(eqn.psi()),
carrierMcThermo.specieIndex(eqn.psi()),
eqn.psi()
);
}
}
}

View File

@ -435,7 +435,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{
scalar dm = np0*dMassGas[i];
label gid = composition.localToCarrierId(GAS, i);
scalar hs = composition.carrier().Hs(gid, pc, T0);
scalar hs = composition.carrier().hsi(gid, pc, T0);
cloud.rhoTrans(gid)[this->cell()] += dm;
cloud.UTransRef()[this->cell()] += dm*U0;
cloud.hsTransRef()[this->cell()] += dm*hs;
@ -444,7 +444,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{
scalar dm = np0*dMassLiquid[i];
label gid = composition.localToCarrierId(LIQ, i);
scalar hs = composition.carrier().Hs(gid, pc, T0);
scalar hs = composition.carrier().hsi(gid, pc, T0);
cloud.rhoTrans(gid)[this->cell()] += dm;
cloud.UTransRef()[this->cell()] += dm*U0;
cloud.hsTransRef()[this->cell()] += dm*hs;
@ -456,7 +456,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{
scalar dm = np0*dMassSolid[i];
label gid = composition.localToCarrierId(SLD, i);
scalar hs = composition.carrier().Hs(gid, pc, T0);
scalar hs = composition.carrier().hsi(gid, pc, T0);
cloud.rhoTrans(gid)[this->cell()] += dm;
cloud.UTransRef()[this->cell()] += dm*U0;
cloud.hsTransRef()[this->cell()] += dm*hs;
@ -466,7 +466,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
forAll(dMassSRCarrier, i)
{
scalar dm = np0*dMassSRCarrier[i];
scalar hs = composition.carrier().Hs(i, pc, T0);
scalar hs = composition.carrier().hsi(i, pc, T0);
cloud.rhoTrans(i)[this->cell()] += dm;
cloud.UTransRef()[this->cell()] += dm*U0;
cloud.hsTransRef()[this->cell()] += dm*hs;
@ -598,7 +598,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
forAll(dMassDV, i)
{
const label id = composition.localToCarrierId(GAS, i);
const scalar Cp = composition.carrier().Cp(id, td.pc(), Ts);
const scalar Cp = composition.carrier().Cpi(id, td.pc(), Ts);
const scalar W = composition.carrier().Wi(id);
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);

View File

@ -132,7 +132,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
{
const label cid = composition.localToCarrierId(idPhase, i);
const scalar Cp = composition.carrier().Cp(cid, td.pc(), Tsdash);
const scalar Cp = composition.carrier().Cpi(cid, td.pc(), Tsdash);
const scalar W = composition.carrier().Wi(cid);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
@ -254,7 +254,7 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
forAll(cloud.rhoTrans(), i)
{
scalar Y = cloud.rhoTrans(i)[this->cell()]/addedMass;
CpEff += Y*cloud.composition().carrier().Cp(i, td.pc(), td.Tc());
CpEff += Y*cloud.composition().carrier().Cpi(i, td.pc(), td.Tc());
}
const scalar Cpc = td.CpInterp().psi()[this->cell()];
@ -296,14 +296,15 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
return;
}
const basicSpecieMixture& carrier = cloud.composition().carrier();
const fluidMulticomponentThermo& carrierThermo =
cloud.composition().carrier();
// Far field carrier molar fractions
scalarField Xinf(carrier.species().size());
scalarField Xinf(carrierThermo.species().size());
forAll(Xinf, i)
{
Xinf[i] = carrier.Y(i)[this->cell()]/carrier.Wi(i);
Xinf[i] = carrierThermo.Y(i)[this->cell()]/carrierThermo.Wi(i);
}
Xinf /= sum(Xinf);
@ -325,7 +326,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
const scalar Csi = Cs[i] + Xsff*Xinf[i]*CsTot;
Xs[i] = (2.0*Csi + Xinf[i]*CsTot)/3.0;
Ys[i] = Xs[i]*carrier.Wi(i);
Ys[i] = Xs[i]*carrierThermo.Wi(i);
}
Xs /= sum(Xs);
Ys /= sum(Ys);
@ -340,14 +341,14 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
forAll(Ys, i)
{
const scalar W = carrier.Wi(i);
const scalar W = carrierThermo.Wi(i);
const scalar sqrtW = sqrt(W);
const scalar cbrtW = cbrt(W);
rhos += Xs[i]*W;
mus += Ys[i]*sqrtW*carrier.mu(i, td.pc(), T);
kappas += Ys[i]*cbrtW*carrier.kappa(i, td.pc(), T);
Cps += Xs[i]*carrier.Cp(i, td.pc(), T);
mus += Ys[i]*sqrtW*carrierThermo.mui(i, td.pc(), T);
kappas += Ys[i]*cbrtW*carrierThermo.kappai(i, td.pc(), T);
Cps += Xs[i]*carrierThermo.Cpi(i, td.pc(), T);
sumYiSqrtW += Ys[i]*sqrtW;
sumYiCbrtW += Ys[i]*cbrtW;
@ -494,7 +495,7 @@ void Foam::ReactingParcel<ParcelType>::calc
{
scalar dmi = dm*Y_[i];
label gid = composition.localToCarrierId(0, i);
scalar hs = composition.carrier().Hs(gid, td.pc(), T0);
scalar hs = composition.carrier().hsi(gid, td.pc(), T0);
cloud.rhoTrans(gid)[this->cell()] += dmi;
cloud.hsTransRef()[this->cell()] += dmi*hs;
@ -555,7 +556,7 @@ void Foam::ReactingParcel<ParcelType>::calc
{
scalar dm = np0*dMass[i];
label gid = composition.localToCarrierId(0, i);
scalar hs = composition.carrier().Hs(gid, td.pc(), T0);
scalar hs = composition.carrier().hsi(gid, td.pc(), T0);
cloud.rhoTrans(gid)[this->cell()] += dm;
cloud.UTransRef()[this->cell()] += dm*U0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "CompositionModel.H"
#include "fluidMulticomponentThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -32,10 +33,10 @@ Foam::CompositionModel<CloudType>::CompositionModel(CloudType& owner)
:
CloudSubModelBase<CloudType>(owner),
carrierThermo_(owner.carrierThermo()),
carrierMixture_
carrierMcThermoPtr_
(
isA<basicSpecieMixture>(carrierThermo_)
? &refCast<const basicSpecieMixture>(carrierThermo_)
isA<fluidMulticomponentThermo>(carrierThermo_)
? &refCast<const fluidMulticomponentThermo>(carrierThermo_)
: nullptr
),
thermo_(owner.thermo()),
@ -53,19 +54,19 @@ Foam::CompositionModel<CloudType>::CompositionModel
:
CloudSubModelBase<CloudType>(owner, dict, typeName, type),
carrierThermo_(owner.carrierThermo()),
carrierMixture_
carrierMcThermoPtr_
(
isA<basicSpecieMixture>(carrierThermo_)
? &refCast<const basicSpecieMixture>(carrierThermo_)
isA<fluidMulticomponentThermo>(carrierThermo_)
? &refCast<const fluidMulticomponentThermo>(carrierThermo_)
: nullptr
),
thermo_(owner.thermo()),
phaseProps_
(
this->coeffDict().lookup("phases"),
carrierMixture_ == nullptr
carrierMcThermoPtr_ == nullptr
? hashedWordList::null()
: carrierMixture_->species(),
: carrierMcThermoPtr_->species(),
thermo_.liquids().components(),
thermo_.solids().components()
)
@ -80,7 +81,7 @@ Foam::CompositionModel<CloudType>::CompositionModel
:
CloudSubModelBase<CloudType>(cm),
carrierThermo_(cm.carrierThermo_),
carrierMixture_(cm.carrierMixture_),
carrierMcThermoPtr_(cm.carrierMcThermoPtr_),
thermo_(cm.thermo_),
phaseProps_(cm.phaseProps_)
{}
@ -103,17 +104,17 @@ const Foam::parcelThermo& Foam::CompositionModel<CloudType>::thermo() const
template<class CloudType>
const Foam::basicSpecieMixture&
const Foam::fluidMulticomponentThermo&
Foam::CompositionModel<CloudType>::carrier() const
{
if (carrierMixture_ == nullptr)
if (carrierMcThermoPtr_ == nullptr)
{
FatalErrorInFunction
<< "carrier requested, but object is not allocated"
<< abort(FatalError);
}
return *carrierMixture_;
return *carrierMcThermoPtr_;
}
@ -187,9 +188,9 @@ Foam::label Foam::CompositionModel<CloudType>::carrierId
{
label id = -1;
forAll(carrierMixture_->species(), i)
forAll(carrierMcThermoPtr_->species(), i)
{
if (cmptName == carrierMixture_->species()[i])
if (cmptName == carrierMcThermoPtr_->species()[i])
{
id = i;
}
@ -200,7 +201,7 @@ Foam::label Foam::CompositionModel<CloudType>::carrierId
FatalErrorInFunction
<< "Unable to determine global id for requested component "
<< cmptName << ". Available components are " << nl
<< carrierMixture_->species()
<< carrierMcThermoPtr_->species()
<< abort(FatalError);
}
@ -278,7 +279,7 @@ Foam::scalarField Foam::CompositionModel<CloudType>::X
forAll(Y, i)
{
label cid = props.carrierId(i);
X[i] = Y[i]/carrierMixture_->Wi(cid);
X[i] = Y[i]/carrierMcThermoPtr_->Wi(cid);
WInv += X[i];
}
break;
@ -324,7 +325,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::H
forAll(Y, i)
{
label cid = props.carrierId(i);
HMixture += Y[i]*carrierMixture_->Ha(cid, p, T);
HMixture += Y[i]*carrierMcThermoPtr_->hai(cid, p, T);
}
break;
}
@ -373,7 +374,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::Hs
forAll(Y, i)
{
label cid = props.carrierId(i);
HsMixture += Y[i]*carrierMixture_->Hs(cid, p, T);
HsMixture += Y[i]*carrierMcThermoPtr_->hsi(cid, p, T);
}
break;
}
@ -424,7 +425,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::Hc
forAll(Y, i)
{
label cid = props.carrierId(i);
HcMixture += Y[i]*carrierMixture_->Hf(cid);
HcMixture += Y[i]*carrierMcThermoPtr_->hfi(cid);
}
break;
}
@ -474,7 +475,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::Cp
forAll(Y, i)
{
label cid = props.carrierId(i);
CpMixture += Y[i]*carrierMixture_->Cp(cid, p, T);
CpMixture += Y[i]*carrierMcThermoPtr_->Cpi(cid, p, T);
}
break;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,7 +40,7 @@ SourceFiles
#include "CloudSubModelBase.H"
#include "parcelThermo.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
#include "phasePropertiesList.H"
#include "runTimeSelectionTables.H"
@ -60,11 +60,11 @@ class CompositionModel
{
// Private Data
//- Reference to thermophysical properties of the carrier fluid
//- Reference to thermo properties of the carrier fluid
const fluidThermo& carrierThermo_;
//- Pointer to the multi-component carrier composition
const basicSpecieMixture* carrierMixture_;
//- Reference to multicomponent thermo properties of the carrier fluid
const fluidMulticomponentThermo* carrierMcThermoPtr_;
//- Reference to the thermo database
const parcelThermo& thermo_;
@ -135,7 +135,7 @@ public:
// Composition lists
//- Return the carrier components (wrapper function)
const basicSpecieMixture& carrier() const;
const fluidMulticomponentThermo& carrier() const;
//- Return the global (additional) liquids
const liquidMixtureProperties& liquids() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -243,7 +243,7 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
}
case (parent::etEnthalpyDifference):
{
scalar hc = this->owner().composition().carrier().Ha(idc, p, T);
scalar hc = this->owner().composition().carrier().hai(idc, p, T);
scalar hp = liquids_.properties()[idl].Ha(p, T);
dh = hc - hp;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -182,10 +182,10 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
forAll(this->owner().composition().carrier().Y(), i)
{
scalar Yc = this->owner().composition().carrier().Y()[i][p.cell()];
Hc += Yc*this->owner().composition().carrier().Ha(i, pc, Tc);
Hsc += Yc*this->owner().composition().carrier().Ha(i, ps, Ts);
Cpc += Yc*this->owner().composition().carrier().Cp(i, ps, Ts);
kappac += Yc*this->owner().composition().carrier().kappa(i, ps, Ts);
Hc += Yc*this->owner().composition().carrier().hai(i, pc, Tc);
Hsc += Yc*this->owner().composition().carrier().hai(i, ps, Ts);
Cpc += Yc*this->owner().composition().carrier().Cpi(i, ps, Ts);
kappac += Yc*this->owner().composition().carrier().kappai(i, ps, Ts);
}
// calculate mass transfer of each specie in liquid
@ -326,7 +326,8 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
}
case (parent::etEnthalpyDifference):
{
scalar hc = this->owner().composition().carrier().Ha(idc, p, TDash);
scalar hc =
this->owner().composition().carrier().hai(idc, p, TDash);
scalar hp = liquids_.properties()[idl].Ha(p, TDash);
dh = hc - hp;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_);
HcCO2_ = owner.composition().carrier().hfi(CO2GlobalId_);
if (Sb_ < 0)
{
@ -132,10 +132,11 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
}
const parcelThermo& thermo = this->owner().thermo();
const basicSpecieMixture& carrier = this->owner().composition().carrier();
const fluidMulticomponentThermo& carrierThermo =
this->owner().composition().carrier();
// Local mass fraction of O2 in the carrier phase
const scalar YO2 = carrier.Y(O2GlobalId_)[celli];
const scalar YO2 = carrierThermo.Y(O2GlobalId_)[celli];
// Change in C mass [kg]
scalar dmC = 4.0*mathematical::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ Foam::COxidationHurtMitchell<CloudType>::COxidationHurtMitchell
const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_);
HcCO2_ = owner.composition().carrier().hfi(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -131,10 +131,11 @@ Foam::scalar Foam::COxidationHurtMitchell<CloudType>::calculate
}
const parcelThermo& thermo = this->owner().thermo();
const basicSpecieMixture& carrier = this->owner().composition().carrier();
const fluidMulticomponentThermo& carrierThermo =
this->owner().composition().carrier();
// Local mass fraction of O2 in the carrier phase
const scalar YO2 = carrier.Y(O2GlobalId_)[celli];
const scalar YO2 = carrierThermo.Y(O2GlobalId_)[celli];
// No combustion if no oxygen present
if (YO2 < small)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,7 +62,7 @@ Foam::COxidationIntrinsicRate<CloudType>::COxidationIntrinsicRate
const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_);
HcCO2_ = owner.composition().carrier().hfi(CO2GlobalId_);
if (Sb_ < 0)
{
@ -144,10 +144,11 @@ Foam::scalar Foam::COxidationIntrinsicRate<CloudType>::calculate
}
const parcelThermo& thermo = this->owner().thermo();
const basicSpecieMixture& carrier = this->owner().composition().carrier();
const fluidMulticomponentThermo& carrierThermo =
this->owner().composition().carrier();
// Local mass fraction of O2 in the carrier phase []
const scalar YO2 = carrier.Y(O2GlobalId_)[celli];
const scalar YO2 = carrierThermo.Y(O2GlobalId_)[celli];
// Quick exit if oxidant not present
if (YO2 < rootVSmall)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ COxidationKineticDiffusionLimitedRate
const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_);
HcCO2_ = owner.composition().carrier().hfi(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -129,10 +129,11 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
}
const parcelThermo& thermo = this->owner().thermo();
const basicSpecieMixture& carrier = this->owner().composition().carrier();
const fluidMulticomponentThermo& carrierThermo =
this->owner().composition().carrier();
// Local mass fraction of O2 in the carrier phase
const scalar YO2 = carrier.Y(O2GlobalId_)[celli];
const scalar YO2 = carrierThermo.Y(O2GlobalId_)[celli];
// Diffusion rate coefficient
const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,7 +69,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_);
HcCO2_ = owner.composition().carrier().hfi(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -143,10 +143,11 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
}
const parcelThermo& thermo = this->owner().thermo();
const basicSpecieMixture& carrier = this->owner().composition().carrier();
const fluidMulticomponentThermo& carrierThermo =
this->owner().composition().carrier();
// Cell carrier phase O2 species density [kg/m^3]
const scalar rhoO2 = rhoc*carrier.Y(O2GlobalId_)[celli];
const scalar rhoO2 = rhoc*carrierThermo.Y(O2GlobalId_)[celli];
if (rhoO2 < small)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
#include "extrapolatedCalculatedFvPatchFields.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -67,7 +67,7 @@ Foam::radiationModels::absorptionEmissionModels::greyMean::greyMean
thermo_(mesh.lookupObject<fluidThermo>(physicalProperties::typeName)),
Yj_(nSpecies_)
{
if (!isA<basicSpecieMixture>(thermo_))
if (!isA<fluidMulticomponentThermo>(thermo_))
{
FatalErrorInFunction
<< "Model requires a multi-component thermo package"
@ -180,8 +180,8 @@ Foam::radiationModels::absorptionEmissionModels::greyMean::aCont
const label bandI
) const
{
const basicSpecieMixture& mixture =
dynamic_cast<const basicSpecieMixture&>(thermo_);
const fluidMulticomponentThermo& mcThermo =
dynamic_cast<const fluidMulticomponentThermo&>(thermo_);
const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p();
@ -219,13 +219,13 @@ Foam::radiationModels::absorptionEmissionModels::greyMean::aCont
else
{
scalar invWt = 0.0;
forAll(mixture.Y(), s)
forAll(mcThermo.Y(), s)
{
invWt += mixture.Y(s)[celli]/mixture.Wi(s);
invWt += mcThermo.Y(s)[celli]/mcThermo.Wi(s);
}
label index = mixture.species()[iter.key()];
scalar Xk = mixture.Y(index)[celli]/(mixture.Wi(index)*invWt);
label index = mcThermo.species()[iter.key()];
scalar Xk = mcThermo.Y(index)[celli]/(mcThermo.Wi(index)*invWt);
Xipi = Xk*paToAtm(p[celli]);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ License
#include "wideBand.H"
#include "addToRunTimeSelectionTable.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -67,6 +67,13 @@ Foam::radiationModels::absorptionEmissionModels::wideBand::wideBand
Yj_(nSpecies_),
totalWaveLength_(0)
{
if (!isA<fluidMulticomponentThermo>(thermo_))
{
FatalErrorInFunction
<< "Model requires a multi-component thermo package"
<< abort(FatalError);
}
label nBand = 0;
forAllConstIter(dictionary, coeffsDict_, iter)
{
@ -195,8 +202,8 @@ Foam::radiationModels::absorptionEmissionModels::wideBand::aCont
const label bandi
) const
{
const basicSpecieMixture& mixture =
dynamic_cast<const basicSpecieMixture&>(thermo_);
const fluidMulticomponentThermo& mcThermo =
dynamic_cast<const fluidMulticomponentThermo&>(thermo_);
const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p();
@ -232,15 +239,15 @@ Foam::radiationModels::absorptionEmissionModels::wideBand::aCont
else
{
scalar invWt = 0;
forAll(mixture.Y(), s)
forAll(mcThermo.Y(), s)
{
invWt += mixture.Y(s)[celli]/mixture.Wi(s);
invWt += mcThermo.Y(s)[celli]/mcThermo.Wi(s);
}
const label index = mixture.species()[iter.key()];
const label index = mcThermo.species()[iter.key()];
const scalar Xk =
mixture.Y(index)[celli]/(mixture.Wi(index)*invWt);
mcThermo.Y(index)[celli]/(mcThermo.Wi(index)*invWt);
Xipi = Xk*paToAtm(p[celli]);
}

View File

@ -27,7 +27,7 @@ License
#include "volFields.H"
#include "surfaceFields.H"
#include "fluidThermophysicalTransportModel.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -100,8 +100,8 @@ Foam::adsorptionMassFractionFvPatchScalarField::calcPhiYp() const
scalar Wi = NaN;
if (property_ != massFraction)
{
const basicSpecieMixture& mixture = composition(db());
Wi = mixture.Wi(mixture.species()[YName]);
const fluidMulticomponentThermo& thermo = this->thermo(db());
Wi = thermo.Wi(thermo.species()[YName]);
}
// Get the mixture molecular weights, if needed

View File

@ -91,8 +91,6 @@ SourceFiles
namespace Foam
{
class basicSpecieMixture;
/*---------------------------------------------------------------------------*\
Class adsorptionMassFractionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/

View File

@ -28,7 +28,7 @@ License
#include "volFields.H"
#include "surfaceFields.H"
#include "fluidThermophysicalTransportModel.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
#include "mappedPatchBase.H"
#include "addToRunTimeSelectionTable.H"
@ -134,8 +134,8 @@ Foam::semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp() const
scalar Wi = NaN;
if (property_ != massFraction)
{
const basicSpecieMixture& mixture = composition(db());
Wi = mixture.Wi(mixture.species()[YName]);
const fluidMulticomponentThermo& thermo = this->thermo(db());
Wi = thermo.Wi(thermo.species()[YName]);
}
// Get the mixture molecular weights, if needed

View File

@ -92,8 +92,6 @@ SourceFiles
namespace Foam
{
class basicSpecieMixture;
/*---------------------------------------------------------------------------*\
Class semiPermeableBaffleMassFractionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/

View File

@ -57,15 +57,17 @@ const Foam::NamedEnum
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
const Foam::basicSpecieMixture&
Foam::specieTransferMassFractionFvPatchScalarField::composition
const Foam::fluidMulticomponentThermo&
Foam::specieTransferMassFractionFvPatchScalarField::thermo
(
const objectRegistry& db
)
{
const word& name = physicalProperties::typeName;
return db.lookupObject<fluidMulticomponentThermo>(name).composition();
return
db.lookupObject<fluidMulticomponentThermo>
(
physicalProperties::typeName
);
}

View File

@ -50,7 +50,7 @@ SourceFiles
namespace Foam
{
class basicSpecieMixture;
class fluidMulticomponentThermo;
/*---------------------------------------------------------------------------*\
Class specieTransferMassFractionFvPatchScalarField Declaration
@ -107,8 +107,11 @@ public:
// Static member functions
//- Access the composition for the given database
static const basicSpecieMixture& composition(const objectRegistry& db);
//- Get the thermo from the given database
static const fluidMulticomponentThermo& thermo
(
const objectRegistry& db
);
// Constructors

View File

@ -29,7 +29,7 @@ License
#include "volFields.H"
#include "surfaceFields.H"
#include "fluidThermophysicalTransportModel.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -88,12 +88,9 @@ const Foam::tmp<Foam::scalarField>
Foam::specieTransferTemperatureFvPatchScalarField::phiHep() const
{
typedef specieTransferMassFractionFvPatchScalarField YBCType;
const basicSpecieMixture& mixture = YBCType::composition(db());
const PtrList<volScalarField>& Y = mixture.Y();
const fluidMulticomponentThermo& thermo = YBCType::thermo(db());
const PtrList<volScalarField>& Y = thermo.Y();
// Get thermodynamic properties
const fluidThermo& thermo =
db().lookupObject<fluidThermo>(physicalProperties::typeName);
const fvPatchScalarField& Tp = *this;
const fvPatchScalarField& pp = thermo.p().boundaryField()[patch().index()];
@ -112,7 +109,7 @@ Foam::specieTransferTemperatureFvPatchScalarField::phiHep() const
<< exit(FatalError);
}
phiHep += refCast<const YBCType>(Yp).phiYp()*mixture.HE(i, pp, Tp);
phiHep += refCast<const YBCType>(Yp).phiYp()*thermo.hei(i, pp, Tp);
}
return tPhiHep;

View File

@ -28,7 +28,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "basicSpecieMixture.H"
#include "fluidMulticomponentThermo.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -78,7 +78,7 @@ const Foam::tmp<Foam::scalarField>
Foam::specieTransferVelocityFvPatchVectorField::phip() const
{
typedef specieTransferMassFractionFvPatchScalarField YBCType;
const PtrList<volScalarField>& Y = YBCType::composition(db()).Y();
const PtrList<volScalarField>& Y = YBCType::thermo(db()).Y();
// Sum up the phiYp-s from all the species
tmp<scalarField> tPhip(new scalarField(this->size(), 0));

View File

@ -1,4 +1,9 @@
basicThermo/basicThermo.C
basicThermo/BasicThermoName.C
pureThermo/pureThermo.C
rhoThermo/rhoThermo.C
fluidThermo/fluidThermo.C
fluidThermo/hydrostaticInitialisation.C
@ -6,9 +11,11 @@ fluidThermo/hydrostaticInitialisation.C
psiThermo/psiThermo.C
psiThermo/psiThermos.C
rhoThermo/rhoThermo.C
rhoThermo/rhoThermos.C
rhoThermo/liquidThermo.C
rhoFluidThermo/rhoFluidThermo.C
rhoFluidThermo/rhoFluidThermos.C
liquidThermo/liquidThermo.C
liquidThermo/liquidThermos.C
derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C
derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 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 "PhysicalPropertiesThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicThermoType>
Foam::PhysicalPropertiesThermo<BasicThermoType>::PhysicalPropertiesThermo
(
const fvMesh& mesh,
const word& phaseName
)
:
physicalProperties(mesh, phaseName),
BasicThermoType(*this, mesh, phaseName)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasicThermoType>
Foam::PhysicalPropertiesThermo<BasicThermoType>::~PhysicalPropertiesThermo()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasicThermoType>
const Foam::IOdictionary&
Foam::PhysicalPropertiesThermo<BasicThermoType>::properties() const
{
return *this;
}
template<class BasicThermoType>
Foam::IOdictionary&
Foam::PhysicalPropertiesThermo<BasicThermoType>::properties()
{
return *this;
}
template<class BasicThermoType>
bool Foam::PhysicalPropertiesThermo<BasicThermoType>::read()
{
if (physicalProperties::read())
{
BasicThermoType::read(*this);
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 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::PhysicalPropertiesThermo
Description
Wrapper around a thermo which also constructs the physical properties
dictionary
\*---------------------------------------------------------------------------*/
#ifndef PhysicalPropertiesThermo_H
#define PhysicalPropertiesThermo_H
#include "physicalProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class PhysicalPropertiesThermo Declaration
\*---------------------------------------------------------------------------*/
template<class BasicThermoType>
class PhysicalPropertiesThermo
:
public physicalProperties,
public BasicThermoType
{
public:
// Constructors
//- Construct from mesh and phase name
PhysicalPropertiesThermo
(
const fvMesh& mesh,
const word& phaseName = word::null
);
//- Destructor
virtual ~PhysicalPropertiesThermo();
// Member Functions
//- Access the properties dictionary
virtual const IOdictionary& properties() const;
//- Non-const access the properties dictionary
virtual IOdictionary& properties();
//- Read the properties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "PhysicalPropertiesThermo.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,27 +23,20 @@ License
\*---------------------------------------------------------------------------*/
#include "heThermo.H"
#include "BasicThermo.H"
#include "gradientEnergyFvPatchScalarField.H"
#include "mixedEnergyFvPatchScalarField.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicThermo, class MixtureType>
template
<
class CellMixture,
class PatchFaceMixture,
class Method,
class ... Args
>
template<class MixtureType, class BasicThermoType>
template<class Mixture, class Method, class ... Args>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::volScalarFieldProperty
Foam::BasicThermo<MixtureType, BasicThermoType>::volScalarFieldProperty
(
const word& psiName,
const dimensionSet& psiDim,
CellMixture cellMixture,
PatchFaceMixture patchFaceMixture,
Mixture mixture,
Method psiMethod,
const Args& ... args
) const
@ -60,23 +53,26 @@ Foam::heThermo<BasicThermo, MixtureType>::volScalarFieldProperty
volScalarField& psi = tPsi.ref();
forAll(this->T_, celli)
forAll(psi, celli)
{
psi[celli] = ((this->*cellMixture)(celli).*psiMethod)(args[celli] ...);
auto composition = this->cellComposition(celli);
psi[celli] =
((this->*mixture)(composition).*psiMethod)(args[celli] ...);
}
volScalarField::Boundary& psiBf = psi.boundaryFieldRef();
forAll(psiBf, patchi)
{
fvPatchScalarField& pPsi = psiBf[patchi];
forAll(this->T_.boundaryField()[patchi], facei)
forAll(psiBf[patchi], patchFacei)
{
pPsi[facei] =
((this->*patchFaceMixture)(patchi, facei).*psiMethod)
auto composition = this->patchFaceComposition(patchi, patchFacei);
psiBf[patchi][patchFacei] =
((this->*mixture)(composition).*psiMethod)
(
args.boundaryField()[patchi][facei] ...
args.boundaryField()[patchi][patchFacei] ...
);
}
}
@ -85,12 +81,12 @@ Foam::heThermo<BasicThermo, MixtureType>::volScalarFieldProperty
}
template<class BasicThermo, class MixtureType>
template<class CellMixture, class Method, class ... Args>
template<class MixtureType, class BasicThermoType>
template<class Mixture, class Method, class ... Args>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::cellSetProperty
Foam::BasicThermo<MixtureType, BasicThermoType>::cellSetProperty
(
CellMixture cellMixture,
Mixture mixture,
Method psiMethod,
const labelList& cells,
const Args& ... args
@ -104,20 +100,22 @@ Foam::heThermo<BasicThermo, MixtureType>::cellSetProperty
forAll(cells, celli)
{
auto composition = this->cellComposition(cells[celli]);
psi[celli] =
((this->*cellMixture)(cells[celli]).*psiMethod)(args[celli] ...);
((this->*mixture)(composition).*psiMethod)(args[celli] ...);
}
return tPsi;
}
template<class BasicThermo, class MixtureType>
template<class PatchFaceMixture, class Method, class ... Args>
template<class MixtureType, class BasicThermoType>
template<class Mixture, class Method, class ... Args>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::patchFieldProperty
Foam::BasicThermo<MixtureType, BasicThermoType>::patchFieldProperty
(
PatchFaceMixture patchFaceMixture,
Mixture mixture,
Method psiMethod,
const label patchi,
const Args& ... args
@ -129,22 +127,21 @@ Foam::heThermo<BasicThermo, MixtureType>::patchFieldProperty
);
scalarField& psi = tPsi.ref();
forAll(this->T_.boundaryField()[patchi], facei)
forAll(psi, patchFacei)
{
psi[facei] =
((this->*patchFaceMixture)(patchi, facei).*psiMethod)
(
args[facei] ...
);
auto composition = this->patchFaceComposition(patchi, patchFacei);
psi[patchFacei] =
((this->*mixture)(composition).*psiMethod)(args[patchFacei] ...);
}
return tPsi;
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::UIndirectList<Foam::scalar>
Foam::heThermo<BasicThermo, MixtureType>::cellSetScalarList
Foam::BasicThermo<MixtureType, BasicThermoType>::cellSetScalarList
(
const volScalarField& psi,
const labelList& cells
@ -154,9 +151,9 @@ Foam::heThermo<BasicThermo, MixtureType>::cellSetScalarList
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::UniformField<Foam::scalar>
Foam::heThermo<BasicThermo, MixtureType>::cellSetScalarList
Foam::BasicThermo<MixtureType, BasicThermoType>::cellSetScalarList
(
const uniformGeometricScalarField& psi,
const labelList&
@ -166,8 +163,8 @@ Foam::heThermo<BasicThermo, MixtureType>::cellSetScalarList
}
template<class BasicThermo, class MixtureType>
void Foam::heThermo<BasicThermo, MixtureType>::
template<class MixtureType, class BasicThermoType>
void Foam::BasicThermo<MixtureType, BasicThermoType>::
heBoundaryCorrection(volScalarField& h)
{
volScalarField::Boundary& hBf = h.boundaryFieldRef();
@ -190,21 +187,22 @@ heBoundaryCorrection(volScalarField& h)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicThermo, class MixtureType>
Foam::heThermo<BasicThermo, MixtureType>::heThermo
template<class MixtureType, class BasicThermoType>
Foam::BasicThermo<MixtureType, BasicThermoType>::BasicThermo
(
const fvMesh& mesh,
const word& phaseName
)
:
BasicThermo(mesh, phaseName),
MixtureType(*this, mesh, phaseName),
physicalProperties(mesh, phaseName),
MixtureType(properties()),
BasicThermoType(properties(), mixture(), mesh, phaseName),
he_
(
IOobject
(
BasicThermo::phasePropertyName
BasicThermoType::phasePropertyName
(
MixtureType::thermoType::heName(),
phaseName
@ -218,8 +216,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
(
"he",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::HE,
this->p_,
this->T_
@ -232,7 +229,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
(
IOobject
(
BasicThermo::phasePropertyName("Cp", phaseName),
BasicThermoType::phasePropertyName("Cp", phaseName),
mesh.time().name(),
mesh
),
@ -244,7 +241,7 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
(
IOobject
(
BasicThermo::phasePropertyName("Cv", phaseName),
BasicThermoType::phasePropertyName("Cv", phaseName),
mesh.time().name(),
mesh
),
@ -258,16 +255,16 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasicThermo, class MixtureType>
Foam::heThermo<BasicThermo, MixtureType>::~heThermo()
template<class MixtureType, class BasicThermoType>
Foam::BasicThermo<MixtureType, BasicThermoType>::~BasicThermo()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
const Foam::volScalarField&
Foam::heThermo<BasicThermo, MixtureType>::Cpv() const
Foam::BasicThermo<MixtureType, BasicThermoType>::Cpv() const
{
if (MixtureType::thermoType::enthalpy())
{
@ -280,8 +277,9 @@ Foam::heThermo<BasicThermo, MixtureType>::Cpv() const
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::he
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::he
(
const volScalarField& p,
const volScalarField& T
@ -291,8 +289,7 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::he
(
"he",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::HE,
p,
T
@ -300,8 +297,9 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::he
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::he
(
const scalarField& T,
const labelList& cells
@ -309,7 +307,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
{
return cellSetProperty
(
&MixtureType::cellThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::HE,
cells,
cellSetScalarList(this->p_, cells),
@ -318,8 +316,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::he
(
const scalarField& T,
const label patchi
@ -327,7 +326,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::HE,
patchi,
this->p_.boundaryField()[patchi],
@ -336,16 +335,15 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::hs() const
Foam::BasicThermo<MixtureType, BasicThermoType>::hs() const
{
return volScalarFieldProperty
(
"hs",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Hs,
this->p_,
this->T_
@ -353,8 +351,9 @@ Foam::heThermo<BasicThermo, MixtureType>::hs() const
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::hs
(
const volScalarField& p,
const volScalarField& T
@ -364,8 +363,7 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
(
"hs",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Hs,
p,
T
@ -373,8 +371,9 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::hs
(
const scalarField& T,
const labelList& cells
@ -382,7 +381,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
{
return cellSetProperty
(
&MixtureType::cellThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Hs,
cells,
cellSetScalarList(this->p_, cells),
@ -391,8 +390,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::hs
(
const scalarField& T,
const label patchi
@ -400,7 +400,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Hs,
patchi,
this->p_.boundaryField()[patchi],
@ -409,16 +409,15 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::hs
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::ha() const
Foam::BasicThermo<MixtureType, BasicThermoType>::ha() const
{
return volScalarFieldProperty
(
"ha",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Ha,
this->p_,
this->T_
@ -426,8 +425,9 @@ Foam::heThermo<BasicThermo, MixtureType>::ha() const
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::ha
(
const volScalarField& p,
const volScalarField& T
@ -437,8 +437,7 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
(
"ha",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Ha,
p,
T
@ -446,8 +445,9 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::ha
(
const scalarField& T,
const labelList& cells
@ -455,7 +455,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
{
return cellSetProperty
(
&MixtureType::cellThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Ha,
cells,
cellSetScalarList(this->p_, cells),
@ -464,8 +464,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::ha
(
const scalarField& T,
const label patchi
@ -473,7 +474,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Ha,
patchi,
this->p_.boundaryField()[patchi],
@ -482,23 +483,23 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::ha
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::hc() const
Foam::BasicThermo<MixtureType, BasicThermoType>::hc() const
{
return volScalarFieldProperty
(
"hc",
dimEnergy/dimMass,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Hf
);
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::Cp
(
const scalarField& T,
const label patchi
@ -506,7 +507,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Cp,
patchi,
this->p_.boundaryField()[patchi],
@ -515,9 +516,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::Cv
Foam::BasicThermo<MixtureType, BasicThermoType>::Cv
(
const scalarField& T,
const label patchi
@ -525,7 +526,7 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::Cv,
patchi,
this->p_.boundaryField()[patchi],
@ -534,8 +535,9 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::gamma
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::gamma
(
const scalarField& T,
const label patchi
@ -543,7 +545,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::gamma
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::gamma,
patchi,
this->p_.boundaryField()[patchi],
@ -552,16 +554,17 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::gamma
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::gamma() const
Foam::BasicThermo<MixtureType, BasicThermoType>::gamma() const
{
return volScalarField::New("gamma", Cp_/Cv_);
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cpv
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::Cpv
(
const scalarField& T,
const label patchi
@ -578,8 +581,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cpv
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::THE
(
const volScalarField& h,
const volScalarField& p,
@ -590,8 +594,7 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
(
"T",
dimTemperature,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::THE,
h,
p,
@ -600,8 +603,9 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::THE
(
const scalarField& h,
const scalarField& T0,
@ -610,7 +614,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
{
return cellSetProperty
(
&MixtureType::cellThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::THE,
cells,
h,
@ -620,8 +624,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::THE
(
const scalarField& h,
const scalarField& T0,
@ -630,7 +635,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::THE,
patchi,
h,
@ -640,42 +645,43 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
}
template<class BasicThermo, class MixtureType>
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::W() const
Foam::BasicThermo<MixtureType, BasicThermoType>::W() const
{
return volScalarFieldProperty
(
"W",
dimMass/dimMoles,
&MixtureType::cellThermoMixture,
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::W
);
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::W
template<class MixtureType, class BasicThermoType>
Foam::tmp<Foam::scalarField>
Foam::BasicThermo<MixtureType, BasicThermoType>::W
(
const label patchi
) const
{
return patchFieldProperty
(
&MixtureType::patchFaceThermoMixture,
&MixtureType::thermoMixture,
&MixtureType::thermoMixtureType::W,
patchi
);
}
template<class BasicThermo, class MixtureType>
bool Foam::heThermo<BasicThermo, MixtureType>::read()
template<class MixtureType, class BasicThermoType>
bool Foam::BasicThermo<MixtureType, BasicThermoType>::read()
{
if (BasicThermo::read())
if (physicalProperties::read())
{
MixtureType::read(*this);
BasicThermoType::read(*this);
return true;
}
else

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,21 +22,23 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::heThermo
Foam::BasicThermo
Description
Enthalpy/Internal energy for a mixture
Thermo implementation and storage of energy and heat capacities. Provides
overloads of the functions defined in the basic thermo type that depend on
the primitive thermo model.
SourceFiles
heThermo.C
BasicThermo.C
\*---------------------------------------------------------------------------*/
#ifndef heThermo_H
#define heThermo_H
#ifndef BasicThermo_H
#define BasicThermo_H
#include "basicMixture.H"
#include "volFields.H"
#include "physicalProperties.H"
#include "uniformGeometricFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,14 +47,23 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class heThermo Declaration
Class BasicThermoName Declaration
\*---------------------------------------------------------------------------*/
template<class BasicThermo, class MixtureType>
class heThermo
TemplateName(BasicThermo);
/*---------------------------------------------------------------------------*\
Class BasicThermo Declaration
\*---------------------------------------------------------------------------*/
template<class MixtureType, class BasicThermoType>
class BasicThermo
:
public BasicThermo,
public MixtureType
public BasicThermoName,
public physicalProperties,
public MixtureType,
public BasicThermoType
{
protected:
@ -71,38 +82,31 @@ protected:
// Protected Member Functions
//- Return a volScalarField of the given property
template
<
class CellMixture,
class PatchFaceMixture,
class Method,
class ... Args
>
template<class Mixture, class Method, class ... Args>
tmp<volScalarField> volScalarFieldProperty
(
const word& psiName,
const dimensionSet& psiDim,
CellMixture cellMixture,
PatchFaceMixture patchFaceMixture,
Mixture mixture,
Method psiMethod,
const Args& ... args
) const;
//- Return a scalarField of the given property on a cell set
template<class CellMixture, class Method, class ... Args>
template<class Mixture, class Method, class ... Args>
tmp<scalarField> cellSetProperty
(
CellMixture cellMixture,
Mixture mixture,
Method psiMethod,
const labelList& cells,
const Args& ... args
) const;
//- Return a scalarField of the given property on a patch
template<class PatchFaceMixture, class Method, class ... Args>
template<class Mixture, class Method, class ... Args>
tmp<scalarField> patchFieldProperty
(
PatchFaceMixture patchFaceMixture,
Mixture mixture,
Method psiMethod,
const label patchi,
const Args& ... args
@ -128,35 +132,48 @@ protected:
public:
// Typedefs
//- Mixture type
typedef MixtureType mixtureType;
//- Basic thermo
typedef BasicThermoType basicThermoType;
//- Disambiguate debug switch used by derivations
using BasicThermoName::debug;
// Constructors
//- Construct from mesh
heThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh and phase name
BasicThermo(const fvMesh&, const word& phaseName);
//- Disallow default bitwise copy construction
heThermo(const heThermo<BasicThermo, MixtureType>&) = delete;
BasicThermo(const BasicThermo<MixtureType, BasicThermoType>&) = delete;
//- Destructor
virtual ~heThermo();
virtual ~BasicThermo();
// Member Functions
//- Return the composition of the mixture
virtual typename MixtureType::basicMixtureType&
composition()
//- Return the properties dictionary
virtual IOdictionary& properties()
{
return *this;
}
//- Return the composition of the mixture
virtual const typename MixtureType::basicMixtureType&
composition() const
//- Return the properties dictionary
virtual const IOdictionary& properties() const
{
return *this;
}
//- Return the mixture
const MixtureType& mixture() const
{
return *this;
}
@ -361,10 +378,10 @@ public:
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "heThermo.C"
#include "BasicThermo.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 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 "BasicThermo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(BasicThermoName, 0);
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More