mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Add interPhaseChangeFoam solver
This commit is contained in:
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Kunz.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
defineTypeNameAndDebug(Kunz, 0);
|
||||
addToRunTimeSelectionTable(phaseChangeTwoPhaseMixture, Kunz, components);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseChangeTwoPhaseMixtures::Kunz::Kunz
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
)
|
||||
:
|
||||
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
|
||||
|
||||
UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")),
|
||||
tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")),
|
||||
Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")),
|
||||
Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0),
|
||||
|
||||
mcCoeff_(Cc_*rho2()/tInf_),
|
||||
mvCoeff_(Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
mcCoeff_*sqr(limitedAlpha1)
|
||||
*max(p - pSat(), p0_)/max(p - pSat(), 0.01*pSat()),
|
||||
|
||||
mvCoeff_*min(p - pSat(), p0_)
|
||||
);
|
||||
}
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
mcCoeff_*sqr(limitedAlpha1)*(1.0 - limitedAlpha1)
|
||||
*pos(p - pSat())/max(p - pSat(), 0.01*pSat()),
|
||||
|
||||
(-mvCoeff_)*limitedAlpha1*neg(p - pSat())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseChangeTwoPhaseMixtures::Kunz::correct()
|
||||
{}
|
||||
|
||||
|
||||
bool Foam::phaseChangeTwoPhaseMixtures::Kunz::read()
|
||||
{
|
||||
if (phaseChangeTwoPhaseMixture::read())
|
||||
{
|
||||
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
|
||||
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_;
|
||||
|
||||
mcCoeff_ = Cc_*rho2()/tInf_;
|
||||
mvCoeff_ = Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,135 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 Generac License as published by the
|
||||
Free Software Foundation; either 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the ho it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy oNU General Public License
|
||||
along with OpenFOAM; if not, write Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floorn, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::phaseChangeTwoPhaseMixtures::Kunz
|
||||
|
||||
Description
|
||||
Kunz cavitation model slightly modified so that the condensation term
|
||||
is switched off when the pressure is less than the saturation vapour
|
||||
pressure. This change allows the condensation term to be formulated as
|
||||
a coefficient multiplying (p - p_sat) so that it can be included as an
|
||||
implicit term in the pressure equation.
|
||||
|
||||
Reference:
|
||||
@verbatim
|
||||
Kunz, R.F., Boger, D.A., Stinebring, D.R., Chyczewski, Lindau. J.W.,
|
||||
Gibeling, H.J., Venkateswaran, S., Govindan, T.R.,
|
||||
“A Preconditioned Implicit Method for Two-Phase Flows with Application
|
||||
to Cavitation Prediction,”
|
||||
Computers and Fluids,
|
||||
29(8):849-875, 2000.
|
||||
@verbatim
|
||||
|
||||
SourceFiles
|
||||
Kunz.C
|
||||
|
||||
\*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Kunz_H
|
||||
#define Kunz_H
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
|
||||
/*--------------------------------------------------------------------*\
|
||||
Class Kunz
|
||||
\*--------------------------------------------------------------------*/
|
||||
|
||||
class Kunz
|
||||
:
|
||||
public phaseChangeTwoPhaseMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar UInf_;
|
||||
dimensionedScalar tInf_;
|
||||
dimensionedScalar Cc_;
|
||||
dimensionedScalar Cv_;
|
||||
|
||||
dimensionedScalar p0_;
|
||||
|
||||
dimensionedScalar mcCoeff_;
|
||||
dimensionedScalar mvCoeff_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Kunz");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Kunz
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name = "alpha1"
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~Kunz()
|
||||
{}
|
||||
|
||||
|
||||
// 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 an
|
||||
// explicit term for the condensation rate and a coefficient to
|
||||
// multiply (p - pSat) for the vaporisation rate
|
||||
virtual Pair<tmp<volScalarField> > mDotP() const;
|
||||
|
||||
//- Correct the Kunz phaseChange model
|
||||
virtual void correct();
|
||||
|
||||
//- Read the transportProperties dictionary and update
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace phaseChangeTwoPhaseMixtures
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,75 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Merkle.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
defineTypeNameAndDebug(Merkle, 0);
|
||||
addToRunTimeSelectionTable(phaseChangeTwoPhaseMixture, Merkle, components);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseChangeTwoPhaseMixtures::Merkle::Merkle
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
)
|
||||
:
|
||||
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
|
||||
|
||||
UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")),
|
||||
tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")),
|
||||
Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")),
|
||||
Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0),
|
||||
|
||||
mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_)),
|
||||
mvCoeff_(Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotAlphal() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
mcCoeff_*max(p - pSat(), p0_),
|
||||
@ -0,0 +1,121 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Merkle.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
defineTypeNameAndDebug(Merkle, 0);
|
||||
addToRunTimeSelectionTable(phaseChangeTwoPhaseMixture, Merkle, components);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseChangeTwoPhaseMixtures::Merkle::Merkle
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
)
|
||||
:
|
||||
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
|
||||
|
||||
UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")),
|
||||
tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")),
|
||||
Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")),
|
||||
Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0),
|
||||
|
||||
mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_)),
|
||||
mvCoeff_(Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotAlphal() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
mcCoeff_*max(p - pSat(), p0_),
|
||||
mvCoeff_*min(p - pSat(), p0_)
|
||||
);
|
||||
}
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
mcCoeff_*(1.0 - limitedAlpha1)*pos(p - pSat()),
|
||||
(-mvCoeff_)*limitedAlpha1*neg(p - pSat())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseChangeTwoPhaseMixtures::Merkle::correct()
|
||||
{}
|
||||
|
||||
|
||||
bool Foam::phaseChangeTwoPhaseMixtures::Merkle::read()
|
||||
{
|
||||
if (phaseChangeTwoPhaseMixture::read())
|
||||
{
|
||||
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
|
||||
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_;
|
||||
|
||||
mcCoeff_ = Cc_/(0.5*sqr(UInf_)*tInf_);
|
||||
mvCoeff_ = Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,129 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========Merkle= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 Generac License as published by the
|
||||
Free Software Foundation; either 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the ho it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy oNU General Public License
|
||||
along with OpenFOAM; if not, write Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floorn, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::phaseChangeTwoPhaseMixtures::Merkle
|
||||
|
||||
Description
|
||||
Merkle cavitation model.
|
||||
|
||||
Reference:
|
||||
@verbatim
|
||||
C. L. Merkle, J. Feng, and P. E. O. Buelow,
|
||||
"Computational modeling of the dynamics of sheet cavitation",
|
||||
in Proceedings Third International Symposium on Cavitation
|
||||
Grenoble, France 1998.
|
||||
@verbatim
|
||||
|
||||
SourceFiles
|
||||
Merkle.C
|
||||
|
||||
\*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Merkle_H
|
||||
#define Merkle_H
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
|
||||
/*--------------------------------------------------------------------*\
|
||||
Class Merkle
|
||||
\*--------------------------------------------------------------------*/
|
||||
|
||||
class Merkle
|
||||
:
|
||||
public phaseChangeTwoPhaseMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar UInf_;
|
||||
dimensionedScalar tInf_;
|
||||
dimensionedScalar Cc_;
|
||||
dimensionedScalar Cv_;
|
||||
|
||||
dimensionedScalar p0_;
|
||||
|
||||
dimensionedScalar mcCoeff_;
|
||||
dimensionedScalar mvCoeff_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Merkle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Merkle
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name = "alpha1"
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~Merkle()
|
||||
{}
|
||||
|
||||
|
||||
// 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 an
|
||||
// explicit term for the condensation rate and a coefficient to
|
||||
// multiply (p - pSat) for the vaporisation rate
|
||||
virtual Pair<tmp<volScalarField> > mDotP() const;
|
||||
|
||||
//- Correct the Merkle phaseChange model
|
||||
virtual void correct();
|
||||
|
||||
//- Read the transportProperties dictionary and update
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace phaseChangeTwoPhaseMixtures
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,169 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SchnerrSauer.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
defineTypeNameAndDebug(SchnerrSauer, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
phaseChangeTwoPhaseMixture,
|
||||
SchnerrSauer,
|
||||
components
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::SchnerrSauer
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
)
|
||||
:
|
||||
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
|
||||
|
||||
n_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("n")),
|
||||
dNuc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc")),
|
||||
Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")),
|
||||
Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")),
|
||||
|
||||
p0_("0", pSat().dimensions(), 0.0)
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::rRb
|
||||
(
|
||||
const volScalarField& limitedAlpha1
|
||||
) const
|
||||
{
|
||||
return pow
|
||||
(
|
||||
((4*mathematicalConstant::pi*n_)/3)
|
||||
*limitedAlpha1/(1.0 + alphaNuc() - limitedAlpha1),
|
||||
1.0/3.0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::dimensionedScalar
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::alphaNuc() const
|
||||
{
|
||||
dimensionedScalar Vnuc = n_*mathematicalConstant::pi*pow3(dNuc_)/6;
|
||||
return Vnuc/(1 + Vnuc);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff
|
||||
(
|
||||
const volScalarField& p
|
||||
) const
|
||||
{
|
||||
volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
|
||||
volScalarField rho =
|
||||
(limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2());
|
||||
|
||||
return
|
||||
(3*rho1()*rho2())*sqrt(2/(3*rho1()))
|
||||
*rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));
|
||||
}
|
||||
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
|
||||
|
||||
volScalarField pCoeff = this->pCoeff(p);
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
Cc_*limitedAlpha1*pCoeff*max(p - pSat(), p0_),
|
||||
|
||||
Cv_*(1.0 + alphaNuc() - limitedAlpha1)*pCoeff*min(p - pSat(), p0_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const
|
||||
{
|
||||
const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
|
||||
volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
|
||||
|
||||
volScalarField apCoeff = limitedAlpha1*pCoeff(p);
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
Cc_*(1.0 - limitedAlpha1)*pos(p - pSat())*apCoeff,
|
||||
|
||||
(-Cv_)*(1.0 + alphaNuc() - limitedAlpha1)*neg(p - pSat())*apCoeff
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::correct()
|
||||
{}
|
||||
|
||||
|
||||
bool Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::read()
|
||||
{
|
||||
if (phaseChangeTwoPhaseMixture::read())
|
||||
{
|
||||
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
|
||||
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("n") >> n_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc") >> dNuc_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_;
|
||||
phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========Merkle= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 Generac License as published by the
|
||||
Free Software Foundation; either 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the ho it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy oNU General Public License
|
||||
along with OpenFOAM; if not, write Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floorn, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer
|
||||
|
||||
Description
|
||||
SchnerrSauer cavitation model.
|
||||
|
||||
Reference:
|
||||
@verbatim
|
||||
Schnerr, G. H., And Sauer, J.,
|
||||
"Physical and Numerical Modeling of Unsteady Cavitation Dynamics",
|
||||
Proc. 4th International Conference on Multiphase Flow,
|
||||
New Orleans, U.S.A., 2001.
|
||||
@verbatim
|
||||
|
||||
SourceFiles
|
||||
SchnerrSauer.C
|
||||
|
||||
\*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SchnerrSauer_H
|
||||
#define SchnerrSauer_H
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace phaseChangeTwoPhaseMixtures
|
||||
{
|
||||
|
||||
/*--------------------------------------------------------------------*\
|
||||
Class SchnerrSauer
|
||||
\*--------------------------------------------------------------------*/
|
||||
|
||||
class SchnerrSauer
|
||||
:
|
||||
public phaseChangeTwoPhaseMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Bubble number density
|
||||
dimensionedScalar n_;
|
||||
|
||||
//- Nucleation site diameter
|
||||
dimensionedScalar dNuc_;
|
||||
|
||||
//- Condensation rate coefficient
|
||||
dimensionedScalar Cc_;
|
||||
|
||||
//- Vapourisation rate coefficient
|
||||
dimensionedScalar Cv_;
|
||||
|
||||
dimensionedScalar p0_;
|
||||
|
||||
//- Nucleation site volume-fraction
|
||||
dimensionedScalar alphaNuc() const;
|
||||
|
||||
//- Reciprocal bubble radius
|
||||
tmp<volScalarField>rRb(const volScalarField& limitedAlpha1) const;
|
||||
|
||||
//- Part of the condensation and vapourisation rates
|
||||
tmp<volScalarField> pCoeff(const volScalarField& p) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("SchnerrSauer");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
SchnerrSauer
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name = "alpha1"
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~SchnerrSauer()
|
||||
{}
|
||||
|
||||
|
||||
// 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 an
|
||||
// explicit term for the condensation rate and a coefficient to
|
||||
// multiply (p - pSat) for the vaporisation rate
|
||||
virtual Pair<tmp<volScalarField> > mDotP() const;
|
||||
|
||||
//- Correct the SchnerrSauer phaseChange model
|
||||
virtual void correct();
|
||||
|
||||
//- Read the transportProperties dictionary and update
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace phaseChangeTwoPhaseMixtures
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
#include "twoPhaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>
|
||||
Foam::phaseChangeTwoPhaseMixture::New
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
)
|
||||
{
|
||||
IOdictionary transportPropertiesDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
U.time().constant(),
|
||||
U.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
word phaseChangeTwoPhaseMixtureTypeName
|
||||
(
|
||||
transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture")
|
||||
);
|
||||
|
||||
Info<< "Selecting phaseChange model "
|
||||
<< phaseChangeTwoPhaseMixtureTypeName << endl;
|
||||
|
||||
componentsConstructorTable::iterator cstrIter =
|
||||
componentsConstructorTablePtr_
|
||||
->find(phaseChangeTwoPhaseMixtureTypeName);
|
||||
|
||||
if (cstrIter == componentsConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"phaseChangeTwoPhaseMixture::New"
|
||||
) << "Unknown phaseChangeTwoPhaseMixture type "
|
||||
<< phaseChangeTwoPhaseMixtureTypeName << endl << endl
|
||||
<< "Valid phaseChangeTwoPhaseMixtures are : " << endl
|
||||
<< componentsConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi, alpha1Name));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(phaseChangeTwoPhaseMixture, 0);
|
||||
defineRunTimeSelectionTable(phaseChangeTwoPhaseMixture, components);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture
|
||||
(
|
||||
const word& type,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
)
|
||||
:
|
||||
twoPhaseMixture(U, phi, alpha1Name),
|
||||
phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")),
|
||||
pSat_(lookup("pSat"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixture::vDotAlphal() const
|
||||
{
|
||||
volScalarField alphalCoeff = 1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2());
|
||||
Pair<tmp<volScalarField> > mDotAlphal = this->mDotAlphal();
|
||||
|
||||
return Pair<tmp<volScalarField> >
|
||||
(
|
||||
alphalCoeff*mDotAlphal[0],
|
||||
alphalCoeff*mDotAlphal[1]
|
||||
);
|
||||
}
|
||||
|
||||
Foam::Pair<Foam::tmp<Foam::volScalarField> >
|
||||
Foam::phaseChangeTwoPhaseMixture::vDotP() const
|
||||
{
|
||||
dimensionedScalar pCoeff(1.0/rho1() - 1.0/rho2());
|
||||
Pair<tmp<volScalarField> > mDotP = this->mDotP();
|
||||
|
||||
return Pair<tmp<volScalarField> >(pCoeff*mDotP[0], pCoeff*mDotP[1]);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::phaseChangeTwoPhaseMixture::read()
|
||||
{
|
||||
if (twoPhaseMixture::read())
|
||||
{
|
||||
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
|
||||
lookup("pSat") >> pSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,175 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ 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 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::phaseChangeTwoPhaseMixture
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
phaseChangeTwoPhaseMixture.C
|
||||
newPhaseChangeModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef phaseChangeTwoPhaseMixture_H
|
||||
#define phaseChangeTwoPhaseMixture_H
|
||||
|
||||
#include "twoPhaseMixture.H"
|
||||
#include "typeInfo.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "volFields.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "autoPtr.H"
|
||||
#include "Pair.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class phaseChangeTwoPhaseMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class phaseChangeTwoPhaseMixture
|
||||
:
|
||||
public twoPhaseMixture
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
dictionary phaseChangeTwoPhaseMixtureCoeffs_;
|
||||
|
||||
//- Saturation vapour pressure
|
||||
dimensionedScalar pSat_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
phaseChangeTwoPhaseMixture(const phaseChangeTwoPhaseMixture&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const phaseChangeTwoPhaseMixture&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("phaseChangeTwoPhaseMixture");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
phaseChangeTwoPhaseMixture,
|
||||
components,
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
),
|
||||
(U, phi, alpha1Name)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected phaseChange model
|
||||
static autoPtr<phaseChangeTwoPhaseMixture> New
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
phaseChangeTwoPhaseMixture
|
||||
(
|
||||
const word& type,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name = "alpha1"
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~phaseChangeTwoPhaseMixture()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return const-access to the saturation vapour pressure
|
||||
const dimensionedScalar& pSat() const
|
||||
{
|
||||
return pSat_;
|
||||
}
|
||||
|
||||
//- 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 = 0;
|
||||
|
||||
//- Return the mass condensation and vaporisation rates as an
|
||||
// explicit term for the condensation rate and a coefficient to
|
||||
// multiply (p - pSat) for the vaporisation rate
|
||||
virtual Pair<tmp<volScalarField> > mDotP() const = 0;
|
||||
|
||||
//- Return the volumetric 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
|
||||
Pair<tmp<volScalarField> > vDotAlphal() const;
|
||||
|
||||
//- Return the volumetric condensation and vaporisation rates as an
|
||||
// explicit term for the condensation rate and a coefficient to
|
||||
// multiply (p - pSat) for the vaporisation rate
|
||||
Pair<tmp<volScalarField> > vDotP() const;
|
||||
|
||||
//- Correct the phaseChange model
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Read the transportProperties dictionary and update
|
||||
virtual bool read() = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user