ENH: RASModel.C: clipping input to log
[OpenFOAM-1.7.x.git] / src / thermophysicalModels / liquids / H2O / H2O.H
blobfcf8768a46b8e3fe15c646a92a203bbd20137020
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.
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::H2O
27 Description
28     water
30 SourceFiles
31     H2O.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef H2O_H
36 #define H2O_H
38 #include "liquid.H"
39 #include "NSRDSfunc0.H"
40 #include "NSRDSfunc1.H"
41 #include "NSRDSfunc2.H"
42 #include "NSRDSfunc3.H"
43 #include "NSRDSfunc4.H"
44 #include "NSRDSfunc5.H"
45 #include "NSRDSfunc6.H"
46 #include "NSRDSfunc7.H"
47 #include "APIdiffCoefFunc.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                            Class H2O Declaration
56 \*---------------------------------------------------------------------------*/
58 class H2O
60     public liquid
62     // Private data
64         NSRDSfunc5 rho_;
65         NSRDSfunc1 pv_;
66         NSRDSfunc6 hl_;
67         NSRDSfunc0 cp_;
68         NSRDSfunc0 h_;
69         NSRDSfunc7 cpg_;
70         NSRDSfunc4 B_;
71         NSRDSfunc1 mu_;
72         NSRDSfunc2 mug_;
73         NSRDSfunc0 K_;
74         NSRDSfunc2 Kg_;
75         NSRDSfunc6 sigma_;
76         APIdiffCoefFunc D_;
79 public:
81     //- Runtime type information
82     TypeName("H2O");
85     // Constructors
87         //- Construct null
88         H2O();
90         //- Construct from components
91         H2O
92         (
93             const liquid& l,
94             const NSRDSfunc5& density,
95             const NSRDSfunc1& vapourPressure,
96             const NSRDSfunc6& heatOfVapourisation,
97             const NSRDSfunc0& heatCapacity,
98             const NSRDSfunc0& enthalpy,
99             const NSRDSfunc7& idealGasHeatCapacity,
100             const NSRDSfunc4& secondVirialCoeff,
101             const NSRDSfunc1& dynamicViscosity,
102             const NSRDSfunc2& vapourDynamicViscosity,
103             const NSRDSfunc0& thermalConductivity,
104             const NSRDSfunc2& vapourThermalConductivity,
105             const NSRDSfunc6& surfaceTension,
106             const APIdiffCoefFunc& vapourDiffussivity
107         );
109         //- Construct from Istream
110         H2O(Istream& is);
113     // Member Functions
115         //- Liquid density [kg/m^3]
116         inline scalar rho(scalar p, scalar T) const;
118         //- Vapour pressure [Pa]
119         inline scalar pv(scalar p, scalar T) const;
121         //- Heat of vapourisation [J/kg]
122         inline scalar hl(scalar p, scalar T) const;
124         //- Liquid heat capacity [J/(kg K)]
125         inline scalar cp(scalar p, scalar T) const;
127         //- Liquid Enthalpy [J/(kg)]
128         inline scalar h(scalar p, scalar T) const;
130         //- Ideal gas heat capacity [J/(kg K)]
131         inline scalar cpg(scalar p, scalar T) const;
133         //- Second Virial Coefficient [m^3/kg]
134         inline scalar B(scalar p, scalar T) const;
136         //- Liquid viscosity [Pa s]
137         inline scalar mu(scalar p, scalar T) const;
139         //- Vapour viscosity [Pa s]
140         inline scalar mug(scalar p, scalar T) const;
142         //- Liquid thermal conductivity  [W/(m K)]
143         inline scalar K(scalar p, scalar T) const;
145         //- Vapour thermal conductivity  [W/(m K)]
146         inline scalar Kg(scalar p, scalar T) const;
148         //- Surface tension [N/m]
149         inline scalar sigma(scalar p, scalar T) const;
151         //- Vapour diffussivity [m2/s]
152         inline scalar D(scalar p, scalar T) const;
154         //- Vapour diffussivity [m2/s] with specified binary pair
155         inline scalar D(scalar p, scalar T, scalar Wb) const;
158     // I-O
160         //- Write the function coefficients
161         void writeData(Ostream& os) const
162         {
163             liquid::writeData(os); os << nl;
164             rho_.writeData(os); os << nl;
165             pv_.writeData(os); os << nl;
166             hl_.writeData(os); os << nl;
167             cp_.writeData(os); os << nl;
168             cpg_.writeData(os); os << nl;
169             B_.writeData(os); os << nl;
170             mu_.writeData(os); os << nl;
171             mug_.writeData(os); os << nl;
172             K_.writeData(os); os << nl;
173             Kg_.writeData(os); os << nl;
174             sigma_.writeData(os); os << nl;
175             D_.writeData(os); os << endl;
176         }
179         //- Ostream Operator
180         friend Ostream& operator<<(Ostream& os, const H2O& l)
181         {
182             l.writeData(os);
183             return os;
184         }
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 } // End namespace Foam
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 #include "H2OI.H"
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #endif
200 // ************************************************************************* //