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-2020 OpenCFD Ltd.
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::functionObjects::thermoCoupleProbes
28 
29 Group
30  grpUtilitiesFunctionObjects
31 
32 Description
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 
41 Usage
42  Example of function object specification:
43  \verbatim
44  probes
45  {
46  type thermoCoupleProbes;
47  libs (utilityFunctionObjects);
48  writeControl timeStep;
49  writeInterval 1;
50 
51  solver rodas23;
52  absTol 1e-12;
53  relTol 1e-8;
54 
55  interpolationScheme cellPoint;
56 
57  // thermocouple properties
58  rho 8908;
59  Cp 440;
60  d 1e-3;
61  epsilon 0.85;
62 
63  radiationField G;
64 
65  probeLocations
66  (
67  (0.5 0.5 0.5)
68  );
69  fields
70  (
71  T
72  );
73  }
74  \endverbatim
75 
76 
77 SourceFiles
78  thermoCoupleProbes.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef functionObjects_thermoCoupleProbes_H
83 #define functionObjects_thermoCoupleProbes_H
84 
85 #include "probes.H"
86 #include "ODESystem.H"
87 #include "ODESolver.H"
88 #include "basicThermo.H"
89 #include "fluidThermo.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 namespace functionObjects
96 {
97 
98 /*---------------------------------------------------------------------------*\
99  Class thermoCoupleProbes Declaration
100 \*---------------------------------------------------------------------------*/
101 
102 class thermoCoupleProbes
103 :
104  public probes,
105  public ODESystem
106 {
107 protected:
108 
109  // Protected data
110 
111  //- Thermocouple density
112  scalar rho_;
113 
114  //- Thermocouple heat capacity
115  scalar Cp_;
116 
117  //- Thermocouple diameter
118  scalar d_;
119 
120  //- Thermocouple emissivity
121  scalar epsilon_;
122 
123  //- Name of the velocity field
124  word UName_;
125 
126  //- Name of the incident radiation field
128 
129  //- Fluid thermo reference
130  const fluidThermo& thermo_;
131 
132  //- ODESolver
134 
135  //- Cached thermocouple temperature
137 
138 
139  // Protected Member Functions
140 
141  //- Sample and write a particular volume field
142  template<class Type>
143  void sampleAndWrite
144  (
146  );
147 
148 
149 private:
150 
151  //- No copy construct
152  thermoCoupleProbes(const thermoCoupleProbes&) = delete;
153 
154  //- No copy assignment
155  void operator=(const thermoCoupleProbes&) = delete;
156 
157 
158 public:
159 
160  //- Runtime type information
161  TypeName("thermoCoupleProbes");
162 
163 
164  // Constructors
165 
166  //- Construct for given objectRegistry and dictionary.
167  // Allow the possibility to load fields from files
169  (
170  const word& name,
171  const Time& runTime,
172  const dictionary& dict,
173  const bool loadFromFiles = false,
174  const bool readFields = true
175  );
176 
177 
178  //- Destructor
179  virtual ~thermoCoupleProbes();
180 
181 
182  // ODE functions (overriding abstract functions in ODE.H)
183 
184  //- Number of ODE's to solve
185  virtual label nEqns() const;
186 
187  virtual void derivatives
188  (
189  const scalar x,
190  const scalarField& y,
191  scalarField& dydx
192  ) const;
193 
194  virtual void jacobian
195  (
196  const scalar t,
197  const scalarField& y,
198  scalarField& dfdt,
199  scalarSquareMatrix& dfdy
200  ) const;
201 
202 
203  // Public Member Functions
204 
205  //- Sample and write
206  virtual bool write();
207 
208  //- Execute, currently does nothing
209  virtual bool execute();
210 
211  //- Read
212  virtual bool read(const dictionary&);
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace functionObjects
219 } // End namespace Foam
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #ifdef NoRepository
225 #endif
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 #endif
230 
231 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
basicThermo.H
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::functionObjects::thermoCoupleProbes::derivatives
virtual void derivatives(const scalar x, const scalarField &y, scalarField &dydx) const
Definition: thermoCoupleProbes.C:95
fluidThermo.H
Foam::fluidThermo
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:48
Foam::functionObjects::thermoCoupleProbes::nEqns
virtual label nEqns() const
Definition: thermoCoupleProbes.C:88
ODESystem.H
Foam::functionObjects::thermoCoupleProbes::execute
virtual bool execute()
Definition: thermoCoupleProbes.C:178
probes.H
Foam::Field
Generic templated field type.
Definition: Field.H:59
Foam::functionObjects::thermoCoupleProbes::~thermoCoupleProbes
virtual ~thermoCoupleProbes()
Definition: thermoCoupleProbes.C:84
Foam::functionObjects::thermoCoupleProbes::UName_
word UName_
Definition: thermoCoupleProbes.H:119
Foam::functionObjects::thermoCoupleProbes::write
virtual bool write()
Definition: thermoCoupleProbes.C:162
Foam::probes
Set of locations to sample.
Definition: probes.H:106
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
Foam::functionObjects::thermoCoupleProbes::Cp_
scalar Cp_
Definition: thermoCoupleProbes.H:110
ODESolver.H
Foam::functionObjects::thermoCoupleProbes::epsilon_
scalar epsilon_
Definition: thermoCoupleProbes.H:116
Foam::functionObjects::thermoCoupleProbes::TypeName
TypeName("thermoCoupleProbes")
Foam::functionObjects::thermoCoupleProbes::sampleAndWrite
void sampleAndWrite(const GeometricField< Type, fvPatchField, volMesh > &)
Definition: thermoCoupleProbesTemplates.C:25
Foam
Definition: atmBoundaryLayer.C:26
Foam::functionObjects::thermoCoupleProbes
Sample probe for temperature using a thermocouple.
Definition: thermoCoupleProbes.H:97
Foam::functionObjects::thermoCoupleProbes::thermo_
const fluidThermo & thermo_
Definition: thermoCoupleProbes.H:125
Foam::functionObjects::thermoCoupleProbes::odeSolver_
autoPtr< ODESolver > odeSolver_
Definition: thermoCoupleProbes.H:128
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:49
Foam::SquareMatrix< scalar >
Foam::functionObject::name
const word & name() const noexcept
Definition: functionObject.C:136
Foam::ODESystem
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:43
Foam::functionObjects::thermoCoupleProbes::d_
scalar d_
Definition: thermoCoupleProbes.H:113
Foam::functionObjects::readFields
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition: readFields.H:151
Foam::functionObjects::thermoCoupleProbes::radiationFieldName_
word radiationFieldName_
Definition: thermoCoupleProbes.H:122
x
x
Definition: LISASMDCalcMethod2.H:52
thermoCoupleProbesTemplates.C
Foam::functionObjects::thermoCoupleProbes::rho_
scalar rho_
Definition: thermoCoupleProbes.H:107
Foam::functionObjects::thermoCoupleProbes::jacobian
virtual void jacobian(const scalar t, const scalarField &y, scalarField &dfdt, scalarSquareMatrix &dfdy) const
Definition: thermoCoupleProbes.C:141
Foam::functionObjects::thermoCoupleProbes::read
virtual bool read(const dictionary &)
Definition: thermoCoupleProbes.C:192
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:49
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::functionObjects::thermoCoupleProbes::Ttc_
scalarField Ttc_
Definition: thermoCoupleProbes.H:131