AntoineExtended.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 "AntoineExtended.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace saturationModels
34 {
37  (
41  );
42 
43  static const coefficient oneT(dimTemperature, 1);
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
49 
50 template<class FieldType>
52 Foam::saturationModels::AntoineExtended::pSat(const FieldType& T) const
53 {
54  return onePbyTpowD_*exp(A_ + B_/(C_ + T) + E_*pow(T, F_))*pow(T, D_);
55 }
56 
57 
58 template<class FieldType>
60 Foam::saturationModels::AntoineExtended::pSatPrime(const FieldType& T) const
61 {
62  return pSat(T)*((D_ + E_*(F_*pow(T, F_)))/T - B_/sqr(C_ + T));
63 }
64 
65 
66 template<class FieldType>
68 Foam::saturationModels::AntoineExtended::lnPSat(const FieldType& T) const
69 {
70  return A_ + B_/(C_ + T) + D_*log(T/oneT) + E_*pow(T, F_);
71 }
72 
73 
74 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
75 
77 (
78  const dictionary& dict
79 )
80 :
82  A_("A", dimless, dict),
83  B_("B", dimTemperature, dict),
84  C_("C", dimTemperature, dict),
85  D_("D", dimless, dict),
86  F_("F", dimless, dict),
87  E_("E", dimless/pow(dimTemperature, F_), dict),
88  onePbyTpowD_(dimPressure/pow(dimTemperature, D_), 1)
89 {}
90 
91 
92 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
93 
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
100 IMPLEMENT_PSAT(saturationModels::AntoineExtended, scalarField);
101 
102 
103 IMPLEMENT_PSAT(saturationModels::AntoineExtended, volScalarField::Internal);
104 
105 
106 IMPLEMENT_PSAT(saturationModels::AntoineExtended, volScalarField);
107 
108 
109 // ************************************************************************* //
IMPLEMENT_PSAT(saturationModels::AntoineExtended, 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
Extended Antoine equation for the vapour pressure.
AntoineExtended(const dictionary &dict)
Construct from a dictionary and an interface.
Model to describe the dependence of saturation pressure on temperature.
A class for managing temporary objects.
Definition: tmp.H:55
addToRunTimeSelectionTable(saturationPressureModel, Antoine, dictionary)
defineTypeNameAndDebug(Antoine, 0)
static const coefficient oneT(dimTemperature, 1)
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)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
dictionary dict
Structure to store a dimensioned coefficient of the saturation model.