Reorganised linkage to avoid link errors from foamToC -allLibs

This commit is contained in:
Henry Weller
2023-02-24 22:40:12 +00:00
parent b97d24a372
commit 6cac79b47b
15 changed files with 332 additions and 15 deletions

View File

@ -20,9 +20,6 @@ phaseSystem/phaseSystem.C
phaseSystem/phaseSystemNew.C
phaseSystem/phaseSystemSolve.C
PhaseSystems/HeatTransferPhaseSystem/heatTransferPhaseSystem.C
PhaseSystems/TwoResistanceHeatTransferPhaseSystem/twoResistanceHeatTransferPhaseSystem.C
diameterModels/diameterModel/diameterModel.C
diameterModels/diameterModel/diameterModelNew.C
diameterModels/sphericalDiameter/sphericalDiameter.C
@ -38,7 +35,6 @@ diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/IATEwakeEntrainmentCo
diameterModels/IATE/IATEsources/turbulentBreakUp/IATEturbulentBreakUp.C
diameterModels/IATE/IATEsources/randomCoalescence/IATErandomCoalescence.C
diameterModels/IATE/IATEsources/phaseChange/IATEphaseChange.C
diameterModels/IATE/IATEsources/wallBoiling/IATEwallBoiling.C
sizeGroup = diameterModels/velocityGroup/sizeGroup
$(sizeGroup)/sizeGroup.C
@ -97,7 +93,6 @@ $(driftModels)/phaseChange/phaseChange.C
nucleationModels = populationBalanceModel/nucleationModels
$(nucleationModels)/nucleationModel/nucleationModel.C
$(nucleationModels)/reactionDriven/reactionDriven.C
$(nucleationModels)/wallBoiling/wallBoiling.C
BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C
BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethodNew.C

View File

@ -1,756 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2022 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 "HeatTransferPhaseSystem.H"
#include "fvmSup.H"
#include "rhoMulticomponentThermo.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefs
(
const phaseSystem::dmdtfTable& dmdtfs,
phaseSystem::heatTransferTable& eqns
) const
{
// Loop the pairs
forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter)
{
const phaseInterface interface(*this, dmdtfIter.key());
const volScalarField& dmdtf = *dmdtfIter();
const volScalarField dmdtf21(posPart(dmdtf));
const volScalarField dmdtf12(negPart(dmdtf));
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo();
const volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he();
const volScalarField hs1(thermo1.hs());
const volScalarField hs2(thermo2.hs());
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
// Transfer of sensible enthalpy within the phases
*eqns[phase1.name()] +=
dmdtf*hs1 + fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
*eqns[phase2.name()] -=
dmdtf*hs2 + fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
// Transfer of sensible enthalpy between the phases
*eqns[phase1.name()] += dmdtf21*(hs2 - hs1);
*eqns[phase2.name()] -= dmdtf12*(hs1 - hs2);
// Transfer of kinetic energy
*eqns[phase1.name()] += dmdtf21*K2 + dmdtf12*K1;
*eqns[phase2.name()] -= dmdtf12*K1 + dmdtf21*K2;
}
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
(
const phaseSystem::dmidtfTable& dmidtfs,
phaseSystem::heatTransferTable& eqns
) const
{
static const dimensionedScalar one(dimless, 1);
// Loop the pairs
forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter)
{
const phaseInterface interface(*this, dmidtfIter.key());
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 volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he();
const volScalarField hs1(thermo1.hs());
const volScalarField hs2(thermo2.hs());
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
// Loop the species
forAllConstIter(HashPtrTable<volScalarField>, *dmidtfIter(), dmidtfJter)
{
const word& specie = dmidtfJter.key();
// Mass transfer rates
const volScalarField& dmidtf = *dmidtfJter();
const volScalarField dmidtf21(posPart(dmidtf));
const volScalarField dmidtf12(negPart(dmidtf));
// Specie indices
const label speciei1 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
// Enthalpies
const volScalarField hsi1
(
compositionPtr1
? compositionPtr1->Hs(speciei1, thermo1.p(), thermo1.T())
: tmp<volScalarField>(hs1)
);
const volScalarField hsi2
(
compositionPtr2
? compositionPtr2->Hs(speciei2, thermo2.p(), thermo2.T())
: tmp<volScalarField>(hs2)
);
// Limited mass fractions
tmp<volScalarField> tYi1, tYi2;
if (residualY_ > 0)
{
tYi1 =
compositionPtr1
? max(compositionPtr1->Y(speciei1), residualY_)
: volScalarField::New("Yi1", this->mesh(), one);
tYi2 =
compositionPtr2
? max(compositionPtr2->Y(speciei2), residualY_)
: volScalarField::New("Yi2", this->mesh(), one);
}
// Transfer of sensible enthalpy within the phases
*eqns[phase1.name()] += dmidtf*hsi1;
*eqns[phase2.name()] -= dmidtf*hsi2;
if (residualY_ > 0)
{
*eqns[phase1.name()] +=
fvm::Sp(dmidtf12/tYi1(), he1) - dmidtf12/tYi1()*he1;
*eqns[phase2.name()] -=
fvm::Sp(dmidtf21/tYi2(), he2) - dmidtf21/tYi2()*he2;
}
// Transfer of sensible enthalpy between the phases
*eqns[phase1.name()] += dmidtf21*(hsi2 - hsi1);
*eqns[phase2.name()] -= dmidtf12*(hsi1 - hsi2);
// Transfer of kinetic energy
*eqns[phase1.name()] += dmidtf21*K2 + dmidtf12*K1;
*eqns[phase2.name()] -= dmidtf12*K1 + dmidtf21*K2;
}
}
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefsWithoutL
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const
{
// Loop the pairs
forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter)
{
const phaseInterface interface(*this, dmdtfIter.key());
const volScalarField& dmdtf = *dmdtfIter();
const volScalarField dmdtf21(posPart(dmdtf));
const volScalarField dmdtf12(negPart(dmdtf));
const volScalarField& Tf = *Tfs[dmdtfIter.key()];
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo();
const volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he();
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
// Interface enthalpies
const volScalarField hsf1(thermo1.hs(thermo1.p(), Tf));
const volScalarField hsf2(thermo2.hs(thermo1.p(), Tf));
// Transfer of energy from the interface into the bulk
switch (scheme)
{
case latentHeatScheme::symmetric:
{
*eqns[phase1.name()] += dmdtf*hsf1;
*eqns[phase2.name()] -= dmdtf*hsf2;
break;
}
case latentHeatScheme::upwind:
{
// Bulk enthalpies
const volScalarField hs1(thermo1.hs());
const volScalarField hs2(thermo2.hs());
*eqns[phase1.name()] += dmdtf21*hsf1 + dmdtf12*hs1;
*eqns[phase2.name()] -= dmdtf12*hsf2 + dmdtf21*hs2;
break;
}
}
*eqns[phase1.name()] += fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
*eqns[phase2.name()] -= fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
// Transfer of kinetic energy
*eqns[phase1.name()] += dmdtf21*K2 + dmdtf12*K1;
*eqns[phase2.name()] -= dmdtf12*K1 + dmdtf21*K2;
}
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtL
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const
{
// Loop the pairs
forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter)
{
const phaseInterface interface(*this, dmdtfIter.key());
const volScalarField& dmdtf = *dmdtfIter();
const volScalarField dmdtf21(posPart(dmdtf));
const volScalarField dmdtf12(negPart(dmdtf));
const volScalarField& Tf = *Tfs[dmdtfIter.key()];
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
// Latent heat contribution
const volScalarField L(this->L(interface, dmdtf, Tf, scheme));
*eqns[phase1.name()] += ((1 - weight)*dmdtf12 + weight*dmdtf21)*L;
*eqns[phase2.name()] += ((1 - weight)*dmdtf21 + weight*dmdtf12)*L;
}
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefs
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const
{
addDmdtHefsWithoutL(dmdtfs, Tfs, scheme, eqns);
addDmdtL(dmdtfs, Tfs, weight, scheme, eqns);
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefsWithoutL
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const
{
static const dimensionedScalar one(dimless, 1);
// Loop the pairs
forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter)
{
const phaseInterface interface(*this, dmidtfIter.key());
const volScalarField& Tf = *Tfs[dmidtfIter.key()];
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 volScalarField& he1 = thermo1.he();
const volScalarField& he2 = thermo2.he();
const volScalarField K1(phase1.K());
const volScalarField K2(phase2.K());
// Interface enthalpies
const volScalarField hsf1(thermo1.hs(thermo1.p(), Tf));
const volScalarField hsf2(thermo2.hs(thermo2.p(), Tf));
// Loop the species
forAllConstIter(HashPtrTable<volScalarField>, *dmidtfIter(), dmidtfJter)
{
const word& specie = dmidtfJter.key();
// Mass transfer rates
const volScalarField& dmidtf = *dmidtfJter();
const volScalarField dmidtf21(posPart(dmidtf));
const volScalarField dmidtf12(negPart(dmidtf));
// Specie indices
const label speciei1 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
// Interface enthalpies
const volScalarField hsfi1
(
compositionPtr1
? compositionPtr1->Hs(speciei1, thermo1.p(), Tf)
: tmp<volScalarField>(hsf1)
);
const volScalarField hsfi2
(
compositionPtr2
? compositionPtr2->Hs(speciei2, thermo2.p(), Tf)
: tmp<volScalarField>(hsf2)
);
// Limited mass fractions
tmp<volScalarField> tYi1, tYi2;
if (this->residualY_ > 0)
{
tYi1 =
compositionPtr1
? max(compositionPtr1->Y(speciei1), this->residualY_)
: volScalarField::New("Yi1", this->mesh(), one);
tYi2 =
compositionPtr2
? max(compositionPtr2->Y(speciei2), this->residualY_)
: volScalarField::New("Yi2", this->mesh(), one);
}
// Transfer of energy from the interface into the bulk
switch (scheme)
{
case latentHeatScheme::symmetric:
{
*eqns[phase1.name()] += dmidtf*hsfi1;
*eqns[phase2.name()] -= dmidtf*hsfi2;
break;
}
case latentHeatScheme::upwind:
{
// Bulk enthalpies
const volScalarField hsi1
(
compositionPtr1
? compositionPtr1->Hs(speciei1, thermo1.p(), thermo1.T())
: thermo1.hs()
);
const volScalarField hsi2
(
compositionPtr2
? compositionPtr2->Hs(speciei2, thermo2.p(), thermo2.T())
: thermo2.hs()
);
*eqns[phase1.name()] += dmidtf21*hsfi1 + dmidtf12*hsi1;
*eqns[phase2.name()] -= dmidtf12*hsfi2 + dmidtf21*hsi2;
break;
}
}
if (this->residualY_ > 0)
{
*eqns[phase1.name()] +=
fvm::Sp(dmidtf12/tYi1(), he1) - dmidtf12/tYi1()*he1;
}
if (this->residualY_ > 0)
{
*eqns[phase2.name()] -=
fvm::Sp(dmidtf21/tYi2(), he2) - dmidtf21/tYi2()*he2;
}
// Transfer of kinetic energy
*eqns[phase1.name()] += dmidtf21*K2 + dmidtf12*K1;
*eqns[phase2.name()] -= dmidtf12*K1 + dmidtf21*K2;
}
}
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtL
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const
{
// Loop the pairs
forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter)
{
const phaseInterface interface(*this, dmidtfIter.key());
const volScalarField& Tf = *Tfs[dmidtfIter.key()];
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
// Loop the species
forAllConstIter(HashPtrTable<volScalarField>, *dmidtfIter(), dmidtfJter)
{
const word& specie = dmidtfJter.key();
// Mass transfer rates
const volScalarField& dmidtf = *dmidtfJter();
const volScalarField dmidtf21(posPart(dmidtf));
const volScalarField dmidtf12(negPart(dmidtf));
// Latent heat contribution
const volScalarField Li
(
this->Li(interface, specie, dmidtf, Tf, scheme)
);
*eqns[phase1.name()] +=
((1 - weight)*dmidtf12 + weight*dmidtf21)*Li;
*eqns[phase2.name()] +=
((1 - weight)*dmidtf21 + weight*dmidtf12)*Li;
}
}
}
template<class BasePhaseSystem>
void Foam::HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const
{
addDmidtHefsWithoutL(dmidtfs, Tfs, scheme, eqns);
addDmidtL(dmidtfs, Tfs, weight, scheme, eqns);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::HeatTransferPhaseSystem
(
const fvMesh& mesh
)
:
heatTransferPhaseSystem(),
BasePhaseSystem(mesh),
residualY_(this->template lookupOrDefault<scalar>("residualY", -1))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::~HeatTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::tmp<Foam::volScalarField>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::L
(
const phaseInterface& interface,
const volScalarField& dmdtf,
const volScalarField& Tf,
const latentHeatScheme scheme
) const
{
const rhoThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo();
// Interface enthalpies
const volScalarField haf1(thermo1.ha(thermo1.p(), Tf));
const volScalarField haf2(thermo2.ha(thermo2.p(), Tf));
switch (scheme)
{
case latentHeatScheme::symmetric:
{
return haf2 - haf1;
}
case latentHeatScheme::upwind:
{
// Bulk enthalpies
const volScalarField ha1(thermo1.ha());
const volScalarField ha2(thermo2.ha());
return
neg0(dmdtf)*haf2 + pos(dmdtf)*ha2
- pos0(dmdtf)*haf1 - neg(dmdtf)*ha1;
}
}
return tmp<volScalarField>(nullptr);
}
template<class BasePhaseSystem>
Foam::tmp<Foam::scalarField>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::L
(
const phaseInterface& interface,
const scalarField& dmdtf,
const scalarField& Tf,
const labelUList& cells,
const latentHeatScheme scheme
) const
{
const rhoThermo& thermo1 = interface.phase1().thermo();
const rhoThermo& thermo2 = interface.phase2().thermo();
// Interface enthalpies
const scalarField haf1(thermo1.ha(Tf, cells));
const scalarField haf2(thermo2.ha(Tf, cells));
switch (scheme)
{
case latentHeatScheme::symmetric:
{
return haf2 - haf1;
}
case latentHeatScheme::upwind:
{
const scalarField T1(UIndirectList<scalar>(thermo1.T(), cells));
const scalarField T2(UIndirectList<scalar>(thermo2.T(), cells));
// Bulk enthalpies
const scalarField ha1(thermo1.ha(T1, cells));
const scalarField ha2(thermo2.ha(T2, cells));
return
neg0(dmdtf)*haf2 + pos(dmdtf)*ha2
- pos0(dmdtf)*haf1 - neg(dmdtf)*ha1;
}
}
return tmp<scalarField>(nullptr);
}
template<class BasePhaseSystem>
Foam::tmp<Foam::volScalarField>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
(
const phaseInterface& interface,
const word& specie,
const volScalarField& dmdtf,
const volScalarField& Tf,
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 label speciei1 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
// Interface enthalpies
const volScalarField hafi1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, thermo1.p(), Tf)
: thermo1.ha(thermo1.p(), Tf)
);
const volScalarField hafi2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, thermo2.p(), Tf)
: thermo2.ha(thermo1.p(), Tf)
);
switch (scheme)
{
case latentHeatScheme::symmetric:
{
return hafi2 - hafi1;
}
case latentHeatScheme::upwind:
{
// Bulk enthalpies
const volScalarField hai1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, thermo1.p(), thermo1.T())
: thermo1.ha()
);
const volScalarField hai2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, thermo2.p(), thermo2.T())
: thermo2.ha()
);
return
neg0(dmdtf)*hafi2 + pos(dmdtf)*hai2
- pos0(dmdtf)*hafi1 - neg(dmdtf)*hai1;
}
}
return tmp<volScalarField>(nullptr);
}
template<class BasePhaseSystem>
Foam::tmp<Foam::scalarField>
Foam::HeatTransferPhaseSystem<BasePhaseSystem>::Li
(
const phaseInterface& interface,
const word& specie,
const scalarField& dmdtf,
const scalarField& Tf,
const labelUList& cells,
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 label speciei1 =
compositionPtr1 ? compositionPtr1->species()[specie] : -1;
const label speciei2 =
compositionPtr2 ? compositionPtr2->species()[specie] : -1;
const scalarField p1(UIndirectList<scalar>(thermo1.p(), cells));
const scalarField p2(UIndirectList<scalar>(thermo2.p(), cells));
// Interface enthalpies
const scalarField hafi1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, p1, Tf)
: thermo1.ha(Tf, cells)
);
const scalarField hafi2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, p2, Tf)
: thermo2.ha(Tf, cells)
);
switch (scheme)
{
case latentHeatScheme::symmetric:
{
return hafi2 - hafi1;
}
case latentHeatScheme::upwind:
{
const scalarField T1(UIndirectList<scalar>(thermo1.T(), cells));
const scalarField T2(UIndirectList<scalar>(thermo2.T(), cells));
// Bulk enthalpies
const scalarField hai1
(
compositionPtr1
? compositionPtr1->Ha(speciei1, p1, T1)
: thermo1.ha(T1, cells)
);
const scalarField hai2
(
compositionPtr2
? compositionPtr2->Ha(speciei2, p2, T2)
: thermo2.ha(T2, cells)
);
return
neg0(dmdtf)*hafi2 + pos(dmdtf)*hai2
- pos0(dmdtf)*hafi1 - neg(dmdtf)*hai1;
}
}
return tmp<scalarField>(nullptr);
}
template<class BasePhaseSystem>
bool Foam::HeatTransferPhaseSystem<BasePhaseSystem>::read()
{
if (BasePhaseSystem::read())
{
bool readOK = true;
// Models ...
return readOK;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -1,226 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 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::HeatTransferPhaseSystem
Description
...
SourceFiles
HeatTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/
#ifndef HeatTransferPhaseSystem_H
#define HeatTransferPhaseSystem_H
#include "heatTransferPhaseSystem.H"
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class HeatTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/
template<class BasePhaseSystem>
class HeatTransferPhaseSystem
:
public heatTransferPhaseSystem,
public BasePhaseSystem
{
protected:
// Protected Member Functions
//- Add energy transfer terms which result from bulk mass transfers
void addDmdtHefs
(
const phaseSystem::dmdtfTable& dmdtfs,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from specie mass transfers
void addDmidtHefs
(
const phaseSystem::dmidtfTable& dmidtfs,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from bulk phase changes,
// without the latent heat contribution
void addDmdtHefsWithoutL
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const;
//- Add latent heat terms which result from bulk phase changes.
// Weight is the proportion of the latent heat contribution applied to
// the downwind side of the mass transfer.
void addDmdtL
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from bulk phase changes.
// Weight is the proportion of the latent heat contribution applied to
// the downwind side of the mass transfer.
void addDmdtHefs
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from specie phase changes,
// without the latent heat contribution
void addDmidtHefsWithoutL
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const;
//- Add latent heat terms which result from specie phase changes.
// Weight is the proportion of the latent heat contribution applied to
// the downwind side of the mass transfer.
void addDmidtL
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from specie phase changes
// Weight is the proportion of the latent heat contribution applied to
// the downwind side of the mass transfer.
void addDmidtHefs
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const scalar weight,
const latentHeatScheme scheme,
phaseSystem::heatTransferTable& eqns
) const;
// Protected data
//- Residual mass fraction used for linearisation of heat transfer
// terms that result from mass transfers of individual species
scalar residualY_;
public:
// Constructors
//- Construct from fvMesh
HeatTransferPhaseSystem(const fvMesh&);
//- Destructor
virtual ~HeatTransferPhaseSystem();
// Member Functions
//- Return the latent heat for a given interface, mass transfer rate
// (used only for it's sign), and interface temperature
virtual tmp<volScalarField> L
(
const phaseInterface& interface,
const volScalarField& dmdtf,
const volScalarField& Tf,
const latentHeatScheme scheme
) const;
//- As above, but for a cell-set
virtual tmp<scalarField> L
(
const phaseInterface& interface,
const scalarField& dmdtf,
const scalarField& Tf,
const labelUList& cells,
const latentHeatScheme scheme
) const;
//- Return the latent heat for a given interface, specie, mass transfer
// rate (used only for it's sign), and interface temperature
virtual tmp<volScalarField> Li
(
const phaseInterface& interface,
const word& member,
const volScalarField& dmidtf,
const volScalarField& Tf,
const latentHeatScheme scheme
) const;
//- As above, but for a cell-set
virtual tmp<scalarField> Li
(
const phaseInterface& interface,
const word& member,
const scalarField& dmidtf,
const scalarField& Tf,
const labelUList& cells,
const latentHeatScheme scheme
) const;
//- Read base phaseProperties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "HeatTransferPhaseSystem.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,67 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2022 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 "heatTransferPhaseSystem.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
template<>
const char* NamedEnum
<
Foam::heatTransferPhaseSystem::latentHeatScheme,
2
>::names[] = {"symmetric", "upwind"};
}
const Foam::NamedEnum
<
Foam::heatTransferPhaseSystem::latentHeatScheme,
2
>
Foam::heatTransferPhaseSystem::latentHeatSchemeNames_;
namespace Foam
{
defineTypeNameAndDebug(heatTransferPhaseSystem, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferPhaseSystem::heatTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::heatTransferPhaseSystem::~heatTransferPhaseSystem()
{}
// ************************************************************************* //

View File

@ -1,133 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2022 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::heatTransferPhaseSystem
SourceFiles
heatTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/
#ifndef heatTransferPhaseSystem_H
#define heatTransferPhaseSystem_H
#include "NamedEnum.H"
#include "primitiveFieldsFwd.H"
#include "volFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class phaseInterface;
/*---------------------------------------------------------------------------*\
Class heatTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/
class heatTransferPhaseSystem
{
public:
//- Enumeration for the latent heat scheme
enum class latentHeatScheme
{
symmetric,
upwind
};
//- Names of the latent heat schemes
static const NamedEnum<latentHeatScheme, 2> latentHeatSchemeNames_;
//- Runtime type information
TypeName("heatTransferPhaseSystem");
// Constructors
//- Default constructor
heatTransferPhaseSystem();
//- Destructor
virtual ~heatTransferPhaseSystem();
// Member Functions
//- Return the latent heat for a given interface, mass transfer rate
// (used only for it's sign), and interface temperature
virtual tmp<volScalarField> L
(
const phaseInterface& interface,
const volScalarField& dmdtf,
const volScalarField& Tf,
const latentHeatScheme scheme
) const = 0;
//- As above, but for a cell-set
virtual tmp<scalarField> L
(
const phaseInterface& interface,
const scalarField& dmdtf,
const scalarField& Tf,
const labelUList& cells,
const latentHeatScheme scheme
) const = 0;
//- Return the latent heat for a given interface, specie, mass transfer
// rate (used only for it's sign), and interface temperature
virtual tmp<volScalarField> Li
(
const phaseInterface& interface,
const word& member,
const volScalarField& dmidtf,
const volScalarField& Tf,
const latentHeatScheme scheme
) const = 0;
//- As above, but for a cell-set
virtual tmp<scalarField> Li
(
const phaseInterface& interface,
const word& member,
const scalarField& dmidtf,
const scalarField& Tf,
const labelUList& cells,
const latentHeatScheme scheme
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,331 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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 "TwoResistanceHeatTransferPhaseSystem.H"
#include "heatTransferModel.H"
#include "fvmSup.H"
#include "rhoMulticomponentThermo.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasePhaseSystem>
void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefs
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
const latentHeatTransfer transfer,
phaseSystem::heatTransferTable& eqns
) const
{
HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefsWithoutL
(
dmdtfs,
Tfs,
scheme,
eqns
);
// Loop the pairs
forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter)
{
const phaseInterface interface(*this, dmdtfIter.key());
const volScalarField& dmdtf = *dmdtfIter();
const volScalarField& Tf = *Tfs[interface];
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo();
// Transfer coefficients
const sidedBlendedHeatTransferModel& heatTransferModel =
heatTransferModels_[interface];
const volScalarField H1(heatTransferModel.modelInThe(phase1).K());
const volScalarField H2(heatTransferModel.modelInThe(phase2).K());
const volScalarField H1Fac(H1/(H1 + H2));
const volScalarField HEff(H1Fac*H2);
// Latent heat contribution
switch (transfer)
{
case latentHeatTransfer::heat:
{
*eqns[phase1.name()] +=
- HEff*(thermo2.T() - thermo1.T()) + H1*(Tf - thermo1.T());
*eqns[phase2.name()] +=
- HEff*(thermo1.T() - thermo2.T()) + H2*(Tf - thermo2.T());
break;
}
case latentHeatTransfer::mass:
{
const volScalarField L(this->L(interface, dmdtf, Tf, scheme));
*eqns[phase1.name()] += H1Fac*dmdtf*L;
*eqns[phase2.name()] += (1 - H1Fac)*dmdtf*L;
break;
}
}
}
}
template<class BasePhaseSystem>
void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
const latentHeatTransfer transfer,
phaseSystem::heatTransferTable& eqns
) const
{
HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefsWithoutL
(
dmidtfs,
Tfs,
scheme,
eqns
);
// Loop the pairs
forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter)
{
const phaseInterface interface(*this, dmidtfIter.key());
const volScalarField& Tf = *Tfs[interface];
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
const rhoThermo& thermo1 = phase1.thermo();
const rhoThermo& thermo2 = phase2.thermo();
// Transfer coefficients
const sidedBlendedHeatTransferModel& heatTransferModel =
heatTransferModels_[interface];
const volScalarField H1(heatTransferModel.modelInThe(phase1).K());
const volScalarField H2(heatTransferModel.modelInThe(phase2).K());
const volScalarField H1Fac(H1/(H1 + H2));
const volScalarField HEff(H1Fac*H2);
// Loop the species
forAllConstIter(HashPtrTable<volScalarField>, *dmidtfIter(), dmidtfJter)
{
const word& specie = dmidtfJter.key();
const volScalarField& dmidtf = *dmidtfJter();
// Latent heat contribution
switch (transfer)
{
case latentHeatTransfer::heat:
{
// Do nothing. This term is handled outside the specie loop.
break;
}
case latentHeatTransfer::mass:
{
const volScalarField Li
(
this->Li(interface, specie, dmidtf, Tf, scheme)
);
*eqns[phase1.name()] += H1Fac*dmidtf*Li;
*eqns[phase2.name()] += (1 - H1Fac)*dmidtf*Li;
break;
}
}
}
// Latent heat contribution
switch (transfer)
{
case latentHeatTransfer::heat:
{
*eqns[phase1.name()] +=
- HEff*(thermo2.T() - thermo1.T()) + H1*(Tf - thermo1.T());
*eqns[phase2.name()] +=
- HEff*(thermo1.T() - thermo2.T()) + H2*(Tf - thermo2.T());
break;
}
case latentHeatTransfer::mass:
{
// Do nothing. This term is handled inside the specie loop.
break;
}
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
TwoResistanceHeatTransferPhaseSystem
(
const fvMesh& mesh
)
:
HeatTransferPhaseSystem<BasePhaseSystem>(mesh)
{
this->generateInterfacialModels(heatTransferModels_);
// Check that models have been specified on both sides of the interfaces
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
const phaseInterface& interface = heatTransferModelIter()->interface();
forAllConstIter(phaseInterface, interface, iter)
{
if (!heatTransferModelIter()->haveModelInThe(iter()))
{
FatalErrorInFunction
<< "A heat transfer model for the " << iter().name()
<< " side of the " << interface.name()
<< " interface is not specified"
<< exit(FatalError);
}
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
~TwoResistanceHeatTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::autoPtr<Foam::phaseSystem::heatTransferTable>
Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
heatTransfer() const
{
autoPtr<phaseSystem::heatTransferTable> eqnsPtr
(
new phaseSystem::heatTransferTable()
);
phaseSystem::heatTransferTable& eqns = eqnsPtr();
forAll(this->phaseModels_, phasei)
{
const phaseModel& phase = this->phaseModels_[phasei];
eqns.insert
(
phase.name(),
new fvScalarMatrix(phase.thermo().he(), dimEnergy/dimTime)
);
}
forAllConstIter
(
heatTransferModelTable,
heatTransferModels_,
heatTransferModelIter
)
{
const sidedBlendedHeatTransferModel& model = heatTransferModelIter()();
const phaseModel& phase1 = model.interface().phase1();
const phaseModel& phase2 = model.interface().phase2();
const volScalarField& he1 = phase1.thermo().he();
const volScalarField& he2 = phase2.thermo().he();
const volScalarField Cpv1(phase1.thermo().Cpv());
const volScalarField Cpv2(phase2.thermo().Cpv());
const volScalarField H1(model.modelInThe(phase1).K());
const volScalarField H2(model.modelInThe(phase2).K());
const volScalarField HEff(H1*H2/(H1 + H2));
*eqns[phase1.name()] +=
HEff*(phase2.thermo().T() - phase1.thermo().T())
+ H1/Cpv1*he1 - fvm::Sp(H1/Cpv1, he1);
*eqns[phase2.name()] +=
HEff*(phase1.thermo().T() - phase2.thermo().T())
+ H2/Cpv2*he2 - fvm::Sp(H2/Cpv2, he2);
}
return eqnsPtr;
}
template<class BasePhaseSystem>
void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
predictThermophysicalTransport()
{
BasePhaseSystem::predictThermophysicalTransport();
correctInterfaceThermo();
}
template<class BasePhaseSystem>
void Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::
correctThermophysicalTransport()
{
BasePhaseSystem::correctThermophysicalTransport();
}
template<class BasePhaseSystem>
bool Foam::TwoResistanceHeatTransferPhaseSystem<BasePhaseSystem>::read()
{
if (BasePhaseSystem::read())
{
bool readOK = true;
// Models ...
return readOK;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -1,168 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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::TwoResistanceHeatTransferPhaseSystem
Description
Class which models interfacial heat transfer between a number of phases.
Two heat transfer models are stored at each interface, one for each phase.
This permits definition of an interface temperature with which heat transfer
occurs. It also allows derived systems to define other thermodynamic
properties at the interface and therefore represent phase changes.
See also
OneResistanceHeatTransferPhaseSystem
SourceFiles
TwoResistanceHeatTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/
#ifndef TwoResistanceHeatTransferPhaseSystem_H
#define TwoResistanceHeatTransferPhaseSystem_H
#include "twoResistanceHeatTransferPhaseSystem.H"
#include "HeatTransferPhaseSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class sidedBlendedHeatTransferModel;
/*---------------------------------------------------------------------------*\
Class TwoResistanceHeatTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/
template<class BasePhaseSystem>
class TwoResistanceHeatTransferPhaseSystem
:
public twoResistanceHeatTransferPhaseSystem,
public HeatTransferPhaseSystem<BasePhaseSystem>
{
protected:
// Protected typedefs
typedef HashTable
<
autoPtr<sidedBlendedHeatTransferModel>,
phaseInterfaceKey,
phaseInterfaceKey::hash
> heatTransferModelTable;
typedef
typename HeatTransferPhaseSystem<BasePhaseSystem>::latentHeatScheme
latentHeatScheme;
// Protected data
// Sub Models
//- Heat transfer models
heatTransferModelTable heatTransferModels_;
// Protected Member Functions
//- Add energy transfer terms which result from bulk mass transfers
// and phase changes
using HeatTransferPhaseSystem<BasePhaseSystem>::addDmdtHefs;
//- Add energy transfer terms which result from bulk phase changes
// that are coupled to the two-resistance heat transfer model
void addDmdtHefs
(
const phaseSystem::dmdtfTable& dmdtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
const latentHeatTransfer transfer,
phaseSystem::heatTransferTable& eqns
) const;
//- Add energy transfer terms which result from specie mass transfers
// and phase changes
using HeatTransferPhaseSystem<BasePhaseSystem>::addDmidtHefs;
//- Add energy transfer terms which result from specie phase changes
// that are coupled to the two-resistance heat transfer model
void addDmidtHefs
(
const phaseSystem::dmidtfTable& dmidtfs,
const phaseSystem::dmdtfTable& Tfs,
const latentHeatScheme scheme,
const latentHeatTransfer transfer,
phaseSystem::heatTransferTable& eqns
) const;
public:
// Constructors
//- Construct from fvMesh
TwoResistanceHeatTransferPhaseSystem(const fvMesh&);
//- Destructor
virtual ~TwoResistanceHeatTransferPhaseSystem();
// Member Functions
//- Return the heat transfer matrices
virtual autoPtr<phaseSystem::heatTransferTable> heatTransfer() const;
//- Predict the energy transport e.g. alphat
// and interface properties e.g. Tf
virtual void predictThermophysicalTransport();
//- Correct the energy transport e.g. alphat
virtual void correctThermophysicalTransport();
//- Correct the interface thermodynamics
virtual void correctInterfaceThermo() = 0;
//- Read base phaseProperties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "TwoResistanceHeatTransferPhaseSystem.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2022 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 "twoResistanceHeatTransferPhaseSystem.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
template<>
const char* NamedEnum
<
Foam::twoResistanceHeatTransferPhaseSystem::latentHeatTransfer,
2
>::names[] = {"heat", "mass"};
}
const Foam::NamedEnum
<
Foam::twoResistanceHeatTransferPhaseSystem::latentHeatTransfer,
2
>
Foam::twoResistanceHeatTransferPhaseSystem::latentHeatTransferNames_;
// ************************************************************************* //

View File

@ -1,70 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2022 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::twoResistanceHeatTransferPhaseSystem
SourceFiles
twoResistanceHeatTransferPhaseSystem.C
\*---------------------------------------------------------------------------*/
#ifndef twoResistanceHeatTransferPhaseSystem_H
#define twoResistanceHeatTransferPhaseSystem_H
#include "NamedEnum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class twoResistanceHeatTransferPhaseSystem Declaration
\*---------------------------------------------------------------------------*/
class twoResistanceHeatTransferPhaseSystem
{
public:
//- Enumeration for the form of the latent heat transfer
enum class latentHeatTransfer
{
heat,
mass
};
//- Names of the forms of the latent heat transfer
static const NamedEnum<latentHeatTransfer, 2> latentHeatTransferNames_;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //