contactHeatFluxSource.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) 2019-2022 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::fa::contactHeatFluxSource
28 
29 Group
30  grpFaOptionsSources
31 
32 Description
33  Applies contact heat flux between specified \c faMesh
34  and \c fvMesh within a specified region for compressible flows.
35 
36 Usage
37  Minimal example by using \c constant/faOptions:
38  \verbatim
39  contactHeatFluxSource1
40  {
41  // Mandatory entries (unmodifiable)
42  type contactHeatFluxSource;
43  Tprimary <TprimaryFieldName>;
44 
45  // Optional entries (runtime modifiable)
46  T <Tname>;
47  thicknessLayers (<layer1> <layer2> ... <layerN>);
48 
49  // Conditional optional entries (runtime modifiable)
50 
51  // when the entry "thicknessLayers" is present
52  kappaLayers (<layer1> <layer2> ... <layerN>);
53 
54  // Mandatory/Optional (inherited) entries
55  ...
56  }
57  \endverbatim
58 
59  where the entries mean:
60  \table
61  Property | Description | Type | Reqd | Dflt
62  type | Type name: contactHeatFluxSource | word | yes | -
63  Tprimary | Name of primary temperature field | word | yes | -
64  T | Name of operand temperature field | word | no | T
65  thicknessLayers | List of thicknesses of layers | scalarList | no | -
66  kappaLayers | List of conductivities of layers | scalarList | cndtnl | -
67  \endtable
68 
69  The inherited entries are elaborated in:
70  - \link faOption.H \endlink
71  - \link faceSetOption.H \endlink
72  - \link temperatureCoupledBase.H \endlink
73 
74 SourceFiles
75  contactHeatFluxSource.C
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef Foam_fa_contactHeatFluxSource_H
80 #define Foam_fa_contactHeatFluxSource_H
81 
82 #include "faOption.H"
83 #include "Function1.H"
84 #include "PtrList.H"
85 #include "areaFields.H"
86 #include "faceSetOption.H"
87 #include "temperatureCoupledBase.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 namespace fa
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class contactHeatFluxSource Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class contactHeatFluxSource
101 :
102  public fa::faceSetOption
103 {
104  // Private Classes
105 
106  //- Wrapper to make non-abstract
107  struct temperatureCoupling : public Foam::temperatureCoupledBase
108  {
109  // Inherit constructors
111 
112  //- The fvPatch
113  const fvPatch& patch() const noexcept { return patch_; }
114 
115  // Dummy implementations
116 
117  //- Map (and resize as needed) from self given a mapping object
118  virtual void autoMap(const fvPatchFieldMapper&)
119  {}
120 
121  // Dummy implementation
122  virtual void rmap(const fvPatchField<scalar>&, const labelList&)
123  {}
124  };
125 
126 
127  // Private Data
128 
129  //- Name of temperature field
130  word TName_;
132  //- Name of primary temperature field
133  word TprimaryName_;
134 
135  //- Primary region temperature
136  const volScalarField& Tprimary_;
137 
138  //- Thickness of layers
139  scalarList thicknessLayers_;
140 
141  //- Conductivity of layers
142  scalarList kappaLayers_;
143 
144  //- Total contact resistance
145  scalar contactRes_;
146 
147  //- Current time index (used for updating)
148  label curTimeIndex_;
149 
150  //- Contact coupling (per-patch)
152 
153 
154  // Private Member Functions
155 
156  //- Return htc [W/m2/K] coupling to the primary region
158 
159 
160 public:
161 
162  //- Runtime type information
163  TypeName("contactHeatFluxSource");
164 
165 
166  // Constructors
167 
168  //- Construct from explicit source name and mesh
170  (
171  const word& sourceName,
172  const word& modelType,
173  const dictionary& dict,
174  const fvMesh& mesh
175  );
176 
177  //- No copy construct
179 
180  //- No copy assignment
181  void operator=(const contactHeatFluxSource&) = delete;
182 
183 
184  //- Destructor
185  virtual ~contactHeatFluxSource() = default;
186 
187 
188  // Member Functions
189 
190  // Evaluation
191 
192  //- Add explicit contribution to compressible momentum equation
193  virtual void addSup
194  (
195  const areaScalarField& h,
196  const areaScalarField& rho,
197  faMatrix<scalar>& eqn,
198  const label fieldi
199  );
200 
201 
202  // IO
203 
204  //- Read source dictionary
205  virtual bool read(const dictionary& dict);
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace fa
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 
217 #endif
218 
219 // ************************************************************************* //
TypeName("contactHeatFluxSource")
Runtime type information.
virtual ~contactHeatFluxSource()=default
Destructor.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: faOptionI.H:29
dictionary dict
const fvPatch & patch_
Underlying patch.
Applies contact heat flux between specified faMesh and fvMesh within a specified region for compressi...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A class for handling words, derived from Foam::string.
Definition: word.H:63
temperatureCoupledBase(const fvPatch &patch, const KMethodType method=KMethodType::mtFluidThermo)
Default construct from patch, using fluidThermo (default) or specified method.
const direction noexcept
Definition: Scalar.H:258
void operator=(const contactHeatFluxSource &)=delete
No copy assignment.
virtual void addSup(const areaScalarField &h, const areaScalarField &rho, faMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible momentum equation.
const dimensionedScalar h
Planck constant.
Common functions used in temperature coupled boundaries.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
contactHeatFluxSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
A special matrix type and solver, designed for finite area solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: faMatricesFwd.H:37
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual bool read(const dictionary &dict)
Read source dictionary.
Namespace for OpenFOAM.