FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::NSRDSfunc6
00026 
00027 Description
00028     NSRDS function number 106
00029 
00030     Source:
00031     @verbatim
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     @endverbatim
00051 
00052 \*---------------------------------------------------------------------------*/
00053 
00054 #ifndef NSRDSfunc6_H
00055 #define NSRDSfunc6_H
00056 
00057 #include <thermophysicalFunctions/thermophysicalFunction.H>
00058 
00059 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00060 
00061 namespace Foam
00062 {
00063 
00064 /*---------------------------------------------------------------------------*\
00065                            Class NSRDSfunc6 Declaration
00066 \*---------------------------------------------------------------------------*/
00067 
00068 class NSRDSfunc6
00069 :
00070     public thermophysicalFunction
00071 {
00072     // Private data
00073 
00074         // NSRDS function 106 coefficients
00075         scalar Tc_, a_, b_, c_, d_, e_;
00076 
00077 
00078 public:
00079 
00080     //- Runtime type information
00081     TypeName("NSRDSfunc6");
00082 
00083 
00084     // Constructors
00085 
00086         //- Construct from components
00087         NSRDSfunc6(scalar Tc, scalar a, scalar b, scalar c, scalar d, scalar e)
00088         :
00089             Tc_(Tc),
00090             a_(a),
00091             b_(b),
00092             c_(c),
00093             d_(d),
00094             e_(e)
00095         {}
00096 
00097         //- Construct from Istream
00098         NSRDSfunc6(Istream& is)
00099         :
00100             Tc_(readScalar(is)),
00101             a_(readScalar(is)),
00102             b_(readScalar(is)),
00103             c_(readScalar(is)),
00104             d_(readScalar(is)),
00105             e_(readScalar(is))
00106         {}
00107 
00108 
00109     // Member Functions
00110 
00111         //- Evaluate the function and return the result
00112         scalar f(scalar, scalar T) const
00113         {
00114             scalar Tr = T/Tc_;
00115             return a_*pow(1 - Tr, ((e_*Tr + d_)*Tr + c_)*Tr + b_);
00116         }
00117 
00118 
00119         //- Write the function coefficients
00120         void writeData(Ostream& os) const
00121         {
00122             os  << Tc_ << token::SPACE
00123                 << a_ << token::SPACE
00124                 << b_ << token::SPACE
00125                 << c_ << token::SPACE
00126                 << d_ << token::SPACE
00127                 << e_;
00128         }
00129 
00130 
00131     // Ostream Operator
00132 
00133         friend Ostream& operator<<(Ostream& os, const NSRDSfunc6& f)
00134         {
00135             f.writeData(os);
00136             return os;
00137         }
00138 };
00139 
00140 
00141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00142 
00143 } // End namespace Foam
00144 
00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00146 
00147 #endif
00148 
00149 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines