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-2024 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 "fieldMapper.H"
29 #include "volFields.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
35 (
36  const fvPatch& p,
38  const dictionary& dict
39 )
40 :
41  fixedValueFvPatchScalarField(p, iF, dict, false),
43  qro_("qro", dimPower/dimArea, dict, p.size())
44 {
45  if (dict.found("value"))
46  {
48  (
49  scalarField("value", iF.dimensions(), dict, p.size())
50  );
51  }
52  else
53  {
55  }
56 }
57 
58 
61 (
63  const fvPatch& p,
65  const fieldMapper& mapper
66 )
67 :
68  fixedValueFvPatchScalarField(ptf, p, iF, mapper),
70  (
71  patch(),
72  ptf.emissivityMethod(),
73  ptf.emissivity_,
74  mapper
75  ),
76  qro_(mapper(ptf.qro_))
77 {}
78 
79 
82 (
85 )
86 :
87  fixedValueFvPatchScalarField(ptf, iF),
89  (
90  ptf.patch(),
91  ptf.emissivityMethod(),
92  ptf.emissivity_
93  ),
94  qro_(ptf.qro_)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
101 (
102  const fvPatchScalarField& ptf,
103  const fieldMapper& mapper
104 )
105 {
106  fixedValueFvPatchScalarField::map(ptf, mapper);
107  radiationCoupledBase::map(ptf, mapper);
109  refCast<const greyDiffusiveViewFactorFixedValueFvPatchScalarField>(ptf);
110 
111  mapper(qro_, mrptf.qro_);
112 }
113 
114 
116 (
117  const fvPatchScalarField& ptf
118 )
119 {
120  fixedValueFvPatchScalarField::reset(ptf);
123  refCast<const greyDiffusiveViewFactorFixedValueFvPatchScalarField>(ptf);
124 
125  qro_.reset(mrptf.qro_);
126 }
127 
128 
130 {
131  if (this->updated())
132  {
133  return;
134  }
135 
136  if (debug)
137  {
138  scalar Q = gSum((*this)*patch().magSf());
139 
140  Info<< patch().boundaryMesh().mesh().name() << ':'
141  << patch().name() << ':'
142  << this->internalField().name() << " <- "
143  << " heat transfer rate:" << Q
144  << " wall radiative heat flux "
145  << " min:" << gMin(*this)
146  << " max:" << gMax(*this)
147  << " avg:" << gAverage(*this)
148  << endl;
149  }
150 
151  fixedValueFvPatchScalarField::updateCoeffs();
152 }
153 
154 
156 (
157  Ostream& os
158 ) const
159 {
162  writeEntry(os, "qro", qro_);
163 }
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 namespace Foam
169 {
171  (
174  );
175 }
176 
177 
178 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
Definition: fvPatchField.C:249
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a grey-diffuse condition for radiative heat flux,...
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
greyDiffusiveViewFactorFixedValueFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
Common functions to emissivity. It gets supplied from lookup into a dictionary or calculated by the s...
void write(Ostream &) const
Write.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Namespace for OpenFOAM.
Type gSum(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
const dimensionSet dimPower
messageStream Info
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Type gAverage(const FieldField< Field, Type > &f)
const dimensionSet dimArea
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
dictionary dict
volScalarField & p