immersedBoundaryWallFunctionFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation, either version 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField
26 
27 Description
28  Boundary condition for passive turbulence variables (U, k, q, R, nut)
29  when using wall functions on an immersed boundary patch
30 
31  Apart form standard immersed boundary capability, the patch field allows
32  only some values to be fixed, as defined by the wall function calculation.
33 
34  This is handled using the ibWallValue and ibWallMask arrays, corresponding
35  to the number of ibCells
36 
37  The implementation of wall functions on an immersed boundary will fix
38  the values of k, epsilon, nut and tangential velocity in cells within
39  the log-law layer. For the cells in the laminar sublayer, k and epsilon
40  (omega) will be calculated using a zero gradient condition,
41  nut will be set to zero and the tangential component of the
42  velocity will be corrected.
43 
44 Author
45  Hrvoje Jasak, Wikki Ltd. All rights reserved
46 
47 SourceFiles
48  immersedBoundaryWallFunctionFvPatchField.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef immersedBoundaryWallFunctionFvPatchField_H
53 #define immersedBoundaryWallFunctionFvPatchField_H
54 
55 #include "fvPatchFields.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 namespace incompressible
63 {
64 namespace RASModels
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class immersedBoundaryWallFunctionFvPatchField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class Type>
73 :
74  public immersedBoundaryFvPatchField<Type>
75 {
76  // Private data
77 
78  //- Value to fix in IB cell
79  mutable Field<Type> wallValue_;
80 
81  //- Indicator on values to fix
82  mutable boolList wallMask_;
83 
84 
85 protected:
86 
87  // Protected Member Functions
88 
89  //- Set IB cell values: contains data manipulation
90  virtual void setIbCellValues(const Field<Type>&) const;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("immersedBoundaryWallFunction");
97 
98 
99  // Constructors
100 
101  //- Construct from patch and internal field
103  (
104  const fvPatch&,
106  );
107 
108  //- Construct from patch, internal field and dictionary
110  (
111  const fvPatch&,
113  const dictionary&
114  );
115 
116  //- Construct by mapping given
117  // immersedBoundaryWallFunctionFvPatchField
118  // onto a new patch
120  (
122  const fvPatch&,
124  const fvPatchFieldMapper&
125  );
126 
127  //- Construct as copy
129  (
131  );
132 
133  //- Construct and return a clone
134  virtual tmp<fvPatchField<Type> > clone() const
135  {
136  return tmp<fvPatchField<Type> >
137  (
139  );
140  }
141 
142  //- Construct as copy setting internal field reference
144  (
147  );
148 
149  //- Construct and return a clone setting internal field reference
151  (
153  ) const
154  {
155  return tmp<fvPatchField<Type> >
156  (
158  );
159  }
160 
161 
162  //- Destructor
164  {}
165 
166 
167  // Member functions
168 
169  // Access
170 
171  //- Access to value to fix in IB cell. Note non-const access
172  Field<Type>& wallValue() const;
173 
174  //- Access to indicator on fixed values. Note non-const access
175  boolList& wallMask() const;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace RASModels
182 } // End namespace incompressible
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #ifdef NoRepository
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::immersedBoundaryWallFunctionFvPatchField
immersedBoundaryWallFunctionFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: immersedBoundaryWallFunctionFvPatchField.C:99
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField
Boundary condition for passive turbulence variables (U, k, q, R, nut) when using wall functions on an...
Definition: immersedBoundaryWallFunctionFvPatchField.H:71
immersedBoundaryFvPatchField.H
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::wallMask_
boolList wallMask_
Indicator on values to fix.
Definition: immersedBoundaryWallFunctionFvPatchField.H:81
Foam::Field< Type >
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::TypeName
TypeName("immersedBoundaryWallFunction")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::wallValue
Field< Type > & wallValue() const
Access to value to fix in IB cell. Note non-const access.
Definition: immersedBoundaryWallFunctionFvPatchField.C:171
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: immersedBoundaryWallFunctionFvPatchField.H:133
fvPatchFields.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::immersedBoundaryFvPatchField
Foam::immersedBoundaryFvPatchField.
Definition: immersedBoundaryFvPatchField.H:53
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::wallMask
boolList & wallMask() const
Access to indicator on fixed values. Note non-const access.
Definition: immersedBoundaryWallFunctionFvPatchField.C:200
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::wallValue_
Field< Type > wallValue_
Value to fix in IB cell.
Definition: immersedBoundaryWallFunctionFvPatchField.H:78
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::~immersedBoundaryWallFunctionFvPatchField
virtual ~immersedBoundaryWallFunctionFvPatchField()
Destructor.
Definition: immersedBoundaryWallFunctionFvPatchField.H:162
Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField::setIbCellValues
virtual void setIbCellValues(const Field< Type > &) const
Set IB cell values: contains data manipulation.
Definition: immersedBoundaryWallFunctionFvPatchField.C:46
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
immersedBoundaryWallFunctionFvPatchField.C