Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / properties / liquidProperties / CH4N2O / CH4N2O.H
blob62d5c8b7eb35eab8e85cf4b753609db9c329435d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2011 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::CH4N2O
27 Description
28     urea, note that some of the properties are unavailable in the literature
29     and have been copied from water.
31 SourceFiles
32     CH4N2O.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef CH4N2O_H
37 #define CH4N2O_H
39 #include "liquidProperties.H"
40 #include "NSRDSfunc0.H"
41 #include "NSRDSfunc1.H"
42 #include "NSRDSfunc2.H"
43 #include "NSRDSfunc3.H"
44 #include "NSRDSfunc4.H"
45 #include "NSRDSfunc5.H"
46 #include "NSRDSfunc6.H"
47 #include "NSRDSfunc7.H"
48 #include "NSRDSfunc14.H"
49 #include "APIdiffCoefFunc.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 /*---------------------------------------------------------------------------*\
57                            Class CH4N2O Declaration
58 \*---------------------------------------------------------------------------*/
60 class CH4N2O
62     public liquidProperties
64     // Private data
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_;
80 public:
82     //- Runtime type information
83     TypeName("CH4N2O");
86     // Constructors
88         //- Construct null
89         CH4N2O();
91         //- Construct from components
92         CH4N2O
93         (
94             const liquidProperties& 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         );
110         //- Construct from Istream
111         CH4N2O(Istream& is);
113         //- Construct from dictionary
114         CH4N2O(const dictionary& dict);
116         //- Construct copy
117         CH4N2O(const CH4N2O& liq);
119         //- Construct and return clone
120         virtual autoPtr<liquidProperties> clone() const
121         {
122             return autoPtr<liquidProperties>(new CH4N2O(*this));
123         }
126     // Member Functions
128         //- Liquid density [kg/m^3]
129         inline scalar rho(scalar p, scalar T) const;
131         //- Vapour pressure [Pa]
132         inline scalar pv(scalar p, scalar T) const;
134         //- Heat of vapourisation [J/kg]
135         inline scalar hl(scalar p, scalar T) const;
137         //- Liquid heat capacity [J/(kg K)]
138         inline scalar Cp(scalar p, scalar T) const;
140         //- Liquid Enthalpy [J/(kg)]
141         inline scalar h(scalar p, scalar T) const;
143         //- Ideal gas heat capacity [J/(kg K)]
144         inline scalar Cpg(scalar p, scalar T) const;
146         //- Second Virial Coefficient [m^3/kg]
147         inline scalar B(scalar p, scalar T) const;
149         //- Liquid viscosity [Pa s]
150         inline scalar mu(scalar p, scalar T) const;
152         //- Vapour viscosity [Pa s]
153         inline scalar mug(scalar p, scalar T) const;
155         //- Liquid thermal conductivity  [W/(m K)]
156         inline scalar K(scalar p, scalar T) const;
158         //- Vapour thermal conductivity  [W/(m K)]
159         inline scalar Kg(scalar p, scalar T) const;
161         //- Surface tension [N/m]
162         inline scalar sigma(scalar p, scalar T) const;
164         //- Vapour diffussivity [m2/s]
165         inline scalar D(scalar p, scalar T) const;
167         //- Vapour diffussivity [m2/s] with specified binary pair
168         inline scalar D(scalar p, scalar T, scalar Wb) const;
171     // I-O
173         //- Write the function coefficients
174         void writeData(Ostream& os) const
175         {
176             liquidProperties::writeData(os); os << nl;
177             rho_.writeData(os); os << nl;
178             pv_.writeData(os); os << nl;
179             hl_.writeData(os); os << nl;
180             Cp_.writeData(os); os << nl;
181             Cpg_.writeData(os); os << nl;
182             B_.writeData(os); os << nl;
183             mu_.writeData(os); os << nl;
184             mug_.writeData(os); os << nl;
185             K_.writeData(os); os << nl;
186             Kg_.writeData(os); os << nl;
187             sigma_.writeData(os); os << nl;
188             D_.writeData(os); os << endl;
189         }
191         //- Ostream Operator
192         friend Ostream& operator<<(Ostream& os, const CH4N2O& l)
193         {
194             l.writeData(os);
195             return os;
196         }
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 } // End namespace Foam
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 #include "CH4N2OI.H"
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 #endif
212 // ************************************************************************* //