Loading...
Searching...
No Matches
heatExchangerModel.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) 2022 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
26Namespace
27 Foam::heatExchangerModels
28
29Description
30 A namespace for various heat exchanger model implementations.
31
32Class
33 Foam::heatExchangerModel
34
35Description
36 Base class for heat exchanger models to handle various
37 characteristics for the \c heatExchangerSource fvOption.
38
39SourceFiles
40 heatExchangerModel.C
41 heatExchangerModelNew.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef Foam_heatExchangerModel_H
46#define Foam_heatExchangerModel_H
47
48#include "fvMesh.H"
49#include "writeFile.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class heatExchangerModel Declaration
58\*---------------------------------------------------------------------------*/
59
61:
63{
64protected:
65
66 // Protected Data
68 //- Reference to the mesh
69 const fvMesh& mesh_;
70
71 //- Dictionary containing coefficients specific to the chosen model
73
74 //- Reference to the name of the fvOption source
75 const word& name_;
76
77 //- Name of operand velocity field
79
80 //- Name of operand temperature field
83 //- Name of operand flux field
85
86 //- Name of the faceZone at the heat exchanger inlet
88
89 //- Local list of face IDs
91
92 //- Local list of patch IDs per face
94
95 //- List of +1/-1 representing face flip map (1 use as is, -1 negate)
98
99public:
100
101 //- Runtime type information
102 TypeName("heatExchangerModel");
103
104
105 // Declare runtime constructor selection table
106
108 (
109 autoPtr,
113 const fvMesh& mesh,
114 const word& name,
115 const dictionary& coeffs
116 ),
117 (mesh, name, coeffs)
118 );
119
121 // Selectors
122
123 //- Return a reference to the selected heat exchanger model
126 const fvMesh& mesh,
127 const word& name,
128 const dictionary& coeffs
129 );
130
131
132 // Constructors
133
134 //- Construct from components
136 (
137 const fvMesh& mesh,
138 const word& name,
139 const dictionary& coeffs
140 );
141
142 //- No copy construct
143 heatExchangerModel(const heatExchangerModel&) = delete;
144
145 //- No copy assignment
146 void operator=(const heatExchangerModel&) = delete;
147
148
149 //- Destructor
150 virtual ~heatExchangerModel() = default;
151
152
153 // Member Functions
154
155 // Access
156
157 //- Return const reference to the name of velocity field
158 virtual const word& U() const
159 {
160 return UName_;
161 }
162
163
164 // Evaluation
165
166 //- Initialise data members of the model
167 virtual void initialise();
168
169 //- Return energy density per unit length [J/m3/m]
170 virtual tmp<scalarField> energyDensity(const labelList& cells) = 0;
171
173 // I-O
174
175 //- Read top-level dictionary
176 virtual bool read(const dictionary& dict) = 0;
177
178 //- Write data to stream and files
179 virtual void write(const bool log) = 0;
180};
181
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185} // End namespace Foam
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189#endif
190
191// ************************************************************************* //
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
Base class for writing single files from the function objects.
Definition writeFile.H:113
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
heatExchangerModel(const heatExchangerModel &)=delete
No copy construct.
declareRunTimeSelectionTable(autoPtr, heatExchangerModel, dictionary,(const fvMesh &mesh, const word &name, const dictionary &coeffs),(mesh, name, coeffs))
virtual void initialise()
Initialise data members of the model.
const word & name_
Reference to the name of the fvOption source.
const fvMesh & mesh_
Reference to the mesh.
word UName_
Name of operand velocity field.
virtual void write(const bool log)=0
Write data to stream and files.
heatExchangerModel(const fvMesh &mesh, const word &name, const dictionary &coeffs)
Construct from components.
virtual ~heatExchangerModel()=default
Destructor.
virtual tmp< scalarField > energyDensity(const labelList &cells)=0
Return energy density per unit length [J/m3/m].
word phiName_
Name of operand flux field.
void operator=(const heatExchangerModel &)=delete
No copy assignment.
const dictionary & coeffs_
Dictionary containing coefficients specific to the chosen model.
word faceZoneName_
Name of the faceZone at the heat exchanger inlet.
labelList faceId_
Local list of face IDs.
word TName_
Name of operand temperature field.
labelList facePatchId_
Local list of patch IDs per face.
static autoPtr< heatExchangerModel > New(const fvMesh &mesh, const word &name, const dictionary &coeffs)
Return a reference to the selected heat exchanger model.
labelList faceSign_
List of +1/-1 representing face flip map (1 use as is, -1 negate).
virtual const word & U() const
Return const reference to the name of velocity field.
TypeName("heatExchangerModel")
Runtime type information.
virtual bool read(const dictionary &dict)=0
Read top-level dictionary.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
const cellShapeList & cells
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
dimensionedScalar log(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
runTime write()
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68