FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

alphaSgsWallFunctionFvPatchScalarField.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "alphaSgsWallFunctionFvPatchScalarField.H"
00027 #include <compressibleLESModels/LESModel.H>
00028 #include <finiteVolume/fvPatchFieldMapper.H>
00029 #include <finiteVolume/volFields.H>
00030 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00031 #include <finiteVolume/wallFvPatch.H>
00032 
00033 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00034 
00035 namespace Foam
00036 {
00037 namespace compressible
00038 {
00039 namespace LESModels
00040 {
00041 
00042 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00043 
00044 void alphaSgsWallFunctionFvPatchScalarField::checkType()
00045 {
00046     if (!isA<wallFvPatch>(patch()))
00047     {
00048         FatalErrorIn
00049         (
00050             "alphaSgsWallFunctionFvPatchScalarField::checkType()"
00051         )
00052             << "Patch type for patch " << patch().name() << " must be wall\n"
00053             << "Current patch type is " << patch().type() << nl
00054             << exit(FatalError);
00055     }
00056 }
00057 
00058 
00059 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00060 
00061 alphaSgsWallFunctionFvPatchScalarField::
00062 alphaSgsWallFunctionFvPatchScalarField
00063 (
00064     const fvPatch& p,
00065     const DimensionedField<scalar, volMesh>& iF
00066 )
00067 :
00068     fixedValueFvPatchScalarField(p, iF),
00069     Prt_(0.85)
00070 {
00071     checkType();
00072 }
00073 
00074 
00075 alphaSgsWallFunctionFvPatchScalarField::
00076 alphaSgsWallFunctionFvPatchScalarField
00077 (
00078     const alphaSgsWallFunctionFvPatchScalarField& ptf,
00079     const fvPatch& p,
00080     const DimensionedField<scalar, volMesh>& iF,
00081     const fvPatchFieldMapper& mapper
00082 )
00083 :
00084     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
00085     Prt_(ptf.Prt_)
00086 {}
00087 
00088 
00089 alphaSgsWallFunctionFvPatchScalarField::
00090 alphaSgsWallFunctionFvPatchScalarField
00091 (
00092     const fvPatch& p,
00093     const DimensionedField<scalar, volMesh>& iF,
00094     const dictionary& dict
00095 )
00096 :
00097     fixedValueFvPatchScalarField(p, iF, dict),
00098     Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
00099 {
00100     checkType();
00101 }
00102 
00103 
00104 alphaSgsWallFunctionFvPatchScalarField::
00105 alphaSgsWallFunctionFvPatchScalarField
00106 (
00107     const alphaSgsWallFunctionFvPatchScalarField& awfpsf
00108 )
00109 :
00110     fixedValueFvPatchScalarField(awfpsf),
00111     Prt_(awfpsf.Prt_)
00112 {
00113     checkType();
00114 }
00115 
00116 
00117 alphaSgsWallFunctionFvPatchScalarField::
00118 alphaSgsWallFunctionFvPatchScalarField
00119 (
00120     const alphaSgsWallFunctionFvPatchScalarField& awfpsf,
00121     const DimensionedField<scalar, volMesh>& iF
00122 )
00123 :
00124     fixedValueFvPatchScalarField(awfpsf, iF),
00125     Prt_(awfpsf.Prt_)
00126 
00127 {
00128     checkType();
00129 }
00130 
00131 
00132 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00133 
00134 void alphaSgsWallFunctionFvPatchScalarField::evaluate
00135 (
00136     const Pstream::commsTypes
00137 )
00138 {
00139     const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
00140 
00141     const scalarField muSgsw =
00142         lesModel.muSgs()().boundaryField()[patch().index()];
00143 
00144     operator==(muSgsw/Prt_);
00145 }
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 makePatchTypeField
00151 (
00152     fvPatchScalarField,
00153     alphaSgsWallFunctionFvPatchScalarField
00154 );
00155 
00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00157 
00158 } // End namespace LESModels
00159 } // End namespace compressible
00160 } // End namespace Foam
00161 
00162 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines