![]() |
|
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 NSRDSfunc2 00027 00028 Description 00029 NSRDS function number 102 00030 00031 Source: 00032 NSRDS - AICHE 00033 Data Compilation Tables 00034 of Properties of 00035 Pure Compounds 00036 00037 Design Institute for Physical Property Data 00038 American Institute of Chemical Engineers 00039 345 East 47th Street 00040 New York, New York 10017 00041 00042 National Standard Reference Data System 00043 American Institute of Chemical Engineers 00044 00045 T.E. Daubert - R.P. Danner 00046 00047 Department of Chemical Engineering 00048 The Pennsylvania State University 00049 University Park, PA 16802 00050 00051 \*---------------------------------------------------------------------------*/ 00052 00053 #ifndef NSRDSfunc2_H 00054 #define NSRDSfunc2_H 00055 00056 #include "thermophysicalFunction.H" 00057 00058 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00059 00060 namespace Foam 00061 { 00062 00063 /*---------------------------------------------------------------------------*\ 00064 Class NSRDSfunc2 Declaration 00065 \*---------------------------------------------------------------------------*/ 00066 00067 class NSRDSfunc2 00068 : 00069 public thermophysicalFunction 00070 { 00071 // Private data 00072 00073 // NSRDS function 102 coefficients 00074 scalar a_, b_, c_, d_; 00075 00076 00077 public: 00078 00079 //- Runtime type information 00080 TypeName("NSRDSfunc2"); 00081 00082 00083 // Constructors 00084 00085 //- Construct from components 00086 NSRDSfunc2(scalar a, scalar b, scalar c, scalar d) 00087 : 00088 a_(a), 00089 b_(b), 00090 c_(c), 00091 d_(d) 00092 {} 00093 00094 //- Construct from Istream 00095 NSRDSfunc2(Istream& is) 00096 : 00097 a_(readScalar(is)), 00098 b_(readScalar(is)), 00099 c_(readScalar(is)), 00100 d_(readScalar(is)) 00101 {} 00102 00103 00104 // Member Functions 00105 00106 //- Evaluate the function and return the result 00107 scalar f(scalar, scalar T) const 00108 { 00109 return a_*pow(T, b_)/(1.0 + c_/T + d_/sqr(T)); 00110 } 00111 00112 00113 //- Write the function coefficients 00114 void writeData(Ostream& os) const 00115 { 00116 os << a_ << token::SPACE 00117 << b_ << token::SPACE 00118 << c_ << token::SPACE 00119 << d_; 00120 } 00121 00122 00123 // Ostream Operator 00124 00125 friend Ostream& operator<<(Ostream& os, const NSRDSfunc2& f) 00126 { 00127 f.writeData(os); 00128 return os; 00129 } 00130 }; 00131 00132 00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00134 00135 } // End namespace Foam 00136 00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00138 00139 #endif 00140 00141 // ************************************************************************* //