00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef skewLinear_H
00038 #define skewLinear_H
00039
00040 #include "skewCorrectionVectors.H"
00041 #include "linear.H"
00042 #include "gaussGrad.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049
00050
00051
00052
00053 template<class Type>
00054 class skewLinear
00055 :
00056 public linear<Type>
00057 {
00058
00059
00060
00061 skewLinear(const skewLinear&);
00062
00063
00064 void operator=(const skewLinear&);
00065
00066
00067 public:
00068
00069
00070 TypeName("skewLinear");
00071
00072
00073
00074
00075
00076 skewLinear(const fvMesh& mesh)
00077 :
00078 linear<Type>(mesh)
00079 {}
00080
00081
00082
00083 skewLinear
00084 (
00085 const fvMesh& mesh,
00086 Istream&
00087 )
00088 :
00089 linear<Type>(mesh)
00090 {}
00091
00092
00093
00094 skewLinear
00095 (
00096 const fvMesh& mesh,
00097 const surfaceScalarField&,
00098 Istream&
00099 )
00100 :
00101 linear<Type>(mesh)
00102 {}
00103
00104
00105
00106
00107
00108 virtual bool corrected() const
00109 {
00110 return skewCorrectionVectors::New(this->mesh()).skew();
00111 }
00112
00113
00114 virtual tmp<GeometricField<Type, fvPatchField, surfaceMesh> >
00115 correction
00116 (
00117 const GeometricField<Type, fvPatchField, volMesh>& vf
00118 ) const
00119 {
00120 const fvMesh& mesh = this->mesh();
00121
00122 const skewCorrectionVectors& scv = skewCorrectionVectors::New(mesh);
00123
00124 tmp<GeometricField<Type, fvPatchField, surfaceMesh> > tsfCorr
00125 (
00126 new GeometricField<Type, fvPatchField, surfaceMesh>
00127 (
00128 IOobject
00129 (
00130 vf.name(),
00131 mesh.time().timeName(),
00132 mesh
00133 ),
00134 mesh,
00135 dimensioned<Type>
00136 (
00137 vf.name(),
00138 vf.dimensions(),
00139 pTraits<Type>::zero
00140 )
00141 )
00142 );
00143
00144 for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
00145 {
00146 tsfCorr().replace
00147 (
00148 cmpt,
00149 scv() & linear
00150 <
00151 typename outerProduct
00152 <
00153 vector,
00154 typename pTraits<Type>::cmptType
00155 >::type
00156 > (mesh).interpolate
00157 (
00158 fv::gaussGrad<typename pTraits<Type>::cmptType>
00159 (mesh).grad(vf.component(cmpt))
00160 )
00161 );
00162 }
00163
00164 return tsfCorr;
00165 }
00166 };
00167
00168
00169
00170
00171 }
00172
00173
00174
00175 #endif
00176
00177