![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 APIdiffCoefFunc 00027 00028 Description 00029 API function for vapour mass diffusivity 00030 00031 Source: 00032 API (American Petroleum Institute) 00033 Technical Data Book 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef APIdiffCoefFunc_H 00038 #define APIdiffCoefFunc_H 00039 00040 #include "thermophysicalFunction.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class APIdiffCoefFunc Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class APIdiffCoefFunc 00052 : 00053 public thermophysicalFunction 00054 { 00055 // Private data 00056 00057 // API vapour mass diffusivity function coefficients 00058 scalar a_, b_, wf_, wa_; 00059 00060 00061 public: 00062 00063 //- Runtime type information 00064 TypeName("APIdiffCoefFunc"); 00065 00066 00067 // Constructors 00068 00069 //- Construct from components 00070 APIdiffCoefFunc(scalar a, scalar b, scalar wf, scalar wa) 00071 : 00072 a_(a), 00073 b_(b), 00074 wf_(wf), 00075 wa_(wa) 00076 {} 00077 00078 //- Construct from Istream 00079 APIdiffCoefFunc(Istream& is) 00080 : 00081 a_(readScalar(is)), 00082 b_(readScalar(is)), 00083 wf_(readScalar(is)), 00084 wa_(readScalar(is)) 00085 {} 00086 00087 00088 // Member Functions 00089 00090 //- API vapour mass diffusivity function 00091 scalar f(scalar p, scalar T) const 00092 { 00093 return 00094 3.6059e-3*(pow(1.8*T, 1.75))*sqrt(1/wf_ + 1/wa_) 00095 /(p*sqr((pow(a_, (1.0/3.0)) + pow(b_, (1.0/3.0))))); 00096 } 00097 00098 00099 //- Write the function coefficients 00100 void writeData(Ostream& os) const 00101 { 00102 os << a_ << token::SPACE 00103 << b_ << token::SPACE 00104 << wf_ << token::SPACE 00105 << wa_; 00106 } 00107 00108 00109 // Ostream Operator 00110 00111 friend Ostream& operator<<(Ostream& os, const APIdiffCoefFunc& f) 00112 { 00113 f.writeData(os); 00114 return os; 00115 } 00116 }; 00117 00118 00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00120 00121 } // End namespace Foam 00122 00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00124 00125 #endif 00126 00127 // ************************************************************************* //