![]() |
|
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 directionMixedFvPatchField 00027 00028 Description 00029 00030 SourceFiles 00031 directionMixedFvPatchField.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef directionMixedFvPatchField_H 00036 #define directionMixedFvPatchField_H 00037 00038 #include "transformFvPatchField.H" 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class directionMixedFvPatch Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 template<class Type> 00050 class directionMixedFvPatchField 00051 : 00052 public transformFvPatchField<Type> 00053 { 00054 // Private data 00055 00056 //- Value field 00057 Field<Type> refValue_; 00058 00059 //- Normal gradient field 00060 Field<Type> refGrad_; 00061 00062 //- Fraction (0-1) of value used for boundary condition 00063 scalarField valueFraction_; 00064 00065 00066 public: 00067 00068 //- Runtime type information 00069 TypeName("directionMixed"); 00070 00071 00072 // Constructors 00073 00074 //- Construct from patch and internal field 00075 directionMixedFvPatchField 00076 ( 00077 const fvPatch&, 00078 const Field<Type>& 00079 ); 00080 00081 //- Construct from patch, internal field and dictionary 00082 directionMixedFvPatchField 00083 ( 00084 const fvPatch&, 00085 const Field<Type>&, 00086 const dictionary& 00087 ); 00088 00089 //- Construct by mapping given directionMixedFvPatchField onto 00090 // a new patch 00091 directionMixedFvPatchField 00092 ( 00093 const directionMixedFvPatchField<Type>&, 00094 const fvPatch&, 00095 const Field<Type>&, 00096 const fvPatchFieldMapper& 00097 ); 00098 00099 //- Construct and return a clone 00100 virtual tmp<fvPatchField<Type> > clone() const 00101 { 00102 return tmp<fvPatchField<Type> > 00103 ( 00104 new directionMixedFvPatchField<Type>(*this) 00105 ); 00106 } 00107 00108 //- Construct as copy setting internal field reference 00109 directionMixedFvPatchField 00110 ( 00111 const directionMixedFvPatchField<Type>&, 00112 const Field<Type>& 00113 ); 00114 00115 //- Construct and return a clone setting internal field reference 00116 virtual tmp<fvPatchField<Type> > clone(const Field<Type>& iF) const 00117 { 00118 return tmp<fvPatchField<Type> > 00119 ( 00120 new directionMixedFvPatchField<Type>(*this, iF) 00121 ); 00122 } 00123 00124 00125 // Member functions 00126 00127 // Access 00128 00129 //- Return true if this patch field fixes a value. 00130 // Needed to check if a level has to be specified while solving 00131 // Poissons equations. 00132 virtual bool fixesValue() const 00133 { 00134 return true; 00135 } 00136 00137 00138 // Mapping functions 00139 00140 //- Map (and resize as needed) from self given a mapping object 00141 virtual void autoMap 00142 ( 00143 const fvPatchFieldMapper& 00144 ); 00145 00146 //- Reverse map the given fvPatchField onto this fvPatchField 00147 virtual void rmap 00148 ( 00149 const fvPatchField<Type>&, 00150 const labelList& 00151 ); 00152 00153 00154 // Return defining fields 00155 00156 virtual Field<Type>& refValue() 00157 { 00158 return refValue_; 00159 } 00160 00161 virtual const Field<Type>& refValue() const 00162 { 00163 return refValue_; 00164 } 00165 00166 virtual Field<Type>& refGrad() 00167 { 00168 return refGrad_; 00169 } 00170 00171 virtual const Field<Type>& refGrad() const 00172 { 00173 return refGrad_; 00174 } 00175 00176 virtual scalarField& valueFraction() 00177 { 00178 return valueFraction_; 00179 } 00180 00181 virtual const scalarField& valueFraction() const 00182 { 00183 return valueFraction_; 00184 } 00185 00186 00187 // Evaluation functions 00188 00189 //- Return gradient at boundary 00190 virtual tmp<Field<Type> > snGrad() const; 00191 00192 //- Evaluate the patch field 00193 virtual void evaluate(); 00194 00195 //- Return face-gradient transform diagonal 00196 virtual tmp<Field<Type> > snGradTransformDiag() const; 00197 00198 00199 //- Write 00200 virtual void write(Ostream&) const; 00201 00202 00203 // Member operators 00204 00205 virtual void operator=(const fvPatchField<Type>&) {} 00206 virtual void operator+=(const fvPatchField<Type>&) {} 00207 virtual void operator-=(const fvPatchField<Type>&) {} 00208 virtual void operator*=(const fvPatchField<Type>&) {} 00209 virtual void operator/=(const fvPatchField<Type>&) {} 00210 00211 virtual void operator=(const Field<Type>&) {} 00212 virtual void operator+=(const Field<Type>&) {} 00213 virtual void operator-=(const Field<Type>&) {} 00214 virtual void operator*=(const Field<scalar>&) {} 00215 virtual void operator/=(const Field<scalar>&) {} 00216 00217 virtual void operator=(const Type&) {} 00218 virtual void operator+=(const Type&) {} 00219 virtual void operator-=(const Type&) {} 00220 virtual void operator*=(const scalar) {} 00221 virtual void operator/=(const scalar) {} 00222 }; 00223 00224 00225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00226 00227 } // End namespace Foam 00228 00229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00230 00231 #ifdef NoRepository 00232 # include "directionMixedFvPatchField.C" 00233 #endif 00234 00235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00236 00237 #endif 00238 00239 // ************************************************************************* //