changed isA<wallPolyPatch> & isA<wallFvPatch> almost everywhere
[openfoam-extend-OpenFOAM-1.6-ext.git] / src / turbulenceModels / compressible / LES / derivedFvPatchFields / wallFunctions / alphaSgsWallFunctions / alphaSgsWallFunction / alphaSgsWallFunctionFvPatchScalarField.C
blob23d648e49010f137b7bc98852856a88af2201bec
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "alphaSgsWallFunctionFvPatchScalarField.H"
28 #include "LESModel.H"
29 #include "fvPatchFieldMapper.H"
30 #include "volFields.H"
31 #include "addToRunTimeSelectionTable.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 namespace Foam
37 namespace compressible
39 namespace LESModels
42 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
44 void alphaSgsWallFunctionFvPatchScalarField::checkType()
46     if (!patch().isWall())
47     {
48         FatalErrorIn
49         (
50             "alphaSgsWallFunctionFvPatchScalarField::checkType()"
51         )
52             << "Patch type for patch " << patch().name() << " must be wall\n"
53             << "Current patch type is " << patch().type() << nl
54             << exit(FatalError);
55     }
59 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
61 alphaSgsWallFunctionFvPatchScalarField::
62 alphaSgsWallFunctionFvPatchScalarField
64     const fvPatch& p,
65     const DimensionedField<scalar, volMesh>& iF
68     fixedValueFvPatchScalarField(p, iF),
69     Prt_(0.85)
71     checkType();
75 alphaSgsWallFunctionFvPatchScalarField::
76 alphaSgsWallFunctionFvPatchScalarField
78     const alphaSgsWallFunctionFvPatchScalarField& ptf,
79     const fvPatch& p,
80     const DimensionedField<scalar, volMesh>& iF,
81     const fvPatchFieldMapper& mapper
84     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
85     Prt_(ptf.Prt_)
89 alphaSgsWallFunctionFvPatchScalarField::
90 alphaSgsWallFunctionFvPatchScalarField
92     const fvPatch& p,
93     const DimensionedField<scalar, volMesh>& iF,
94     const dictionary& dict
97     fixedValueFvPatchScalarField(p, iF, dict),
98     Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
100     checkType();
104 alphaSgsWallFunctionFvPatchScalarField::
105 alphaSgsWallFunctionFvPatchScalarField
107     const alphaSgsWallFunctionFvPatchScalarField& awfpsf
110     fixedValueFvPatchScalarField(awfpsf),
111     Prt_(awfpsf.Prt_)
113     checkType();
117 alphaSgsWallFunctionFvPatchScalarField::
118 alphaSgsWallFunctionFvPatchScalarField
120     const alphaSgsWallFunctionFvPatchScalarField& awfpsf,
121     const DimensionedField<scalar, volMesh>& iF
124     fixedValueFvPatchScalarField(awfpsf, iF),
125     Prt_(awfpsf.Prt_)
128     checkType();
132 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
134 void alphaSgsWallFunctionFvPatchScalarField::evaluate
136     const Pstream::commsTypes
139     const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
141     const scalarField muSgsw =
142         lesModel.muSgs()().boundaryField()[patch().index()];
144     operator==(muSgsw/Prt_);
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 makePatchTypeField
152     fvPatchScalarField,
153     alphaSgsWallFunctionFvPatchScalarField
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace LESModels
159 } // End namespace compressible
160 } // End namespace Foam
162 // ************************************************************************* //