Merge branch 'upstream/OpenFOAM' into master
[freefoam.git] / src / thermophysicalModels / liquids / C2H6 / C2H6.H
blob07e95b6337bde85372c9ebbbf8399a7a98d18981
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::C2H6
28 Description
29     ethane
31 SourceFiles
32     C2H6.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef C2H6_H
37 #define C2H6_H
39 #include <liquids/liquid.H>
40 #include <thermophysicalFunctions/NSRDSfunc0.H>
41 #include <thermophysicalFunctions/NSRDSfunc1.H>
42 #include <thermophysicalFunctions/NSRDSfunc2.H>
43 #include <thermophysicalFunctions/NSRDSfunc3.H>
44 #include <thermophysicalFunctions/NSRDSfunc4.H>
45 #include <thermophysicalFunctions/NSRDSfunc5.H>
46 #include <thermophysicalFunctions/NSRDSfunc6.H>
47 #include <thermophysicalFunctions/NSRDSfunc7.H>
48 #include <thermophysicalFunctions/NSRDSfunc14.H>
49 #include <thermophysicalFunctions/APIdiffCoefFunc.H>
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 /*---------------------------------------------------------------------------*\
57                            Class C2H6 Declaration
58 \*---------------------------------------------------------------------------*/
60 class C2H6
62     public liquid
64     // Private data
66         NSRDSfunc5 rho_;
67         NSRDSfunc1 pv_;
68         NSRDSfunc6 hl_;
69         NSRDSfunc14 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("C2H6");
87     // Constructors
89         //- Construct null
90         C2H6();
92         //- Construct from components
93         C2H6
94         (
95             const liquid& l,
96             const NSRDSfunc5& density,
97             const NSRDSfunc1& vapourPressure,
98             const NSRDSfunc6& heatOfVapourisation,
99             const NSRDSfunc14& 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         C2H6(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 C2H6& l)
179         {
180             l.writeData(os);
181             return os;
182         }
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 #include "C2H6I.H"
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #endif
198 // ************************ vim: set sw=4 sts=4 et: ************************ //