filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.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) 2013-2017 OpenFOAM Foundation
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::filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
28 
29 Description
30  Mixed boundary condition for temperature, to be used in the flow and
31  pyrolysis regions when a film region model is used.
32 
33  Example usage:
34  \verbatim
35  myInterfacePatchName
36  {
37  type filmPyrolysisRadiativeCoupledMixed;
38  Tnbr T;
39  kappaMethod fluidThermo;
40  kappa none;
41  qr qr;
42  filmDeltaDry 0.0;
43  filmDeltaWet 3e-4;
44  value $internalField;
45  }
46  \endverbatim
47 
48  Needs to be on underlying mapped(Wall)FvPatch.
49  It calculates local field as:
50 
51  \verbatim
52  ratio = (filmDelta - filmDeltaDry)/(filmDeltaWet - filmDeltaDry)
53  \endverbatim
54 
55  when ratio = 1 is considered wet and the film temperature is fixed at
56  the wall. If ratio = 0 (dry) it emulates the normal radiative solid BC.
57 
58  In between ratio 0 and 1 the gradient and value contributions are
59  weighted using the ratio field in the following way:
60 
61  \verbatim
62  qConv = ratio*htcwfilm*(Tfilm - *this);
63  qRad = (1.0 - ratio)*qr;
64  \endverbatim
65 
66  Then the solid can gain or loose energy through radiation or conduction
67  towards the film.
68 
69  Notes:
70  - \c kappaMethod and \c kappa are inherited from temperatureCoupledBase.
71  - qr is the radiative flux defined in the radiation model.
72 
73 
74 See also
75  Foam::temperatureCoupledBase
76 
77 SourceFiles
78  filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef filmPyrolysisRadiativeCoupledMixedFvPatchScalarField_H
83 #define filmPyrolysisRadiativeCoupledMixedFvPatchScalarField_H
84 
85 #include "mixedFvPatchFields.H"
86 #include "temperatureCoupledBase.H"
87 #include "thermoSingleLayer.H"
88 #include "pyrolysisModel.H"
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class filmPyrolysisRadiativeCoupledMixedFvPatchScalarField Declaration
98 \*---------------------------------------------------------------------------*/
99 
101 :
102  public mixedFvPatchScalarField,
104 {
105 public:
109 
112 
114 
115 
116 private:
117 
118  // Private Data
119 
120  //- Name of film region
121  const word filmRegionName_;
122 
123  //- Name of pyrolysis region
124  const word pyrolysisRegionName_;
125 
126  //- Name of field on the neighbour region
127  const word TnbrName_;
128 
129  //- Name of the radiative heat flux
130  const word qrName_;
131 
132  //- Convective Scaling Factor (as determined by Prateep's tests)
133  const scalar convectiveScaling_;
134 
135  //- Minimum delta film to be considered dry
136  const scalar filmDeltaDry_;
137 
138  //- Maximum delta film to be considered wet
139  const scalar filmDeltaWet_;
140 
141 
142  // Private Member Functions
143 
144  //- Retrieve film model from the database, or FatalError
145  const filmModelType& filmModel() const;
146 
147  //- Retrieve pyrolysis model from the database, or FatalError
148  const pyrolysisModelType& pyrModel() const;
149 
150 
151 public:
152 
153  //- Runtime type information
154  TypeName("filmPyrolysisRadiativeCoupledMixed");
155 
156 
157  // Constructors
158 
159  //- Construct from patch and internal field
161  (
162  const fvPatch&,
164  );
165 
166  //- Construct from patch, internal field and dictionary
168  (
169  const fvPatch&,
171  const dictionary&
172  );
173 
174  //- Construct by mapping given
175  // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
176  // new patch
178  (
179  const
181  const fvPatch&,
183  const fvPatchFieldMapper&
184  );
185 
186  //- Construct and return a clone
187  virtual tmp<fvPatchScalarField> clone() const
188  {
190  (
192  (
193  *this
194  )
195  );
196  }
197 
198  //- Construct as copy setting internal field reference
200  (
203  );
204 
205  //- Construct and return a clone setting internal field reference
207  (
209  ) const
210  {
212  (
214  (
215  *this,
216  iF
217  )
218  );
219  }
220 
221 
222  // Member functions
223 
224  // Mapping functions
225 
226  //- Map (and resize as needed) from self given a mapping object
227  virtual void autoMap
228  (
229  const fvPatchFieldMapper&
230  );
231 
232  //- Reverse map the given fvPatchField onto this fvPatchField
233  virtual void rmap
234  (
236  const labelList&
237  );
238 
239 
240  //- Get corresponding K field
241  tmp<scalarField> K() const;
242 
243  //- Update the coefficients associated with the patch field
244  virtual void updateCoeffs();
245 
246  //- Write
247  virtual void write(Ostream&) const;
248 };
249 
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 } // End namespace Foam
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #endif
258 
259 // ************************************************************************* //
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Mixed boundary condition for temperature, to be used in the flow and pyrolysis regions when a film re...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
tmp< scalarField > K() const
Get corresponding K field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Common functions used in temperature coupled boundaries.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
TypeName("filmPyrolysisRadiativeCoupledMixed")
Runtime type information.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Thermodynamic form of single-cell layer surface film model.
Namespace for OpenFOAM.