FreeFOAM The Cross-Platform CFD Toolkit
alphaSgsWallFunctionFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
29 #include <finiteVolume/volFields.H>
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace compressible
38 {
39 namespace LESModels
40 {
41 
42 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
43 
44 void alphaSgsWallFunctionFvPatchScalarField::checkType()
45 {
46  if (!isA<wallFvPatch>(patch()))
47  {
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  }
56 }
57 
58 
59 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
60 
61 alphaSgsWallFunctionFvPatchScalarField::
62 alphaSgsWallFunctionFvPatchScalarField
63 (
64  const fvPatch& p,
66 )
67 :
68  fixedValueFvPatchScalarField(p, iF),
69  Prt_(0.85)
70 {
71  checkType();
72 }
73 
74 
75 alphaSgsWallFunctionFvPatchScalarField::
76 alphaSgsWallFunctionFvPatchScalarField
77 (
79  const fvPatch& p,
81  const fvPatchFieldMapper& mapper
82 )
83 :
84  fixedValueFvPatchScalarField(ptf, p, iF, mapper),
85  Prt_(ptf.Prt_)
86 {}
87 
88 
89 alphaSgsWallFunctionFvPatchScalarField::
90 alphaSgsWallFunctionFvPatchScalarField
91 (
92  const fvPatch& p,
94  const dictionary& dict
95 )
96 :
97  fixedValueFvPatchScalarField(p, iF, dict),
98  Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
99 {
100  checkType();
101 }
102 
103 
104 alphaSgsWallFunctionFvPatchScalarField::
105 alphaSgsWallFunctionFvPatchScalarField
106 (
108 )
109 :
110  fixedValueFvPatchScalarField(awfpsf),
111  Prt_(awfpsf.Prt_)
112 {
113  checkType();
114 }
115 
116 
117 alphaSgsWallFunctionFvPatchScalarField::
118 alphaSgsWallFunctionFvPatchScalarField
119 (
122 )
123 :
124  fixedValueFvPatchScalarField(awfpsf, iF),
125  Prt_(awfpsf.Prt_)
126 
127 {
128  checkType();
129 }
130 
131 
132 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
133 
134 void alphaSgsWallFunctionFvPatchScalarField::evaluate
135 (
136  const Pstream::commsTypes
137 )
138 {
139  const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
140 
141  const scalarField muSgsw =
142  lesModel.muSgs()().boundaryField()[patch().index()];
143 
144  operator==(muSgsw/Prt_);
145 }
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
151 (
154 );
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace LESModels
159 } // End namespace compressible
160 } // End namespace Foam
161 
162 // ************************ vim: set sw=4 sts=4 et: ************************ //