OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

NSRDSfunc6.H

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