BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / specie / equationOfState / icoPolynomial / icoPolynomial.H
blobd293abc8f91ba75f9dab2bbe77ec5290e2e6aa2c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::icoPolynomial
27 Description
28     Incompressible, polynomial form of equation of state, using a polynomial
29     function for density.
31 SourceFiles
32     icoPolynomialI.H
33     icoPolynomial.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef icoPolynomial_H
38 #define icoPolynomial_H
40 #include "specie.H"
41 #include "autoPtr.H"
42 #include "Polynomial.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward declaration of friend functions and operators
51 template<int PolySize>
52 class icoPolynomial;
54 template<int PolySize>
55 icoPolynomial<PolySize> operator+
57     const icoPolynomial<PolySize>&,
58     const icoPolynomial<PolySize>&
61 template<int PolySize>
62 icoPolynomial<PolySize> operator-
64     const icoPolynomial<PolySize>&,
65     const icoPolynomial<PolySize>&
68 template<int PolySize>
69 icoPolynomial<PolySize> operator*
71     const scalar,
72     const icoPolynomial<PolySize>&
75 template<int PolySize>
76 icoPolynomial<PolySize> operator==
78     const icoPolynomial<PolySize>&,
79     const icoPolynomial<PolySize>&
82 template<int PolySize>
83 Ostream& operator<<
85     Ostream&,
86     const icoPolynomial<PolySize>&
90 /*---------------------------------------------------------------------------*\
91                         Class icoPolynomial Declaration
92 \*---------------------------------------------------------------------------*/
94 template<int PolySize>
95 class icoPolynomial
97     public specie
99     // Private data
101         //- Density polynomial coefficients
102         //  Note: input in [kg/m3], but internally uses [kg/m3/kmol]
103         Polynomial<PolySize> rhoCoeffs_;
106 public:
108     // Constructors
110         //- Construct from components
111         inline icoPolynomial
112         (
113             const specie& sp,
114             const Polynomial<PolySize>& rhoPoly
115         );
117         //- Construct from Istream
118         icoPolynomial(Istream&);
120         //- Construct from dictionary
121         icoPolynomial(const dictionary& dict);
123         //- Construct as copy
124         inline icoPolynomial(const icoPolynomial&);
126         //- Construct as named copy
127         inline icoPolynomial(const word& name, const icoPolynomial&);
129         //- Construct and return a clone
130         inline autoPtr<icoPolynomial> clone() const;
132         // Selector from Istream
133         inline static autoPtr<icoPolynomial> New(Istream& is);
135         // Selector from dictionary
136         inline static autoPtr<icoPolynomial> New(const dictionary& dict);
139     // Member functions
141         // Fundamental properties
143             //- Return density [kg/m^3]
144             inline scalar rho(scalar p, scalar T) const;
146             //- Return compressibility rho/p [s^2/m^2]
147             inline scalar psi(scalar p, scalar T) const;
149             //- Return compression factor []
150             inline scalar Z(scalar p, scalar T) const;
153         // I-O
155             //- Write to Ostream
156             void write(Ostream& os) const;
159     // Member operators
161         inline icoPolynomial& operator=(const icoPolynomial&);
162         inline void operator+=(const icoPolynomial&);
163         inline void operator-=(const icoPolynomial&);
165         inline void operator*=(const scalar);
168     // Friend operators
170         friend icoPolynomial operator+ <PolySize>
171         (
172             const icoPolynomial&,
173             const icoPolynomial&
174         );
176         friend icoPolynomial operator- <PolySize>
177         (
178             const icoPolynomial&,
179             const icoPolynomial&
180         );
182         friend icoPolynomial operator* <PolySize>
183         (
184             const scalar s,
185             const icoPolynomial&
186         );
188         friend icoPolynomial operator== <PolySize>
189         (
190             const icoPolynomial&,
191             const icoPolynomial&
192         );
195     // Ostream Operator
197         friend Ostream& operator<< <PolySize>(Ostream&, const icoPolynomial&);
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #define makeIcoPolynomial(PolySize)                                          \
208                                                                              \
209 defineTemplateTypeNameAndDebugWithName                                       \
210 (                                                                            \
211     icoPolynomial<PolySize>,                                                 \
212     "icoPolynomial<"#PolySize">",                                            \
213     0                                                                        \
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 #include "icoPolynomialI.H"
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 #ifdef NoRepository
223 #   include "icoPolynomial.C"
224 #endif
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 #endif
230 // ************************************************************************* //