greyDiffusiveViewFactorFixedValueFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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  mapper
63  ),
64  qro_(mapper(ptf.qro_))
65 {}
66 
67 
70 (
71  const fvPatch& p,
73  const dictionary& dict
74 )
75 :
76  fixedValueFvPatchScalarField(p, iF, dict, false),
77  radiationCoupledBase(p, dict),
78  qro_("qro", dict, p.size())
79 {
80  if (dict.found("value"))
81  {
82  fvPatchScalarField::operator=
83  (
84  scalarField("value", dict, p.size())
85  );
86 
87  }
88  else
89  {
90  fvPatchScalarField::operator=(0.0);
91  }
92 }
93 
94 
97 (
99 )
100 :
101  fixedValueFvPatchScalarField(ptf),
103  (
104  ptf.patch(),
105  ptf.emissivityMethod(),
106  ptf.emissivity_
107  ),
108  qro_(ptf.qro_)
109 {}
110 
111 
114 (
117 )
118 :
119  fixedValueFvPatchScalarField(ptf, iF),
121  (
122  ptf.patch(),
123  ptf.emissivityMethod(),
124  ptf.emissivity_
125  ),
126  qro_(ptf.qro_)
127 {}
128 
129 
130 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
131 
133 (
134  const fvPatchFieldMapper& m
135 )
136 {
137  fixedValueFvPatchScalarField::autoMap(m);
138  radiationCoupledBase::autoMap(m);
139  m(qro_, qro_);
140 }
141 
142 
144 (
145  const fvPatchScalarField& ptf,
146  const labelList& addr
147 )
148 {
149  fixedValueFvPatchScalarField::rmap(ptf, addr);
150  radiationCoupledBase::rmap(ptf, addr);
152  refCast<const greyDiffusiveViewFactorFixedValueFvPatchScalarField>(ptf);
153 
154  qro_.rmap(mrptf.qro_, addr);
155 }
156 
158 {
159  if (this->updated())
160  {
161  return;
162  }
163 
164  if (debug)
165  {
166  scalar Q = gSum((*this)*patch().magSf());
167 
168  Info<< patch().boundaryMesh().mesh().name() << ':'
169  << patch().name() << ':'
170  << this->internalField().name() << " <- "
171  << " heat transfer rate:" << Q
172  << " wall radiative heat flux "
173  << " min:" << gMin(*this)
174  << " max:" << gMax(*this)
175  << " avg:" << gAverage(*this)
176  << endl;
177  }
178 
179  fixedValueFvPatchScalarField::updateCoeffs();
180 }
181 
182 
184 (
185  Ostream& os
186 ) const
187 {
190  writeEntry(os, "qro", qro_);
191 }
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 namespace Foam
197 {
199  (
202  );
203 }
204 
205 
206 // ************************************************************************* //
This boundary condition provides a grey-diffuse condition for radiative heat flux, qr, for use with the view factor model.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:438
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Type gMin(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
scalarField emissivity_
Emissivity.
Macros for easy insertion into run-time selection tables.
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
Type gSum(const FieldField< Field, Type > &f)
greyDiffusiveViewFactorFixedValueFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
void write(Ostream &) const
Write.
Foam::fvPatchFieldMapper.
Common functions to emissivity. It gets supplied from lookup into a dictionary or calculated by the s...
word emissivityMethod() const
Method to obtain emissivity.
virtual label size() const
Return size.
Definition: fvPatch.H:155
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)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
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
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Namespace for OpenFOAM.