initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / liquids / CH3OH / CH3OH.H
blob11deb6a8617afda836335894044d13924e744cb0
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::CH3OH
28 Description
29     methanol
31 SourceFiles
32     CH3OH.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef CH3OH_H
37 #define CH3OH_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 "NSRDSfunc14.H"
49 #include "APIdiffCoefFunc.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 /*---------------------------------------------------------------------------*\
57                            Class CH3OH Declaration
58 \*---------------------------------------------------------------------------*/
60 class CH3OH
62     public liquid
64     // Private data
66         NSRDSfunc5 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_;
81 public:
83     //- Runtime type information
84     TypeName("CH3OH");
87     // Constructors
89         //- Construct null
90         CH3OH();
92         //- Construct from components
93         CH3OH
94         (
95             const liquid& l,
96             const NSRDSfunc5& 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         CH3OH(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 CH3OH& l)
179         {
180             l.writeData(os);
181             return os;
182         }
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 #include "CH3OHI.H"
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #endif
198 // ************************************************************************* //