integratedNonUniformTableThermophysicalFunction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2020 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::thermophysicalFunctions::integratedNonUniformTable
28 
29 Description
30  Non-uniform tabulated property function that linearly interpolates between
31  the values.
32 
33  To speed-up the search of the non-uniform table a uniform jump-table is
34  created on construction which is used for fast indirect addressing into
35  the table.
36 
37 Usage
38  \integratedNonUniformTable
39  Property | Description
40  values | List of (temperature property) value pairs
41  \endintegratedNonUniformTable
42 
43  Example for the density of water between 280 and 350K
44  \verbatim
45  rho
46  {
47  type integratedNonUniformTable;
48 
49  values
50  (
51  (280 999.87)
52  (300 995.1)
53  (350 973.7)
54  );
55  }
56  \endverbatim
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef integratedNonUniformTableThermophysicalFunction_H
61 #define integratedNonUniformTableThermophysicalFunction_H
62 
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 namespace thermophysicalFunctions
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class integratedNonUniformTable Declaration
74 \*---------------------------------------------------------------------------*/
75 
77 :
78  public nonUniformTable
79 {
80  // Private Data
81 
82  List<scalar> intf_;
83 
84  List<scalar> intfByT_;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("integratedNonUniformTable");
91 
92 
93  // Constructors
94 
95  //- Construct from entry name and dictionary
97 
98  //- Construct from dictionary, using "values" for the lookup
99  explicit integratedNonUniformTable(const dictionary& dict);
100 
101 
102  // Member Functions
103 
104  //- Integrate the function and return the result
105  scalar intfdT(scalar p, scalar T) const;
106 
107  //- Integrate the function divided by T and return the result
108  scalar intfByTdT(scalar p, scalar T) const;
109 
110  //- Write the function coefficients
111  void writeData(Ostream& os) const;
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace thermophysicalFunctions
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::thermophysicalFunctions::integratedNonUniformTable::integratedNonUniformTable
integratedNonUniformTable(const word &name, const dictionary &dict)
Construct from entry name and dictionary.
Definition: integratedNonUniformTableThermophysicalFunction.C:55
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::thermophysicalFunctions::integratedNonUniformTable::writeData
void writeData(Ostream &os) const
Write the function coefficients.
Definition: integratedNonUniformTableThermophysicalFunction.C:132
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::thermophysicalFunctions::integratedNonUniformTable
Non-uniform tabulated property function that linearly interpolates between the values.
Definition: integratedNonUniformTableThermophysicalFunction.H:75
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::thermophysicalFunctions::integratedNonUniformTable::TypeName
TypeName("integratedNonUniformTable")
Runtime type information.
Foam::thermophysicalFunctions::integratedNonUniformTable::intfByTdT
scalar intfByTdT(scalar p, scalar T) const
Integrate the function divided by T and return the result.
Definition: integratedNonUniformTableThermophysicalFunction.C:115
nonUniformTableThermophysicalFunction.H
Foam::List< scalar >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::nonUniformTable
Definition: nonUniformTableThermophysicalFunction.H:76
Foam::thermophysicalFunctions::integratedNonUniformTable::intfdT
scalar intfdT(scalar p, scalar T) const
Integrate the function and return the result.
Definition: integratedNonUniformTableThermophysicalFunction.C:97