OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "alphaSgsWallFunctionFvPatchScalarField.H"
00028 #include "LESModel.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "volFields.H"
00031 #include "addToRunTimeSelectionTable.H"
00032 #include "wallFvPatch.H"
00033 
00034 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00035 
00036 namespace Foam
00037 {
00038 namespace compressible
00039 {
00040 namespace LESModels
00041 {
00042 
00043 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00044 
00045 void alphaSgsWallFunctionFvPatchScalarField::checkType()
00046 {
00047     if (!isA<wallFvPatch>(patch()))
00048     {
00049         FatalErrorIn
00050         (
00051             "alphaSgsWallFunctionFvPatchScalarField::checkType()"
00052         )
00053             << "Patch type for patch " << patch().name() << " must be wall\n"
00054             << "Current patch type is " << patch().type() << nl
00055             << exit(FatalError);
00056     }
00057 }
00058 
00059 
00060 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00061 
00062 alphaSgsWallFunctionFvPatchScalarField::
00063 alphaSgsWallFunctionFvPatchScalarField
00064 (
00065     const fvPatch& p,
00066     const DimensionedField<scalar, volMesh>& iF
00067 )
00068 :
00069     fixedValueFvPatchScalarField(p, iF),
00070     Prt_(0.85)
00071 {
00072     checkType();
00073 }
00074 
00075 
00076 alphaSgsWallFunctionFvPatchScalarField::
00077 alphaSgsWallFunctionFvPatchScalarField
00078 (
00079     const alphaSgsWallFunctionFvPatchScalarField& ptf,
00080     const fvPatch& p,
00081     const DimensionedField<scalar, volMesh>& iF,
00082     const fvPatchFieldMapper& mapper
00083 )
00084 :
00085     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
00086     Prt_(ptf.Prt_)
00087 {}
00088 
00089 
00090 alphaSgsWallFunctionFvPatchScalarField::
00091 alphaSgsWallFunctionFvPatchScalarField
00092 (
00093     const fvPatch& p,
00094     const DimensionedField<scalar, volMesh>& iF,
00095     const dictionary& dict
00096 )
00097 :
00098     fixedValueFvPatchScalarField(p, iF, dict),
00099     Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
00100 {
00101     checkType();
00102 }
00103 
00104 
00105 alphaSgsWallFunctionFvPatchScalarField::
00106 alphaSgsWallFunctionFvPatchScalarField
00107 (
00108     const alphaSgsWallFunctionFvPatchScalarField& awfpsf
00109 )
00110 :
00111     fixedValueFvPatchScalarField(awfpsf),
00112     Prt_(awfpsf.Prt_)
00113 {
00114     checkType();
00115 }
00116 
00117 
00118 alphaSgsWallFunctionFvPatchScalarField::
00119 alphaSgsWallFunctionFvPatchScalarField
00120 (
00121     const alphaSgsWallFunctionFvPatchScalarField& awfpsf,
00122     const DimensionedField<scalar, volMesh>& iF
00123 )
00124 :
00125     fixedValueFvPatchScalarField(awfpsf, iF),
00126     Prt_(awfpsf.Prt_)
00127 
00128 {
00129     checkType();
00130 }
00131 
00132 
00133 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00134 
00135 void alphaSgsWallFunctionFvPatchScalarField::evaluate
00136 (
00137     const Pstream::commsTypes
00138 )
00139 {
00140     const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
00141 
00142     const scalarField muSgsw =
00143         lesModel.muSgs()().boundaryField()[patch().index()];
00144 
00145     operator==(muSgsw/Prt_);
00146 }
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 makePatchTypeField
00152 (
00153     fvPatchScalarField,
00154     alphaSgsWallFunctionFvPatchScalarField
00155 );
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 } // End namespace LESModels
00160 } // End namespace compressible
00161 } // End namespace Foam
00162 
00163 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd