initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / thermophysicalModels / liquids / C8H10 / C8H10.H
blob425b00813d3df0691e53b488519b9a472f3e36b4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::C8H10
28 Description
29     ethylBenzene
31 SourceFiles
32     C8H10.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef C8H10_H
37 #define C8H10_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 C8H10 Declaration
57 \*---------------------------------------------------------------------------*/
59 class C8H10
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("C8H10");
86     // Constructors
88         //- Construct null
89         C8H10()
90         :
91             liquid(106.167, 617.17, 3.6094e+6, 0.37381, 0.263, 178.15, 4.038e-3, 409.35, 1.9680e-30, 0.3036, 1.8043e+4),
92             rho_(76.3765398, 0.26438, 617.17, 0.2921),
93             pv_(88.246, -7691.1, -9.797, 5.931e-06, 2),
94             hl_(617.17, 516167.924119547, 0.3882, 0, 0, 0),
95             cp_(818.521762883005, 6.66873887366131, -0.0248005500767658, 4.23860521631015e-05, 0, 0),
96             // NN: enthalpy, h_, is not used in the sprayModel.
97             // For consistency, the enthalpy is derived from hlat and hl.
98             // It is, however, convenient to have it available.
99             h_(-524002.612929508, 818.521762883005, 3.33436943683065, -0.00826685002558862, 1.05965130407754e-05, 0),
100             cpg_(738.835984816374, 3201.5598067196, 1559, 2285.07916772632, -702),
101             B_(0.00165776559571242, -2.77958310962917, -388067.855359952, -5.86905535618412e+18, 1.58052878954854e+21),
102             mu_(-10.452, 1048.4, -0.0715, 0, 0),
103             mug_(1.2e-06, 0.4518, 439, 0),
104             K_(0.20149, -0.00023988, 0, 0, 0, 0),
105             Kg_(1.708e-05, 1.319, 565.6, 0),
106             sigma_(617.17, 0.066, 1.268, 0, 0, 0),
107             D_(147.18, 20.1, 106.167, 28) // NN: Same as nHeptane
108         {}
109         C8H10
110         (
111             const liquid& l,
112             const NSRDSfunc5& density,
113             const NSRDSfunc1& vapourPressure,
114             const NSRDSfunc6& heatOfVapourisation,
115             const NSRDSfunc0& heatCapacity,
116             const NSRDSfunc0& enthalpy,
117             const NSRDSfunc7& idealGasHeatCapacity,
118             const NSRDSfunc4& secondVirialCoeff,
119             const NSRDSfunc1& dynamicViscosity,
120             const NSRDSfunc2& vapourDynamicViscosity,
121             const NSRDSfunc0& thermalConductivity,
122             const NSRDSfunc2& vapourThermalConductivity,
123             const NSRDSfunc6& surfaceTension,
124             const APIdiffCoefFunc& vapourDiffussivity
125         )
126         :
127             liquid(l),
128             rho_(density),
129             pv_(vapourPressure),
130             hl_(heatOfVapourisation),
131             cp_(heatCapacity),
132             h_(enthalpy),
133             cpg_(idealGasHeatCapacity),
134             B_(secondVirialCoeff),
135             mu_(dynamicViscosity),
136             mug_(vapourDynamicViscosity),
137             K_(thermalConductivity),
138             Kg_(vapourThermalConductivity),
139             sigma_(surfaceTension),
140             D_(vapourDiffussivity)
141         {}
143         //- Construct from Istream
144         C8H10(Istream& is)
145         :
146             liquid(is),
147             rho_(is),
148             pv_(is),
149             hl_(is),
150             cp_(is),
151             h_(is),
152             cpg_(is),
153             B_(is),
154             mu_(is),
155             mug_(is),
156             K_(is),
157             Kg_(is),
158             sigma_(is),
159             D_(is)
160         {}
163     // Member Functions
165         //- Liquid density [kg/m^3]
166         scalar rho(scalar p, scalar T) const
167         {
168             return rho_.f(p, T);
169         }
171         //- Vapour pressure [Pa]
172         scalar pv(scalar p, scalar T) const
173         {
174             return pv_.f(p, T);
175         }
177         //- Heat of vapourisation [J/kg]
178         scalar hl(scalar p, scalar T) const
179         {
180             return hl_.f(p, T);
181         }
183         //- Liquid heat capacity [J/(kg K)]
184         scalar cp(scalar p, scalar T) const
185         {
186             return cp_.f(p, T);
187         }
189         //- Liquid Enthalpy [J/(kg)]
190         scalar h(scalar p, scalar T) const
191         {
192             return h_.f(p, T);
193         }
195         //- Ideal gas heat capacity [J/(kg K)]
196         scalar cpg(scalar p, scalar T) const
197         {
198             return cpg_.f(p, T);
199         }
201         //- Second Virial Coefficient [m^3/kg]
202         scalar B(scalar p, scalar T) const
203         {
204             return B_.f(p, T);
205         }
207         //- Liquid viscosity [Pa s]
208         scalar mu(scalar p, scalar T) const
209         {
210             return mu_.f(p, T);
211         }
213         //- Vapour viscosity [Pa s]
214         scalar mug(scalar p, scalar T) const
215         {
216             return mug_.f(p, T);
217         }
219         //- Liquid thermal conductivity  [W/(m K)]
220         scalar K(scalar p, scalar T) const
221         {
222             return K_.f(p, T);
223         }
225         //- Vapour thermal conductivity  [W/(m K)]
226         scalar Kg(scalar p, scalar T) const
227         {
228             return Kg_.f(p, T);
229         }
231         //- Surface tension [N/m]
232         scalar sigma(scalar p, scalar T) const
233         {
234             return sigma_.f(p, T);
235         }
237         //- Vapour diffussivity [m2/s]
238         scalar D(scalar p, scalar T) const
239         {
240             return D_.f(p, T);
241         }
244         //- Write the function coefficients
245         void writeData(Ostream& os) const
246         {
247             liquid::writeData(os); os << nl;
248             rho_.writeData(os); os << nl;
249             pv_.writeData(os); os << nl;
250             hl_.writeData(os); os << nl;
251             cp_.writeData(os); os << nl;
252             cpg_.writeData(os); os << nl;
253             B_.writeData(os); os << nl;
254             mu_.writeData(os); os << nl;
255             mug_.writeData(os); os << nl;
256             K_.writeData(os); os << nl;
257             Kg_.writeData(os); os << nl;
258             sigma_.writeData(os); os << nl;
259             D_.writeData(os); os << endl;
260         }
263     // Ostream Operator
265         friend Ostream& operator<<(Ostream& os, const C8H10& l)
266         {
267             l.writeData(os);
268             return os;
269         }
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 } // End namespace Foam
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
279 #endif
281 // ************************************************************************* //