Antoine.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "Antoine.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace saturationModels
34 {
38 
39  static const coefficient oneP(dimPressure, 1);
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45 
46 template<class FieldType>
48 Foam::saturationModels::Antoine::pSat(const FieldType& T) const
49 {
50  return oneP*exp(A_ + B_/(C_ + T));
51 }
52 
53 
54 template<class FieldType>
56 Foam::saturationModels::Antoine::pSatPrime(const FieldType& T) const
57 {
58  return - pSat(T)*B_/sqr(C_ + T);
59 }
60 
61 
62 template<class FieldType>
64 Foam::saturationModels::Antoine::lnPSat(const FieldType& T) const
65 {
66  return A_ + B_/(C_ + T);
67 }
68 
69 
70 template<class FieldType>
72 Foam::saturationModels::Antoine::Tsat(const FieldType& p) const
73 {
74  return B_/(log(p/oneP) - A_) - C_;
75 }
76 
77 
78 template<class FieldType>
80 Foam::saturationModels::Antoine::TsatPrime(const FieldType& p) const
81 {
82  return -(B_/p/sqr(log(p/oneP) - A_));
83 }
84 
85 
86 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
87 
89 :
92  A_("A", dimless, dict),
93  B_("B", dimTemperature, dict),
94  C_("C", dimTemperature, dict)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
106 IMPLEMENT_PSAT(saturationModels::Antoine, scalarField);
107 
108 
109 IMPLEMENT_PSAT(saturationModels::Antoine, volScalarField::Internal);
110 
111 
112 IMPLEMENT_PSAT(saturationModels::Antoine, volScalarField);
113 
114 
115 IMPLEMENT_TSAT(saturationModels::Antoine, scalarField);
116 
117 
118 IMPLEMENT_TSAT(saturationModels::Antoine, volScalarField::Internal);
119 
120 
121 IMPLEMENT_TSAT(saturationModels::Antoine, volScalarField);
122 
123 
124 // ************************************************************************* //
IMPLEMENT_PSAT(saturationModels::Antoine, scalarField)
IMPLEMENT_TSAT(saturationModels::Antoine, scalarField)
Macros for easy insertion into run-time selection tables.
DimensionedField< Type, GeoMesh, PrimitiveField > Internal
Type of the internal field from which this GeometricField is derived.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Antoine equation for the vapour pressure.
Definition: Antoine.H:63
Antoine(const dictionary &dict)
Construct from a dictionary.
Definition: Antoine.C:88
virtual ~Antoine()
Destructor.
Definition: Antoine.C:100
Model to describe the dependence of saturation pressure on temperature.
Model to describe the dependence of saturation temperature on pressure.
A class for managing temporary objects.
Definition: tmp.H:55
addToRunTimeSelectionTable(saturationPressureModel, Antoine, dictionary)
static const coefficient oneP(dimPressure, 1)
defineTypeNameAndDebug(Antoine, 0)
Namespace for OpenFOAM.
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet dimPressure
const dimensionSet dimless
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimTemperature
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
dictionary dict
volScalarField & p
Structure to store a dimensioned coefficient of the saturation model.