initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / liquids / CH4N2O / CH4N2O.H
blobbcfbbd62ef4dfa66fd4c4e8c6e40f4f144e0f1fc
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::CH4N2O
28 Description
29     urea, note that some of the properties are unavailable in the literature
30     and have been copied from water.
32 SourceFiles
33     CH4N2O.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef CH4N2O_H
38 #define CH4N2O_H
40 #include "liquid.H"
41 #include "NSRDSfunc0.H"
42 #include "NSRDSfunc1.H"
43 #include "NSRDSfunc2.H"
44 #include "NSRDSfunc3.H"
45 #include "NSRDSfunc4.H"
46 #include "NSRDSfunc5.H"
47 #include "NSRDSfunc6.H"
48 #include "NSRDSfunc7.H"
49 #include "NSRDSfunc14.H"
50 #include "APIdiffCoefFunc.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace Foam
57 /*---------------------------------------------------------------------------*\
58                            Class CH4N2O Declaration
59 \*---------------------------------------------------------------------------*/
61 class CH4N2O
63     public liquid
65     // Private data
67         NSRDSfunc0 rho_;
68         NSRDSfunc1 pv_;
69         NSRDSfunc6 hl_;
70         NSRDSfunc0 cp_;
71         NSRDSfunc0 h_;
72         NSRDSfunc7 cpg_;
73         NSRDSfunc4 B_;
74         NSRDSfunc1 mu_;
75         NSRDSfunc2 mug_;
76         NSRDSfunc0 K_;
77         NSRDSfunc2 Kg_;
78         NSRDSfunc6 sigma_;
79         APIdiffCoefFunc D_;
81 public:
83     //- Runtime type information
84     TypeName("CH4N2O");
87     // Constructors
89         //- Construct null
90         CH4N2O();
92         //- Construct from components
93         CH4N2O
94         (
95             const liquid& l,
96             const NSRDSfunc0& density,
97             const NSRDSfunc1& vapourPressure,
98             const NSRDSfunc6& heatOfVapourisation,
99             const NSRDSfunc0& heatCapacity,
100             const NSRDSfunc0& enthalpy,
101             const NSRDSfunc7& idealGasHeatCapacity,
102             const NSRDSfunc4& secondVirialCoeff,
103             const NSRDSfunc1& dynamicViscosity,
104             const NSRDSfunc2& vapourDynamicViscosity,
105             const NSRDSfunc0& thermalConductivity,
106             const NSRDSfunc2& vapourThermalConductivity,
107             const NSRDSfunc6& surfaceTension,
108             const APIdiffCoefFunc& vapourDiffussivity
109         );
111         //- Construct from Istream
112         CH4N2O(Istream& is);
115     // Member Functions
117         //- Liquid density [kg/m^3]
118         inline scalar rho(scalar p, scalar T) const;
120         //- Vapour pressure [Pa]
121         inline scalar pv(scalar p, scalar T) const;
123         //- Heat of vapourisation [J/kg]
124         inline scalar hl(scalar p, scalar T) const;
126         //- Liquid heat capacity [J/(kg K)]
127         inline scalar cp(scalar p, scalar T) const;
129         //- Liquid Enthalpy [J/(kg)]
130         inline scalar h(scalar p, scalar T) const;
132         //- Ideal gas heat capacity [J/(kg K)]
133         inline scalar cpg(scalar p, scalar T) const;
135         //- Second Virial Coefficient [m^3/kg]
136         inline scalar B(scalar p, scalar T) const;
138         //- Liquid viscosity [Pa s]
139         inline scalar mu(scalar p, scalar T) const;
141         //- Vapour viscosity [Pa s]
142         inline scalar mug(scalar p, scalar T) const;
144         //- Liquid thermal conductivity  [W/(m K)]
145         inline scalar K(scalar p, scalar T) const;
147         //- Vapour thermal conductivity  [W/(m K)]
148         inline scalar Kg(scalar p, scalar T) const;
150         //- Surface tension [N/m]
151         inline scalar sigma(scalar p, scalar T) const;
153         //- Vapour diffussivity [m2/s]
154         inline scalar D(scalar p, scalar T) const;
157     // I-O
159         //- Write the function coefficients
160         void writeData(Ostream& os) const
161         {
162             liquid::writeData(os); os << nl;
163             rho_.writeData(os); os << nl;
164             pv_.writeData(os); os << nl;
165             hl_.writeData(os); os << nl;
166             cp_.writeData(os); os << nl;
167             cpg_.writeData(os); os << nl;
168             B_.writeData(os); os << nl;
169             mu_.writeData(os); os << nl;
170             mug_.writeData(os); os << nl;
171             K_.writeData(os); os << nl;
172             Kg_.writeData(os); os << nl;
173             sigma_.writeData(os); os << nl;
174             D_.writeData(os); os << endl;
175         }
177         //- Ostream Operator
178         friend Ostream& operator<<(Ostream& os, const CH4N2O& l)
179         {
180             l.writeData(os);
181             return os;
182         }
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 #include "CH4N2OI.H"
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #endif
198 // ************************************************************************* //