BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / turbulenceModels / incompressible / RAS / include / wallNonlinearViscosityI.H
blob74e4846db655bf77dbebdda0a0d0f3e974d722c3
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Global
25     wallNonlinearViscosity
27 Description
28     Calculate wall viscosity for non-linear models
30 \*---------------------------------------------------------------------------*/
33     const fvPatchList& patches = mesh_.boundary();
35     const scalar yPlusLam = this->yPlusLam(kappa_.value(), E_.value());
37     const volScalarField nuLam(this->nu());
39     forAll(patches, patchi)
40     {
41         const fvPatch& curPatch = patches[patchi];
43         if (isA<wallFvPatch>(curPatch))
44         {
45             const scalarField& nuw = nuLam.boundaryField()[patchi];
46             scalarField& nutw = nut_.boundaryField()[patchi];
48             forAll(curPatch, facei)
49             {
50                 label faceCelli = curPatch.faceCells()[facei];
52                 //- Using local Cmu
53                 scalar Cmu25 = pow025(Cmu_[faceCelli]);
55                 scalar yPlus =
56                     Cmu25*y_[patchi][facei]*sqrt(k_[faceCelli])/nuw[facei];
58                 if (yPlus > yPlusLam)
59                 {
60                     nutw[facei] =
61                         nuw[facei]
62                        *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
63                 }
64                 else
65                 {
66                     nutw[facei] = 0.0;
67                 }
68             }
69         }
70     }
74 // ************************************************************************* //