initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / liquids / H2O / H2O.H
blob92287b22161b8c587f8e3735f5b07bc82e18dbd9
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::H2O
28 Description
29     water
31 SourceFiles
32     H2O.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef H2O_H
37 #define H2O_H
39 #include "liquid.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 "APIdiffCoefFunc.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 /*---------------------------------------------------------------------------*\
56                            Class H2O Declaration
57 \*---------------------------------------------------------------------------*/
59 class H2O
61     public liquid
63     // Private data
65         NSRDSfunc5 rho_;
66         NSRDSfunc1 pv_;
67         NSRDSfunc6 hl_;
68         NSRDSfunc0 cp_;
69         NSRDSfunc0 h_;
70         NSRDSfunc7 cpg_;
71         NSRDSfunc4 B_;
72         NSRDSfunc1 mu_;
73         NSRDSfunc2 mug_;
74         NSRDSfunc0 K_;
75         NSRDSfunc2 Kg_;
76         NSRDSfunc6 sigma_;
77         APIdiffCoefFunc D_;
80 public:
82     //- Runtime type information
83     TypeName("H2O");
86     // Constructors
88         //- Construct null
89         H2O();
91         //- Construct from components
92         H2O
93         (
94             const liquid& l,
95             const NSRDSfunc5& 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         H2O(Istream& is);
114     // Member Functions
116         //- Liquid density [kg/m^3]
117         inline scalar rho(scalar p, scalar T) const;
119         //- Vapour pressure [Pa]
120         inline scalar pv(scalar p, scalar T) const;
122         //- Heat of vapourisation [J/kg]
123         inline scalar hl(scalar p, scalar T) const;
125         //- Liquid heat capacity [J/(kg K)]
126         inline scalar cp(scalar p, scalar T) const;
128         //- Liquid Enthalpy [J/(kg)]
129         inline scalar h(scalar p, scalar T) const;
131         //- Ideal gas heat capacity [J/(kg K)]
132         inline scalar cpg(scalar p, scalar T) const;
134         //- Second Virial Coefficient [m^3/kg]
135         inline scalar B(scalar p, scalar T) const;
137         //- Liquid viscosity [Pa s]
138         inline scalar mu(scalar p, scalar T) const;
140         //- Vapour viscosity [Pa s]
141         inline scalar mug(scalar p, scalar T) const;
143         //- Liquid thermal conductivity  [W/(m K)]
144         inline scalar K(scalar p, scalar T) const;
146         //- Vapour thermal conductivity  [W/(m K)]
147         inline scalar Kg(scalar p, scalar T) const;
149         //- Surface tension [N/m]
150         inline scalar sigma(scalar p, scalar T) const;
152         //- Vapour diffussivity [m2/s]
153         inline scalar D(scalar p, scalar T) const;
156     // I-O
158         //- Write the function coefficients
159         void writeData(Ostream& os) const
160         {
161             liquid::writeData(os); os << nl;
162             rho_.writeData(os); os << nl;
163             pv_.writeData(os); os << nl;
164             hl_.writeData(os); os << nl;
165             cp_.writeData(os); os << nl;
166             cpg_.writeData(os); os << nl;
167             B_.writeData(os); os << nl;
168             mu_.writeData(os); os << nl;
169             mug_.writeData(os); os << nl;
170             K_.writeData(os); os << nl;
171             Kg_.writeData(os); os << nl;
172             sigma_.writeData(os); os << nl;
173             D_.writeData(os); os << endl;
174         }
177         //- Ostream Operator
178         friend Ostream& operator<<(Ostream& os, const H2O& l)
179         {
180             l.writeData(os);
181             return os;
182         }
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 #include "H2OI.H"
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #endif
198 // ************************************************************************* //