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:
Will Bainbridge
2022-11-16 07:40:03 +00:00
parent 9567bc0d4b
commit 721bf7b41a
10 changed files with 97 additions and 47 deletions

View File

@ -1,6 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \
@ -11,6 +12,7 @@ EXE_INC = \
LIB_LIBS = \ LIB_LIBS = \
-lphysicalProperties \ -lphysicalProperties \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lsaturationModels \
-lcompressibleTwoPhaseMixture \ -lcompressibleTwoPhaseMixture \
-lcompressibleCavitationModels \ -lcompressibleCavitationModels \
-lfiniteVolume \ -lfiniteVolume \

View File

@ -149,7 +149,8 @@ void Foam::fv::compressible::VoFCavitation::addSup
const volScalarField::Internal vDot2P(pCoeff*mDot12P[1]); const volScalarField::Internal vDot2P(pCoeff*mDot12P[1]);
eqn += eqn +=
(vDot2P - vDot1P)*(cavitation_->pSat() - rho*gh) vDot2P*cavitation_->pSat1() - vDot1P*cavitation_->pSat2()
- (vDot2P - vDot1P)*rho*gh
- fvm::Sp(vDot2P - vDot1P, eqn.psi()); - fvm::Sp(vDot2P - vDot1P, eqn.psi());
} }
} }

View File

@ -56,7 +56,7 @@ Foam::compressible::cavitationModels::Kunz::Kunz
Cc_("Cc", dimless, dict), Cc_("Cc", dimless, dict),
Cv_("Cv", dimless, dict), Cv_("Cv", dimless, dict),
p0_("0", pSat().dimensions(), 0.0) p0_("0", dimPressure, 0)
{ {
correct(); correct();
} }
@ -81,11 +81,14 @@ Foam::compressible::cavitationModels::Kunz::mDotcvAlphal() const
min(max(alphal(), scalar(0)), scalar(1)) min(max(alphal(), scalar(0)), scalar(1))
); );
const volScalarField::Internal pSatv(this->pSatv());
const volScalarField::Internal pSatl(this->pSatl());
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
( (
mcCoeff_*sqr(limitedAlphal) mcCoeff_*sqr(limitedAlphal)
*max(p - pSat(), p0_)/max(p - pSat(), 0.01*pSat()), *max(p - pSatv, p0_)/max(p - pSatv, 0.01*pSatv),
-mvCoeff_*min(p - pSat(), p0_) -mvCoeff_*min(p - pSatl, p0_)
); );
} }
@ -107,11 +110,14 @@ Foam::compressible::cavitationModels::Kunz::mDotcvP() const
min(max(alphal(), scalar(0)), scalar(1)) min(max(alphal(), scalar(0)), scalar(1))
); );
const volScalarField::Internal pSatv(this->pSatv());
const volScalarField::Internal pSatl(this->pSatl());
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
( (
mcCoeff_*sqr(limitedAlphal)*(1.0 - limitedAlphal) mcCoeff_*sqr(limitedAlphal)*(1 - limitedAlphal)
*pos0(p - pSat())/max(p - pSat(), 0.01*pSat()), *pos0(p - pSatv)/max(p - pSatv, 0.01*pSatv),
(-mvCoeff_)*limitedAlphal*neg(p - pSat()) -mvCoeff_*limitedAlphal*neg(p - pSatl)
); );
} }

View File

@ -1,19 +1,17 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/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/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lcompressibleTwoPhaseMixture \
-lfluidThermophysicalModels \
-lspecie \
-lphysicalProperties \ -lphysicalProperties \
-ltwoPhaseMixture \ -lfluidThermophysicalModels \
-ltwoPhaseProperties \ -lsaturationModels \
-linterfaceProperties \ -lcompressibleTwoPhaseMixture \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools

View File

@ -56,7 +56,7 @@ Foam::compressible::cavitationModels::Merkle::Merkle
Cc_("Cc", dimless, dict), Cc_("Cc", dimless, dict),
Cv_("Cv", dimless, dict), Cv_("Cv", dimless, dict),
p0_("0", pSat().dimensions(), 0.0), p0_("0", dimPressure, 0),
mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_)) mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_))
{ {
@ -79,8 +79,8 @@ Foam::compressible::cavitationModels::Merkle::mDotcvAlphal() const
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
( (
mcCoeff_*max(p - pSat(), p0_), mcCoeff_*max(p - pSatv(), p0_),
-mvCoeff_*min(p - pSat(), p0_) -mvCoeff_*min(p - pSatl(), p0_)
); );
} }
@ -103,8 +103,8 @@ Foam::compressible::cavitationModels::Merkle::mDotcvP() const
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
( (
mcCoeff_*(1.0 - limitedAlphal)*pos0(p - pSat()), mcCoeff_*(1 - limitedAlphal)*pos0(p - pSatv()),
(-mvCoeff_)*limitedAlphal*neg(p - pSat()) -mvCoeff_*limitedAlphal*neg(p - pSatl())
); );
} }

View File

@ -62,7 +62,7 @@ Foam::compressible::cavitationModels::SchnerrSauer::SchnerrSauer
Cc_("Cc", dimless, dict), Cc_("Cc", dimless, dict),
Cv_("Cv", dimless, dict), Cv_("Cv", dimless, dict),
p0_("0", pSat().dimensions(), 0.0) p0_("0", dimPressure, 0.0)
{ {
correct(); correct();
} }
@ -79,7 +79,7 @@ Foam::compressible::cavitationModels::SchnerrSauer::rRb
return pow return pow
( (
((4*constant::mathematical::pi*n_)/3) ((4*constant::mathematical::pi*n_)/3)
*limitedAlphal/(1.0 + alphaNuc() - limitedAlphal), *limitedAlphal/(1 + alphaNuc() - limitedAlphal),
1.0/3.0 1.0/3.0
); );
} }
@ -96,7 +96,8 @@ Foam::compressible::cavitationModels::SchnerrSauer::alphaNuc() const
Foam::tmp<Foam::volScalarField::Internal> Foam::tmp<Foam::volScalarField::Internal>
Foam::compressible::cavitationModels::SchnerrSauer::pCoeff Foam::compressible::cavitationModels::SchnerrSauer::pCoeff
( (
const volScalarField::Internal& p const volScalarField::Internal& p,
const volScalarField::Internal& pSat
) const ) const
{ {
const volScalarField::Internal limitedAlphal const volScalarField::Internal limitedAlphal
@ -106,13 +107,12 @@ Foam::compressible::cavitationModels::SchnerrSauer::pCoeff
const volScalarField::Internal rho const volScalarField::Internal rho
( (
limitedAlphal*rhol() limitedAlphal*rhol() + (1 - limitedAlphal)*rhov()
+ (scalar(1) - limitedAlphal)*rhov()
); );
return return
(3*rhol()*rhov())*sqrt(2/(3*rhol())) (3*rhol()*rhov())*sqrt((2.0/3.0)/rhol())
*rRb(limitedAlphal)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat())); *rRb(limitedAlphal)/(rho*sqrt(mag(p - pSat) + 0.01*pSat));
} }
@ -122,17 +122,21 @@ Foam::compressible::cavitationModels::SchnerrSauer::mDotcvAlphal() const
const volScalarField::Internal& p = const volScalarField::Internal& p =
phases_.mesh().lookupObject<volScalarField>("p"); phases_.mesh().lookupObject<volScalarField>("p");
const volScalarField::Internal pCoeff(this->pCoeff(p));
const volScalarField::Internal limitedAlphal const volScalarField::Internal limitedAlphal
( (
min(max(alphal(), scalar(0)), scalar(1)) min(max(alphal(), scalar(0)), scalar(1))
); );
const volScalarField::Internal pSatv(this->pSatv());
const volScalarField::Internal pSatl(this->pSatl());
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
( (
Cc_*limitedAlphal*pCoeff*max(p - pSat(), p0_), Cc_*limitedAlphal*pCoeff(p, pSatv)*max(p - pSatv, p0_),
-Cv_*(1.0 + alphaNuc() - limitedAlphal)*pCoeff*min(p - pSat(), 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 = const volScalarField::Internal& p =
phases_.mesh().lookupObject<volScalarField>("p"); phases_.mesh().lookupObject<volScalarField>("p");
const volScalarField::Internal pCoeff(this->pCoeff(p));
const volScalarField::Internal limitedAlphal const volScalarField::Internal limitedAlphal
( (
min(max(alphal(), scalar(0)), scalar(1)) 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>> return Pair<tmp<volScalarField::Internal>>
( (
Cc_*(1.0 - limitedAlphal)*pos0(p - pSat())*apCoeff, Cc_*(1 - limitedAlphal)*pos0(p - pSatv)*limitedAlphal*pCoeff(p, pSatv),
(-Cv_)*(1.0 + alphaNuc() - limitedAlphal)*neg(p - pSat())*apCoeff -Cv_
*(1 + alphaNuc() - limitedAlphal)
*neg(p - pSatl)
*limitedAlphal
*pCoeff(p, pSatl)
); );
} }

View File

@ -90,7 +90,8 @@ class SchnerrSauer
//- Part of the condensation and vapourisation rates //- Part of the condensation and vapourisation rates
tmp<volScalarField::Internal> pCoeff tmp<volScalarField::Internal> pCoeff
( (
const volScalarField::Internal& p const volScalarField::Internal& p,
const volScalarField::Internal& pSat
) const; ) const;

View File

@ -48,13 +48,16 @@ Foam::compressible::cavitationModel::cavitationModel
: :
phases_(phases), phases_(phases),
liquidIndex_(phases.index(dict.lookup<word>("liquid"))), 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) bool Foam::compressible::cavitationModel::read(const dictionary& dict)
{ {
dict.lookup("pSat") >> pSat_; saturationModel_.reset(saturationPressureModel::New(dict).ptr());
return true; return true;
} }

View File

@ -38,6 +38,7 @@ SourceFiles
#include "compressibleTwoPhases.H" #include "compressibleTwoPhases.H"
#include "fvMatricesFwd.H" #include "fvMatricesFwd.H"
#include "Pair.H" #include "Pair.H"
#include "saturationPressureModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -62,8 +63,8 @@ protected:
//- Index of the liquid //- Index of the liquid
const bool liquidIndex_; const bool liquidIndex_;
//- Saturation vapour pressure //- The saturation pressure model
dimensionedScalar pSat_; autoPtr<saturationPressureModel> saturationModel_;
// Protected Member Functions // Protected Member Functions
@ -92,6 +93,30 @@ protected:
return phases_.rho(!liquidIndex_); 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: public:
@ -139,10 +164,16 @@ public:
// Member Functions // Member Functions
//- Return the saturation vapour pressure //- Return the saturation vapour pressure for phase 1
inline const dimensionedScalar& pSat() const 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 //- Return the mass condensation and vaporisation rates as a

View File

@ -3,10 +3,11 @@ EXE_INC = \
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/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 = \ LIB_LIBS = \
-lphysicalProperties \
-lincompressibleTwoPhaseMixture \ -lincompressibleTwoPhaseMixture \
-lmeshTools \ -lfiniteVolume \
-lfiniteVolume -lmeshTools