liquidPropertiesI.H
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) 2011-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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 inline Foam::scalar Foam::liquidProperties::limit(const scalar T) const
29 {
30  return T;
31 }
32 
33 
34 inline Foam::scalar Foam::liquidProperties::Y() const
35 {
36  return 1;
37 }
38 
39 
40 inline Foam::scalar Foam::liquidProperties::Tc() const
41 {
42  return Tc_;
43 }
44 
45 
46 inline Foam::scalar Foam::liquidProperties::Pc() const
47 {
48  return Pc_;
49 }
50 
51 
52 inline Foam::scalar Foam::liquidProperties::Vc() const
53 {
54  return Vc_;
55 }
56 
57 
58 inline Foam::scalar Foam::liquidProperties::Zc() const
59 {
60  return Zc_;
61 }
62 
63 
64 inline Foam::scalar Foam::liquidProperties::Tt() const
65 {
66  return Tt_;
67 }
68 
69 
70 inline Foam::scalar Foam::liquidProperties::Pt() const
71 {
72  return Pt_;
73 }
74 
75 
76 inline Foam::scalar Foam::liquidProperties::Tb() const
77 {
78  return Tb_;
79 }
80 
81 
82 inline Foam::scalar Foam::liquidProperties::dipm() const
83 {
84  return dipm_;
85 }
86 
87 
88 inline Foam::scalar Foam::liquidProperties::omega() const
89 {
90  return omega_;
91 }
92 
93 
94 inline Foam::scalar Foam::liquidProperties::delta() const
95 {
96  return delta_;
97 }
98 
99 
100 inline Foam::scalar Foam::liquidProperties::psi(scalar p, scalar T) const
101 {
102  return 0;
103 }
104 
105 
106 inline Foam::scalar Foam::liquidProperties::CpMCv(scalar p, scalar T) const
107 {
108  return 0;
109 }
110 
111 
112 inline Foam::scalar Foam::liquidProperties::Es(scalar p, const scalar T) const
113 {
114  return Hs(p, T);
115 }
116 
117 
118 inline Foam::scalar Foam::liquidProperties::Ea(scalar p, const scalar T) const
119 {
120  return Ha(p, T);
121 }
122 
123 
124 template<class Func>
126 (
127  Func& f,
128  const word& name,
129  const dictionary& dict
130 )
131 {
132  if (dict.found(name))
133  {
134  f = Func(name, dict.subDict(name));
135  }
136 }
137 
138 
139 template<class Liquid>
141 (
142  Liquid& l,
143  const dictionary& dict
144 )
145 {
146  l.liquidProperties::readIfPresent(dict);
147  readIfPresent(l.rho_, "rho", dict);
148  readIfPresent(l.pv_, "pv", dict);
149  readIfPresent(l.hl_, "hl", dict);
150  readIfPresent(l.Cp_, "Cp", dict);
151  readIfPresent(l.h_, "h", dict);
152  readIfPresent(l.Cpg_, "Cpg", dict);
153  readIfPresent(l.B_, "B", dict);
154  readIfPresent(l.mu_, "mu", dict);
155  readIfPresent(l.mug_, "mug", dict);
156  readIfPresent(l.kappa_, "kappa", dict);
157  readIfPresent(l.kappag_, "kappag", dict);
158  readIfPresent(l.sigma_, "sigma", dict);
159  // readIfPresent(l.D_, "D", dict);
160 }
161 
162 
163 template<class Liquid>
165 (
166  const Liquid& l,
167  Ostream& os
168 ) const
169 {
170  l.liquidProperties::write(os);
171  writeEntry(os, l.rho_);
172  writeEntry(os, l.pv_);
173  writeEntry(os, l.hl_);
174  writeEntry(os, l.Cp_);
175  writeEntry(os, l.h_);
176  writeEntry(os, l.Cpg_);
177  writeEntry(os, l.B_);
178  writeEntry(os, l.mu_);
179  writeEntry(os, l.mug_);
180  writeEntry(os, l.kappa_);
181  writeEntry(os, l.kappag_);
182  writeEntry(os, l.sigma_);
183  writeEntry(os, l.D_);
184 }
185 
186 
187 // ************************************************************************* //
scalar delta() const
Solubility parameter [(J/m^3)^(1/2)].
virtual scalar Hs(scalar p, scalar T) const =0
Liquid sensible enthalpy [J/kg].
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:643
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
scalar Y() const
Mass fraction of this specie in mixture.
scalar Pt() const
Triple point pressure [Pa].
scalar dipm() const
Dipole moment [].
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:982
scalar Ea(scalar p, scalar T) const
Absolute internal energy [J/kg].
scalar limit(const scalar T) const
Limit the temperature to be in the range Tlow_ to Thigh_.
scalar Tc() const
Critical temperature [K].
scalar Zc() const
Critical compressibility factor.
scalar psi(scalar p, scalar T) const
Liquid compressibility [s^2/m^2].
A class for handling words, derived from string.
Definition: word.H:59
virtual scalar Ha(scalar p, scalar T) const =0
Liquid absolute enthalpy [J/kg].
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
scalar Vc() const
Critical volume [m^3/kmol].
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
const volScalarField & T
scalar omega() const
Pitzer&#39;s acentric factor [].
scalar Pc() const
Critical pressure [Pa].
volScalarField & p
scalar Es(scalar p, const scalar T) const
Sensible internal energy [J/kg].
virtual void write(Ostream &os) const =0
Write the function coefficients.
scalar Tb() const
Normal boiling temperature [K].
scalar Tt() const
Triple point temperature [K].