compressible::cavitationModels: Use temperature dependent saturation pressure model
The cavitation models used by the compressibleVoF module can now have a
temperature-dependent saturation pressure model specified. For example,
in the constant/fvModels file of a compressibleVoF case:
VoFCavitation
{
type VoFCavitation;
libs ("libcompressibleVoFCavitation.so");
model SchnerrSauer;
liquid water;
// Constant saturation pressure
//pSat 2300;
// Antoine equation for temperature-dependent saturation pressure
pSat
{
type Antoine;
A 22;
B -3000;
C -500;
}
n 1.6e+13;
dNuc 2.0e-06;
Cc 1;
Cv 1;
}
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \
|
||||
@ -11,6 +12,7 @@ EXE_INC = \
|
||||
LIB_LIBS = \
|
||||
-lphysicalProperties \
|
||||
-lfluidThermophysicalModels \
|
||||
-lsaturationModels \
|
||||
-lcompressibleTwoPhaseMixture \
|
||||
-lcompressibleCavitationModels \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -149,7 +149,8 @@ void Foam::fv::compressible::VoFCavitation::addSup
|
||||
const volScalarField::Internal vDot2P(pCoeff*mDot12P[1]);
|
||||
|
||||
eqn +=
|
||||
(vDot2P - vDot1P)*(cavitation_->pSat() - rho*gh)
|
||||
vDot2P*cavitation_->pSat1() - vDot1P*cavitation_->pSat2()
|
||||
- (vDot2P - vDot1P)*rho*gh
|
||||
- fvm::Sp(vDot2P - vDot1P, eqn.psi());
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ Foam::compressible::cavitationModels::Kunz::Kunz
|
||||
Cc_("Cc", dimless, dict),
|
||||
Cv_("Cv", dimless, dict),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0)
|
||||
p0_("0", dimPressure, 0)
|
||||
{
|
||||
correct();
|
||||
}
|
||||
@ -81,11 +81,14 @@ Foam::compressible::cavitationModels::Kunz::mDotcvAlphal() const
|
||||
min(max(alphal(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField::Internal pSatv(this->pSatv());
|
||||
const volScalarField::Internal pSatl(this->pSatl());
|
||||
|
||||
return Pair<tmp<volScalarField::Internal>>
|
||||
(
|
||||
mcCoeff_*sqr(limitedAlphal)
|
||||
*max(p - pSat(), p0_)/max(p - pSat(), 0.01*pSat()),
|
||||
-mvCoeff_*min(p - pSat(), p0_)
|
||||
*max(p - pSatv, p0_)/max(p - pSatv, 0.01*pSatv),
|
||||
-mvCoeff_*min(p - pSatl, p0_)
|
||||
);
|
||||
}
|
||||
|
||||
@ -107,11 +110,14 @@ Foam::compressible::cavitationModels::Kunz::mDotcvP() const
|
||||
min(max(alphal(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField::Internal pSatv(this->pSatv());
|
||||
const volScalarField::Internal pSatl(this->pSatl());
|
||||
|
||||
return Pair<tmp<volScalarField::Internal>>
|
||||
(
|
||||
mcCoeff_*sqr(limitedAlphal)*(1.0 - limitedAlphal)
|
||||
*pos0(p - pSat())/max(p - pSat(), 0.01*pSat()),
|
||||
(-mvCoeff_)*limitedAlphal*neg(p - pSat())
|
||||
mcCoeff_*sqr(limitedAlphal)*(1 - limitedAlphal)
|
||||
*pos0(p - pSatv)/max(p - pSatv, 0.01*pSatv),
|
||||
-mvCoeff_*limitedAlphal*neg(p - pSatl)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,19 +1,17 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lcompressibleTwoPhaseMixture \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lphysicalProperties \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-linterfaceProperties \
|
||||
-lfluidThermophysicalModels \
|
||||
-lsaturationModels \
|
||||
-lcompressibleTwoPhaseMixture \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -56,7 +56,7 @@ Foam::compressible::cavitationModels::Merkle::Merkle
|
||||
Cc_("Cc", dimless, dict),
|
||||
Cv_("Cv", dimless, dict),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0),
|
||||
p0_("0", dimPressure, 0),
|
||||
|
||||
mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_))
|
||||
{
|
||||
@ -79,8 +79,8 @@ Foam::compressible::cavitationModels::Merkle::mDotcvAlphal() const
|
||||
|
||||
return Pair<tmp<volScalarField::Internal>>
|
||||
(
|
||||
mcCoeff_*max(p - pSat(), p0_),
|
||||
-mvCoeff_*min(p - pSat(), p0_)
|
||||
mcCoeff_*max(p - pSatv(), p0_),
|
||||
-mvCoeff_*min(p - pSatl(), p0_)
|
||||
);
|
||||
}
|
||||
|
||||
@ -103,8 +103,8 @@ Foam::compressible::cavitationModels::Merkle::mDotcvP() const
|
||||
|
||||
return Pair<tmp<volScalarField::Internal>>
|
||||
(
|
||||
mcCoeff_*(1.0 - limitedAlphal)*pos0(p - pSat()),
|
||||
(-mvCoeff_)*limitedAlphal*neg(p - pSat())
|
||||
mcCoeff_*(1 - limitedAlphal)*pos0(p - pSatv()),
|
||||
-mvCoeff_*limitedAlphal*neg(p - pSatl())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ Foam::compressible::cavitationModels::SchnerrSauer::SchnerrSauer
|
||||
Cc_("Cc", dimless, dict),
|
||||
Cv_("Cv", dimless, dict),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0)
|
||||
p0_("0", dimPressure, 0.0)
|
||||
{
|
||||
correct();
|
||||
}
|
||||
@ -79,7 +79,7 @@ Foam::compressible::cavitationModels::SchnerrSauer::rRb
|
||||
return pow
|
||||
(
|
||||
((4*constant::mathematical::pi*n_)/3)
|
||||
*limitedAlphal/(1.0 + alphaNuc() - limitedAlphal),
|
||||
*limitedAlphal/(1 + alphaNuc() - limitedAlphal),
|
||||
1.0/3.0
|
||||
);
|
||||
}
|
||||
@ -96,7 +96,8 @@ Foam::compressible::cavitationModels::SchnerrSauer::alphaNuc() const
|
||||
Foam::tmp<Foam::volScalarField::Internal>
|
||||
Foam::compressible::cavitationModels::SchnerrSauer::pCoeff
|
||||
(
|
||||
const volScalarField::Internal& p
|
||||
const volScalarField::Internal& p,
|
||||
const volScalarField::Internal& pSat
|
||||
) const
|
||||
{
|
||||
const volScalarField::Internal limitedAlphal
|
||||
@ -106,13 +107,12 @@ Foam::compressible::cavitationModels::SchnerrSauer::pCoeff
|
||||
|
||||
const volScalarField::Internal rho
|
||||
(
|
||||
limitedAlphal*rhol()
|
||||
+ (scalar(1) - limitedAlphal)*rhov()
|
||||
limitedAlphal*rhol() + (1 - limitedAlphal)*rhov()
|
||||
);
|
||||
|
||||
return
|
||||
(3*rhol()*rhov())*sqrt(2/(3*rhol()))
|
||||
*rRb(limitedAlphal)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));
|
||||
(3*rhol()*rhov())*sqrt((2.0/3.0)/rhol())
|
||||
*rRb(limitedAlphal)/(rho*sqrt(mag(p - pSat) + 0.01*pSat));
|
||||
}
|
||||
|
||||
|
||||
@ -122,17 +122,21 @@ Foam::compressible::cavitationModels::SchnerrSauer::mDotcvAlphal() const
|
||||
const volScalarField::Internal& p =
|
||||
phases_.mesh().lookupObject<volScalarField>("p");
|
||||
|
||||
const volScalarField::Internal pCoeff(this->pCoeff(p));
|
||||
|
||||
const volScalarField::Internal limitedAlphal
|
||||
(
|
||||
min(max(alphal(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField::Internal pSatv(this->pSatv());
|
||||
const volScalarField::Internal pSatl(this->pSatl());
|
||||
|
||||
return Pair<tmp<volScalarField::Internal>>
|
||||
(
|
||||
Cc_*limitedAlphal*pCoeff*max(p - pSat(), p0_),
|
||||
-Cv_*(1.0 + alphaNuc() - limitedAlphal)*pCoeff*min(p - pSat(), p0_)
|
||||
Cc_*limitedAlphal*pCoeff(p, pSatv)*max(p - pSatv, p0_),
|
||||
-Cv_
|
||||
*(1 + alphaNuc() - limitedAlphal)
|
||||
*pCoeff(p, pSatl)
|
||||
*min(p - pSatl, p0_)
|
||||
);
|
||||
}
|
||||
|
||||
@ -143,19 +147,22 @@ Foam::compressible::cavitationModels::SchnerrSauer::mDotcvP() const
|
||||
const volScalarField::Internal& p =
|
||||
phases_.mesh().lookupObject<volScalarField>("p");
|
||||
|
||||
const volScalarField::Internal pCoeff(this->pCoeff(p));
|
||||
|
||||
const volScalarField::Internal limitedAlphal
|
||||
(
|
||||
min(max(alphal(), scalar(0)), scalar(1))
|
||||
);
|
||||
|
||||
const volScalarField::Internal apCoeff(limitedAlphal*pCoeff);
|
||||
const volScalarField::Internal pSatv(this->pSatv());
|
||||
const volScalarField::Internal pSatl(this->pSatl());
|
||||
|
||||
return Pair<tmp<volScalarField::Internal>>
|
||||
(
|
||||
Cc_*(1.0 - limitedAlphal)*pos0(p - pSat())*apCoeff,
|
||||
(-Cv_)*(1.0 + alphaNuc() - limitedAlphal)*neg(p - pSat())*apCoeff
|
||||
Cc_*(1 - limitedAlphal)*pos0(p - pSatv)*limitedAlphal*pCoeff(p, pSatv),
|
||||
-Cv_
|
||||
*(1 + alphaNuc() - limitedAlphal)
|
||||
*neg(p - pSatl)
|
||||
*limitedAlphal
|
||||
*pCoeff(p, pSatl)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,8 @@ class SchnerrSauer
|
||||
//- Part of the condensation and vapourisation rates
|
||||
tmp<volScalarField::Internal> pCoeff
|
||||
(
|
||||
const volScalarField::Internal& p
|
||||
const volScalarField::Internal& p,
|
||||
const volScalarField::Internal& pSat
|
||||
) const;
|
||||
|
||||
|
||||
|
||||
@ -48,13 +48,16 @@ Foam::compressible::cavitationModel::cavitationModel
|
||||
:
|
||||
phases_(phases),
|
||||
liquidIndex_(phases.index(dict.lookup<word>("liquid"))),
|
||||
pSat_("pSat", dimPressure, dict.lookup("pSat"))
|
||||
saturationModel_
|
||||
(
|
||||
saturationPressureModel::New(dict.subDict("saturationPressure"))
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
bool Foam::compressible::cavitationModel::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("pSat") >> pSat_;
|
||||
saturationModel_.reset(saturationPressureModel::New(dict).ptr());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ SourceFiles
|
||||
#include "compressibleTwoPhases.H"
|
||||
#include "fvMatricesFwd.H"
|
||||
#include "Pair.H"
|
||||
#include "saturationPressureModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -62,8 +63,8 @@ protected:
|
||||
//- Index of the liquid
|
||||
const bool liquidIndex_;
|
||||
|
||||
//- Saturation vapour pressure
|
||||
dimensionedScalar pSat_;
|
||||
//- The saturation pressure model
|
||||
autoPtr<saturationPressureModel> saturationModel_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
@ -92,6 +93,30 @@ protected:
|
||||
return phases_.rho(!liquidIndex_);
|
||||
}
|
||||
|
||||
//- Return the liquid thermo
|
||||
inline const rhoThermo& thermol() const
|
||||
{
|
||||
return phases_.thermo(liquidIndex_);
|
||||
}
|
||||
|
||||
//- Return the vapour thermo
|
||||
inline const rhoThermo& thermov() const
|
||||
{
|
||||
return phases_.thermo(!liquidIndex_);
|
||||
}
|
||||
|
||||
//- Return the saturation vapour pressure for the liquid
|
||||
inline tmp<volScalarField::Internal> pSatl() const
|
||||
{
|
||||
return saturationModel_->pSat(thermol().T()());
|
||||
}
|
||||
|
||||
//- Return the saturation vapour pressure for the vapour
|
||||
inline tmp<volScalarField::Internal> pSatv() const
|
||||
{
|
||||
return saturationModel_->pSat(thermov().T()());
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -139,10 +164,16 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the saturation vapour pressure
|
||||
inline const dimensionedScalar& pSat() const
|
||||
//- Return the saturation vapour pressure for phase 1
|
||||
inline tmp<volScalarField::Internal> pSat1() const
|
||||
{
|
||||
return pSat_;
|
||||
return liquidIndex_ ? pSatv() : pSatl();
|
||||
}
|
||||
|
||||
//- Return the saturation vapour pressure for phase 2
|
||||
inline tmp<volScalarField::Internal> pSat2() const
|
||||
{
|
||||
return liquidIndex_ ? pSatl() : pSatv();
|
||||
}
|
||||
|
||||
//- Return the mass condensation and vaporisation rates as a
|
||||
|
||||
@ -3,10 +3,11 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lphysicalProperties \
|
||||
-lincompressibleTwoPhaseMixture \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
Reference in New Issue
Block a user