Loading...
Searching...
No Matches
thermoCoupleProbes.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) 2016-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::functionObjects::thermoCoupleProbes
28
29Group
30 grpUtilitiesFunctionObjects
31
32Description
33 Sample probe for temperature using a thermocouple.
34
35 Uses the correlation:
36
37 \f[
38 Nu = 2.0 + \left(0.4 Re^{0.5} + 0.06 Re^{2/3}\right)*Pr^{0.4}
39 \f]
40
41Usage
42 Minimal example by using \c system/controlDict.functions:
43 \verbatim
44 thermoCoupleProbesFO
45 {
46 // Mandatory entries
47 type thermoCoupleProbes;
48 libs (utilityFunctionObjects);
49 radiationField <word>; // G;
50
51 rho <scalar>;
52 Cp <scalar>;
53 d <scalar>;
54 epsilon <scalar>;
55
56 // Optional entries
57 U <word>;
58
59 // Inherited entries
60 probeLocations (<vectorList>);
61 fields (<wordList>);
62 ...
63 }
64 \endverbatim
65
66 where the entries mean:
67 \table
68 Property | Description | Type | Reqd | Deflt
69 type | Type name: systemCall | word | yes | -
70 libs | Library name: utilityFunctionObjects | word | yes | -
71 radiationField | Name of the radiation field | word | yes | -
72 rho | Thermocouple density | scalar | yes | -
73 Cp | Thermocouple heat capacity | scalar | yes | -
74 d | Thermocouple diameter | scalar | yes | -
75 epsilon | Thermocouple emissivity | scalar | yes | -
76 U | Name of the velocity field | word | no | U
77 \endtable
78
79 The inherited entries are elaborated in:
80 - \link probes.H \endlink
81 - \link ODESystem.H \endlink
82
83SourceFiles
84 thermoCoupleProbes.C
85
86\*---------------------------------------------------------------------------*/
87
88#ifndef Foam_functionObjects_thermoCoupleProbes_H
89#define Foam_functionObjects_thermoCoupleProbes_H
90
91#include "probes.H"
92#include "ODESystem.H"
93#include "ODESolver.H"
94#include "basicThermo.H"
95#include "fluidThermo.H"
96
97// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98
99namespace Foam
100{
101namespace functionObjects
102{
103
104/*---------------------------------------------------------------------------*\
105 Class thermoCoupleProbes Declaration
106\*---------------------------------------------------------------------------*/
107
109:
110 public probes,
111 public ODESystem
112{
113protected:
114
115 // Protected Data
116
117 //- Thermocouple density
118 scalar rho_;
119
120 //- Thermocouple heat capacity
121 scalar Cp_;
122
123 //- Thermocouple diameter
124 scalar d_;
125
126 //- Thermocouple emissivity
127 scalar epsilon_;
128
129 //- Name of the velocity field
130 word UName_;
131
132 //- Name of the incident radiation field
134
135 //- Fluid thermo reference
136 const fluidThermo& thermo_;
137
138 //- ODESolver
139 autoPtr<ODESolver> odeSolver_;
140
141 //- Cached thermocouple temperature
143
144
145private:
146
147 // Private Member Functions
148
149 //- Sample/write
150 template<class Type>
151 void writeValues
152 (
153 const word& fieldName,
154 const Field<Type>& values,
155 const scalar timeValue
156 );
158 //- No copy construct
159 thermoCoupleProbes(const thermoCoupleProbes&) = delete;
160
161 //- No copy assignment
162 void operator=(const thermoCoupleProbes&) = delete;
163
164
165public:
166
167 //- Runtime type information
168 TypeName("thermoCoupleProbes");
170
171 // Constructors
172
173 //- Construct for given objectRegistry and dictionary.
174 // Allow the possibility to load fields from files
175 thermoCoupleProbes
176 (
177 const word& name,
178 const Time& runTime,
180 const bool loadFromFiles = false,
181 const bool readFields = true
182 );
183
185 //- Destructor
186 virtual ~thermoCoupleProbes() = default;
187
188
189 // ODE functions (overriding abstract functions in ODE.H)
190
191 //- Number of ODE's to solve
192 virtual label nEqns() const;
193
194 virtual void derivatives
195 (
196 const scalar x,
197 const scalarField& y,
198 scalarField& dydx
199 ) const;
200
201 virtual void jacobian
202 (
203 const scalar t,
205 scalarField& dfdt,
207 ) const;
208
210 // Public Member Functions
211
212 //- Read the function-object dictionary
213 virtual bool read(const dictionary&);
214
215 //- Execute the function-object operations
216 // Evaluates the ODESolver
217 virtual bool execute();
218
219 //- Write the function-object results
220 virtual bool write();
221};
222
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226} // End namespace functionObjects
227} // End namespace Foam
228
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231#ifdef NoRepository
232 #include "thermoCoupleProbes.txx"
233#endif
234
235// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236
237#endif
238
239// ************************************************************************* //
scalar y
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
ODESystem()
Construct null.
Definition ODESystem.H:53
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Fundamental fluid thermodynamic properties.
Definition fluidThermo.H:52
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition readFields.H:146
Sample probe for temperature using a thermocouple.
const fluidThermo & thermo_
Fluid thermo reference.
scalar Cp_
Thermocouple heat capacity.
word UName_
Name of the velocity field.
virtual void jacobian(const scalar t, const scalarField &y, scalarField &dfdt, scalarSquareMatrix &dfdy) const
Calculate the Jacobian of the system.
scalar epsilon_
Thermocouple emissivity.
word radiationFieldName_
Name of the incident radiation field.
autoPtr< ODESolver > odeSolver_
ODESolver.
virtual void derivatives(const scalar x, const scalarField &y, scalarField &dydx) const
Calculate the derivatives in dydx.
TypeName("thermoCoupleProbes")
Runtime type information.
virtual label nEqns() const
Number of ODE's to solve.
virtual ~thermoCoupleProbes()=default
Destructor.
virtual bool execute()
Execute the function-object operations.
scalarField Ttc_
Cached thermocouple temperature.
virtual bool write()
Write the function-object results.
virtual bool read(const dictionary &)
Read the function-object dictionary.
probes(const word &name, const Time &runTime, const dictionary &dict, const bool loadFromFiles=false, const bool readFields=true)
Construct from Time and dictionary.
Definition probes.C:41
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
SquareMatrix< scalar > scalarSquareMatrix
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68