atmBoundaryLayerInletEpsilonFvPatchScalarField.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-2023 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 #include "surfaceFields.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
41 (
42  const fvPatch& p,
44  const dictionary& dict
45 )
46 :
47  inletOutletFvPatchScalarField(p, iF),
48  atmBoundaryLayer(patch().Cf(), dict)
49 {
50  phiName_ = dict.lookupOrDefault<word>("phi", "phi");
51 
52  refValue() = epsilon(patch().Cf());
53  refGrad() = 0;
54  valueFraction() = 1;
55 
56  if (dict.found("value"))
57  {
58  scalarField::operator=(scalarField("value", dict, p.size()));
59  }
60  else
61  {
62  scalarField::operator=(refValue());
63  }
64 }
65 
66 
69 (
71  const fvPatch& p,
73  const fvPatchFieldMapper& mapper
74 )
75 :
76  inletOutletFvPatchScalarField(psf, p, iF, mapper),
77  atmBoundaryLayer(psf, mapper)
78 {}
79 
80 
83 (
86 )
87 :
88  inletOutletFvPatchScalarField(psf, iF),
89  atmBoundaryLayer(psf)
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
96 (
97  const fvPatchScalarField& psf,
98  const fvPatchFieldMapper& mapper
99 )
100 {
101  inletOutletFvPatchScalarField::map(psf, mapper);
102 
104  refCast<const atmBoundaryLayerInletEpsilonFvPatchScalarField>(psf);
105 
106  atmBoundaryLayer::map(blpsf, mapper);
107 }
108 
109 
111 (
112  const fvPatchScalarField& psf
113 )
114 {
115  inletOutletFvPatchScalarField::reset(psf);
116 
118  refCast<const atmBoundaryLayerInletEpsilonFvPatchScalarField>(psf);
119 
121 }
122 
123 
125 {
128  writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
129  writeEntry(os, "value", *this);
130 }
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
136 (
139 );
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // ************************************************************************* //
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...
void operator=(const Field< scalar > &)
Definition: Field.C:526
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
This boundary condition specifies an inlet value for the turbulence dissipation, ,...
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchScalarField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
atmBoundaryLayerInletEpsilonFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
This class provides functions to evaluate the velocity and turbulence distributions appropriate for a...
void reset(const atmBoundaryLayer &)
Reset the atmBoundaryLayer to the given atmBoundaryLayer.
void write(Ostream &) const
Write.
void map(const atmBoundaryLayer &, const fvPatchFieldMapper &)
Map the given atmBoundaryLayer onto this atmBoundaryLayer.
tmp< scalarField > epsilon(const vectorField &p) const
Return the turbulent dissipation rate distribution for the ATM.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:231
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
dictionary dict
volScalarField & p
Foam::surfaceFields.