fixedMultiPhaseHeatFluxFvPatchScalarField.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) 2015-2020 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fixedMultiPhaseHeatFluxFvPatchScalarField
29 
30 Description
31  Calculates a wall temperature that produces
32  the specified overall wall heat flux across
33  all the phases in an Eulerian multi-phase simulation.
34 
35  Intended to be used with \c copiedFixedValue
36  to ensure that phase wall temperature are consistent:
37  - Set \c fixedMultiPhaseHeatFlux boundary for one of the phases
38  - Use \c copiedFixedValue for all the other phases.
39 
40 Usage
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  // Mandatory entries
46  type fixedMultiPhaseHeatFlux;
47  q <scalarField>;
48 
49  // Optional entries
50  relax <scalar>;
51  Tmin <scalar>;
52 
53  // Inherited entries
54  ...
55  }
56  \endverbatim
57 
58  where the entries mean:
59  \table
60  Property | Description | Type | Reqd | Deflt
61  type | Type name: fixedMultiPhaseHeatFlux | word | yes | -
62  q | Heat power [W] or flux [W/m2] | scalarField | yes | -
63  relax | Relaxation factor | scalar | no | 1.0
64  Tmin | Minimum temperature limit [K] | scalar | no | 273.0
65  \endtable
66 
67  The inherited entries are elaborated in:
68  - \link fixedValueFvPatchFields.H \endlink
69 
70 See also
71  Foam::fixedValueFvPatchField
72 
73 SourceFiles
74  fixedMultiPhaseHeatFluxFvPatchScalarField.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef fixedMultiPhaseHeatFluxFvPatchScalarField_H
79 #define fixedMultiPhaseHeatFluxFvPatchScalarField_H
80 
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class fixedMultiPhaseHeatFluxFvPatchScalarField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class fixedMultiPhaseHeatFluxFvPatchScalarField
93 :
94  public fixedValueFvPatchScalarField
95 {
96  // Private Data
97 
98  //- Heat power [W] or flux [W/m2]
99  scalarField q_;
100 
101  //- Relaxation factor
102  scalar relax_;
103 
104  //- Minimum temperature limit [K]
105  scalar Tmin_;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("fixedMultiPhaseHeatFlux");
112 
113 
114  // Constructors
115 
116  //- Construct from patch and internal field
118  (
119  const fvPatch&,
121  );
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const fvPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given
132  //- fixedMultiPhaseHeatFluxFvPatchScalarField
133  //- onto a new patch
135  (
137  const fvPatch&,
139  const fvPatchFieldMapper&
140  );
141 
142  //- Construct as copy
144  (
146  );
147 
148  //- Construct and return a clone
149  virtual tmp<fvPatchScalarField> clone() const
150  {
152  (
154  );
155  }
156 
157  //- Construct as copy setting internal field reference
159  (
162  );
163 
164  //- Construct and return a clone setting internal field reference
166  (
168  ) const
169  {
171  (
173  );
174  }
175 
176 
177  // Member Functions
178 
179  // Mapping
180 
181  //- Map (and resize as needed) from self given a mapping object
182  // Used to update fields following mesh topology change
183  virtual void autoMap(const fvPatchFieldMapper&);
184 
185  //- Reverse map the given fvPatchField onto this fvPatchField
186  // Used to reconstruct fields
187  virtual void rmap(const fvPatchScalarField&, const labelList&);
188 
189 
190  // Evaluation
191 
192  //- Update the coefficients associated with the patch field
193  virtual void updateCoeffs();
194 
195 
196  // I-O
197 
198  //- Write
199  virtual void write(Ostream&) const;
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:68
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fixedMultiPhaseHeatFluxFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
fvPatchField< scalar > fvPatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:55
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
TypeName("fixedMultiPhaseHeatFlux")
Runtime type information.
Calculates a wall temperature that produces the specified overall wall heat flux across all the phase...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.