multiphaseEuler: Use saturation models from the thermo library

The multiphaseEuler module now uses saturation models from the
centralised thermophysical properties library.

The control of these models is slightly different than for the previous
multiphaseEuler-specific saturation models. Where previously a
"saturationPressure" or "saturationTemperature" sub-dictionary was
employed, now "pSat" and "Tsat" entries are used which can be specified
flexibly in a similar manner to function1-s. See the previous commit for
details.
This commit is contained in:
Will Bainbridge
2022-11-16 15:22:39 +00:00
parent 5e8eb78e28
commit 9b373b2950
39 changed files with 135 additions and 1630 deletions

View File

@ -14,13 +14,7 @@ interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.C
interfaceCompositionModels/Raoult/Raoult.C
interfaceCompositionModels/saturated/saturated.C
saturationModels/saturationModel/saturationModel.C
saturationModels/saturationModel/saturationModelNew.C
saturationModels/Antoine/Antoine.C
saturationModels/AntoineExtended/AntoineExtended.C
saturationModels/ArdenBuck/ArdenBuck.C
saturationModels/polynomial/polynomial.C
saturationModels/function1/function1.C
saturationModels/constantSaturationConditions/constantSaturationConditions.C
interfaceSaturationTemperatureModel/interfaceSaturationTemperatureModel.C
interfaceSaturationTemperatureModel/interfaceSaturationTemperatureModelNew.C
LIB = $(FOAM_LIBBIN)/libeulerianInterfacialCompositionModels

View File

@ -5,6 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
@ -15,4 +16,4 @@ EXE_INC = \
LIB_LIBS = \
-lfluidThermophysicalModels \
-lmulticomponentThermophysicalModels \
-lspecie
-lsaturationModels

View File

@ -118,20 +118,18 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid
saturationModel12_.reset
(
saturationModel::New
saturationPressureModel::New
(
dict.subDict(species1Name_).subDict("interaction"),
interface,
false
"interaction",
dict.subDict(species1Name_)
).ptr()
);
saturationModel21_.reset
(
saturationModel::New
saturationPressureModel::New
(
dict.subDict(species2Name_).subDict("interaction"),
interface,
false
"interaction",
dict.subDict(species2Name_)
).ptr()
);

View File

@ -41,7 +41,7 @@ SourceFiles
#define nonRandomTwoLiquid_H
#include "interfaceCompositionModel.H"
#include "saturationModel.H"
#include "saturationPressureModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,10 +91,10 @@ class nonRandomTwoLiquid
dimensionedScalar beta21_;
//- Interaction parameter model for species 1
autoPtr<saturationModel> saturationModel12_;
autoPtr<saturationPressureModel> saturationModel12_;
//- Interaction parameter model for species 2
autoPtr<saturationModel> saturationModel21_;
autoPtr<saturationPressureModel> saturationModel21_;
//- Composition model for species 1
autoPtr<interfaceCompositionModel> speciesModel1_;

View File

@ -70,15 +70,7 @@ Foam::interfaceCompositionModels::saturated::saturated
interfaceCompositionModel(dict, interface),
saturatedName_(species()[0]),
saturatedIndex_(composition().species()[saturatedName_]),
saturationModel_
(
saturationModel::New
(
dict.subDict("saturationPressure"),
interface,
false
)
)
saturationModel_(saturationPressureModel::New("pSat", dict))
{
if (species().size() != 1)
{

View File

@ -37,7 +37,7 @@ SourceFiles
#define saturated_H
#include "interfaceCompositionModel.H"
#include "saturationModel.H"
#include "saturationPressureModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,7 +65,7 @@ protected:
label saturatedIndex_;
//- Saturation pressure model
autoPtr<saturationModel> saturationModel_;
autoPtr<saturationPressureModel> saturationModel_;
// Private Member Functions

View File

@ -23,20 +23,24 @@ License
\*---------------------------------------------------------------------------*/
#include "saturationModel.H"
#include "interfaceSaturationTemperatureModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(saturationModel, 0);
defineRunTimeSelectionTable(saturationModel, dictionary);
defineTypeNameAndDebug(interfaceSaturationTemperatureModel, 0);
defineRunTimeSelectionTable
(
interfaceSaturationTemperatureModel,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModel::saturationModel
Foam::interfaceSaturationTemperatureModel::interfaceSaturationTemperatureModel
(
const dictionary& dict,
const phaseInterface& interface
@ -46,30 +50,43 @@ Foam::saturationModel::saturationModel
(
IOobject
(
IOobject::groupName("saturationModel", interface.name()),
interface.mesh().time().constant(),
IOobject::groupName(typeName, interface.name()),
interface.mesh().time().timeName(),
interface.mesh()
)
),
saturationModel_(saturationTemperatureModel::New(dict)),
interface_(interface)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModel::~saturationModel()
Foam::interfaceSaturationTemperatureModel::
~interfaceSaturationTemperatureModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::phaseInterface& Foam::saturationModel::interface() const
const Foam::phaseInterface&
Foam::interfaceSaturationTemperatureModel::interface() const
{
return interface_;
}
bool Foam::saturationModel::writeData(Ostream& os) const
Foam::tmp<Foam::volScalarField>
Foam::interfaceSaturationTemperatureModel::Tsat
(
const volScalarField& p
) const
{
return saturationModel_->Tsat(p);
}
bool Foam::interfaceSaturationTemperatureModel::writeData(Ostream& os) const
{
return os.good();
}

View File

@ -22,25 +22,25 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::saturationModel
Foam::interfaceSaturationTemperatureModel
Description
Model to describe the dependence of saturation pressure on temperature, and
vice versa
Wrapper around saturationTemperatureModel to facilitate convenient
construction on interfaces
SourceFiles
saturationModel.C
saturationModelNew.C
interfaceSaturationTemperatureModel.C
interfaceSaturationTemperatureModelNew.C
\*---------------------------------------------------------------------------*/
#ifndef saturationModel_H
#define saturationModel_H
#ifndef interfaceSaturationTemperatureModel_H
#define interfaceSaturationTemperatureModel_H
#include "volFields.H"
#include "dictionary.H"
#include "phaseInterface.H"
#include "runTimeSelectionTables.H"
#include "saturationTemperatureModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,15 +48,18 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class saturationModel Declaration
Class interfaceSaturationTemperatureModel Declaration
\*---------------------------------------------------------------------------*/
class saturationModel
class interfaceSaturationTemperatureModel
:
public regIOobject
{
// Private Data
//- The saturation temperature model
autoPtr<saturationTemperatureModel> saturationModel_;
//- The interface
const phaseInterface interface_;
@ -64,14 +67,14 @@ class saturationModel
public:
//- Runtime type information
TypeName("saturationModel");
TypeName("saturationTemperatureModel");
//- Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
saturationModel,
interfaceSaturationTemperatureModel,
dictionary,
(
const dictionary& dict,
@ -84,25 +87,23 @@ public:
// Constructors
//- Construct from a dictionary and an interface
saturationModel
interfaceSaturationTemperatureModel
(
const dictionary& dict,
const phaseInterface& interface
);
// Selectors
static autoPtr<saturationModel> New
static autoPtr<interfaceSaturationTemperatureModel> New
(
const dictionary& dict,
const phaseInterface& interface,
const bool outer=true
);
//- Destructor
virtual ~saturationModel();
virtual ~interfaceSaturationTemperatureModel();
// Member Functions
@ -110,31 +111,10 @@ public:
//- Access the interface
const phaseInterface& interface() const;
//- Saturation pressure
virtual tmp<volScalarField> pSat
(
const volScalarField& T
) const = 0;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime
(
const volScalarField& T
) const = 0;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat
(
const volScalarField& T
) const = 0;
//- Saturation temperature
virtual tmp<volScalarField> Tsat
(
const volScalarField& p
) const = 0;
tmp<volScalarField> Tsat(const volScalarField& p) const;
//- Dummy write for regIOobject
// Dummy write for regIOobject
bool writeData(Ostream& os) const;
};

View File

@ -23,40 +23,32 @@ License
\*---------------------------------------------------------------------------*/
#include "saturationModel.H"
#include "interfaceSaturationTemperatureModel.H"
#include "phaseSystem.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::saturationModel> Foam::saturationModel::New
Foam::autoPtr<Foam::interfaceSaturationTemperatureModel>
Foam::interfaceSaturationTemperatureModel::New
(
const dictionary& dict,
const phaseInterface& interface,
const bool outer
)
{
DebugVar("**********");
const dictionary& modelDict =
outer ? interface.fluid().modelSubDict<saturationModel>(dict) : dict;
outer
? interface.fluid().modelSubDict
<interfaceSaturationTemperatureModel>(dict)
: dict;
const word saturationModelType(modelDict.lookup("type"));
Info<< "Selecting saturationModel for "
<< interface.name() << ": " << saturationModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(saturationModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown saturationModelType type "
<< saturationModelType << endl << endl
<< "Valid saturationModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(modelDict, interface);
return
autoPtr<interfaceSaturationTemperatureModel>
(
new interfaceSaturationTemperatureModel(modelDict, interface)
);
}

View File

@ -1,108 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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 "Antoine.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(Antoine, 0);
addToRunTimeSelectionTable(saturationModel, Antoine, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::Antoine::Antoine
(
const dictionary& dict,
const phaseInterface& interface
)
:
saturationModel(dict, interface),
A_("A", dimless, dict),
B_("B", dimTemperature, dict),
C_("C", dimTemperature, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::Antoine::~Antoine()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::pSat
(
const volScalarField& T
) const
{
return
dimensionedScalar(dimPressure, 1)
*exp(A_ + B_/(C_ + T));
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::pSatPrime
(
const volScalarField& T
) const
{
return - pSat(T)*B_/sqr(C_ + T);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::lnPSat
(
const volScalarField& T
) const
{
return A_ + B_/(C_ + T);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::Antoine::Tsat
(
const volScalarField& p
) const
{
return
B_/(log(p*dimensionedScalar(dimless/dimPressure, 1)) - A_)
- C_;
}
// ************************************************************************* //

View File

@ -1,121 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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::saturationModels::Antoine
Description
Antoine equation for the vapour pressure.
\f[
\log p = A + \frac{B}{C + T}
\f]
Coefficients \f$A\f$, \f$B\f$ and \f$C\f$ are to be supplied and should be
suitable for natural logarithms and temperatures in Kelvin.
SourceFiles
Antoine.C
\*---------------------------------------------------------------------------*/
#ifndef Antoine_H
#define Antoine_H
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class Antoine Declaration
\*---------------------------------------------------------------------------*/
class Antoine
:
public saturationModel
{
protected:
// Protected data
//- Constant A
dimensionedScalar A_;
//- Constant B
dimensionedScalar B_;
//- Constant C
dimensionedScalar C_;
public:
//- Runtime type information
TypeName("Antoine");
// Constructors
//- Construct from a dictionary and an interface
Antoine
(
const dictionary& dict,
const phaseInterface& interface
);
//- Destructor
virtual ~Antoine();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,118 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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 "AntoineExtended.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(AntoineExtended, 0);
addToRunTimeSelectionTable
(
saturationModel,
AntoineExtended,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::AntoineExtended::AntoineExtended
(
const dictionary& dict,
const phaseInterface& interface
)
:
Antoine(dict, interface),
D_("D", dimless, dict),
F_("F", dimless, dict),
E_("E", dimless/pow(dimTemperature, F_), dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::AntoineExtended::~AntoineExtended()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::pSat
(
const volScalarField& T
) const
{
return
dimensionedScalar(dimPressure/pow(dimTemperature, D_), 1)
*exp(A_ + B_/(C_ + T) + E_*pow(T, F_))
*pow(T, D_);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::pSatPrime
(
const volScalarField& T
) const
{
return pSat(T)*((D_ + E_*F_*pow(T, F_))/T - B_/sqr(C_ + T));
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::lnPSat
(
const volScalarField& T
) const
{
return
A_
+ B_/(C_ + T)
+ D_*log(T*dimensionedScalar(dimless/dimTemperature, 1))
+ E_*pow(T, F_);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::AntoineExtended::Tsat
(
const volScalarField& p
) const
{
NotImplemented;
return volScalarField::null();
}
// ************************************************************************* //

View File

@ -1,121 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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::saturationModels::AntoineExtended
Description
Extended Antoine equation for the vapour pressure.
\f[
\log (p) = A + \frac{B}{C + T} + D \log (T) + E T^F
\f]
Coefficients \f$A\f$, \f$B\f$, \f$C\f$, \f$D\f$, \f$E\f$ and \f$F\f$ are
to be supplied and should be suitable for natural logarithms and
temperatures in Kelvin.
SourceFiles
AntoineExtended.C
\*---------------------------------------------------------------------------*/
#ifndef AntoineExtended_H
#define AntoineExtended_H
#include "Antoine.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class AntoineExtended Declaration
\*---------------------------------------------------------------------------*/
class AntoineExtended
:
public Antoine
{
// Private Data
//- Constant D
dimensionedScalar D_;
//- Constant F
dimensionedScalar F_;
//- Constant E
// (after F so F's dimensions can be used in the construction)
dimensionedScalar E_;
public:
//- Runtime type information
TypeName("AntoineExtended");
// Constructors
//- Construct from a dictionary and an interface
AntoineExtended
(
const dictionary& dict,
const phaseInterface& interface
);
//- Destructor
virtual ~AntoineExtended();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,130 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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 "ArdenBuck.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(ArdenBuck, 0);
addToRunTimeSelectionTable(saturationModel, ArdenBuck, dictionary);
}
}
static const Foam::dimensionedScalar zeroC("", Foam::dimTemperature, 273.15);
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21);
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678);
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5);
static const Foam::dimensionedScalar D("", Foam::dimTemperature, 257.14);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::xByTC
(
const volScalarField& TC
) const
{
return (B - TC/C)/(D + TC);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::ArdenBuck::ArdenBuck
(
const dictionary& dict,
const phaseInterface& interface
)
:
saturationModel(dict, interface)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::ArdenBuck::~ArdenBuck()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::pSat
(
const volScalarField& T
) const
{
volScalarField TC(T - zeroC);
return A*exp(TC*xByTC(TC));
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::pSatPrime
(
const volScalarField& T
) const
{
volScalarField TC(T - zeroC);
volScalarField x(xByTC(TC));
return A*exp(TC*x)*(D*x - TC/C)/(D + TC);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::lnPSat
(
const volScalarField& T
) const
{
volScalarField TC(T - zeroC);
return log(A.value()) + TC*xByTC(TC);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::ArdenBuck::Tsat
(
const volScalarField& p
) const
{
NotImplemented;
return volScalarField::null();
}
// ************************************************************************* //

View File

@ -1,106 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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::saturationModels::ArdenBuck
Description
ArdenBuck equation for the vapour pressure of moist air.
SourceFiles
ArdenBuck.C
\*---------------------------------------------------------------------------*/
#ifndef ArdenBuck_H
#define ArdenBuck_H
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class ArdenBuck Declaration
\*---------------------------------------------------------------------------*/
class ArdenBuck
:
public saturationModel
{
// Private Member Functions
//- Exponent divided by the temperature
tmp<volScalarField> xByTC(const volScalarField& TC) const;
public:
//- Runtime type information
TypeName("ArdenBuck");
// Constructors
//- Construct from a dictionary and an interface
ArdenBuck
(
const dictionary& dict,
const phaseInterface& interface
);
//- Destructor
virtual ~ArdenBuck();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,130 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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 "constantSaturationConditions.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(constantSaturationConditions, 0);
addToRunTimeSelectionTable
(
saturationModel,
constantSaturationConditions,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::constantSaturationConditions::
constantSaturationConditions
(
const dictionary& dict,
const phaseInterface& interface
)
:
saturationModel(dict, interface),
pSat_("pSat", dimPressure, dict),
Tsat_("Tsat", dimTemperature, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::constantSaturationConditions::
~constantSaturationConditions()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::pSat
(
const volScalarField& T
) const
{
return volScalarField::New
(
"pSat",
T.mesh(),
pSat_
);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::pSatPrime
(
const volScalarField& T
) const
{
return volScalarField::New
(
"pSatPrime",
T.mesh(),
dimensionedScalar(dimPressure/dimTemperature, 0)
);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::lnPSat
(
const volScalarField& T
) const
{
return volScalarField::New
(
"lnPSat",
T.mesh(),
dimensionedScalar(dimless, log(pSat_.value()))
);
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::constantSaturationConditions::Tsat
(
const volScalarField& p
) const
{
return volScalarField::New
(
"Tsat",
p.mesh(),
Tsat_
);
}
// ************************************************************************* //

View File

@ -1,111 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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::saturationModels::constantSaturationConditions
Description
Constant saturation pressure and temperature.
SourceFiles
constantSaturationConditions.C
\*---------------------------------------------------------------------------*/
#ifndef constantSaturationConditions_H
#define constantSaturationConditions_H
#include "saturationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class constantSaturationConditions Declaration
\*---------------------------------------------------------------------------*/
class constantSaturationConditions
:
public saturationModel
{
protected:
// Private Data
//- Constant saturation pressure
dimensionedScalar pSat_;
//- Constant saturation temperature
dimensionedScalar Tsat_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from a dictionary and an interface
constantSaturationConditions
(
const dictionary& dict,
const phaseInterface& interface
);
//- Destructor
virtual ~constantSaturationConditions();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,136 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-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 "function1.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(function1, 0);
addToRunTimeSelectionTable(saturationModel, function1, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::function1::function1
(
const dictionary& dict,
const phaseInterface& interface
)
:
saturationModel(dict, interface),
function_(Function1<scalar>::New("function", dict))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::function1::~function1()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::pSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::pSatPrime
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::lnPSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::function1::Tsat
(
const volScalarField& p
) const
{
tmp<volScalarField> tTsat
(
volScalarField::New
(
"Tsat",
p.mesh(),
dimensionedScalar(dimTemperature, 0)
)
);
volScalarField& Tsat = tTsat.ref();
forAll(Tsat, celli)
{
Tsat[celli] = function_->value(p[celli]);
}
volScalarField::Boundary& TsatBf = Tsat.boundaryFieldRef();
forAll(Tsat.boundaryField(), patchi)
{
scalarField& Tsatp = TsatBf[patchi];
const scalarField& pp = p.boundaryField()[patchi];
forAll(Tsatp, facei)
{
Tsatp[facei] = function_->value(pp[facei]);
}
}
return tTsat;
}
// ************************************************************************* //

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-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::saturationModels::function1
Description
Saturation vapour temperature in terms of
the vapour pressure (in Pa). The saturation temperature in Kelvins is
specified as a Foam::Function1 type, to enable use of, e.g. constant,
polynomial, table values.
Currently this class only provides \f$T_sat\f$, the inverse function to
return the vapour pressure for a given temperature are not implemented.
Examples:
\verbatim
type function1;
function polynomial
(
(308.0422 0)
(0.0015096 1)
(-1.61589e-8 2)
(1.114106e-13 3)
(-4.52216e-19 4)
(1.05192e-24 5)
(-1.2953e-30 6)
(6.5365e-37 7)
)
\endverbatim
\verbatim
type function1;
function table;
functionCoeffs
{
file "filename.csv";
format csv;
nHeaderLine 1;
refColumn 0;
componentColumns (1);
separator ",";
mergeSeparators no;
outOfBounds clamp;
interpolationScheme linear;
};
\endverbatim
SourceFiles
function1.C
\*---------------------------------------------------------------------------*/
#ifndef function1_H
#define function1_H
#include "saturationModel.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class function1 Declaration
\*---------------------------------------------------------------------------*/
class function1
:
public saturationModel
{
// Private Data
//- Saturation temperature as a function of pressure
autoPtr<Function1<scalar>> function_;
public:
//- Runtime type information
TypeName("function1");
// Constructors
//- Construct from a dictionary and an interface
function1
(
const dictionary& dict,
const phaseInterface& interface
);
//- Destructor
virtual ~function1();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,135 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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 "polynomial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
defineTypeNameAndDebug(polynomial, 0);
addToRunTimeSelectionTable(saturationModel, polynomial, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::saturationModels::polynomial::polynomial
(
const dictionary& dict,
const phaseInterface& interface
)
:
saturationModel(dict, interface),
C_(dict.lookup("C<8>"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::saturationModels::polynomial::~polynomial()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::pSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::pSatPrime
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::lnPSat
(
const volScalarField& T
) const
{
NotImplemented;
return volScalarField::null();
}
Foam::tmp<Foam::volScalarField>
Foam::saturationModels::polynomial::Tsat
(
const volScalarField& p
) const
{
tmp<volScalarField> tTsat
(
volScalarField::New
(
"Tsat",
p.mesh(),
dimensionedScalar(dimTemperature, 0)
)
);
volScalarField& Tsat = tTsat.ref();
forAll(Tsat, celli)
{
Tsat[celli] = C_.value(p[celli]);
}
volScalarField::Boundary& TsatBf = Tsat.boundaryFieldRef();
forAll(Tsat.boundaryField(), patchi)
{
scalarField& Tsatp = TsatBf[patchi];
const scalarField& pp = p.boundaryField()[patchi];
forAll(Tsatp, facei)
{
Tsatp[facei] = C_.value(pp[facei]);
}
}
return tTsat;
}
// ************************************************************************* //

View File

@ -1,117 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-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::saturationModels::polynomial
Description
Polynomial equation for the saturation vapour temperature in terms of
the vapour pressure (in Pa).
\f[
T_sat = \sum_i C_i p^i
\f]
where \f$p\f$ is the pressure in Pa and \f$C\f$ are the coefficients.
Currently this class only provides \f$T_sat\f$, the inverse function to
return the vapour pressure for a given temperature are not implemented.
SourceFiles
polynomial.C
\*---------------------------------------------------------------------------*/
#ifndef polynomial_H
#define polynomial_H
#include "saturationModel.H"
#include "Polynomial.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace saturationModels
{
/*---------------------------------------------------------------------------*\
Class polynomial Declaration
\*---------------------------------------------------------------------------*/
class polynomial
:
public saturationModel
{
// Private Data
//- Polynomial coefficients
Polynomial<8> C_;
public:
//- Runtime type information
TypeName("polynomial");
// Constructors
//- Construct from a dictionary and an interface
polynomial
(
const dictionary& dict,
const phaseInterface& interface
);
//- Destructor
virtual ~polynomial();
// Member Functions
//- Saturation pressure
virtual tmp<volScalarField> pSat(const volScalarField& T) const;
//- Saturation pressure derivative w.r.t. temperature
virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
//- Natural log of the saturation pressure
virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
//- Saturation temperature
virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace saturationModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,6 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \

View File

@ -28,7 +28,7 @@ License
#include "heatTransferPhaseSystem.H"
#include "compressibleMomentumTransportModels.H"
#include "phaseCompressibleMomentumTransportModel.H"
#include "saturationModel.H"
#include "interfaceSaturationTemperatureModel.H"
#include "rhoMulticomponentThermo.H"
#include "addToRunTimeSelectionTable.H"
@ -389,7 +389,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
const phaseInterface interface(vapor, liquid);
if (fluid.foundInterfacialModel<saturationModel>(interface))
if
(
fluid.foundInterfacialModel
<
interfaceSaturationTemperatureModel
>(interface)
)
{
// Retrieve turbulence properties from models
const phaseCompressible::momentumTransportModel& turbModel
@ -462,8 +468,11 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
const scalarField Cpw(lThermo.Cp(Tw, patchi));
// Saturation temperature
const saturationModel& satModel =
fluid.lookupInterfacialModel<saturationModel>(interface);
const interfaceSaturationTemperatureModel& satModel =
fluid.lookupInterfacialModel
<
interfaceSaturationTemperatureModel
>(interface);
const tmp<volScalarField> tTsat = satModel.Tsat(lThermo.p());
const volScalarField& Tsat = tTsat();
const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]);

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/saturationModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \

View File

@ -87,7 +87,10 @@ ThermalPhaseChangePhaseSystem
const phaseModel& phase1 = interface.phase1();
const phaseModel& phase2 = interface.phase2();
this->template validateMassTransfer<saturationModel>(interface);
this->template validateMassTransfer
<
interfaceSaturationTemperatureModel
>(interface);
if
(
@ -218,7 +221,7 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
const Foam::saturationModel&
const Foam::interfaceSaturationTemperatureModel&
Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::saturation
(
const phaseInterfaceKey& key
@ -329,7 +332,8 @@ Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::heatTransfer() const
forAllConstIter(phaseSystem::dmdtfTable, nDmdtfs_, nDmdtfIter)
{
const phaseInterface interface(*this, nDmdtfIter.key());
const saturationModel& satModel = this->saturation(nDmdtfIter.key());
const interfaceSaturationTemperatureModel& satModel =
this->saturation(nDmdtfIter.key());
Tns.insert
(

View File

@ -59,7 +59,7 @@ SourceFiles
#define ThermalPhaseChangePhaseSystem_H
#include "phaseSystem.H"
#include "saturationModel.H"
#include "interfaceSaturationTemperatureModel.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -80,7 +80,7 @@ class ThermalPhaseChangePhaseSystem
typedef HashTable
<
autoPtr<saturationModel>,
autoPtr<interfaceSaturationTemperatureModel>,
phaseInterfaceKey,
phaseInterfaceKey::hash
> saturationModelTable;
@ -141,8 +141,11 @@ public:
// Member Functions
//- Return the saturationModel
const saturationModel& saturation(const phaseInterfaceKey& key) const;
//- Return the saturation temperature model for an interface
const interfaceSaturationTemperatureModel& saturation
(
const phaseInterfaceKey& key
) const;
//- Return the mass transfer rate for an interface
virtual tmp<volScalarField> dmdtf(const phaseInterfaceKey& key) const;

View File

@ -25,7 +25,7 @@ License
#include "linearTsubDiameter.H"
#include "phaseSystem.H"
#include "saturationModel.H"
#include "interfaceSaturationTemperatureModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -103,10 +103,19 @@ void Foam::diameterModels::linearTsub::correct()
const phaseModel& liquid = fluid.phases()[liquidPhaseName_];
const phaseInterface interface(phase(), liquid);
if (fluid.foundInterfacialModel<saturationModel>(interface))
if
(
fluid.foundInterfacialModel
<
interfaceSaturationTemperatureModel
>(interface)
)
{
const saturationModel& satModel =
fluid.lookupInterfacialModel<saturationModel>(interface);
const interfaceSaturationTemperatureModel& satModel =
fluid.lookupInterfacialModel
<
interfaceSaturationTemperatureModel
>(interface);
const volScalarField Tsub
(

View File

@ -82,10 +82,7 @@ interfaceComposition
type saturated;
species (H2O);
Le 1.0;
saturationPressure
{
type ArdenBuck;
}
pSat ArdenBuck;
}
C3H8O
{
@ -101,7 +98,7 @@ interfaceComposition
type saturated;
species (C3H8O);
Le 1.0;
saturationPressure
pSat
{
type Antoine;
A 22.7057916;

View File

@ -67,10 +67,7 @@ interfaceComposition
type saturated;
species ( H2O );
Le 1.0;
saturationPressure
{
type ArdenBuck;
}
pSat ArdenBuck;
}
}

View File

@ -54,13 +54,12 @@ surfaceTension
}
}
saturation
saturationTemperature
{
steam_water
{
type constant;
pSat 1e5;
Tsat 372.76;
type constant;
value 372.76;
}
}

View File

@ -126,7 +126,7 @@ blending
}
}
saturation
saturationTemperature
{
gas_liquid
{

View File

@ -115,10 +115,7 @@ interfaceComposition
type saturated;
species ( H2O );
Le 1.0;
saturationPressure
{
type ArdenBuck;
}
pSat ArdenBuck;
}
}

View File

@ -115,10 +115,7 @@ interfaceComposition
type saturated;
species ( water );
Le 1.0;
saturationPressure
{
type ArdenBuck;
}
pSat ArdenBuck;
}
gas_liquid_inThe_liquid

View File

@ -115,10 +115,7 @@ interfaceComposition
type saturated;
species ( H2O );
Le 1.0;
saturationPressure
{
type ArdenBuck;
}
pSat ArdenBuck;
}
}

View File

@ -59,13 +59,12 @@ surfaceTension
}
}
saturation
saturationTemperature
{
steam_water
{
type constant;
pSat 1e5;
Tsat 372.76;
type constant;
value 372.76;
}
}

View File

@ -163,7 +163,7 @@ blending
}
}
saturation
saturationTemperature
{
gas_liquid
{

View File

@ -209,7 +209,7 @@ blending
}
}
saturation
saturationTemperature
{
gas_liquid
{

View File

@ -273,7 +273,7 @@ blending
}
}
saturation
saturationTemperature
{
gas_liquid
{