wallHeatTransferFvPatchScalarField.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 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 \*---------------------------------------------------------------------------*/
27 
30 #include "fvPatchFieldMapper.H"
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 
36 (
37  const fvPatch& p,
39 )
40 :
41  mixedFvPatchScalarField(p, iF),
42  Tinf_(p.size(), Zero),
43  alphaWall_(p.size(), Zero)
44 {
45  refValue() = 0.0;
46  refGrad() = 0.0;
47  valueFraction() = 0.0;
48 }
49 
50 
52 (
54  const fvPatch& p,
56  const fvPatchFieldMapper& mapper
57 )
58 :
59  mixedFvPatchScalarField(ptf, p, iF, mapper),
60  Tinf_(ptf.Tinf_, mapper),
61  alphaWall_(ptf.alphaWall_, mapper)
62 {}
63 
64 
66 (
67  const fvPatch& p,
69  const dictionary& dict
70 )
71 :
72  mixedFvPatchScalarField(p, iF),
73  Tinf_("Tinf", dict, p.size()),
74  alphaWall_("alphaWall", dict, p.size())
75 {
76  refValue() = Tinf_;
77  refGrad() = 0.0;
78  valueFraction() = 0.0;
79 
80  if (dict.found("value"))
81  {
83  (
84  scalarField("value", dict, p.size())
85  );
86  }
87  else
88  {
89  evaluate();
90  }
91 }
92 
93 
95 (
97 )
98 :
99  mixedFvPatchScalarField(tppsf),
100  Tinf_(tppsf.Tinf_),
101  alphaWall_(tppsf.alphaWall_)
102 {}
103 
104 
106 (
109 )
110 :
111  mixedFvPatchScalarField(tppsf, iF),
112  Tinf_(tppsf.Tinf_),
113  alphaWall_(tppsf.alphaWall_)
114 {}
115 
116 
117 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
118 
120 (
121  const fvPatchFieldMapper& m
122 )
123 {
124  scalarField::autoMap(m);
125  Tinf_.autoMap(m);
126  alphaWall_.autoMap(m);
127 }
128 
129 
131 (
132  const fvPatchScalarField& ptf,
133  const labelList& addr
134 )
135 {
136  mixedFvPatchScalarField::rmap(ptf, addr);
137 
139  refCast<const wallHeatTransferFvPatchScalarField>(ptf);
140 
141  Tinf_.rmap(tiptf.Tinf_, addr);
142  alphaWall_.rmap(tiptf.alphaWall_, addr);
143 }
144 
145 
147 {
148  if (updated())
149  {
150  return;
151  }
152 
153  const compressible::turbulenceModel& turbModel =
154  db().lookupObject<compressible::turbulenceModel>
155  (
157  (
159  internalField().group()
160  )
161  );
162 
163  const label patchi = patch().index();
164 
165  valueFraction() =
166  1.0/
167  (
168  1.0
169  + turbModel.kappaEff(patchi)*patch().deltaCoeffs()/alphaWall_
170  );
171 
172  mixedFvPatchScalarField::updateCoeffs();
173 }
174 
175 
177 {
179  Tinf_.writeEntry("Tinf", os);
180  alphaWall_.writeEntry("alphaWall", os);
181  writeEntry("value", os);
182 }
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 namespace Foam
188 {
190  (
193  );
194 }
195 
196 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::wallHeatTransferFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: wallHeatTransferFvPatchScalarField.C:176
Foam::fvPatchField< scalar >::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:384
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::constant::atomic::group
constexpr const char *const group
Group name for atomic constants.
Definition: atomicConstants.H:52
Foam::wallHeatTransferFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: wallHeatTransferFvPatchScalarField.C:131
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
wallHeatTransferFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: wallHeatTransferFvPatchScalarField.C:36
fvPatchFieldMapper.H
Foam::wallHeatTransferFvPatchScalarField
This boundary condition provides an enthalpy condition for wall heat transfer.
Definition: wallHeatTransferFvPatchScalarField.H:86
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::wallHeatTransferFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: wallHeatTransferFvPatchScalarField.C:120
Foam::wallHeatTransferFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: wallHeatTransferFvPatchScalarField.C:146
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ThermalDiffusivity::kappaEff
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
Definition: ThermalDiffusivity.H:146
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::ThermalDiffusivity
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
Definition: phaseCompressibleTurbulenceModelFwd.H:47
Foam::List< label >
wallHeatTransferFvPatchScalarField.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::IOobject::groupName
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
turbulentFluidThermoModel.H
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::stringOps::evaluate
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
Definition: stringOpsEvaluate.C:37