initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / thermophysicalFunctions / NSRDSfunctions / NSRDSfunc1 / NSRDSfunc1.H
blob6136b91130e602346747cf0a008553e1937b0230
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::NSRDSfunc1
28 Description
29     NSRDS function number 101
31     Source:
32     @verbatim
33                       NSRDS - AICHE
34                  Data Compilation Tables
35                     of Properties of
36                      Pure Compounds
38         Design Institute for Physical Property Data
39           American Institute of Chemical Engineers
40                   345 East 47th Street
41                 New York, New York 10017
43          National Standard Reference Data System
44          American Institute of Chemical Engineers
46           T.E. Daubert       -       R.P. Danner
48             Department of Chemical Engineering
49             The Pennsylvania State University
50                 University Park, PA 16802
51     @endverbatim
53 \*---------------------------------------------------------------------------*/
55 #ifndef NSRDSfunc1_H
56 #define NSRDSfunc1_H
58 #include "thermophysicalFunction.H"
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 namespace Foam
65 /*---------------------------------------------------------------------------*\
66                            Class NSRDSfunc1 Declaration
67 \*---------------------------------------------------------------------------*/
69 class NSRDSfunc1
71     public thermophysicalFunction
73     // Private data
75         // NSRDS function 101 coefficients
76         scalar a_, b_, c_, d_, e_;
79 public:
81     //- Runtime type information
82     TypeName("NSRDSfunc1");
85     // Constructors
87         //- Construct from components
88         NSRDSfunc1(scalar a, scalar b, scalar c, scalar d, scalar e)
89         :
90             a_(a),
91             b_(b),
92             c_(c),
93             d_(d),
94             e_(e)
95         {}
97         //- Construct from Istream
98         NSRDSfunc1(Istream& is)
99         :
100             a_(readScalar(is)),
101             b_(readScalar(is)),
102             c_(readScalar(is)),
103             d_(readScalar(is)),
104             e_(readScalar(is))
105         {}
108     // Member Functions
110         //- Evaluate the function and return the result
111         scalar f(scalar, scalar T) const
112         {
113             return exp(a_ + b_/T + c_*log(T) + d_*pow(T, e_));
114         }
117         //- Write the function coefficients
118         void writeData(Ostream& os) const
119         {
120             os  << a_ << token::SPACE
121                 << b_ << token::SPACE
122                 << c_ << token::SPACE
123                 << d_ << token::SPACE
124                 << e_;
125         }
128     // Ostream Operator
130         friend Ostream& operator<<(Ostream& os, const NSRDSfunc1& f)
131         {
132             f.writeData(os);
133             return os;
134         }
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 #endif
146 // ************************************************************************* //