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 {
84 private:
85 
86  // Private data
87 
88  //- Specific heat capacity [J/kg/K]
89  scalar Cp_;
90 
91  //- Mass [kg]
92  scalar mass_;
93 
94  //- Current time index (used for updating)
95  label curTimeIndex_;
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("lumpedMassWallTemperature");
102 
103 
104  // Constructors
105 
106  //- Construct from patch and internal field
108  (
109  const fvPatch&,
111  );
112 
113  //- Construct from patch, internal field and dictionary
115  (
116  const fvPatch&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given
122  // lumpedMassWallTemperatureFvPatchScalarField
123  // onto a new patch
125  (
127  const fvPatch&,
129  const fvPatchFieldMapper&
130  );
131 
132  //- Construct as copy
134  (
136  );
137 
138  //- Construct and return a clone
139  virtual tmp<fvPatchScalarField> clone() const
140  {
142  (
144  );
145  }
146 
147  //- Construct as copy setting internal field reference
149  (
152  );
153 
154  //- Construct and return a clone setting internal field reference
156  (
158  ) const
159  {
161  (
163  );
164  }
165 
166 
167  // Member functions
168 
169  // Mapping functions
170 
171  //- Map (and resize as needed) from self given a mapping object
172  virtual void autoMap
173  (
174  const fvPatchFieldMapper&
175  );
176 
177  //- Reverse map the given fvPatchField onto this fvPatchField
178  virtual void rmap
179  (
180  const fvPatchField<scalar>&,
181  const labelList&
182  );
183 
184 
185  // Evaluation functions
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190 
191  // I-O
192 
193  //- Write
194  void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::lumpedMassWallTemperatureFvPatchScalarField::rmap
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: lumpedMassWallTemperatureFvPatchScalarField.C:143
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:135
Foam::lumpedMassWallTemperatureFvPatchScalarField
Employs a lumped mass model for temperature.
Definition: lumpedMassWallTemperatureFvPatchScalarField.H:98
Foam::lumpedMassWallTemperatureFvPatchScalarField::lumpedMassWallTemperatureFvPatchScalarField
lumpedMassWallTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: lumpedMassWallTemperatureFvPatchScalarField.C:38
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
temperatureCoupledBase.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::lumpedMassWallTemperatureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: lumpedMassWallTemperatureFvPatchScalarField.H:158
mixedFvPatchFields.H
Foam::lumpedMassWallTemperatureFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: lumpedMassWallTemperatureFvPatchScalarField.C:133
Foam::List< label >
Foam::lumpedMassWallTemperatureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: lumpedMassWallTemperatureFvPatchScalarField.C:160
Foam::lumpedMassWallTemperatureFvPatchScalarField::TypeName
TypeName("lumpedMassWallTemperature")
Runtime type information.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::lumpedMassWallTemperatureFvPatchScalarField::write
void write(Ostream &) const
Write.
Definition: lumpedMassWallTemperatureFvPatchScalarField.C:223