FreeFOAM The Cross-Platform CFD Toolkit
CH4N2O.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
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 Class
25  Foam::CH4N2O
26 
27 Description
28  urea, note that some of the properties are unavailable in the literature
29  and have been copied from water.
30 
31 SourceFiles
32  CH4N2O.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef CH4N2O_H
37 #define CH4N2O_H
38 
39 #include <liquids/liquid.H>
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class CH4N2O Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class CH4N2O
61 :
62  public liquid
63 {
64  // Private data
65 
66  NSRDSfunc0 rho_;
67  NSRDSfunc1 pv_;
68  NSRDSfunc6 hl_;
69  NSRDSfunc0 cp_;
70  NSRDSfunc0 h_;
71  NSRDSfunc7 cpg_;
72  NSRDSfunc4 B_;
73  NSRDSfunc1 mu_;
74  NSRDSfunc2 mug_;
75  NSRDSfunc0 K_;
76  NSRDSfunc2 Kg_;
77  NSRDSfunc6 sigma_;
78  APIdiffCoefFunc D_;
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("CH4N2O");
84 
85 
86  // Constructors
87 
88  //- Construct null
89  CH4N2O();
90 
91  //- Construct from components
92  CH4N2O
93  (
94  const liquid& l,
95  const NSRDSfunc0& density,
96  const NSRDSfunc1& vapourPressure,
97  const NSRDSfunc6& heatOfVapourisation,
98  const NSRDSfunc0& heatCapacity,
99  const NSRDSfunc0& enthalpy,
100  const NSRDSfunc7& idealGasHeatCapacity,
101  const NSRDSfunc4& secondVirialCoeff,
102  const NSRDSfunc1& dynamicViscosity,
103  const NSRDSfunc2& vapourDynamicViscosity,
104  const NSRDSfunc0& thermalConductivity,
105  const NSRDSfunc2& vapourThermalConductivity,
106  const NSRDSfunc6& surfaceTension,
107  const APIdiffCoefFunc& vapourDiffussivity
108  );
109 
110  //- Construct from Istream
111  CH4N2O(Istream& is);
112 
113 
114  // Member Functions
115 
116  //- Liquid density [kg/m^3]
117  inline scalar rho(scalar p, scalar T) const;
118 
119  //- Vapour pressure [Pa]
120  inline scalar pv(scalar p, scalar T) const;
121 
122  //- Heat of vapourisation [J/kg]
123  inline scalar hl(scalar p, scalar T) const;
124 
125  //- Liquid heat capacity [J/(kg K)]
126  inline scalar cp(scalar p, scalar T) const;
127 
128  //- Liquid Enthalpy [J/(kg)]
129  inline scalar h(scalar p, scalar T) const;
130 
131  //- Ideal gas heat capacity [J/(kg K)]
132  inline scalar cpg(scalar p, scalar T) const;
133 
134  //- Second Virial Coefficient [m^3/kg]
135  inline scalar B(scalar p, scalar T) const;
136 
137  //- Liquid viscosity [Pa s]
138  inline scalar mu(scalar p, scalar T) const;
139 
140  //- Vapour viscosity [Pa s]
141  inline scalar mug(scalar p, scalar T) const;
142 
143  //- Liquid thermal conductivity [W/(m K)]
144  inline scalar K(scalar p, scalar T) const;
145 
146  //- Vapour thermal conductivity [W/(m K)]
147  inline scalar Kg(scalar p, scalar T) const;
148 
149  //- Surface tension [N/m]
150  inline scalar sigma(scalar p, scalar T) const;
151 
152  //- Vapour diffussivity [m2/s]
153  inline scalar D(scalar p, scalar T) const;
154 
155  //- Vapour diffussivity [m2/s] with specified binary pair
156  inline scalar D(scalar p, scalar T, scalar Wb) const;
157 
158 
159  // I-O
160 
161  //- Write the function coefficients
162  void writeData(Ostream& os) const
163  {
164  liquid::writeData(os); os << nl;
165  rho_.writeData(os); os << nl;
166  pv_.writeData(os); os << nl;
167  hl_.writeData(os); os << nl;
168  cp_.writeData(os); os << nl;
169  cpg_.writeData(os); os << nl;
170  B_.writeData(os); os << nl;
171  mu_.writeData(os); os << nl;
172  mug_.writeData(os); os << nl;
173  K_.writeData(os); os << nl;
174  Kg_.writeData(os); os << nl;
175  sigma_.writeData(os); os << nl;
176  D_.writeData(os); os << endl;
177  }
178 
179  //- Ostream Operator
180  friend Ostream& operator<<(Ostream& os, const CH4N2O& l)
181  {
182  l.writeData(os);
183  return os;
184  }
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #include "CH4N2OI.H"
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************ vim: set sw=4 sts=4 et: ************************ //
201