basicSymmetryFvPatchField.C
Go to the documentation of this file.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 #include "basicSymmetryFvPatchField.H"
00028 #include "symmTransformField.H"
00029
00030
00031
00032 namespace Foam
00033 {
00034
00035
00036
00037 template<class Type>
00038 basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField
00039 (
00040 const fvPatch& p,
00041 const DimensionedField<Type, volMesh>& iF
00042 )
00043 :
00044 transformFvPatchField<Type>(p, iF)
00045 {}
00046
00047
00048 template<class Type>
00049 basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField
00050 (
00051 const basicSymmetryFvPatchField<Type>& ptf,
00052 const fvPatch& p,
00053 const DimensionedField<Type, volMesh>& iF,
00054 const fvPatchFieldMapper& mapper
00055 )
00056 :
00057 transformFvPatchField<Type>(ptf, p, iF, mapper)
00058 {}
00059
00060
00061 template<class Type>
00062 basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField
00063 (
00064 const fvPatch& p,
00065 const DimensionedField<Type, volMesh>& iF,
00066 const dictionary& dict
00067 )
00068 :
00069 transformFvPatchField<Type>(p, iF, dict)
00070 {
00071 this->evaluate();
00072 }
00073
00074
00075 template<class Type>
00076 basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField
00077 (
00078 const basicSymmetryFvPatchField<Type>& ptf
00079 )
00080 :
00081 transformFvPatchField<Type>(ptf)
00082 {}
00083
00084
00085 template<class Type>
00086 basicSymmetryFvPatchField<Type>::basicSymmetryFvPatchField
00087 (
00088 const basicSymmetryFvPatchField<Type>& ptf,
00089 const DimensionedField<Type, volMesh>& iF
00090 )
00091 :
00092 transformFvPatchField<Type>(ptf, iF)
00093 {}
00094
00095
00096
00097
00098
00099 template<class Type>
00100 tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGrad() const
00101 {
00102 vectorField nHat = this->patch().nf();
00103 return
00104 (
00105 transform(I - 2.0*sqr(nHat), this->patchInternalField())
00106 - this->patchInternalField()
00107 )*(this->patch().deltaCoeffs()/2.0);
00108 }
00109
00110
00111
00112 template<class Type>
00113 void basicSymmetryFvPatchField<Type>::evaluate(const Pstream::commsTypes)
00114 {
00115 if (!this->updated())
00116 {
00117 this->updateCoeffs();
00118 }
00119
00120 vectorField nHat = this->patch().nf();
00121 Field<Type>::operator=
00122 (
00123 (
00124 this->patchInternalField()
00125 + transform(I - 2.0*sqr(nHat), this->patchInternalField())
00126 )/2.0
00127 );
00128
00129 transformFvPatchField<Type>::evaluate();
00130 }
00131
00132
00133
00134 template<class Type>
00135 tmp<Field<Type> > basicSymmetryFvPatchField<Type>::snGradTransformDiag() const
00136 {
00137 vectorField nHat = this->patch().nf();
00138 vectorField diag(nHat.size());
00139
00140 diag.replace(vector::X, mag(nHat.component(vector::X)));
00141 diag.replace(vector::Y, mag(nHat.component(vector::Y)));
00142 diag.replace(vector::Z, mag(nHat.component(vector::Z)));
00143
00144 return transformFieldMask<Type>(pow<vector, pTraits<Type>::rank>(diag));
00145 }
00146
00147
00148
00149
00150 }
00151
00152
Copyright © 2000-2009 OpenCFD Ltd