nutkRoughWallFunctionFvPatchScalarField.H 6.18 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
5
    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
6
7
8
9
10
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

11
12
13
14
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
15
16
17
18
19
20
21

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    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
26
\addtogroup icoWallFunctions
@{

27
Class
28
    Foam::incompressible::RASModels::nutkRoughWallFunctionFvPatchScalarField
29
30

Description
31
32
33
    This boundary condition provides a turbulent kinematic viscosity condition
    when using wall functions for rough walls, based on turbulence kinetic
    energy.  The condition manipulates the E parameter to account for roughness effects.
34

35
    Parameter ranges
36
    - roughness height = sand-grain roughness (0 for smooth walls)
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    - roughness constant = 0.5-1.0

    /heading Patch usage

    /table
        Property     | Description             | Required    | Default value
        Ks           | sand-grain roughness height | yes     |
        Cs           | roughness constant      | yes         |
    /endtable

    Example of the boundary condition specification:
    \verbatim
    myPatch
    {
        type            nutkAtmRoughWallFunction;
        Ks              uniform 0;
        Cs              uniform 0.5;
    }
    \endverbatim

SeeAlso
    Foam::nutkRoughWallFunctionFvPatchScalarField
59
60

SourceFiles
61
    nutkRoughWallFunctionFvPatchScalarField.C
62

63
64
@}

65
66
\*---------------------------------------------------------------------------*/

67
68
#ifndef nutkRoughWallFunctionFvPatchScalarField_H
#define nutkRoughWallFunctionFvPatchScalarField_H
69

70
#include "nutkWallFunctionFvPatchScalarField.H"
71
72
73
74
75
76
77
78
79
80
81

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
namespace incompressible
{
namespace RASModels
{

/*---------------------------------------------------------------------------*\
82
           Class nutkRoughWallFunctionFvPatchScalarField Declaration
83
84
\*---------------------------------------------------------------------------*/

85
class nutkRoughWallFunctionFvPatchScalarField
86
:
87
    public nutkWallFunctionFvPatchScalarField
88
{
89
protected:
90

91
    // Protected data
92

93
94
95
96
97
98
99
        //- Roughness height
        scalarField Ks_;

        //- Roughness constant
        scalarField Cs_;


100
    // Protected Member Functions
101
102

        //- Compute the roughness function
103
104
105
106
        virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;

        //- Calculate the turbulence viscosity
        virtual tmp<scalarField> calcNut() const;
107
108
109
110
111


public:

    //- Runtime type information
112
    TypeName("nutkRoughWallFunction");
113
114
115
116
117


    // Constructors

        //- Construct from patch and internal field
118
        nutkRoughWallFunctionFvPatchScalarField
119
120
121
122
123
124
        (
            const fvPatch&,
            const DimensionedField<scalar, volMesh>&
        );

        //- Construct from patch, internal field and dictionary
125
        nutkRoughWallFunctionFvPatchScalarField
126
127
128
129
130
131
132
        (
            const fvPatch&,
            const DimensionedField<scalar, volMesh>&,
            const dictionary&
        );

        //- Construct by mapping given
133
        //  nutkRoughWallFunctionFvPatchScalarField
134
        //  onto a new patch
135
        nutkRoughWallFunctionFvPatchScalarField
136
        (
137
            const nutkRoughWallFunctionFvPatchScalarField&,
138
139
140
141
142
143
            const fvPatch&,
            const DimensionedField<scalar, volMesh>&,
            const fvPatchFieldMapper&
        );

        //- Construct as copy
144
        nutkRoughWallFunctionFvPatchScalarField
145
        (
146
            const nutkRoughWallFunctionFvPatchScalarField&
147
148
149
150
151
152
153
        );

        //- Construct and return a clone
        virtual tmp<fvPatchScalarField> clone() const
        {
            return tmp<fvPatchScalarField>
            (
154
                new nutkRoughWallFunctionFvPatchScalarField(*this)
155
156
157
158
            );
        }

        //- Construct as copy setting internal field reference
159
        nutkRoughWallFunctionFvPatchScalarField
160
        (
161
            const nutkRoughWallFunctionFvPatchScalarField&,
162
163
164
165
166
167
168
169
170
171
172
            const DimensionedField<scalar, volMesh>&
        );

        //- Construct and return a clone setting internal field reference
        virtual tmp<fvPatchScalarField> clone
        (
            const DimensionedField<scalar, volMesh>& iF
        ) const
        {
            return tmp<fvPatchScalarField>
            (
173
                new nutkRoughWallFunctionFvPatchScalarField(*this, iF)
174
175
176
177
178
179
            );
        }


    // Member functions

180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
        // Acces functions

            // Return Ks
             scalarField& Ks()
            {
                return Ks_;
            }

            // Return Cs
            scalarField& Cs()
            {
                return Cs_;
            }


195
196
197
        // Mapping functions

            //- Map (and resize as needed) from self given a mapping object
198
            virtual void autoMap(const fvPatchFieldMapper&);
199
200
201
202
203
204
205
206
207
208
209
210

            //- Reverse map the given fvPatchField onto this fvPatchField
            virtual void rmap
            (
                const fvPatchScalarField&,
                const labelList&
            );


        // I-O

            //- Write
211
            virtual void write(Ostream&) const;
212
213
214
215
216
217
218
219
220
221
222
223
224
225
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace RASModels
} // End namespace incompressible
} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //