Turbulent moving immersed boundary fixes. Inno Gatin
[foam-extend-3.2.git] / src / immersedBoundary / immersedBoundaryTurbulence / wallFunctions / immersedBoundaryWallFunctions / immersedBoundaryWallFunctionFvPatchField.H
blob4ab57497cf287548507625fc098180c756e513e9
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.
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.
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.
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/>.
24 Class
25     Foam::incompressible::RASModels::immersedBoundaryWallFunctionFvPatchField
27 Description
28     Boundary condition for passive turbulence variables (U, k, q, R, nut)
29     when using wall functions on an immersed boundary patch
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.
34     This is handled using the ibWallValue and ibWallMask arrays, corresponding
35     to the number of ibCells
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.
44 Author
45     Hrvoje Jasak, Wikki Ltd.  All rights reserved
47 SourceFiles
48     immersedBoundaryWallFunctionFvPatchField.C
50 \*---------------------------------------------------------------------------*/
52 #ifndef immersedBoundaryWallFunctionFvPatchField_H
53 #define immersedBoundaryWallFunctionFvPatchField_H
55 #include "fvPatchFields.H"
56 #include "immersedBoundaryFvPatchField.H"
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 namespace Foam
62 namespace incompressible
64 namespace RASModels
67 /*---------------------------------------------------------------------------*\
68          Class immersedBoundaryWallFunctionFvPatchField Declaration
69 \*---------------------------------------------------------------------------*/
71 template<class Type>
72 class immersedBoundaryWallFunctionFvPatchField
74     public immersedBoundaryFvPatchField<Type>
76     // Private data
78         //- Value to fix in IB cell
79         mutable Field<Type> wallValue_;
81         //- Indicator on values to fix
82         mutable boolList wallMask_;
85 protected:
87     // Protected Member Functions
89         //- Set IB cell values: contains data manipulation
90         virtual void setIbCellValues(const Field<Type>&) const;
93 public:
95     //- Runtime type information
96     TypeName("immersedBoundaryWallFunction");
99     // Constructors
101         //- Construct from patch and internal field
102         immersedBoundaryWallFunctionFvPatchField
103         (
104             const fvPatch&,
105             const DimensionedField<Type, volMesh>&
106         );
108         //- Construct from patch, internal field and dictionary
109         immersedBoundaryWallFunctionFvPatchField
110         (
111             const fvPatch&,
112             const DimensionedField<Type, volMesh>&,
113             const dictionary&
114         );
116         //- Construct by mapping given
117         // immersedBoundaryWallFunctionFvPatchField
118         //  onto a new patch
119         immersedBoundaryWallFunctionFvPatchField
120         (
121             const immersedBoundaryWallFunctionFvPatchField&,
122             const fvPatch&,
123             const DimensionedField<Type, volMesh>&,
124             const fvPatchFieldMapper&
125         );
127         //- Construct as copy
128         immersedBoundaryWallFunctionFvPatchField
129         (
130             const immersedBoundaryWallFunctionFvPatchField&
131         );
133         //- Construct and return a clone
134         virtual tmp<fvPatchField<Type> > clone() const
135         {
136             return tmp<fvPatchField<Type> >
137             (
138                 new immersedBoundaryWallFunctionFvPatchField(*this)
139             );
140         }
142         //- Construct as copy setting internal field reference
143         immersedBoundaryWallFunctionFvPatchField
144         (
145             const immersedBoundaryWallFunctionFvPatchField&,
146             const DimensionedField<Type, volMesh>&
147         );
149         //- Construct and return a clone setting internal field reference
150         virtual tmp<fvPatchField<Type> > clone
151         (
152             const DimensionedField<Type, volMesh>& iF
153         ) const
154         {
155             return tmp<fvPatchField<Type> >
156             (
157                 new immersedBoundaryWallFunctionFvPatchField(*this, iF)
158             );
159         }
162     //- Destructor
163     virtual ~immersedBoundaryWallFunctionFvPatchField()
164     {}
167     // Member functions
169         // Access
171             //- Access to value to fix in IB cell.  Note non-const access
172             Field<Type>& wallValue() const;
174             //- Access to indicator on fixed values.  Note non-const access
175             boolList& wallMask() const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace RASModels
182 } // End namespace incompressible
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #ifdef NoRepository
188 #   include "immersedBoundaryWallFunctionFvPatchField.C"
189 #endif
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 #endif
195 // ************************************************************************* //