atmosphericBoundaryLayerTurbulentKineticEnergyFvPatchScalarField.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-2026 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 
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
39 (
40  const fvPatch& p,
42  const dictionary& dict
43 )
44 :
45  inletOutletFvPatchScalarField(p, iF, dict, false)
46 {
47  phiName_ = dict.lookupOrDefault<word>("phi", "phi");
48 
49  const atmosphericBoundaryLayer& abl =
50  atmosphericBoundaryLayer::New(patch().db());
51 
52  refValue() = abl.k(patch().Cf());
53  refGrad() = 0;
54  valueFraction() = 1;
55 
56  if (dict.found("value"))
57  {
59  (
60  scalarField("value", iF.dimensions(), dict, p.size())
61  );
62  }
63  else
64  {
65  scalarField::operator=(refValue());
66  }
67 }
68 
69 
72 (
74  const fvPatch& p,
76  const fieldMapper& mapper
77 )
78 :
79  inletOutletFvPatchScalarField(psf, p, iF, mapper)
80 {}
81 
82 
85 (
88 )
89 :
90  inletOutletFvPatchScalarField(psf, iF)
91 {}
92 
93 
94 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
95 
97 (
98  Ostream& os
99 ) const
100 {
102  writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
103  writeEntry(os, "value", *this);
104 }
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
110 (
113 );
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // ************************************************************************* //
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.
void operator=(const Field< scalar > &)
Definition: Field.C:557
friend Ostream & operator(Ostream &, const Field< scalar > &)
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 turbulent kinetic energy,...
atmosphericBoundaryLayerTurbulentKineticEnergyFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
This class provides functions to evaluate the velocity and turbulence distributions appropriate for a...
static const atmosphericBoundaryLayer & New(const objectRegistry &db)
Return a reference to the atmosphericBoundaryLayer.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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:90
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:235
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
makePatchTypeField(fvPatchScalarField, atmosphericBoundaryLayerTurbulentEpsilonFvPatchScalarField)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dictionary dict
volScalarField & p