lumpedMassWallTemperatureFvPatchScalarField.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) 2016 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::lumpedMassWallTemperatureFvPatchScalarField
28 
29 Group
30  grpThermoBoundaryConditions grpWallBoundaryConditions
31 
32 Description
33  Employs a lumped mass model for temperature.
34 
35  It considers a single temperature value for the whole patch and evaluates
36  the temperature evolution using the net heat flux into the patch.
37 
38 Usage
39  \table
40  Property | Description | Required | Default value
41  kappaMethod | thermal conductivity option | yes |
42  Cp | Heat capacity [J/kg.K] | yes |
43  mass | Total mass [kg] | yes |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  myPatch
49  {
50  type lumpedMassWallTemperature;
51  kappaMethod fluidThermo;
52  kappa none;
53  mass 1000;
54  Cp 4100;
55  value uniform 300.0;
56  }
57  \endverbatim
58 
59 SourceFiles
60  lumpedMassWallTemperatureFvPatchScalarField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef lumpedMassWallTemperatureFvPatchScalarField_H
65 #define lumpedMassWallTemperatureFvPatchScalarField_H
66 
67 #include "mixedFvPatchFields.H"
68 #include "temperatureCoupledBase.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class lumpedMassWallTemperatureFvPatchScalarField Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class lumpedMassWallTemperatureFvPatchScalarField
80 :
81  public mixedFvPatchScalarField,
82  public temperatureCoupledBase
83 {
85  typedef mixedFvPatchScalarField parent_bctype;
86 
87 private:
88 
89  // Private data
90 
91  //- Specific heat capacity [J/kg/K]
92  scalar Cp_;
93 
94  //- Mass [kg]
95  scalar mass_;
96 
97  //- Current time index (used for updating)
98  label curTimeIndex_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("lumpedMassWallTemperature");
105 
106 
107  // Constructors
108 
109  //- Construct from patch and internal field
111  (
112  const fvPatch&,
114  );
115 
116  //- Construct from patch, internal field and dictionary
118  (
119  const fvPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping onto a new patch
126  (
127  const this_bctype&,
128  const fvPatch&,
130  const fvPatchFieldMapper&
131  );
132 
133  //- Construct as copy setting internal field reference
135  (
136  const this_bctype&,
138  );
139 
140  //- No copy without an internal field
142  (
143  const this_bctype&
144  ) = delete;
145 
146  //- Clone with an internal field reference
148  (
150  ) const
151  {
152  return fvPatchField<scalar>::Clone(*this, iF);
153  }
154 
155 
156  // Member functions
157 
158  // Mapping functions
159 
160  //- Map (and resize as needed) from self given a mapping object
161  virtual void autoMap
162  (
163  const fvPatchFieldMapper&
164  );
165 
166  //- Reverse map the given fvPatchField onto this fvPatchField
167  virtual void rmap
168  (
169  const fvPatchField<scalar>&,
170  const labelList&
171  );
172 
173 
174  // Evaluation functions
175 
176  //- Update the coefficients associated with the patch field
177  virtual void updateCoeffs();
178 
179 
180  // I-O
181 
182  //- Write
183  void write(Ostream&) const;
184 
185 
186  // Member Operators
187 
188  //- Inherit assignment
189  using parent_bctype::operator=;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("lumpedMassWallTemperature")
Runtime type information.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:635
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:56
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
Namespace for OpenFOAM.
lumpedMassWallTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.