thermalBaffle1DFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::compressible::thermalBaffle1DFvPatchScalarField
26 
27 Description
28  This BC solves a steady 1D thermal baffle.
29 
30  The solid properties are specify as dictionary. Optionally radiative heat
31  flux (qr) can be incorporated into the balance. Some under-relaxation might
32  be needed on qr. Baffle and solid properties need to be specified on the
33  master side of the baffle.
34 
35 Usage
36  Example of the boundary condition specification using constant
37  solid thermo :
38 
39  \verbatim
40  <masterPatchName>
41  {
42  type compressible::thermalBaffle1D<eConstSolidThermoPhysics>;
43 
44  neighbourPatch <slavePatchName>;
45 
46  thickness uniform 0.005; // Thickness [m]
47  qs uniform 100; // Source heat flux [W/m^2]
48 
49  qr none;
50  qrRelaxation 1;
51 
52  // Solid thermo
53  specie
54  {
55  molWeight 20;
56  }
57  transport
58  {
59  kappa 1;
60  }
61  thermodynamics
62  {
63  hf 0;
64  Cv 10;
65  }
66  equationOfState
67  {
68  rho 10;
69  }
70 
71  value uniform 300;
72  }
73 
74  <slavePatchName>
75  {
76  type compressible::thermalBaffle1D<eConstSolidThermoPhysics>;
77 
78  neighbourPatch <masterPatchName>;
79 
80  qr none;
81  relaxation 1;
82 
83  value uniform 300;
84  }
85  \endverbatim
86 
87 SourceFiles
88  thermalBaffle1DFvPatchScalarField.C
89 
90 \*---------------------------------------------------------------------------*/
91 
92 #ifndef thermalBaffle1DFvPatchScalarField_H
93 #define thermalBaffle1DFvPatchScalarField_H
94 
95 #include "mixedFvPatchFields.H"
96 #include "autoPtr.H"
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 namespace Foam
101 {
102 namespace compressible
103 {
104 
105 /*---------------------------------------------------------------------------*\
106  Class thermalBaffle1DFvPatchScalarField Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 template<class solidType>
111 :
112  public mixedFvPatchScalarField
113 {
114  // Private Data
115 
116  //- Name of the temperature field
117  word TName_;
118 
119  //- Baffle is activated
120  bool baffleActivated_;
121 
122  //- Baffle thickness [m]
123  mutable scalarField thickness_;
124 
125  //- Source heat flux [W/m^2]
126  mutable scalarField qs_;
127 
128  //- Solid thermo
129  mutable autoPtr<solidType> solidPtr_;
130 
131  //- Cache qr for relaxation
132  scalarField qrPrevious_;
133 
134  //- Relaxation for qr
135  scalar qrRelaxation_;
136 
137  //- Name of the radiative heat flux in local region
138  const word qrName_;
139 
140 
141  // Private members
142 
143  //- Return const solid thermo
144  const solidType& solid() const;
145 
146  //- Return source heat flux from master
147  tmp<scalarField> qs() const;
148 
149  //- Return thickness from master
150  tmp<scalarField> baffleThickness() const;
151 
152  //- Is this patch the owner?
153  bool owner() const;
154 
155  //- Access the neighbour field
156  const thermalBaffle1DFvPatchScalarField& nbrField() const;
157 
158 
159 public:
160 
161  //- Runtime type information
162  TypeName("compressible::thermalBaffle1D");
163 
164 
165  // Constructors
166 
167  //- Construct from patch, internal field and dictionary
169  (
170  const fvPatch&,
172  const dictionary&
173  );
174 
175  //- Construct by mapping given thermalBaffle1DFvPatchScalarField
176  // onto a new patch
178  (
180  const fvPatch&,
182  const fieldMapper&
183  );
184 
185  //- Disallow copy without setting internal field reference
187  (
189  ) = delete;
190 
191  //- Copy constructor setting internal field reference
193  (
196  );
197 
198  //- Construct and return a clone setting internal field reference
200  (
202  ) const
203  {
205  (
206  new thermalBaffle1DFvPatchScalarField(*this, iF)
207  );
208  }
209 
210 
211  // Member Functions
212 
213  // Mapping functions
214 
215  //- Map the given fvPatchField onto this fvPatchField
216  virtual void map(const fvPatchScalarField&, const fieldMapper&);
217 
218  //- Reset the fvPatchField to the given fvPatchField
219  // Used for mesh to mesh mapping
220  virtual void reset(const fvPatchScalarField&);
221 
222 
223  //- Update the coefficients associated with the patch field
224  virtual void updateCoeffs();
225 
226  //- Write
227  virtual void write(Ostream&) const;
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace compressible
234 } // End namespace Foam
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #ifdef NoRepository
240 #endif
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
TypeName("compressible::thermalBaffle1D")
Runtime type information.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:91
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.