NH3.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) 2021 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 "NH3.H"
27 #include "thermodynamicConstants.H"
29 
30 using namespace Foam::constant::thermodynamic;
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(NH3, 0);
37  addToRunTimeSelectionTable(liquidProperties, NH3,);
38  addToRunTimeSelectionTable(liquidProperties, NH3, dictionary);
39 }
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 :
46  (
47  typeName,
48  17.030,
49  405.65,
50  1.1278e+07,
51  0.07247,
52  0.242,
53  195.41,
54  6.1177e+03,
55  239.72,
56  4.9034e-30,
57  0.2520,
58  2.9217e+04
59  ),
60  rho_("rho", 3.5430e+00*W(), 2.5471e-01, Tc(), 2.8870e-01),
61  pv_("pv", 9.0451e+01, -4.6690e+03, -1.1601e+01, 1.7183e-02, 1),
62  hl_("hl", Tc(), 3.1523e+07/W(), 3.9140e-01, -2.2890e-01, 2.3090e-01, 0),
63  Cp_
64  (
65  "Cp",
66  1.0827e+06/W(),
67  -1.5541e+04/W(),
68  8.9011e+01/W(),
69  -2.2513e-01/W(),
70  2.1336e-04/W(),
71  0
72  ),
73  h_(Cp_.integral("h", - Cp_.integral("", 0).value(Tstd) - 46190000/W())),
74  Cpg_("Cpg", 3.3190e+04/W(), 7.4230e+04/W(), 5.4040e+02, 8.8950e-01),
75  B_("B", 1.5600e-02, -1.9900e+01, -5.0500e+06, -2.5330e+18, 3.8700e+20),
76  mu_("mu", -1.6430e+00, 4.5560e+02, -1.5637e+00, 0, 0),
77  mug_("mug", 4.1855e-08, 9.8060e-01, 3.0800e+01, 0),
78  kappa_("kappa", 1.1606e+00, -2.2840e-03, 0, 0, 0, 0),
79  kappag_("kappag", -4.5900e-02, 1.6520e-01, -1.7078e+03, 0),
80  sigma_("sigma", 9.1200e-02, 1.1028e+00, 0, 0, 0, 0),
81  D_("D", 14.9, 20.1, W(), 28),
82  Hf_(h_.value(Tstd))
83 {}
84 
85 
87 (
88  const liquidProperties& l,
89  const Function1s::NSRDS5& density,
90  const Function1s::NSRDS1& vapourPressure,
91  const Function1s::NSRDS6& heatOfVapourisation,
92  const Function1s::NSRDS0& heatCapacity,
93  const Function1s::NSRDS0& enthalpy,
94  const Function1s::NSRDS3& idealGasHeatCapacity,
95  const Function1s::NSRDS4& secondVirialCoeff,
96  const Function1s::NSRDS1& dynamicViscosity,
97  const Function1s::NSRDS2& vapourDynamicViscosity,
98  const Function1s::NSRDS0& thermalConductivity,
99  const Function1s::NSRDS2& vapourThermalConductivity,
100  const Function1s::NSRDS6& surfaceTension,
101  const Function2s::APIdiffCoef& vapourDiffusivity
102 )
103 :
104  liquidProperties(l),
105  rho_(density),
106  pv_(vapourPressure),
107  hl_(heatOfVapourisation),
108  Cp_(heatCapacity),
109  h_(enthalpy),
110  Cpg_(idealGasHeatCapacity),
111  B_(secondVirialCoeff),
112  mu_(dynamicViscosity),
113  mug_(vapourDynamicViscosity),
114  kappa_(thermalConductivity),
115  kappag_(vapourThermalConductivity),
116  sigma_(surfaceTension),
117  D_(vapourDiffusivity),
118  Hf_(h_.value(Tstd))
119 {}
120 
121 
123 :
124  NH3()
125 {
126  readIfPresent(*this, dict);
127 }
128 
129 
130 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
131 
132 void Foam::NH3::write(Ostream& os) const
133 {
134  liquidProperties::write(*this, os);
135 }
136 
137 
138 // ************************************************************************* //
dictionary dict
NSRDS function number 100.
Definition: NSRDS0.H:69
friend class liquidProperties
Definition: NH3.H:83
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const dimensionedScalar Tstd
Standard temperature.
Liquid ammonia.
Definition: NH3.H:57
NSRDS function number 105.
Definition: NSRDS5.H:69
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
Thermodynamic scalar constants.
NH3()
Construct null.
Definition: NH3.C:43
Macros for easy insertion into run-time selection tables.
virtual scalar value(scalar T) const
Evaluate the function and return the result.
Definition: NSRDS0.H:116
const scalar & Tstd
Standard temperature (default in [K])
NSRDS function number 104.
Definition: NSRDS4.H:69
NSRDS function number 102.
Definition: NSRDS2.H:69
The thermophysical properties of a liquid.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
NSRDS function number 103.
Definition: NSRDS3.H:69
NSRDS function number 101.
Definition: NSRDS1.H:69
void write(Ostream &os) const
Write the function coefficients.
Definition: NH3.C:132
const scalarList W(::W(thermo))
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
NSRDS function number 106.
Definition: NSRDS6.H:69
virtual void write(Ostream &os) const =0
Write the function coefficients.
Namespace for OpenFOAM.