ArdenBuck.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-2026 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 "saturationModels.H"
27 #include "ArdenBuck.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace saturationModels
35 {
39 
40  static const coefficient zeroC("zeroC", dimTemperature, 273.15);
41  static const coefficient A("A", dimPressure, 611.21);
42  static const coefficient B("B", dimless, 18.678);
43  static const coefficient C("C", dimTemperature, 234.5);
44  static const coefficient D("D", dimTemperature, 257.14);
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
50 
51 template<class FieldType>
53 Foam::saturationModels::ArdenBuck::xByTC(const FieldType& TC) const
54 {
55  return (B - TC/C)/(D + TC);
56 }
57 
58 
59 template<class FieldType>
61 Foam::saturationModels::ArdenBuck::pSat(const FieldType& T) const
62 {
63  const FieldType TC(T - zeroC);
64 
65  return A*exp(TC*xByTC(TC));
66 }
67 
68 
69 template<class FieldType>
71 Foam::saturationModels::ArdenBuck::pSatPrime(const FieldType& T) const
72 {
73  const FieldType TC(T - zeroC);
74  const FieldType x(xByTC(TC));
75 
76  return A*exp(TC*x)*(D*x - TC/C)/(D + TC);
77 }
78 
79 
80 template<class FieldType>
82 Foam::saturationModels::ArdenBuck::lnPSat(const FieldType& T) const
83 {
84  const FieldType TC(T - zeroC);
85 
86  return log(A.value()) + TC*xByTC(TC);
87 }
88 
89 
90 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
91 
93 :
95 {}
96 
97 
99 :
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
105 
107 {}
108 
109 
110 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
111 
112 IMPLEMENT_PSAT(saturationModels::ArdenBuck, scalarField);
113 
114 
115 IMPLEMENT_PSAT(saturationModels::ArdenBuck, volScalarField::Internal);
116 
117 
118 IMPLEMENT_PSAT(saturationModels::ArdenBuck, volScalarField);
119 
120 
121 // ************************************************************************* //
IMPLEMENT_PSAT(saturationModels::ArdenBuck, scalarField)
Macros for easy insertion into run-time selection tables.
Graphite solid properties.
Definition: C.H:51
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
const Type & value() const
Return const reference to value.
ArdenBuck equation for the vapour pressure of moist air.
Definition: ArdenBuck.H:53
ArdenBuck()
Construct default.
Definition: ArdenBuck.C:92
virtual ~ArdenBuck()
Destructor.
Definition: ArdenBuck.C:106
Model to describe the dependence of saturation pressure on temperature.
A class for managing temporary objects.
Definition: tmp.H:55
static const coefficient zeroC("zeroC", dimTemperature, 273.15)
addToRunTimeSelectionTable(saturationPressureModel, Antoine, dictionary)
static const coefficient C("C", dimTemperature, 234.5)
static const coefficient D("D", dimTemperature, 257.14)
static const coefficient B("B", dimless, 18.678)
defineTypeNameAndDebug(Antoine, 0)
static const coefficient A("A", dimPressure, 611.21)
Namespace for OpenFOAM.
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet & dimless
Definition: dimensions.C:138
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
const dimensionSet & dimPressure
Definition: dimensions.C:163
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
const dimensionSet & dimTemperature
Definition: dimensions.C:143
dictionary dict
Structure to store a dimensioned coefficient of the saturation model.