1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 API function for vapour mass diffusivity
33 API (American Petroleum Institute)
37 \*---------------------------------------------------------------------------*/
39 #ifndef APIdiffCoefFunc_H
40 #define APIdiffCoefFunc_H
42 #include "thermophysicalFunction.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class APIdiffCoefFunc Declaration
51 \*---------------------------------------------------------------------------*/
55 public thermophysicalFunction
59 // API vapour mass diffusivity function coefficients
60 scalar a_, b_, wf_, wa_;
68 //- Runtime type information
69 TypeName("APIdiffCoefFunc");
74 //- Construct from components
75 APIdiffCoefFunc(scalar a, scalar b, scalar wf, scalar wa)
81 alpha_(sqrt(1/wf_ + 1/wa_)),
82 beta_(sqr((cbrt(a_) + cbrt(b_))))
85 //- Construct from Istream
86 APIdiffCoefFunc(Istream& is)
92 alpha_(sqrt(1/wf_ + 1/wa_)),
93 beta_(sqr((cbrt(a_) + cbrt(b_))))
99 //- API vapour mass diffusivity function using properties from
101 scalar f(scalar p, scalar T) const
103 return 3.6059e-3*(pow(1.8*T, 1.75))*alpha_/(p*beta_);
106 //- Write the function coefficients
107 void writeData(Ostream& os) const
109 os << a_ << token::SPACE
110 << b_ << token::SPACE
111 << wf_ << token::SPACE
118 friend Ostream& operator<<(Ostream& os, const APIdiffCoefFunc& f)
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace Foam
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 // ************************************************************************* //