greyDiffusiveViewFactorFixedValueFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 #include "fvPatchFieldMapper.H"
29 #include "volFields.H"
30 
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
36 (
37  const fvPatch& p,
39 )
40 :
41  fixedValueFvPatchScalarField(p, iF),
42  radiationCoupledBase(patch(), "undefined", scalarField::null()),
43  Qro_(p.size(), 0.0)
44 {}
45 
46 
49 (
51  const fvPatch& p,
53  const fvPatchFieldMapper& mapper
54 )
55 :
56  fixedValueFvPatchScalarField(ptf, p, iF, mapper),
58  (
59  patch(),
60  ptf.emissivityMethod(),
61  ptf.emissivity_
62  ),
63  Qro_(ptf.Qro_)
64 {}
65 
66 
69 (
70  const fvPatch& p,
72  const dictionary& dict
73 )
74 :
75  fixedValueFvPatchScalarField(p, iF),
76  radiationCoupledBase(p, dict),
77  Qro_("Qro", dict, p.size())
78 {
79  if (dict.found("value"))
80  {
81  fvPatchScalarField::operator=
82  (
83  scalarField("value", dict, p.size())
84  );
85 
86  }
87  else
88  {
89  fvPatchScalarField::operator=(0.0);
90  }
91 }
92 
93 
96 (
98 )
99 :
100  fixedValueFvPatchScalarField(ptf),
102  (
103  ptf.patch(),
104  ptf.emissivityMethod(),
105  ptf.emissivity_
106  ),
107  Qro_(ptf.Qro_)
108 {}
109 
110 
113 (
116 )
117 :
118  fixedValueFvPatchScalarField(ptf, iF),
120  (
121  ptf.patch(),
122  ptf.emissivityMethod(),
123  ptf.emissivity_
124  ),
125  Qro_(ptf.Qro_)
126 {}
127 
128 
129 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
130 
133 {
134  if (this->updated())
135  {
136  return;
137  }
138 
139  if (debug)
140  {
141  scalar Q = gSum((*this)*patch().magSf());
142 
143  Info<< patch().boundaryMesh().mesh().name() << ':'
144  << patch().name() << ':'
145  << this->internalField().name() << " <- "
146  << " heat transfer rate:" << Q
147  << " wall radiative heat flux "
148  << " min:" << gMin(*this)
149  << " max:" << gMax(*this)
150  << " avg:" << gAverage(*this)
151  << endl;
152  }
153 
154  fixedValueFvPatchScalarField::updateCoeffs();
155 }
156 
157 
159 write
160 (
161  Ostream& os
162 ) const
163 {
166  Qro_.writeEntry("Qro", os);
167 }
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 namespace Foam
173 {
174 namespace radiation
175 {
177  (
180  );
181 }
182 }
183 
184 
185 // ************************************************************************* //
makePatchTypeField(fvPatchScalarField, greyDiffusiveRadiationMixedFvPatchScalarField)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Type gMin(const FieldField< Field, Type > &f)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
Definition: Field.C:719
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
scalarField emissivity_
Emissivity.
Macros for easy insertion into run-time selection tables.
void write(Ostream &) const
Write.
Type gSum(const FieldField< Field, Type > &f)
greyDiffusiveViewFactorFixedValueFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
word emissivityMethod() const
Method to obtain emissivity.
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
Definition: fvPatch.H:161
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:306
Common functions to emissivity. It gets supplied from lookup into a dictionary or calculated by the s...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
volScalarField scalarField(fieldObject, mesh)
Type gMax(const FieldField< Field, Type > &f)
This boundary condition provides a grey-diffuse condition for radiative heat flux, Qr, for use with the view factor model.
Type gAverage(const FieldField< Field, Type > &f)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
messageStream Info
runTime write()
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Namespace for OpenFOAM.