incompressibleTwoPhaseMixture -> incompressibleTwoPhaseVoFMixture, compressibleTwoPhaseMixture -> compressibleTwoPhaseVoFMixture

to distinguish between mixtures specifically for VoF simulations
This commit is contained in:
Henry Weller
2023-01-09 19:54:41 +00:00
parent a329c2e8e5
commit ead885c508
36 changed files with 130 additions and 599 deletions

View File

@ -1,10 +1,6 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/modules/fluidSolver/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/VoF \
-I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
@ -13,8 +9,6 @@ LIB_LIBS = \
-lfluidSolver \
-lphysicalProperties \
-linterfaceCompression \
-linterfaceProperties \
-ltwoPhaseMixture \
-lfiniteVolume \
-lmeshTools \
-lfvModels \

View File

@ -25,7 +25,7 @@ Class
Foam::VoFMixture
Description
Class to represent a VoF mixture
Two-phase VoF mixture
SourceFiles
VoFMixture.C

View File

@ -234,10 +234,6 @@ void Foam::solvers::VoFSolver::prePredictor()
}
void Foam::solvers::VoFSolver::postCorrector()
{}
void Foam::solvers::VoFSolver::postSolve()
{
divU.clear();

View File

@ -57,7 +57,6 @@ See also
#include "fluidSolver.H"
#include "VoFMixture.H"
#include "interfaceProperties.H"
#include "buoyancy.H"
#include "pressureReference.H"
#include "IOMRFZoneList.H"
@ -233,9 +232,6 @@ public:
//- Construct and solve the pressure equation in the PISO loop
virtual void pressureCorrector() = 0;
//- Correct the momentum transport modelling
virtual void postCorrector();
//- Called after the PIMPLE loop at the end of the time-step
virtual void postSolve();

View File

@ -1,4 +1,4 @@
compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C
compressibleTwoPhaseVoFMixture/compressibleTwoPhaseVoFMixture.C
compressibleInterPhaseTransportModel/compressibleInterPhaseTransportModel.C
compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,8 @@ Foam::compressibleInterPhaseThermophysicalTransportModel::coeffDict() const
Foam::tmp<Foam::volScalarField>
Foam::compressibleInterPhaseThermophysicalTransportModel::kappaEff() const
{
const compressibleTwoPhaseMixture& mixture_ = momentumTransport_.mixture_;
const compressibleTwoPhaseVoFMixture& mixture_ =
momentumTransport_.mixture_;
if (momentumTransport_.twoPhaseTransport_)
{
@ -101,7 +102,8 @@ Foam::compressibleInterPhaseThermophysicalTransportModel::kappaEff
const label patchi
) const
{
const compressibleTwoPhaseMixture& mixture_ = momentumTransport_.mixture_;
const compressibleTwoPhaseVoFMixture& mixture_ =
momentumTransport_.mixture_;
if (momentumTransport_.twoPhaseTransport_)
{
@ -145,7 +147,8 @@ Foam::compressibleInterPhaseThermophysicalTransportModel::kappaEff
Foam::tmp<Foam::volScalarField>
Foam::compressibleInterPhaseThermophysicalTransportModel::alphaEff() const
{
const compressibleTwoPhaseMixture& mixture_ = momentumTransport_.mixture_;
const compressibleTwoPhaseVoFMixture& mixture_ =
momentumTransport_.mixture_;
if (momentumTransport_.twoPhaseTransport_)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,7 +36,7 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel
const surfaceScalarField& alphaPhi1,
const surfaceScalarField& alphaRhoPhi1,
const surfaceScalarField& alphaRhoPhi2,
const compressibleTwoPhaseMixture& mixture
const compressibleTwoPhaseVoFMixture& mixture
)
:
twoPhaseTransport_(false),

View File

@ -44,7 +44,7 @@ SourceFiles
#ifndef compressibleInterPhaseTransportModel_H
#define compressibleInterPhaseTransportModel_H
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "compressibleMomentumTransportModels.H"
#include "phaseCompressibleMomentumTransportModel.H"
@ -67,7 +67,7 @@ class compressibleInterPhaseTransportModel
Switch twoPhaseTransport_;
//- Two-phase mixture
const compressibleTwoPhaseMixture& mixture_;
const compressibleTwoPhaseVoFMixture& mixture_;
//- Mixture volumetric flux
const surfaceScalarField& phi_;
@ -107,7 +107,7 @@ public:
const surfaceScalarField& alphaPhi1,
const surfaceScalarField& alphaRhoPhi1,
const surfaceScalarField& alphaRhoPhi2,
const compressibleTwoPhaseMixture& mixture
const compressibleTwoPhaseVoFMixture& mixture
);
//- Disallow default bitwise copy construction

View File

@ -23,19 +23,19 @@ License
\*---------------------------------------------------------------------------*/
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(compressibleTwoPhaseMixture, 0);
defineTypeNameAndDebug(compressibleTwoPhaseVoFMixture, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture
Foam::compressibleTwoPhaseVoFMixture::compressibleTwoPhaseVoFMixture
(
const fvMesh& mesh
)
@ -155,13 +155,13 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::compressibleTwoPhaseMixture::~compressibleTwoPhaseMixture()
Foam::compressibleTwoPhaseVoFMixture::~compressibleTwoPhaseVoFMixture()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::compressibleTwoPhaseMixture::correctThermo()
void Foam::compressibleTwoPhaseVoFMixture::correctThermo()
{
thermo1_->T() = T_;
thermo1_->he() = thermo1_->he(p_, T_);
@ -173,7 +173,7 @@ void Foam::compressibleTwoPhaseMixture::correctThermo()
}
void Foam::compressibleTwoPhaseMixture::correct()
void Foam::compressibleTwoPhaseVoFMixture::correct()
{
const volScalarField alphaRho1(alpha1()*thermo1_->rho());
const volScalarField alphaRho2(alpha2()*thermo2_->rho());
@ -184,13 +184,13 @@ void Foam::compressibleTwoPhaseMixture::correct()
}
Foam::tmp<Foam::volScalarField> Foam::compressibleTwoPhaseMixture::nu() const
Foam::tmp<Foam::volScalarField> Foam::compressibleTwoPhaseVoFMixture::nu() const
{
return (alpha1()*thermo1_->mu() + alpha2()*thermo2_->mu())/rho_;
}
Foam::tmp<Foam::scalarField> Foam::compressibleTwoPhaseMixture::nu
Foam::tmp<Foam::scalarField> Foam::compressibleTwoPhaseVoFMixture::nu
(
const label patchi
) const
@ -203,7 +203,7 @@ Foam::tmp<Foam::scalarField> Foam::compressibleTwoPhaseMixture::nu
}
bool Foam::compressibleTwoPhaseMixture::read()
bool Foam::compressibleTwoPhaseVoFMixture::read()
{
if (twoPhaseVoFMixture::read())
{

View File

@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::compressibleTwoPhaseMixture
Foam::compressibleTwoPhaseVoFMixture
Description
Class to represent a mixture of two rhoThermo-based phases
SourceFiles
compressibleTwoPhaseMixture.C
compressibleTwoPhaseVoFMixture.C
\*---------------------------------------------------------------------------*/
#ifndef compressibleTwoPhaseMixture_H
#define compressibleTwoPhaseMixture_H
#ifndef compressibleTwoPhaseVoFMixture_H
#define compressibleTwoPhaseVoFMixture_H
#include "twoPhaseVoFMixture.H"
#include "compressibleTwoPhases.H"
@ -45,10 +45,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class compressibleTwoPhaseMixture Declaration
Class compressibleTwoPhaseVoFMixture Declaration
\*---------------------------------------------------------------------------*/
class compressibleTwoPhaseMixture
class compressibleTwoPhaseVoFMixture
:
public twoPhaseVoFMixture,
virtual public compressibleTwoPhases,
@ -85,17 +85,17 @@ class compressibleTwoPhaseMixture
public:
//- Runtime type information
TypeName("compressibleTwoPhaseMixture");
TypeName("compressibleTwoPhaseVoFMixture");
// Constructors
//- Construct from a mesh
compressibleTwoPhaseMixture(const fvMesh& mesh);
compressibleTwoPhaseVoFMixture(const fvMesh& mesh);
//- Destructor
virtual ~compressibleTwoPhaseMixture();
virtual ~compressibleTwoPhaseVoFMixture();
// Member Functions

View File

@ -47,10 +47,13 @@ Foam::solvers::compressibleVoF::compressibleVoF(fvMesh& mesh)
twoPhaseVoFSolver
(
mesh,
autoPtr<twoPhaseVoFMixture>(new compressibleTwoPhaseMixture(mesh))
autoPtr<twoPhaseVoFMixture>(new compressibleTwoPhaseVoFMixture(mesh))
),
mixture(refCast<compressibleTwoPhaseMixture>(twoPhaseVoFSolver::mixture)),
mixture
(
refCast<compressibleTwoPhaseVoFMixture>(twoPhaseVoFSolver::mixture)
),
p(mixture.p()),

View File

@ -59,7 +59,7 @@ See also
#define compressibleVoF_H
#include "twoPhaseVoFSolver.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "compressibleInterPhaseTransportModel.H"
#include "compressibleInterPhaseThermophysicalTransportModel.H"
#include "buoyancy.H"
@ -87,7 +87,7 @@ protected:
// Phase properties
//- The compressible two-phase mixture
compressibleTwoPhaseMixture& mixture;
compressibleTwoPhaseVoFMixture& mixture;
// Thermophysical properties

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFCavitation.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "fvmSup.H"
#include "addToRunTimeSelectionTable.H"
@ -63,7 +63,7 @@ Foam::fv::compressible::VoFCavitation::VoFCavitation
mixture_
(
mesh.lookupObjectRef<compressibleTwoPhaseMixture>
mesh.lookupObjectRef<compressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,7 +86,7 @@ SourceFiles
namespace Foam
{
class compressibleTwoPhaseMixture;
class compressibleTwoPhaseVoFMixture;
namespace fv
{
@ -104,7 +104,7 @@ class VoFCavitation
// Private Data
//- Reference to the mixture properties
const compressibleTwoPhaseMixture& mixture_;
const compressibleTwoPhaseVoFMixture& mixture_;
autoPtr<Foam::compressible::cavitationModel> cavitation_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFClouds.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "fvmSup.H"
#include "uniformDimensionedFields.H"
#include "addToRunTimeSelectionTable.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFSolidificationMeltingSource.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "fvcDdt.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
@ -61,9 +61,9 @@ void Foam::fv::VoFSolidificationMeltingSource::readCoeffs()
Foam::word Foam::fv::VoFSolidificationMeltingSource::alphaSolidName() const
{
const compressibleTwoPhaseMixture& thermo
const compressibleTwoPhaseVoFMixture& thermo
(
mesh().lookupObject<compressibleTwoPhaseMixture>
mesh().lookupObject<compressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)
@ -95,7 +95,7 @@ Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
thermo_
(
mesh().lookupObject<compressibleTwoPhaseMixture>
mesh().lookupObject<compressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)
@ -185,9 +185,9 @@ void Foam::fv::VoFSolidificationMeltingSource::correct()
alphaSolid_.oldTime();
const compressibleTwoPhaseMixture& thermo
const compressibleTwoPhaseVoFMixture& thermo
(
mesh().lookupObject<compressibleTwoPhaseMixture>
mesh().lookupObject<compressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,7 +89,7 @@ SourceFiles
namespace Foam
{
class compressibleTwoPhaseMixture;
class compressibleTwoPhaseVoFMixture;
namespace fv
{
@ -123,7 +123,7 @@ class VoFSolidificationMeltingSource
scalar q_;
//- VoF thermo
const compressibleTwoPhaseMixture& thermo_;
const compressibleTwoPhaseVoFMixture& thermo_;
//- Solid phase fraction
mutable volScalarField alphaSolid_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFPatchTransfer.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "thermoSurfaceFilm.H"
#include "addToRunTimeSelectionTable.H"
@ -153,9 +153,9 @@ void VoFPatchTransfer::correct
const polyBoundaryMesh& pbm = film.mesh().boundaryMesh();
const compressibleTwoPhaseMixture& thermo
const compressibleTwoPhaseVoFMixture& thermo
(
film.primaryMesh().lookupObject<compressibleTwoPhaseMixture>
film.primaryMesh().lookupObject<compressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFSurfaceFilm.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "fvmSup.H"
#include "uniformDimensionedFields.H"
#include "addToRunTimeSelectionTable.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFTurbulenceDamping.H"
#include "compressibleTwoPhaseMixture.H"
#include "compressibleTwoPhaseVoFMixture.H"
#include "compressibleMomentumTransportModel.H"
#include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H"
@ -65,7 +65,7 @@ Foam::fv::compressible::VoFTurbulenceDamping::VoFTurbulenceDamping
delta_("delta", dimLength, dict),
mixture_
(
mesh.lookupObject<compressibleTwoPhaseMixture>
mesh.lookupObject<compressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,7 +81,7 @@ SourceFiles
namespace Foam
{
class compressibleTwoPhaseMixture;
class compressibleTwoPhaseVoFMixture;
class compressibleMomentumTransportModel;
namespace fv
@ -110,7 +110,7 @@ class VoFTurbulenceDamping
dimensionedScalar delta_;
//- Reference to the mixture properties
const compressibleTwoPhaseMixture& mixture_;
const compressibleTwoPhaseVoFMixture& mixture_;
//- Reference to the mixture momentumTransport model
const compressibleMomentumTransportModel& momentumTransport_;

View File

@ -1,4 +1,4 @@
incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
incompressibleTwoPhaseVoFMixture/incompressibleTwoPhaseVoFMixture.C
incompressibleInterPhaseTransportModel/incompressibleInterPhaseTransportModel.C
alphaSuSp.C
pressureCorrector.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFCavitation.H"
#include "incompressibleTwoPhaseMixture.H"
#include "incompressibleTwoPhaseVoFMixture.H"
#include "fvcDdt.H"
#include "fvcDiv.H"
#include "fvmSup.H"
@ -62,7 +62,7 @@ Foam::fv::VoFCavitation::VoFCavitation
mixture_
(
mesh.lookupObjectRef<incompressibleTwoPhaseMixture>
mesh.lookupObjectRef<incompressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,7 +86,7 @@ SourceFiles
namespace Foam
{
class incompressibleTwoPhaseMixture;
class incompressibleTwoPhaseVoFMixture;
namespace fv
{
@ -102,7 +102,7 @@ class VoFCavitation
// Private Data
//- Reference to the mixture properties
const incompressibleTwoPhaseMixture& mixture_;
const incompressibleTwoPhaseVoFMixture& mixture_;
autoPtr<cavitationModel> cavitation_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VoFTurbulenceDamping.H"
#include "incompressibleTwoPhaseMixture.H"
#include "incompressibleTwoPhaseVoFMixture.H"
#include "incompressibleMomentumTransportModel.H"
#include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H"
@ -62,7 +62,7 @@ Foam::fv::VoFTurbulenceDamping::VoFTurbulenceDamping
delta_("delta", dimLength, dict),
mixture_
(
mesh.lookupObject<incompressibleTwoPhaseMixture>
mesh.lookupObject<incompressibleTwoPhaseVoFMixture>
(
"phaseProperties"
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,7 +81,7 @@ SourceFiles
namespace Foam
{
class incompressibleTwoPhaseMixture;
class incompressibleTwoPhaseVoFMixture;
class incompressibleMomentumTransportModel;
namespace fv
@ -108,7 +108,7 @@ class VoFTurbulenceDamping
dimensionedScalar delta_;
//- Reference to the mixture properties
const incompressibleTwoPhaseMixture& mixture_;
const incompressibleTwoPhaseVoFMixture& mixture_;
//- Reference to the mixture turbulence model
const incompressibleMomentumTransportModel& turbulence_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,7 +33,7 @@ incompressibleInterPhaseTransportModel
const volVectorField& U,
const surfaceScalarField& phi,
const surfaceScalarField& alphaPhi1,
const incompressibleTwoPhaseMixture& mixture
const incompressibleTwoPhaseVoFMixture& mixture
)
:
twoPhaseTransport_(false),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,7 @@ SourceFiles
#ifndef incompressibleInterPhaseTransportModel_H
#define incompressibleInterPhaseTransportModel_H
#include "incompressibleTwoPhaseMixture.H"
#include "incompressibleTwoPhaseVoFMixture.H"
#include "incompressibleMomentumTransportModels.H"
#include "phaseIncompressibleMomentumTransportModel.H"
@ -64,7 +64,7 @@ class incompressibleInterPhaseTransportModel
Switch twoPhaseTransport_;
//- Two-phase mixture
const incompressibleTwoPhaseMixture& mixture_;
const incompressibleTwoPhaseVoFMixture& mixture_;
//- Mixture volumetric flux
const surfaceScalarField& phi_;
@ -95,7 +95,7 @@ public:
const volVectorField& U,
const surfaceScalarField& phi,
const surfaceScalarField& alphaPhi1,
const incompressibleTwoPhaseMixture& mixture
const incompressibleTwoPhaseVoFMixture& mixture
);
//- Disallow default bitwise copy construction

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "incompressibleTwoPhaseMixture.H"
#include "incompressibleTwoPhaseVoFMixture.H"
#include "surfaceInterpolate.H"
#include "addToRunTimeSelectionTable.H"
@ -31,13 +31,13 @@ License
namespace Foam
{
defineTypeNameAndDebug(incompressibleTwoPhaseMixture, 0);
defineTypeNameAndDebug(incompressibleTwoPhaseVoFMixture, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
Foam::incompressibleTwoPhaseVoFMixture::incompressibleTwoPhaseVoFMixture
(
const fvMesh& mesh
)
@ -84,7 +84,7 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::incompressibleTwoPhaseMixture::mu() const
Foam::incompressibleTwoPhaseVoFMixture::mu() const
{
const volScalarField limitedAlpha1
(
@ -101,7 +101,7 @@ Foam::incompressibleTwoPhaseMixture::mu() const
Foam::tmp<Foam::surfaceScalarField>
Foam::incompressibleTwoPhaseMixture::muf() const
Foam::incompressibleTwoPhaseVoFMixture::muf() const
{
const surfaceScalarField alpha1f
(
@ -118,7 +118,7 @@ Foam::incompressibleTwoPhaseMixture::muf() const
Foam::tmp<Foam::surfaceScalarField>
Foam::incompressibleTwoPhaseMixture::nuf() const
Foam::incompressibleTwoPhaseVoFMixture::nuf() const
{
const surfaceScalarField alpha1f
(
@ -136,7 +136,7 @@ Foam::incompressibleTwoPhaseMixture::nuf() const
}
bool Foam::incompressibleTwoPhaseMixture::read()
bool Foam::incompressibleTwoPhaseVoFMixture::read()
{
if (twoPhaseVoFMixture::read())
{
@ -152,7 +152,7 @@ bool Foam::incompressibleTwoPhaseMixture::read()
}
void Foam::incompressibleTwoPhaseMixture::correct()
void Foam::incompressibleTwoPhaseVoFMixture::correct()
{
rho_ = alpha1()*rho1_ + alpha2()*rho2_;

View File

@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::incompressibleTwoPhaseMixture
Foam::incompressibleTwoPhaseVoFMixture
Description
Class to represent a mixture of two constant density phases
SourceFiles
incompressibleTwoPhaseMixture.C
incompressibleTwoPhaseVoFMixture.C
\*---------------------------------------------------------------------------*/
#ifndef incompressibleTwoPhaseMixture_H
#define incompressibleTwoPhaseMixture_H
#ifndef incompressibleTwoPhaseVoFMixture_H
#define incompressibleTwoPhaseVoFMixture_H
#include "twoPhaseVoFMixture.H"
#include "incompressibleTwoPhases.H"
@ -45,10 +45,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class incompressibleTwoPhaseMixture Declaration
Class incompressibleTwoPhaseVoFMixture Declaration
\*---------------------------------------------------------------------------*/
class incompressibleTwoPhaseMixture
class incompressibleTwoPhaseVoFMixture
:
public twoPhaseVoFMixture,
virtual public incompressibleTwoPhases,
@ -77,17 +77,17 @@ class incompressibleTwoPhaseMixture
public:
TypeName("incompressibleTwoPhaseMixture");
TypeName("incompressibleTwoPhaseVoFMixture");
// Constructors
//- Construct from a mesh
incompressibleTwoPhaseMixture(const fvMesh& mesh);
incompressibleTwoPhaseVoFMixture(const fvMesh& mesh);
//- Destructor
virtual ~incompressibleTwoPhaseMixture()
virtual ~incompressibleTwoPhaseVoFMixture()
{}

View File

@ -48,10 +48,13 @@ Foam::solvers::incompressibleVoF::incompressibleVoF(fvMesh& mesh)
twoPhaseVoFSolver
(
mesh,
autoPtr<twoPhaseVoFMixture>(new incompressibleTwoPhaseMixture(mesh))
autoPtr<twoPhaseVoFMixture>(new incompressibleTwoPhaseVoFMixture(mesh))
),
mixture(refCast<incompressibleTwoPhaseMixture>(twoPhaseVoFSolver::mixture)),
mixture
(
refCast<incompressibleTwoPhaseVoFMixture>(twoPhaseVoFSolver::mixture)
),
p
(
@ -152,6 +155,11 @@ void Foam::solvers::incompressibleVoF::prePredictor()
// Calculate the mass-flux from the accumulated alphaPhi1
rhoPhi = (alphaPhi1*(rho1 - rho2) + phi*rho2);
if (pimple.predictTransport())
{
momentumTransport.predict();
}
}
@ -159,4 +167,13 @@ void Foam::solvers::incompressibleVoF::thermophysicalPredictor()
{}
void Foam::solvers::incompressibleVoF::postCorrector()
{
if (pimple.correctTransport())
{
momentumTransport.correct();
}
}
// ************************************************************************* //

View File

@ -59,7 +59,7 @@ See also
#define incompressibleVoF_H
#include "twoPhaseVoFSolver.H"
#include "incompressibleTwoPhaseMixture.H"
#include "incompressibleTwoPhaseVoFMixture.H"
#include "incompressibleInterPhaseTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -83,7 +83,7 @@ protected:
// Phase properties
//- The compressible two-phase mixture
incompressibleTwoPhaseMixture& mixture;
incompressibleTwoPhaseVoFMixture& mixture;
// Thermophysical properties
@ -165,6 +165,9 @@ public:
//- Construct and solve the pressure equation in the PISO loop
virtual void pressureCorrector();
//- Correct the momentum and thermophysical transport modelling
virtual void postCorrector();
// Member Operators

View File

@ -65,7 +65,7 @@ void Foam::solvers::twoPhaseVoFSolver::correctCoNum()
void Foam::solvers::twoPhaseVoFSolver::correctInterface()
{
return interface.correct();
interface.correct();
}

View File

@ -58,9 +58,6 @@ See also
#include "VoFSolver.H"
#include "twoPhaseVoFMixture.H"
#include "interfaceProperties.H"
#include "buoyancy.H"
#include "pressureReference.H"
#include "IOMRFZoneList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,256 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-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 "multiphaseMixture.H"
#include "alphaContactAngleFvPatchScalarField.H"
#include "correctContactAngle.H"
#include "surfaceInterpolate.H"
#include "fvcGrad.H"
#include "fvcSnGrad.H"
#include "fvcDiv.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::multiphaseMixture::calcAlphas()
{
scalar level = 0.0;
alphas_ == 0.0;
forAll(phases_, phasei)
{
alphas_ += level*phases_[phasei];
level += 1.0;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::multiphaseMixture::multiphaseMixture(const fvMesh& mesh)
:
IOdictionary
(
IOobject
(
"phaseProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
phases_(PtrListDictionary<phase>(10)),
// phases_(lookup("phases"), phase::iNew(mesh)),
mesh_(mesh),
alphas_
(
IOobject
(
"alphas",
mesh_.time().name(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar(dimless, 0)
),
sigmas_(lookup("sigmas")),
dimSigma_(1, 0, -2, 0, 0),
deltaN_
(
"deltaN",
1e-8/pow(average(mesh_.V()), 1.0/3.0)
)
{
calcAlphas();
alphas_.write();
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::surfaceScalarField>
Foam::multiphaseMixture::surfaceTensionForce(const volVectorField& U) const
{
tmp<surfaceScalarField> tstf
(
surfaceScalarField::New
(
"surfaceTensionForce",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
);
surfaceScalarField& stf = tstf.ref();
forAll(phases_, phasei)
{
const incompressiblePhase& alpha1 = phases_[phasei];
for (label phasej = phasei+1; phasej<phases_.size(); phasej++)
{
const incompressiblePhase& alpha2 = phases_[phasej];
sigmaTable::const_iterator sigma =
sigmas_.find(interfacePair(alpha1, alpha2));
if (sigma == sigmas_.end())
{
FatalErrorInFunction
<< "Cannot find interface " << interfacePair(alpha1, alpha2)
<< " in list of sigma values"
<< exit(FatalError);
}
stf += dimensionedScalar(dimSigma_, sigma())
*fvc::interpolate(K(alpha1, alpha2))*
(
fvc::interpolate(alpha2)*fvc::snGrad(alpha1)
- fvc::interpolate(alpha1)*fvc::snGrad(alpha2)
);
}
}
return tstf;
}
void Foam::multiphaseMixture::correct()
{
forAll(phases_, phasei)
{
// iter()->correct();
}
}
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
/*
// Cell gradient of alpha
volVectorField gradAlpha =
alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
// Interpolated face-gradient of alpha
surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
*/
surfaceVectorField gradAlphaf
(
fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1))
- fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
);
// Face unit interface normal
return gradAlphaf/(mag(gradAlphaf) + deltaN_);
}
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const
{
// Face unit interface normal flux
return nHatfv(alpha1, alpha2) & mesh_.Sf();
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
(
const phase& alpha1,
const phase& alpha2,
const volVectorField& U
) const
{
tmp<surfaceVectorField> tnHatfv = nHatfv(alpha1, alpha2);
correctContactAngle
(
alpha1,
alpha2,
U.boundaryField(),
deltaN_,
tnHatfv.ref().boundaryFieldRef()
);
// Simple expression for curvature
return -fvc::div(tnHatfv & mesh_.Sf());
}
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::nearInterface() const
{
tmp<volScalarField> tnearInt
(
volScalarField::New
(
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)
);
forAll(phases_, phasei)
{
tnearInt.ref() = max
(
tnearInt(),
pos0(phases_[phasei] - 0.01)*pos0(0.99 - phases_[phasei])
);
}
return tnearInt;
}
bool Foam::multiphaseMixture::read()
{
if (regIOobject::read())
{
lookup("sigmas") >> sigmas_;
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -1,222 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-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::multiphaseMixture
Description
Incompressible multiphase mixture with built in solution for the
phase fractions with interface compression for interface-capturing.
Derived from viscosity so that it can be used in conjunction
with the incompressible turbulence models.
Surface tension and contact-angle is handled for the interface
between each phase-pair.
SourceFiles
multiphaseMixture.C
\*---------------------------------------------------------------------------*/
#ifndef multiphaseMixture_H
#define multiphaseMixture_H
#include "viscosity.H"
#include "IOdictionary.H"
#include "phase.H"
#include "UPtrListDictionary.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class multiphaseMixture Declaration
\*---------------------------------------------------------------------------*/
class multiphaseMixture
:
public IOdictionary
{
public:
class interfacePair
:
public Pair<word>
{
public:
class hash
:
public Hash<interfacePair>
{
public:
hash()
{}
label operator()(const interfacePair& key) const
{
return word::hash()(key.first()) + word::hash()(key.second());
}
};
// Constructors
interfacePair()
{}
interfacePair(const word& alpha1Name, const word& alpha2Name)
:
Pair<word>(alpha1Name, alpha2Name)
{}
interfacePair(const phase& alpha1, const phase& alpha2)
:
Pair<word>(alpha1.name(), alpha2.name())
{}
// Friend Operators
friend bool operator==
(
const interfacePair& a,
const interfacePair& b
)
{
return
(
((a.first() == b.first()) && (a.second() == b.second()))
|| ((a.first() == b.second()) && (a.second() == b.first()))
);
}
friend bool operator!=
(
const interfacePair& a,
const interfacePair& b
)
{
return (!(a == b));
}
};
private:
// Private Data
//- Dictionary of phases
UPtrListDictionary<phase> phases_;
const fvMesh& mesh_;
volScalarField alphas_;
typedef HashTable<scalar, interfacePair, interfacePair::hash>
sigmaTable;
sigmaTable sigmas_;
dimensionSet dimSigma_;
//- Stabilisation for normalisation of the interface normal
const dimensionedScalar deltaN_;
// Private Member Functions
void calcAlphas();
tmp<surfaceVectorField> nHatfv
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
tmp<surfaceScalarField> nHatf
(
const volScalarField& alpha1,
const volScalarField& alpha2
) const;
tmp<volScalarField> K
(
const phase& alpha1,
const phase& alpha2,
const volVectorField& U
) const;
public:
// Constructors
//- Construct from fvMesh
multiphaseMixture(const fvMesh& mesh);
//- Destructor
virtual ~multiphaseMixture()
{}
// Member Functions
//- Return the phases
const UPtrListDictionary<phase>& phases() const
{
return phases_;
}
tmp<surfaceScalarField> surfaceTensionForce
(
const volVectorField& U
) const;
//- Indicator of the proximity of the interface
// Field values are 1 near and 0 away for the interface.
tmp<volScalarField> nearInterface() const;
//- Correct the mixture properties
void correct();
//- Read base phaseProperties dictionary
bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //