Merge branch 'upstream/OpenFOAM' into master
[freefoam.git] / src / thermophysicalModels / liquids / IDEA / IDEA.H
blobe8da7bda36874e07c7bddee54cdbe8e549469887
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::IDEA
28 Description
29     The IDEA fuel is constructed by adding 30% alphaMethylNaphthalene
30     with 70% n-decane.
32     The new properties have been calculated by adding the values in these
33     proportions and making a least square fit, using the same NSRDS-eq.
34     so that Y = 0.3*Y_naphthalene + 0.7*Y_decane
36     The valid Temperature range for n-decane is normally 243.51 - 617.70 K
37     and for the naphthalene it is 242.67 - 772.04 K
38     The least square fit was done in the interval 244 - 617 K
40     The critical temperature was taken to be 618.074 K, since this
41     is the 'c'-value in the rho-equation, which corresponds to Tcrit,
42     This value was then used in the fit for the NSRDS6-eq, which uses Tcrit.
43     (important for the latent heat and surface tension)
45     The molecular weights are 142.20 and 142.285 and for the IDEA fuel
46     it is thus 142.26 ( approximately 0.3*142.2 + 0.7*142.285 )
48     Critical pressure was set to the lowest one (n-Decane)
50     Critical volume... also the lowest one (naphthalene) 0.523 m^3/kmol
52     Second Virial Coefficient is n-Decane
54 SourceFiles
55     IDEA.C
57 \*---------------------------------------------------------------------------*/
59 #ifndef IDEA_H
60 #define IDEA_H
62 #include <liquids/liquid.H>
63 #include <thermophysicalFunctions/NSRDSfunc0.H>
64 #include <thermophysicalFunctions/NSRDSfunc1.H>
65 #include <thermophysicalFunctions/NSRDSfunc2.H>
66 #include <thermophysicalFunctions/NSRDSfunc3.H>
67 #include <thermophysicalFunctions/NSRDSfunc4.H>
68 #include <thermophysicalFunctions/NSRDSfunc5.H>
69 #include <thermophysicalFunctions/NSRDSfunc6.H>
70 #include <thermophysicalFunctions/NSRDSfunc7.H>
71 #include <thermophysicalFunctions/APIdiffCoefFunc.H>
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 namespace Foam
78 /*---------------------------------------------------------------------------*\
79                            Class IDEA Declaration
80 \*---------------------------------------------------------------------------*/
82 class IDEA
84     public liquid
86     // Private data
88         NSRDSfunc5 rho_;
89         NSRDSfunc1 pv_;
90         NSRDSfunc6 hl_;
91         NSRDSfunc0 cp_;
92         NSRDSfunc0 h_;
93         NSRDSfunc7 cpg_;
94         NSRDSfunc4 B_;
95         NSRDSfunc1 mu_;
96         NSRDSfunc2 mug_;
97         NSRDSfunc0 K_;
98         NSRDSfunc2 Kg_;
99         NSRDSfunc6 sigma_;
100         APIdiffCoefFunc D_;
103 public:
105     //- Runtime type information
106     TypeName("IDEA");
109     // Constructors
111         //- Construct null
112         IDEA();
114         // Construct from components
115         IDEA
116         (
117             const liquid& l,
118             const NSRDSfunc5& density,
119             const NSRDSfunc1& vapourPressure,
120             const NSRDSfunc6& heatOfVapourisation,
121             const NSRDSfunc0& heatCapacity,
122             const NSRDSfunc0& enthalpy,
123             const NSRDSfunc7& idealGasHeatCapacity,
124             const NSRDSfunc4& secondVirialCoeff,
125             const NSRDSfunc1& dynamicViscosity,
126             const NSRDSfunc2& vapourDynamicViscosity,
127             const NSRDSfunc0& thermalConductivity,
128             const NSRDSfunc2& vapourThermalConductivity,
129             const NSRDSfunc6& surfaceTension,
130             const APIdiffCoefFunc& vapourDiffussivity
131         );
133         //- Construct from Istream
134         IDEA(Istream& is);
137     // Member Functions
139         //- Liquid density [kg/m^3]
140         inline scalar rho(scalar p, scalar T) const;
142         //- Vapour pressure [Pa]
143         inline scalar pv(scalar p, scalar T) const;
145         //- Heat of vapourisation [J/kg]
146         inline scalar hl(scalar p, scalar T) const;
148         //- Liquid heat capacity [J/(kg K)]
149         inline scalar cp(scalar p, scalar T) const;
151         //- Liquid Enthalpy [J/(kg)]
152         inline scalar h(scalar p, scalar T) const;
154         //- Ideal gas heat capacity [J/(kg K)]
155         inline scalar cpg(scalar p, scalar T) const;
157         //- Second Virial Coefficient [m^3/kg]
158         inline scalar B(scalar p, scalar T) const;
160         //- Liquid viscosity [Pa s]
161         inline scalar mu(scalar p, scalar T) const;
163         //- Vapour viscosity [Pa s]
164         inline scalar mug(scalar p, scalar T) const;
166         //- Liquid thermal conductivity  [W/(m K)]
167         inline scalar K(scalar p, scalar T) const;
169         //- Vapour thermal conductivity  [W/(m K)]
170         inline scalar Kg(scalar p, scalar T) const;
172         //- Surface tension [N/m]
173         inline scalar sigma(scalar p, scalar T) const;
175         //- Vapour diffussivity [m2/s]
176         inline scalar D(scalar p, scalar T) const;
179     // I-O
181         //- Write the function coefficients
182         void writeData(Ostream& os) const
183         {
184             liquid::writeData(os); os << nl;
185             rho_.writeData(os); os << nl;
186             pv_.writeData(os); os << nl;
187             hl_.writeData(os); os << nl;
188             cp_.writeData(os); os << nl;
189             cpg_.writeData(os); os << nl;
190             mu_.writeData(os); os << nl;
191             mug_.writeData(os); os << nl;
192             K_.writeData(os); os << nl;
193             Kg_.writeData(os); os << nl;
194             sigma_.writeData(os); os << nl;
195             D_.writeData(os); os << endl;
196         }
198         //- Ostream Operator
199         friend Ostream& operator<<(Ostream& os, const IDEA& l)
200         {
201             l.writeData(os);
202             return os;
203         }
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 } // End namespace Foam
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 #include "IDEAI.H"
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 #endif
219 // ************************ vim: set sw=4 sts=4 et: ************************ //