Loading...
Searching...
No Matches
radiometerProbes.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) 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::radiometerProbes
28
29Group
30 grpUtilitiesFunctionObjects
31
32Description
33 Probes the incident radiative heat flux, qin, at arbitrary points within a
34 domain.
35
36Usage
37 Minimal example by using \c system/controlDict.functions:
38 \verbatim
39 radiometer
40 {
41 // Mandatory entries
42 type radiometerProbes;
43 libs (utilityFunctionObjects);
44 probeLocations (<vectorList>);
45 probeNormals (<vectorList>);
46
47 // Inherited entries
48 ...
49 }
50 \endverbatim
51
52 where the entries mean:
53 \table
54 Property | Description | Type | Reqd | Deflt
55 type | Type name: radiometerProbes | word | yes | -
56 libs | Library name: utilityFunctionObjects | word | yes | -
57 probeLocations | Locations of probes | vectorList | yes | -
58 probeNormals | Normals of specified probes | vectorList | yes | -
59 \endtable
60
61 The inherited entries are elaborated in:
62 - \link regionFunctionObject.H \endlink
63 - \link internalFieldProbe.H \endlink
64 - \link writeFile.H \endlink
65 - \link fvDOM.H \endlink
66
67Note
68 - The function object can only be used with the \c fvDOM radiation model.
69 - The \c solverFreq input of the \c fvDOM model has superiority over
70 \c executeControl and \c writeControl entries.
71
72SourceFiles
73 radiometerProbes.C
74
75\*---------------------------------------------------------------------------*/
76
77#ifndef Foam_functionObjects_radiometerProbes_H
78#define Foam_functionObjects_radiometerProbes_H
79
81//#include "regionFunctionObject.H"
82#include "internalFieldProbe.H"
83#include "writeFile.H"
84#include "fvDOM.H"
85
86// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87
88namespace Foam
89{
90namespace functionObjects
91{
92
93/*---------------------------------------------------------------------------*\
94 Class radiometerProbes Declaration
95\*---------------------------------------------------------------------------*/
96
98:
100 public internalFieldProbe,
101 public writeFile
102{
103 // Private Data
104
105 //- Const reference to the underlying radiation model
106 const radiation::fvDOM& dom_;
107
108 //- Normal vectors of the specified probes
109 vectorField n_;
110
111 //- Pre-computed inner product of probe normals (n_) and average
112 //- solid-angle direction (dAve) per radiative intensity ray
113 List<scalarList> n_dAve_;
114
115 //- Directional selection coefficient for radiative intensity rays
116 // false: ray entering the probe
117 // true: ray leaving the probe
118 List<boolList> C_;
119
120 //- Incident radiative heat flux per probe location
121 scalarField qin_;
123 //- Number of radiative intensity rays
124 label nRay_;
125
126 //- Number of probe locations/normals
127 label szProbes_;
128
129 //- Flag to identify whether the iteration is the first iteration
130 // Resets with a restarted simulation
131 bool firstIter_;
132
133
134 // Private Member Functions
135
136 //- Write file-header information into the output file
137 virtual void writeFileHeader(Ostream& os);
138
139 //- Return the flag to decide if radiation-model calculations are
140 //- performed, so that function object calculations can proceed
141 bool shouldCalcThisStep() const
142 {
143 return
144 firstIter_
145 || (mesh_.time().timeIndex() % dom_.solverFreq() == 0);
146 }
147
148
149public:
150
151 //- Runtime type information
152 TypeName("radiometerProbes");
153
154
155 // Generated Methods
156
157 //- No copy construct
158 radiometerProbes(const radiometerProbes&) = delete;
159
160 //- No copy assignment
161 void operator=(const radiometerProbes&) = delete;
162
163
164 // Constructors
165
166 //- Construct from name, Time and dictionary
168 (
169 const word& name,
170 const Time& runTime,
171 const dictionary& dict
172 );
173
174
175 //- Destructor
176 virtual ~radiometerProbes() = default;
177
178
179 // Public Member Functions
180
181 //- Read the function object settings
182 virtual bool read(const dictionary&);
183
184 //- Execute the function object
185 virtual bool execute();
186
187 //- Write to data files/fields and to streams
188 virtual bool write();
189};
190
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194} // End namespace functionObjects
195} // End namespace Foam
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199#endif
200
201// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Probes the incident radiative heat flux, qin, at arbitrary points within a domain.
radiometerProbes(const radiometerProbes &)=delete
No copy construct.
virtual ~radiometerProbes()=default
Destructor.
void operator=(const radiometerProbes &)=delete
No copy assignment.
TypeName("radiometerProbes")
Runtime type information.
virtual bool execute()
Execute the function object.
virtual bool write()
Write to data files/fields and to streams.
virtual bool read(const dictionary &)
Read the function object settings.
Base class for writing single files from the function objects.
Definition writeFile.H:113
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
Definition writeFile.C:200
internalFieldProbe(const fvMesh &mesh, const dictionary &dict)
Construct from Time and dictionary.
Finite Volume Discrete Ordinates Method. Solves the RTE equation for n directions in a participating ...
Definition fvDOM.H:117
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
label timeIndex
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68