compressibleVoF: Replaced twoPhaseChangeModel with the VoFCavitation fvModel

Replacing the specific twoPhaseChangeModel with a consistent and general fvModel
interface will support not just cavitation using the new compressible
VoFCavitation fvModel but also other phase-change and interface manipulation
models in the future and is easier to use for case-specific and other user
customisation.

Class
    Foam::fv::compressible::VoFCavitation

Description
    Cavitation fvModel

Usage
    Example usage:
    \verbatim
    VoFCavitation
    {
        type    VoFCavitation;

        libs    ("libcompressibleVoFCavitation.so");

        model   SchnerrSauer;

        KunzCoeffs
        {
            pSat    2300;   // Saturation pressure

            UInf    20.0;
            tInf    0.005; // L = 0.1 m
            Cc      1000;
            Cv      1000;
        }

        MerkleCoeffs
        {
            pSat    2300;   // Saturation pressure

            UInf    20.0;
            tInf    0.005;  // L = 0.1 m
            Cc      80;
            Cv      1e-03;
        }

        SchnerrSauerCoeffs
        {
            pSat    2300;   // Saturation pressure

            n       1.6e+13;
            dNuc    2.0e-06;
            Cc      1;
            Cv      1;
        }
    }
    \endverbatim

The cavitating ballValve tutorial has been updated to use the new VoFCavitation
fvModel.
This commit is contained in:
Henry Weller
2022-09-28 13:02:47 +01:00
parent d3df91a5eb
commit 9dc91eb479
58 changed files with 667 additions and 888 deletions

View File

@ -3,11 +3,13 @@ cd ${0%/*} || exit 1 # Run from this directory
wclean libso compressibleTwoPhaseMixture wclean libso compressibleTwoPhaseMixture
wclean libso surfaceTensionModels wclean libso surfaceTensionModels
wclean libso twoPhaseChange
wclean libso compressibleInterPhaseTransportModel wclean libso compressibleInterPhaseTransportModel
wclean libso VoFTurbulenceDamping
wclean libso VoFClouds wclean libso fvModels/VoFTurbulenceDamping
wclean libso VoFSurfaceFilm wclean libso fvModels/VoFClouds
wclean libso fvModels/VoFSurfaceFilm
wclean libso fvModels/VoFCavitation
wclean libso fvModels/VoFSolidificationMeltingSource
wclean wclean

View File

@ -6,11 +6,13 @@ cd ${0%/*} || exit 1 # Run from this directory
wmake $targetType compressibleTwoPhaseMixture wmake $targetType compressibleTwoPhaseMixture
wmake $targetType surfaceTensionModels wmake $targetType surfaceTensionModels
wmake $targetType twoPhaseChange
wmake $targetType compressibleInterPhaseTransportModel wmake $targetType compressibleInterPhaseTransportModel
wmake $targetType VoFTurbulenceDamping
wmake $targetType VoFClouds wmake $targetType fvModels/VoFTurbulenceDamping
wmake $targetType VoFSurfaceFilm wmake $targetType fvModels/VoFClouds
wmake $targetType fvModels/VoFSurfaceFilm
wmake $targetType fvModels/VoFCavitation
wmake $targetType fvModels/VoFSolidificationMeltingSource
wmake $targetType wmake $targetType

View File

@ -2,7 +2,6 @@ EXE_INC = \
-I$(FOAM_SOLVERS)/modules/fluid/fluidSolver/lnInclude \ -I$(FOAM_SOLVERS)/modules/fluid/fluidSolver/lnInclude \
-IcompressibleTwoPhaseMixture \ -IcompressibleTwoPhaseMixture \
-IcompressibleInterPhaseTransportModel/lnInclude \ -IcompressibleInterPhaseTransportModel/lnInclude \
-ItwoPhaseChange/lnInclude \
-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)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
@ -21,7 +20,6 @@ LIB_LIBS = \
-ltwoPhaseMixture \ -ltwoPhaseMixture \
-ltwoPhaseProperties \ -ltwoPhaseProperties \
-linterfaceProperties \ -linterfaceProperties \
-lcompressibleTwoPhaseChangeModels \
-lcompressibleInterPhaseTransportModel \ -lcompressibleInterPhaseTransportModel \
-lfiniteVolume \ -lfiniteVolume \
-lfvModels \ -lfvModels \

View File

@ -18,16 +18,13 @@ tmp<volScalarField::Internal> Su
) )
); );
// Phase change alpha1 source if (fvModels().addsSupToField(alpha1.name()))
Pair<tmp<volScalarField::Internal>> phaseChangeS
(
phaseChange.Salpha(alpha1)
);
if (phaseChangeS[0].valid())
{ {
Su = phaseChangeS[0]; // Phase change alpha1 source
Sp = phaseChangeS[1]; const fvScalarMatrix alphaSup(fvModels().source(alpha1));
Su = alphaSup.Su();
Sp = alphaSup.Sp();
} }
volScalarField::Internal& SpRef = Sp.ref(); volScalarField::Internal& SpRef = Sp.ref();

View File

@ -188,13 +188,6 @@ Foam::solvers::compressibleVoF::compressibleVoF(fvMesh& mesh)
mixture mixture
), ),
phaseChangePtr
(
compressible::twoPhaseChangeModel::New(mixture)
),
phaseChange(*phaseChangePtr),
MRF(mesh) MRF(mesh)
{ {
// Read the controls // Read the controls

View File

@ -59,7 +59,6 @@ See also
#include "fluidSolver.H" #include "fluidSolver.H"
#include "compressibleInterPhaseTransportModel.H" #include "compressibleInterPhaseTransportModel.H"
#include "twoPhaseChangeModel.H"
#include "buoyancy.H" #include "buoyancy.H"
#include "pressureReference.H" #include "pressureReference.H"
@ -147,10 +146,6 @@ protected:
//- Momentum transport model //- Momentum transport model
compressibleInterPhaseTransportModel turbulence; compressibleInterPhaseTransportModel turbulence;
autoPtr<compressible::twoPhaseChangeModel> phaseChangePtr;
compressible::twoPhaseChangeModel& phaseChange;
// Optional models // Optional models

View File

@ -0,0 +1,9 @@
cavitation/cavitationModel/cavitationModel.C
cavitation/cavitationModel/cavitationModelNew.C
cavitation/Kunz/Kunz.C
cavitation/Merkle/Merkle.C
cavitation/SchnerrSauer/SchnerrSauer.C
VoFCavitation.C
LIB = $(FOAM_LIBBIN)/libcompressibleVoFCavitation

View File

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

View File

@ -0,0 +1,185 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 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 "VoFCavitation.H"
#include "compressibleTwoPhaseMixture.H"
#include "fvmSup.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
namespace compressible
{
defineTypeNameAndDebug(VoFCavitation, 0);
addToRunTimeSelectionTable
(
fvModel,
VoFCavitation,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::compressible::VoFCavitation::VoFCavitation
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
fvModel(sourceName, modelType, dict, mesh),
mixture_
(
mesh.lookupObjectRef<compressibleTwoPhaseMixture>
(
"phaseProperties"
)
),
cavitation_(Foam::compressible::cavitationModel::New(dict, mixture_)),
alphaName_(mixture_.alpha1().name())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::wordList Foam::fv::compressible::VoFCavitation::addSupFields() const
{
return {alphaName_, "p_rgh"};
}
void Foam::fv::compressible::VoFCavitation::addSup
(
fvMatrix<scalar>& eqn,
const word& fieldName
) const
{
if (debug)
{
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
}
if (fieldName == alphaName_)
{
volScalarField::Internal alphalCoeff
(
1.0/mixture_.rho1()()
- mixture_.alpha1()()*(1.0/mixture_.rho1()() - 1.0/mixture_.rho2()())
);
const Pair<tmp<volScalarField::Internal>> mDotAlphal
(
cavitation_->mDotAlphal()
);
const volScalarField::Internal vDotcAlphal(alphalCoeff*mDotAlphal[0]());
const volScalarField::Internal vDotvAlphal(alphalCoeff*mDotAlphal[1]());
eqn += fvm::Sp(vDotvAlphal - vDotcAlphal, eqn.psi()) + vDotcAlphal;
}
}
void Foam::fv::compressible::VoFCavitation::addSup
(
const volScalarField&,
fvMatrix<scalar>& eqn,
const word& fieldName
) const
{
if (debug)
{
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
}
if (fieldName == "p_rgh")
{
const volScalarField::Internal& rho =
mesh().lookupObject<volScalarField>("thermo:rho");
const volScalarField::Internal& gh =
mesh().lookupObject<volScalarField>("gh");
const volScalarField::Internal pCoeff
(
1.0/mixture_.rho1()() - 1.0/mixture_.rho2()()
);
const Pair<tmp<volScalarField::Internal>> mDotP
(
cavitation_->mDotP()
);
const volScalarField::Internal vDotcP(pCoeff*mDotP[0]);
const volScalarField::Internal vDotvP(pCoeff*mDotP[1]);
eqn +=
(vDotvP - vDotcP)*(cavitation_->pSat() - rho*gh)
- fvm::Sp(vDotvP - vDotcP, eqn.psi());
}
}
void Foam::fv::compressible::VoFCavitation::topoChange(const polyTopoChangeMap&)
{}
void Foam::fv::compressible::VoFCavitation::mapMesh(const polyMeshMap& map)
{}
void Foam::fv::compressible::VoFCavitation::distribute
(
const polyDistributionMap&
)
{}
bool Foam::fv::compressible::VoFCavitation::movePoints()
{
return true;
}
void Foam::fv::compressible::VoFCavitation::correct()
{
cavitation_->correct();
}
// ************************************************************************* //

View File

@ -0,0 +1,197 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 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::fv::compressible::VoFCavitation
Description
Cavitation fvModel
Usage
Example usage:
\verbatim
VoFCavitation
{
type VoFCavitation;
libs ("libcompressibleVoFCavitation.so");
model SchnerrSauer;
KunzCoeffs
{
pSat 2300; // Saturation pressure
UInf 20.0;
tInf 0.005; // L = 0.1 m
Cc 1000;
Cv 1000;
}
MerkleCoeffs
{
pSat 2300; // Saturation pressure
UInf 20.0;
tInf 0.005; // L = 0.1 m
Cc 80;
Cv 1e-03;
}
SchnerrSauerCoeffs
{
pSat 2300; // Saturation pressure
n 1.6e+13;
dNuc 2.0e-06;
Cc 1;
Cv 1;
}
}
\endverbatim
SourceFiles
VoFCavitation.C
\*---------------------------------------------------------------------------*/
#ifndef VoFCavitation_H
#define VoFCavitation_H
#include "fvModel.H"
#include "cavitationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class compressibleTwoPhaseMixture;
namespace fv
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class VoFCavitation Declaration
\*---------------------------------------------------------------------------*/
class VoFCavitation
:
public fvModel
{
// Private Data
//- Reference to the mixture properties
const compressibleTwoPhaseMixture& mixture_;
autoPtr<Foam::compressible::cavitationModel> cavitation_;
//- The name of the VoF phase-fraction
word alphaName_;
public:
//- Runtime type information
TypeName("VoFCavitation");
// Constructors
//- Construct from explicit source name and mesh
VoFCavitation
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- Disallow default bitwise copy construction
VoFCavitation
(
const VoFCavitation&
) = delete;
// Member Functions
//- Return the list of fields for which the option adds source term
// to the transport equation
virtual wordList addSupFields() const;
//- Add implicit/explicit contributions to VoF phase-fraction equation
virtual void addSup
(
fvMatrix<scalar>& eqn,
const word& fieldName
) const;
//- Add implicit/explicit contributions to p_rgh equation
virtual void addSup
(
const volScalarField& psi,
fvMatrix<scalar>& eqn,
const word& fieldName
) const;
// Mesh changes
//- Update topology using the given map
virtual void topoChange(const polyTopoChangeMap&);
//- Update from another mesh using the given map
virtual void mapMesh(const polyMeshMap&);
//- Redistribute or update using the given distribution map
virtual void distribute(const polyDistributionMap&);
//- Update for mesh motion
virtual bool movePoints();
//- Correct the cavitation model
virtual void correct();
// Member Operators
//- Disallow default bitwise assignment
void operator=(const VoFCavitation&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -32,7 +32,7 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels namespace cavitationModels
{ {
defineTypeNameAndDebug(Kunz, 0); defineTypeNameAndDebug(Kunz, 0);
addToRunTimeSelectionTable(cavitationModel, Kunz, dictionary); addToRunTimeSelectionTable(cavitationModel, Kunz, dictionary);
@ -43,17 +43,18 @@ namespace twoPhaseChangeModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressible::twoPhaseChangeModels::Kunz::Kunz Foam::compressible::cavitationModels::Kunz::Kunz
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
) )
: :
cavitationModel(typeName, mixture), cavitationModel(dict, mixture),
UInf_("UInf", dimVelocity, twoPhaseChangeModelCoeffs_), UInf_("UInf", dimVelocity, dict),
tInf_("tInf", dimTime, twoPhaseChangeModelCoeffs_), tInf_("tInf", dimTime, dict),
Cc_("Cc", dimless, twoPhaseChangeModelCoeffs_), Cc_("Cc", dimless, dict),
Cv_("Cv", dimless, twoPhaseChangeModelCoeffs_), Cv_("Cv", dimless, dict),
p0_("0", pSat().dimensions(), 0.0) p0_("0", pSat().dimensions(), 0.0)
{ {
@ -64,15 +65,15 @@ Foam::compressible::twoPhaseChangeModels::Kunz::Kunz
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>> Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::Kunz::mDotAlphal() const Foam::compressible::cavitationModels::Kunz::mDotAlphal() const
{ {
const volScalarField::Internal& p = const volScalarField::Internal& p =
mixture_.alpha1().db().lookupObject<volScalarField>("p"); mixture_.alpha1().db().lookupObject<volScalarField>("p");
const volScalarField::Internal mcCoeff_(Cc_*rho2()/tInf_); const volScalarField::Internal mcCoeff_(Cc_*mixture_.rho2()()/tInf_);
const volScalarField::Internal mvCoeff_ const volScalarField::Internal mvCoeff_
( (
Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_) Cv_*mixture_.rho2()()/(0.5*mixture_.rho1()()*sqr(UInf_)*tInf_)
); );
const volScalarField::Internal limitedAlpha1 const volScalarField::Internal limitedAlpha1
@ -91,15 +92,15 @@ Foam::compressible::twoPhaseChangeModels::Kunz::mDotAlphal() const
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>> Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::Kunz::mDotP() const Foam::compressible::cavitationModels::Kunz::mDotP() const
{ {
const volScalarField::Internal& p = const volScalarField::Internal& p =
mixture_.alpha1().db().lookupObject<volScalarField>("p"); mixture_.alpha1().db().lookupObject<volScalarField>("p");
const volScalarField::Internal mcCoeff_(Cc_*rho2()/tInf_); const volScalarField::Internal mcCoeff_(Cc_*mixture_.rho2()()/tInf_);
const volScalarField::Internal mvCoeff_ const volScalarField::Internal mvCoeff_
( (
Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_) Cv_*mixture_.rho2()()/(0.5*mixture_.rho1()()*sqr(UInf_)*tInf_)
); );
const volScalarField::Internal limitedAlpha1 const volScalarField::Internal limitedAlpha1
@ -117,22 +118,21 @@ Foam::compressible::twoPhaseChangeModels::Kunz::mDotP() const
} }
void Foam::compressible::twoPhaseChangeModels::Kunz::correct() void Foam::compressible::cavitationModels::Kunz::correct()
{ {}
cavitationModel::correct();
}
bool Foam::compressible::twoPhaseChangeModels::Kunz::read() bool Foam::compressible::cavitationModels::Kunz::read
(
const dictionary& dict
)
{ {
if (cavitationModel::read()) if (cavitationModel::read(dict))
{ {
twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); dict.lookup("UInf") >> UInf_;
dict.lookup("tInf") >> tInf_;
twoPhaseChangeModelCoeffs_.lookup("UInf") >> UInf_; dict.lookup("Cc") >> Cc_;
twoPhaseChangeModelCoeffs_.lookup("tInf") >> tInf_; dict.lookup("Cv") >> Cv_;
twoPhaseChangeModelCoeffs_.lookup("Cc") >> Cc_;
twoPhaseChangeModelCoeffs_.lookup("Cv") >> Cv_;
return true; return true;
} }

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::twoPhaseChangeModels::Kunz Foam::compressible::cavitationModels::Kunz
Description Description
Kunz cavitation model slightly modified so that the condensation term Kunz cavitation model slightly modified so that the condensation term
@ -57,7 +57,7 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels namespace cavitationModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -89,6 +89,7 @@ public:
//- Construct for mixture //- Construct for mixture
Kunz Kunz
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
); );
@ -112,14 +113,14 @@ public:
//- Correct the Kunz phaseChange model //- Correct the Kunz phaseChange model
virtual void correct(); virtual void correct();
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(); virtual bool read(const dictionary& dict);
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace twoPhaseChangeModels } // End namespace cavitationModels
} // End namespace compressible } // End namespace compressible
} // End namespace Foam } // End namespace Foam

View File

@ -32,7 +32,7 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels namespace cavitationModels
{ {
defineTypeNameAndDebug(Merkle, 0); defineTypeNameAndDebug(Merkle, 0);
addToRunTimeSelectionTable(cavitationModel, Merkle, dictionary); addToRunTimeSelectionTable(cavitationModel, Merkle, dictionary);
@ -43,17 +43,18 @@ namespace twoPhaseChangeModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressible::twoPhaseChangeModels::Merkle::Merkle Foam::compressible::cavitationModels::Merkle::Merkle
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
) )
: :
cavitationModel(typeName, mixture), cavitationModel(dict, mixture),
UInf_("UInf", dimVelocity, twoPhaseChangeModelCoeffs_), UInf_("UInf", dimVelocity, dict),
tInf_("tInf", dimTime, twoPhaseChangeModelCoeffs_), tInf_("tInf", dimTime, dict),
Cc_("Cc", dimless, twoPhaseChangeModelCoeffs_), Cc_("Cc", dimless, dict),
Cv_("Cv", dimless, twoPhaseChangeModelCoeffs_), Cv_("Cv", dimless, dict),
p0_("0", pSat().dimensions(), 0.0), p0_("0", pSat().dimensions(), 0.0),
@ -66,14 +67,14 @@ Foam::compressible::twoPhaseChangeModels::Merkle::Merkle
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>> Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::Merkle::mDotAlphal() const Foam::compressible::cavitationModels::Merkle::mDotAlphal() const
{ {
const volScalarField::Internal& p = const volScalarField::Internal& p =
mixture_.alpha1().db().lookupObject<volScalarField>("p"); mixture_.alpha1().db().lookupObject<volScalarField>("p");
const volScalarField::Internal mvCoeff_ const volScalarField::Internal mvCoeff_
( (
Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()) Cv_*mixture_.rho1()()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()())
); );
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
@ -85,7 +86,7 @@ Foam::compressible::twoPhaseChangeModels::Merkle::mDotAlphal() const
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>> Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::Merkle::mDotP() const Foam::compressible::cavitationModels::Merkle::mDotP() const
{ {
const volScalarField::Internal& p = const volScalarField::Internal& p =
mixture_.alpha1().db().lookupObject<volScalarField>("p"); mixture_.alpha1().db().lookupObject<volScalarField>("p");
@ -97,7 +98,7 @@ Foam::compressible::twoPhaseChangeModels::Merkle::mDotP() const
const volScalarField::Internal mvCoeff_ const volScalarField::Internal mvCoeff_
( (
Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()) Cv_*mixture_.rho1()()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()())
); );
return Pair<tmp<volScalarField::Internal>> return Pair<tmp<volScalarField::Internal>>
@ -109,22 +110,21 @@ Foam::compressible::twoPhaseChangeModels::Merkle::mDotP() const
} }
void Foam::compressible::twoPhaseChangeModels::Merkle::correct() void Foam::compressible::cavitationModels::Merkle::correct()
{ {}
cavitationModel::correct();
}
bool Foam::compressible::twoPhaseChangeModels::Merkle::read() bool Foam::compressible::cavitationModels::Merkle::read
(
const dictionary& dict
)
{ {
if (cavitationModel::read()) if (cavitationModel::read(dict))
{ {
twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); dict.lookup("UInf") >> UInf_;
dict.lookup("tInf") >> tInf_;
twoPhaseChangeModelCoeffs_.lookup("UInf") >> UInf_; dict.lookup("Cc") >> Cc_;
twoPhaseChangeModelCoeffs_.lookup("tInf") >> tInf_; dict.lookup("Cv") >> Cv_;
twoPhaseChangeModelCoeffs_.lookup("Cc") >> Cc_;
twoPhaseChangeModelCoeffs_.lookup("Cv") >> Cv_;
return true; return true;
} }

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::twoPhaseChangeModels::Merkle Foam::compressible::cavitationModels::Merkle
Description Description
Merkle cavitation model. Merkle cavitation model.
@ -51,7 +51,7 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels namespace cavitationModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -85,6 +85,7 @@ public:
//- Construct for mixture //- Construct for mixture
Merkle Merkle
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
); );
@ -108,14 +109,14 @@ public:
//- Correct the Merkle phaseChange model //- Correct the Merkle phaseChange model
virtual void correct(); virtual void correct();
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(); virtual bool read(const dictionary& dict);
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace twoPhaseChangeModels } // End namespace cavitationModels
} // End namespace compressible } // End namespace compressible
} // End namespace Foam } // End namespace Foam

View File

@ -33,7 +33,7 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels namespace cavitationModels
{ {
defineTypeNameAndDebug(SchnerrSauer, 0); defineTypeNameAndDebug(SchnerrSauer, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
@ -49,17 +49,18 @@ namespace twoPhaseChangeModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressible::twoPhaseChangeModels::SchnerrSauer::SchnerrSauer Foam::compressible::cavitationModels::SchnerrSauer::SchnerrSauer
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
) )
: :
cavitationModel(typeName, mixture), cavitationModel(dict, mixture),
n_("n", dimless/dimVolume, twoPhaseChangeModelCoeffs_), n_("n", dimless/dimVolume, dict),
dNuc_("dNuc", dimLength, twoPhaseChangeModelCoeffs_), dNuc_("dNuc", dimLength, dict),
Cc_("Cc", dimless, twoPhaseChangeModelCoeffs_), Cc_("Cc", dimless, dict),
Cv_("Cv", dimless, twoPhaseChangeModelCoeffs_), Cv_("Cv", dimless, dict),
p0_("0", pSat().dimensions(), 0.0) p0_("0", pSat().dimensions(), 0.0)
{ {
@ -70,7 +71,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::SchnerrSauer
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField::Internal> Foam::tmp<Foam::volScalarField::Internal>
Foam::compressible::twoPhaseChangeModels::SchnerrSauer::rRb Foam::compressible::cavitationModels::SchnerrSauer::rRb
( (
const volScalarField::Internal& limitedAlpha1 const volScalarField::Internal& limitedAlpha1
) const ) const
@ -85,7 +86,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::rRb
Foam::dimensionedScalar Foam::dimensionedScalar
Foam::compressible::twoPhaseChangeModels::SchnerrSauer::alphaNuc() const Foam::compressible::cavitationModels::SchnerrSauer::alphaNuc() const
{ {
dimensionedScalar Vnuc = n_*constant::mathematical::pi*pow3(dNuc_)/6; dimensionedScalar Vnuc = n_*constant::mathematical::pi*pow3(dNuc_)/6;
return Vnuc/(1 + Vnuc); return Vnuc/(1 + Vnuc);
@ -93,7 +94,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::alphaNuc() const
Foam::tmp<Foam::volScalarField::Internal> Foam::tmp<Foam::volScalarField::Internal>
Foam::compressible::twoPhaseChangeModels::SchnerrSauer::pCoeff Foam::compressible::cavitationModels::SchnerrSauer::pCoeff
( (
const volScalarField::Internal& p const volScalarField::Internal& p
) const ) const
@ -105,18 +106,18 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::pCoeff
const volScalarField::Internal rho const volScalarField::Internal rho
( (
limitedAlpha1*rho1() limitedAlpha1*mixture_.rho1()()
+ (scalar(1) - limitedAlpha1)*rho2() + (scalar(1) - limitedAlpha1)*mixture_.rho2()()
); );
return return
(3*rho1()*rho2())*sqrt(2/(3*rho1())) (3*mixture_.rho1()()*mixture_.rho2()())*sqrt(2/(3*mixture_.rho1()()))
*rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat())); *rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));
} }
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>> Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotAlphal() const Foam::compressible::cavitationModels::SchnerrSauer::mDotAlphal() const
{ {
const volScalarField::Internal& p = const volScalarField::Internal& p =
mixture_.alpha1().db().lookupObject<volScalarField>("p"); mixture_.alpha1().db().lookupObject<volScalarField>("p");
@ -138,7 +139,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotAlphal() const
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>> Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotP() const Foam::compressible::cavitationModels::SchnerrSauer::mDotP() const
{ {
const volScalarField::Internal& p = const volScalarField::Internal& p =
mixture_.alpha1().db().lookupObject<volScalarField>("p"); mixture_.alpha1().db().lookupObject<volScalarField>("p");
@ -161,22 +162,21 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotP() const
} }
void Foam::compressible::twoPhaseChangeModels::SchnerrSauer::correct() void Foam::compressible::cavitationModels::SchnerrSauer::correct()
{ {}
cavitationModel::correct();
}
bool Foam::compressible::twoPhaseChangeModels::SchnerrSauer::read() bool Foam::compressible::cavitationModels::SchnerrSauer::read
(
const dictionary& dict
)
{ {
if (cavitationModel::read()) if (cavitationModel::read(dict))
{ {
twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); dict.lookup("n") >> n_;
dict.lookup("dNuc") >> dNuc_;
twoPhaseChangeModelCoeffs_.lookup("n") >> n_; dict.lookup("Cc") >> Cc_;
twoPhaseChangeModelCoeffs_.lookup("dNuc") >> dNuc_; dict.lookup("Cv") >> Cv_;
twoPhaseChangeModelCoeffs_.lookup("Cc") >> Cc_;
twoPhaseChangeModelCoeffs_.lookup("Cv") >> Cv_;
return true; return true;
} }

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::twoPhaseChangeModels::SchnerrSauer Foam::compressible::cavitationModels::SchnerrSauer
Description Description
SchnerrSauer cavitation model. SchnerrSauer cavitation model.
@ -51,7 +51,7 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels namespace cavitationModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -105,6 +105,7 @@ public:
//- Construct for mixture //- Construct for mixture
SchnerrSauer SchnerrSauer
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
); );
@ -128,14 +129,14 @@ public:
//- Correct the SchnerrSauer phaseChange model //- Correct the SchnerrSauer phaseChange model
virtual void correct(); virtual void correct();
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(); virtual bool read(const dictionary& dict);
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace twoPhaseChangeModels } // End namespace cavitationModels
} // End namespace compressible } // End namespace compressible
} // End namespace Foam } // End namespace Foam

View File

@ -23,7 +23,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "twoPhaseChangeModel.H" #include "cavitationModel.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -31,79 +32,30 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
defineTypeNameAndDebug(twoPhaseChangeModel, 0); defineTypeNameAndDebug(cavitationModel, 0);
defineRunTimeSelectionTable(twoPhaseChangeModel, dictionary); defineRunTimeSelectionTable(cavitationModel, dictionary);
} }
} }
const Foam::word
Foam::compressible::twoPhaseChangeModel::phaseChangePropertiesName
(
"phaseChangeProperties"
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::IOobject Foam::compressible::twoPhaseChangeModel::createIOobject
(
const compressibleTwoPhaseMixture& mixture
) const
{
typeIOobject<IOdictionary> io
(
phaseChangePropertiesName,
mixture.alpha1().mesh().time().constant(),
mixture.alpha1().mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.headerOk())
{
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
}
else
{
io.readOpt() = IOobject::NO_READ;
return io;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressible::twoPhaseChangeModel::twoPhaseChangeModel Foam::compressible::cavitationModel::cavitationModel
( (
const word& type, const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
) )
: :
IOdictionary(createIOobject(mixture)),
mixture_(mixture), mixture_(mixture),
twoPhaseChangeModelCoeffs_(optionalSubDict(type + "Coeffs")) pSat_("pSat", dimPressure, dict.lookup("pSat"))
{} {}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::compressible::cavitationModel::read(const dictionary& dict)
void Foam::compressible::twoPhaseChangeModel::correct()
{}
bool Foam::compressible::twoPhaseChangeModel::read()
{ {
if (regIOobject::read()) dict.lookup("pSat") >> pSat_;
{
twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs");
return true; return true;
}
else
{
return false;
}
} }

View File

@ -35,7 +35,9 @@ SourceFiles
#ifndef cavitationModel_H #ifndef cavitationModel_H
#define cavitationModel_H #define cavitationModel_H
#include "twoPhaseChangeModel.H" #include "compressibleTwoPhaseMixture.H"
#include "fvMatricesFwd.H"
#include "Pair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,18 +45,19 @@ namespace Foam
{ {
namespace compressible namespace compressible
{ {
namespace twoPhaseChangeModels
{
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class cavitationModel Class cavitationModel
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class cavitationModel class cavitationModel
:
public twoPhaseChangeModel
{ {
// Private data protected:
// Protected data
//- Mixture properties
const compressibleTwoPhaseMixture& mixture_;
//- Saturation vapour pressure //- Saturation vapour pressure
dimensionedScalar pSat_; dimensionedScalar pSat_;
@ -66,16 +69,39 @@ public:
TypeName("cavitation"); TypeName("cavitation");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
cavitationModel,
dictionary,
(
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture
),
(dict, mixture)
);
// Constructors // Constructors
//- Construct for mixture //- Construct for mixture
cavitationModel cavitationModel
( (
const word& type, const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
); );
// Selector
static autoPtr<cavitationModel> New
(
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture
);
//- Destructor //- Destructor
virtual ~cavitationModel() virtual ~cavitationModel()
{} {}
@ -98,38 +124,16 @@ public:
// to multiply (p - pSat) // to multiply (p - pSat)
virtual Pair<tmp<volScalarField::Internal>> mDotP() const = 0; virtual Pair<tmp<volScalarField::Internal>> mDotP() const = 0;
//- Return the cavitation explicit and implicit sources //- Correct the cavitation model
// for the phase-fraction equation virtual void correct() = 0;
virtual Pair<tmp<volScalarField::Internal>> Salpha
(
volScalarField& alpha
) const;
//- Return the cavitation source matrix //- Read the dictionary and update
// for the p_rgh pressure equation virtual bool read(const dictionary& dict) = 0;
virtual tmp<fvScalarMatrix> Sp_rgh
(
const volScalarField& rho,
const volScalarField& gh,
volScalarField& p_rgh
) const;
//- Return the cavitation source matrix for the momentum equation
virtual tmp<fvVectorMatrix> SU
(
const volScalarField& rho,
const surfaceScalarField& rhoPhi,
volVectorField& U
) const;
//- Read the phaseProperties dictionary and update
virtual bool read();
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace twoPhaseChangeModels
} // End namespace compressible } // End namespace compressible
} // End namespace Foam } // End namespace Foam

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,46 +23,20 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "noPhaseChange.H" #include "cavitationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::compressible::twoPhaseChangeModel> Foam::autoPtr<Foam::compressible::cavitationModel>
Foam::compressible::twoPhaseChangeModel::New Foam::compressible::cavitationModel::New
( (
const dictionary& dict,
const compressibleTwoPhaseMixture& mixture const compressibleTwoPhaseMixture& mixture
) )
{ {
typeIOobject<IOdictionary> twoPhaseChangeModelIO const word modelType(dict.lookup("model"));
(
IOobject
(
phaseChangePropertiesName,
mixture.alpha1().time().constant(),
mixture.alpha1().db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
word modelType(twoPhaseChangeModels::noPhaseChange::typeName); Info<< "Selecting cavitation model " << modelType << endl;
if (twoPhaseChangeModelIO.headerOk())
{
IOdictionary(twoPhaseChangeModelIO).lookup
(
twoPhaseChangeModel::typeName
) >> modelType;
}
else
{
Info<< "No phase change: "
<< twoPhaseChangeModelIO.name()
<< " not found" << endl;
}
Info<< "Selecting phaseChange model " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType); dictionaryConstructorTablePtr_->find(modelType);
@ -70,14 +44,17 @@ Foam::compressible::twoPhaseChangeModel::New
if (cstrIter == dictionaryConstructorTablePtr_->end()) if (cstrIter == dictionaryConstructorTablePtr_->end())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unknown " << twoPhaseChangeModel::typeName<< " type " << "Unknown cavitation model "
<< modelType << nl << nl << modelType << nl << nl
<< "Valid twoPhaseChangeModels are : " << endl << "Valid cavitationModels are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError); << exit(FatalError);
} }
return autoPtr<twoPhaseChangeModel>(cstrIter()(mixture)); return autoPtr<cavitationModel>
(
cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), mixture)
);
} }

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I../compressibleTwoPhaseMixture \ -I../../compressibleTwoPhaseMixture \
-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)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \

View File

@ -0,0 +1,3 @@
VoFSolidificationMeltingSource.C
LIB = $(FOAM_LIBBIN)/libVoFSolidificationMeltingSource

View File

@ -0,0 +1,19 @@
EXE_INC = \
-I../../compressibleTwoPhaseMixture \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/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 \
-lfiniteVolume \
-lmeshTools

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I../compressibleTwoPhaseMixture \ -I../../compressibleTwoPhaseMixture \
-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)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \

View File

@ -1,5 +1,5 @@
EXE_INC = \ EXE_INC = \
-I../compressibleTwoPhaseMixture \ -I../../compressibleTwoPhaseMixture \
-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)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \

View File

@ -36,21 +36,24 @@ namespace Foam
{ {
namespace fv namespace fv
{ {
defineTypeNameAndDebug(VoFTurbulenceDamping, 0); namespace compressible
{
defineTypeNameAndDebug(VoFTurbulenceDamping, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
fvModel, fvModel,
VoFTurbulenceDamping, VoFTurbulenceDamping,
dictionary dictionary
); );
}
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::VoFTurbulenceDamping::VoFTurbulenceDamping Foam::fv::compressible::VoFTurbulenceDamping::VoFTurbulenceDamping
( (
const word& sourceName, const word& sourceName,
const word& modelType, const word& modelType,
@ -113,13 +116,14 @@ Foam::fv::VoFTurbulenceDamping::VoFTurbulenceDamping
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::wordList Foam::fv::VoFTurbulenceDamping::addSupFields() const Foam::wordList
Foam::fv::compressible::VoFTurbulenceDamping::addSupFields() const
{ {
return wordList(1, fieldName_); return wordList(1, fieldName_);
} }
void Foam::fv::VoFTurbulenceDamping::addSup void Foam::fv::compressible::VoFTurbulenceDamping::addSup
( (
const volScalarField& rho, const volScalarField& rho,
fvMatrix<scalar>& eqn, fvMatrix<scalar>& eqn,
@ -156,7 +160,7 @@ void Foam::fv::VoFTurbulenceDamping::addSup
} }
void Foam::fv::VoFTurbulenceDamping::addSup void Foam::fv::compressible::VoFTurbulenceDamping::addSup
( (
const volScalarField& alpha, const volScalarField& alpha,
const volScalarField&, const volScalarField&,
@ -207,19 +211,28 @@ void Foam::fv::VoFTurbulenceDamping::addSup
} }
void Foam::fv::VoFTurbulenceDamping::topoChange(const polyTopoChangeMap&) void Foam::fv::compressible::VoFTurbulenceDamping::topoChange
(
const polyTopoChangeMap&
)
{} {}
void Foam::fv::VoFTurbulenceDamping::mapMesh(const polyMeshMap& map) void Foam::fv::compressible::VoFTurbulenceDamping::mapMesh
(
const polyMeshMap& map
)
{} {}
void Foam::fv::VoFTurbulenceDamping::distribute(const polyDistributionMap&) void Foam::fv::compressible::VoFTurbulenceDamping::distribute
(
const polyDistributionMap&
)
{} {}
bool Foam::fv::VoFTurbulenceDamping::movePoints() bool Foam::fv::compressible::VoFTurbulenceDamping::movePoints()
{ {
return true; return true;
} }

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::fv::VoFTurbulenceDamping Foam::fv::compressible::VoFTurbulenceDamping
Description Description
Free-surface turbulence damping function Free-surface turbulence damping function
@ -87,6 +87,8 @@ class compressibleMomentumTransportModel;
namespace fv namespace fv
{ {
namespace compressible
{
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class VoFTurbulenceDamping Declaration Class VoFTurbulenceDamping Declaration
@ -196,6 +198,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace fv } // End namespace fv
} // End namespace Foam } // End namespace Foam

View File

@ -83,7 +83,19 @@ void Foam::solvers::compressibleVoF::pressureCorrector()
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
// Cache the phase change pressure source // Cache the phase change pressure source
fvScalarMatrix Sp_rgh(phaseChange.Sp_rgh(rho, buoyancy.gh, p_rgh)); fvScalarMatrix Sp_rgh
(
fvModels().source
(
volScalarField::New
(
"1",
mesh,
dimensionedScalar(dimless/dimPressure, 1)
),
p_rgh
)
);
// Make the fluxes relative to the mesh motion // Make the fluxes relative to the mesh motion
fvc::makeRelative(phiHbyA, U); fvc::makeRelative(phiHbyA, U);

View File

@ -1,9 +0,0 @@
twoPhaseChangeModel/twoPhaseChangeModel.C
twoPhaseChangeModel/twoPhaseChangeModelNew.C
noPhaseChange/noPhaseChange.C
cavitation/cavitationModel/cavitationModel.C
cavitation/Kunz/Kunz.C
cavitation/Merkle/Merkle.C
cavitation/SchnerrSauer/SchnerrSauer.C
LIB = $(FOAM_LIBBIN)/libcompressibleTwoPhaseChangeModels

View File

@ -1,131 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-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 "cavitationModel.H"
#include "fvcDdt.H"
#include "fvcDiv.H"
#include "fvmSup.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace twoPhaseChangeModels
{
defineTypeNameAndDebug(cavitationModel, 0);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressible::twoPhaseChangeModels::cavitationModel::cavitationModel
(
const word& type,
const compressibleTwoPhaseMixture& mixture
)
:
twoPhaseChangeModel(type, mixture),
pSat_("pSat", dimPressure, lookup("pSat"))
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::cavitationModel::Salpha
(
volScalarField& alpha
) const
{
const volScalarField::Internal alphalCoeff
(
1.0/rho1()
- mixture_.alpha1()()*(1.0/rho1() - 1.0/rho2())
);
const Pair<tmp<volScalarField::Internal>> mDotAlphal = this->mDotAlphal();
const volScalarField::Internal vDotcAlphal(alphalCoeff*mDotAlphal[0]());
const volScalarField::Internal vDotvAlphal(alphalCoeff*mDotAlphal[1]());
return Pair<tmp<volScalarField::Internal>>
(
1.0*vDotcAlphal,
vDotvAlphal - vDotcAlphal
);
}
Foam::tmp<Foam::fvScalarMatrix>
Foam::compressible::twoPhaseChangeModels::cavitationModel::Sp_rgh
(
const volScalarField& rho,
const volScalarField& gh,
volScalarField& p_rgh
) const
{
const volScalarField::Internal pCoeff(1.0/rho1() - 1.0/rho2());
const Pair<tmp<volScalarField::Internal>> mDotP = this->mDotP();
const volScalarField::Internal vDotcP(pCoeff*mDotP[0]);
const volScalarField::Internal vDotvP(pCoeff*mDotP[1]);
return
(vDotvP - vDotcP)*(pSat() - rho()*gh())
- fvm::Sp(vDotvP - vDotcP, p_rgh);
}
Foam::tmp<Foam::fvVectorMatrix>
Foam::compressible::twoPhaseChangeModels::cavitationModel::SU
(
const volScalarField& rho,
const surfaceScalarField& rhoPhi,
volVectorField& U
) const
{
return fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U);
}
bool Foam::compressible::twoPhaseChangeModels::cavitationModel::read()
{
if (twoPhaseChangeModel::read())
{
lookup("pSat") >> pSat_;
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -1,133 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-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 "noPhaseChange.H"
#include "fvScalarMatrix.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace twoPhaseChangeModels
{
defineTypeNameAndDebug(noPhaseChange, 0);
addToRunTimeSelectionTable(twoPhaseChangeModel, noPhaseChange, dictionary);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressible::twoPhaseChangeModels::noPhaseChange::noPhaseChange
(
const compressibleTwoPhaseMixture& mixture
)
:
twoPhaseChangeModel(typeName, mixture)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::Pair<Foam::tmp<Foam::volScalarField>>
Foam::compressible::twoPhaseChangeModels::noPhaseChange::mDotAlphal() const
{
return Pair<tmp<volScalarField>>
(
volScalarField::null(),
volScalarField::null()
);
}
Foam::Pair<Foam::tmp<Foam::volScalarField>>
Foam::compressible::twoPhaseChangeModels::noPhaseChange::mDotP() const
{
return Pair<tmp<volScalarField>>
(
volScalarField::null(),
volScalarField::null()
);
}
Foam::Pair<Foam::tmp<Foam::volScalarField::Internal>>
Foam::compressible::twoPhaseChangeModels::noPhaseChange::Salpha
(
volScalarField& alpha
) const
{
return Pair<tmp<volScalarField::Internal>>
(
tmp<volScalarField::Internal>(nullptr),
tmp<volScalarField::Internal>(nullptr)
);
}
Foam::tmp<Foam::fvScalarMatrix>
Foam::compressible::twoPhaseChangeModels::noPhaseChange::Sp_rgh
(
const volScalarField& rho,
const volScalarField& gh,
volScalarField& p_rgh
) const
{
return tmp<fvScalarMatrix>(new fvScalarMatrix(p_rgh, dimVolume/dimTime));
}
Foam::tmp<Foam::fvVectorMatrix>
Foam::compressible::twoPhaseChangeModels::noPhaseChange::SU
(
const volScalarField& rho,
const surfaceScalarField& rhoPhi,
volVectorField& U
) const
{
return tmp<fvVectorMatrix>
(
new fvVectorMatrix(U, dimMass*dimVelocity/dimTime)
);
}
void Foam::compressible::twoPhaseChangeModels::noPhaseChange::correct()
{
twoPhaseChangeModel::correct();
}
bool Foam::compressible::twoPhaseChangeModels::noPhaseChange::read()
{
return twoPhaseChangeModel::read();
}
// ************************************************************************* //

View File

@ -1,131 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-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::twoPhaseChangeModels::noPhaseChange
Description
Dummy phase change model for 'no phase change'
SourceFiles
noPhaseChange.C
\*---------------------------------------------------------------------------*/
#ifndef noPhaseChange_H
#define noPhaseChange_H
#include "twoPhaseChangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
namespace twoPhaseChangeModels
{
/*---------------------------------------------------------------------------*\
Class noPhaseChange
\*---------------------------------------------------------------------------*/
class noPhaseChange
:
public twoPhaseChangeModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct for mixture
noPhaseChange
(
const compressibleTwoPhaseMixture& mixture
);
//- Destructor
virtual ~noPhaseChange()
{}
// Member Functions
//- Return the mass condensation and vaporisation rates as a
// coefficient to multiply (1 - alphal) for the condensation rate
// and a coefficient to multiply alphal for the vaporisation rate
virtual Pair<tmp<volScalarField>> mDotAlphal() const;
//- Return the mass condensation and vaporisation rates as coefficients
// to multiply (p - pSat)
virtual Pair<tmp<volScalarField>> mDotP() const;
//- Return unallocated explicit and implicit sources
// for the phase-fraction equation
virtual Pair<tmp<volScalarField::Internal>> Salpha
(
volScalarField&
) const;
//- Return the zero source matrix
// for the p_rgh pressure equation
virtual tmp<fvScalarMatrix> Sp_rgh
(
const volScalarField& rho,
const volScalarField& gh,
volScalarField& p_rgh
) const;
//- Return the zero source matrix for the momentum equation
virtual tmp<fvVectorMatrix> SU
(
const volScalarField& rho,
const surfaceScalarField& rhoPhi,
volVectorField& U
) const;
//- Correct the noPhaseChange phaseChange model
virtual void correct();
//- Read the phaseProperties dictionary and update
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace twoPhaseChangeModels
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,188 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-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::twoPhaseChangeModel
Description
SourceFiles
twoPhaseChangeModel.C
phaseChangeModelNew.C
\*---------------------------------------------------------------------------*/
#ifndef twoPhaseChangeModel_H
#define twoPhaseChangeModel_H
#include "compressibleTwoPhaseMixture.H"
#include "fvMatricesFwd.H"
#include "Pair.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class twoPhaseChangeModel Declaration
\*---------------------------------------------------------------------------*/
class twoPhaseChangeModel
:
public IOdictionary
{
// Private Member Functions
//- Construct the base IO object
IOobject createIOobject
(
const compressibleTwoPhaseMixture& mixture
) const;
protected:
// Protected data
//- Reference to the two-phase mixture
const compressibleTwoPhaseMixture& mixture_;
//- Model coefficient dictionary
dictionary twoPhaseChangeModelCoeffs_;
public:
//- Runtime type information
TypeName("phaseChangeModel");
//- Default phaseChangeProperties dictionary name
static const word phaseChangePropertiesName;
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
twoPhaseChangeModel,
dictionary,
(
const compressibleTwoPhaseMixture& mixture
),
(mixture)
);
// Constructors
//- Construct from dictionary
twoPhaseChangeModel
(
const word& type,
const compressibleTwoPhaseMixture& mixture
);
//- Disallow default bitwise copy construction
twoPhaseChangeModel(const twoPhaseChangeModel&);
// Selectors
//- Return a reference to the selected phaseChange model
static autoPtr<twoPhaseChangeModel> New
(
const compressibleTwoPhaseMixture& mixture
);
//- Destructor
virtual ~twoPhaseChangeModel()
{}
// Member Functions
//- Return the internal field of the density of phase 1
const volScalarField::Internal& rho1() const
{
return mixture_.rho1();
}
//- Return the internal field of the density of phase 2
const volScalarField::Internal& rho2() const
{
return mixture_.rho2();
}
//- Return the phase-change explicit and implicit sources
// for the phase-fraction equation
virtual Pair<tmp<volScalarField::Internal>> Salpha
(
volScalarField& alpha
) const = 0;
//- Return the phase-change source matrix
// for the p_rgh pressure equation
virtual tmp<fvScalarMatrix> Sp_rgh
(
const volScalarField& rho,
const volScalarField& gh,
volScalarField& p_rgh
) const = 0;
//- Return the phase-change source matrix for the momentum equation
virtual tmp<fvVectorMatrix> SU
(
const volScalarField& rho,
const surfaceScalarField& rhoPhi,
volVectorField& U
) const = 0;
//- Correct the phaseChange model
virtual void correct() = 0;
//- Read the phaseProperties dictionary and update
virtual bool read() = 0;
// Member Operators
//- Disallow default bitwise assignment
void operator=(const twoPhaseChangeModel&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,8 +2,9 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
wclean libso incompressibleInterPhaseTransportModel wclean libso incompressibleInterPhaseTransportModel
wclean libso VoFTurbulenceDamping
wclean libso VoFCavitation wclean libso fvModels/VoFTurbulenceDamping
wclean libso fvModels/VoFCavitation
wclean wclean
wclean interMixingFoam wclean interMixingFoam

View File

@ -5,8 +5,9 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake $targetType incompressibleInterPhaseTransportModel wmake $targetType incompressibleInterPhaseTransportModel
wmake $targetType VoFTurbulenceDamping
wmake $targetType VoFCavitation wmake $targetType fvModels/VoFTurbulenceDamping
wmake $targetType fvModels/VoFCavitation
wmake $targetType wmake $targetType
wmake $targetType interMixingFoam wmake $targetType interMixingFoam

View File

@ -87,8 +87,6 @@ namespace Foam
{ {
class immiscibleIncompressibleTwoPhaseMixture; class immiscibleIncompressibleTwoPhaseMixture;
class interfaceProperties;
class incompressibleMomentumTransportModel;
namespace fv namespace fv
{ {

View File

@ -114,7 +114,7 @@ public:
//- Correct the Kunz phaseChange model //- Correct the Kunz phaseChange model
virtual void correct(); virtual void correct();
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(const dictionary& dict); virtual bool read(const dictionary& dict);
}; };

View File

@ -108,7 +108,7 @@ public:
//- Correct the Merkle phaseChange model //- Correct the Merkle phaseChange model
virtual void correct(); virtual void correct();
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(const dictionary& dict); virtual bool read(const dictionary& dict);
}; };

View File

@ -127,7 +127,7 @@ public:
//- Correct the SchnerrSauer phaseChange model //- Correct the SchnerrSauer phaseChange model
virtual void correct(); virtual void correct();
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(const dictionary& dict); virtual bool read(const dictionary& dict);
}; };

View File

@ -125,7 +125,7 @@ public:
//- Correct the cavitation model //- Correct the cavitation model
virtual void correct() = 0; virtual void correct() = 0;
//- Read the phaseProperties dictionary and update //- Read the dictionary and update
virtual bool read(const dictionary& dict) = 0; virtual bool read(const dictionary& dict) = 0;
}; };

View File

@ -9,21 +9,26 @@ FoamFile
{ {
format ascii; format ascii;
class dictionary; class dictionary;
object phaseChangeProperties; location "constant";
object fvModels;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phaseChangeModel SchnerrSauer; VoFCavitation
pSat 2364;
SchnerrSauerCoeffs
{ {
n 1.6E+13; type VoFCavitation;
dNuc 2.0E-06;
Cc 1.0; libs ("libcompressibleVoFCavitation.so");
Cv 1.0;
model SchnerrSauer;
pSat 2300;
n 1.6e+13;
dNuc 2.0e-06;
Cc 1;
Cv 1;
} }
// ************************************************************************* // //************************************************************************* //