![]() |
|
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 coupledFvPatchField 00027 00028 Description 00029 00030 SourceFiles 00031 coupledFvPatchField.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef coupledFvPatchField_H 00036 #define coupledFvPatchField_H 00037 00038 #include "fvPatchField.H" 00039 #include "coupledFvPatch.H" 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class coupledFvPatch Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 template<class Type> 00051 class coupledFvPatchField 00052 : 00053 public fvPatchField<Type> 00054 { 00055 00056 public: 00057 00058 //- Runtime type information 00059 TypeName(coupledFvPatch::typeName_()); 00060 00061 00062 // Constructors 00063 00064 //- Construct from patch and internal field 00065 coupledFvPatchField 00066 ( 00067 const fvPatch&, 00068 const Field<Type>& 00069 ); 00070 00071 //- Construct from patch and internal field and patch field 00072 coupledFvPatchField 00073 ( 00074 const fvPatch&, 00075 const Field<Type>&, 00076 const Field<Type>& 00077 ); 00078 00079 //- Construct from patch, internal field and dictionary 00080 coupledFvPatchField 00081 ( 00082 const fvPatch&, 00083 const Field<Type>&, 00084 const dictionary& 00085 ); 00086 00087 //- Construct by mapping the given coupledFvPatchField onto a new patch 00088 coupledFvPatchField 00089 ( 00090 const coupledFvPatchField<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 = 0; 00098 00099 //- Construct as copy setting internal field reference 00100 coupledFvPatchField 00101 ( 00102 const coupledFvPatchField<Type>&, 00103 const Field<Type>& 00104 ); 00105 00106 //- Construct and return a clone 00107 virtual tmp<fvPatchField<Type> > clone(const Field<Type>&) const = 0; 00108 00109 00110 // Member functions 00111 00112 // Access 00113 00114 //- Return true if this patch field is derived from 00115 // coupledFvPatchField<Type>. 00116 virtual bool coupled() const 00117 { 00118 return true; 00119 } 00120 00121 //- Return neighbour field given internal field 00122 virtual tmp<Field<Type> > patchNeighbourField() const = 0; 00123 00124 00125 // Evaluation functions 00126 00127 //- Return patch-normal gradient 00128 virtual tmp<Field<Type> > snGrad() const; 00129 00130 //- Initialise the evaluation of the patch field 00131 virtual void initEvaluate(const bool bufferdTransfer); 00132 00133 //- Evaluate the patch field 00134 virtual void evaluate(); 00135 00136 //- Return the matrix diagonal coefficients corresponding to the 00137 // evaluation of the value of this patchField with given weights 00138 virtual tmp<Field<Type> > valueInternalCoeffs 00139 ( 00140 const tmp<scalarField>& 00141 ) const; 00142 00143 //- Return the matrix source coefficients corresponding to the 00144 // evaluation of the value of this patchField with given weights 00145 virtual tmp<Field<Type> > valueBoundaryCoeffs 00146 ( 00147 const tmp<scalarField>& 00148 ) const; 00149 00150 //- Return the matrix diagonal coefficients corresponding to the 00151 // evaluation of the gradient of this patchField 00152 virtual tmp<Field<Type> > gradientInternalCoeffs() const; 00153 00154 //- Return the matrix source coefficients corresponding to the 00155 // evaluation of the gradient of this patchField 00156 virtual tmp<Field<Type> > gradientBoundaryCoeffs() const; 00157 00158 00159 // Coupled interface functionality 00160 00161 //- Return neighbour colouring 00162 virtual tmp<labelField> nbrColour 00163 ( 00164 const labelField& 00165 ) const = 0; 00166 00167 //- Update result field based on interface functionality 00168 virtual void updateInterfaceMatrix 00169 ( 00170 const scalarField& psiInternal, 00171 scalarField& result, 00172 const lduMatrix&, 00173 const scalarField& coeffs, 00174 const direction 00175 ) const = 0; 00176 00177 //- Write 00178 virtual void write(Ostream&) const; 00179 }; 00180 00181 00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00183 00184 } // End namespace Foam 00185 00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00187 00188 #ifdef NoRepository 00189 # include "coupledFvPatchField.C" 00190 #endif 00191 00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00193 00194 #endif 00195 00196 // ************************************************************************* //