![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 Class 00026 turbulentInletFvPatchField 00027 00028 Description 00029 00030 SourceFiles 00031 turbulentInletFvPatchField.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef turbulentInletFvPatchField_H 00036 #define turbulentInletFvPatchField_H 00037 00038 #include "Random.H" 00039 #include "fixedValueFvPatchFields.H" 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class turbulentInletFvPatch Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 template<class Type> 00051 class turbulentInletFvPatchField 00052 : 00053 public fixedValueFvPatchField<Type> 00054 { 00055 00056 // Private data 00057 00058 Random ranGen_; 00059 Type fluctuationScale_; 00060 Field<Type> referenceField_; 00061 label curTimeIndex_; 00062 00063 00064 public: 00065 00066 //- Runtime type information 00067 TypeName("turbulentInlet"); 00068 00069 00070 // Constructors 00071 00072 //- Construct from patch and internal field 00073 turbulentInletFvPatchField 00074 ( 00075 const fvPatch&, 00076 const Field<Type>& 00077 ); 00078 00079 //- Construct from patch, internal field and dictionary 00080 turbulentInletFvPatchField 00081 ( 00082 const fvPatch&, 00083 const Field<Type>&, 00084 const dictionary& 00085 ); 00086 00087 //- Construct by mapping given turbulentInletFvPatchField onto a new patch 00088 turbulentInletFvPatchField 00089 ( 00090 const turbulentInletFvPatchField<Type>&, 00091 const fvPatch&, 00092 const Field<Type>&, 00093 const fvPatchFieldMapper& 00094 ); 00095 00096 //- Construct and return a clone 00097 virtual tmp<fvPatchField<Type> > clone() const 00098 { 00099 return tmp<fvPatchField<Type> > 00100 ( 00101 new turbulentInletFvPatchField<Type>(*this) 00102 ); 00103 } 00104 00105 //- Construct as copy setting internal field reference 00106 turbulentInletFvPatchField 00107 ( 00108 const turbulentInletFvPatchField<Type>&, 00109 const Field<Type>& 00110 ); 00111 00112 //- Construct and return a clone setting internal field reference 00113 virtual tmp<fvPatchField<Type> > clone(const Field<Type>& iF) const 00114 { 00115 return tmp<fvPatchField<Type> > 00116 ( 00117 new turbulentInletFvPatchField<Type>(*this, iF) 00118 ); 00119 } 00120 00121 00122 // Member functions 00123 00124 // Access 00125 00126 //- Return the fluctuation scale 00127 const Type& fluctuationScale() const 00128 { 00129 return fluctuationScale_; 00130 } 00131 00132 //- Return reference to the fluctuation scale to allow adjustment 00133 Type& fluctuationScale() 00134 { 00135 return fluctuationScale_; 00136 } 00137 00138 //- Return the reference field 00139 const Field<Type>& referenceField() const 00140 { 00141 return referenceField_; 00142 } 00143 00144 //- Return reference to the reference field to allow adjustment 00145 Field<Type>& referenceField() 00146 { 00147 return referenceField_; 00148 } 00149 00150 00151 // Mapping functions 00152 00153 //- Map (and resize as needed) from self given a mapping object 00154 virtual void autoMap 00155 ( 00156 const fvPatchFieldMapper& 00157 ); 00158 00159 //- Reverse map the given fvPatchField onto this fvPatchField 00160 virtual void rmap 00161 ( 00162 const fvPatchField<Type>&, 00163 const labelList& 00164 ); 00165 00166 00167 // Evaluation functions 00168 00169 //- Update the coefficients associated with the patch field 00170 virtual void updateCoeffs(); 00171 00172 00173 //- Write 00174 virtual void write(Ostream&) const; 00175 }; 00176 00177 00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00179 00180 } // End namespace Foam 00181 00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00183 00184 #ifdef NoRepository 00185 # include "turbulentInletFvPatchField.C" 00186 #endif 00187 00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00189 00190 #endif 00191 00192 // ************************************************************************* //