fixedNormalSlipFvPatchField.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 "fixedNormalSlipFvPatchField.H"
00028 #include "symmTransformField.H"
00029
00030
00031
00032 namespace Foam
00033 {
00034
00035
00036
00037 template<class Type>
00038 fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
00039 (
00040 const fvPatch& p,
00041 const DimensionedField<Type, volMesh>& iF
00042 )
00043 :
00044 transformFvPatchField<Type>(p, iF),
00045 fixedValue_(p.size(), pTraits<Type>::zero)
00046 {}
00047
00048
00049 template<class Type>
00050 fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
00051 (
00052 const fixedNormalSlipFvPatchField<Type>& ptf,
00053 const fvPatch& p,
00054 const DimensionedField<Type, volMesh>& iF,
00055 const fvPatchFieldMapper& mapper
00056 )
00057 :
00058 transformFvPatchField<Type>(ptf, p, iF, mapper),
00059 fixedValue_(ptf.fixedValue_, mapper)
00060 {}
00061
00062
00063 template<class Type>
00064 fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
00065 (
00066 const fvPatch& p,
00067 const DimensionedField<Type, volMesh>& iF,
00068 const dictionary& dict
00069 )
00070 :
00071 transformFvPatchField<Type>(p, iF),
00072 fixedValue_("fixedValue", dict, p.size())
00073 {
00074 evaluate();
00075 }
00076
00077
00078 template<class Type>
00079 fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
00080 (
00081 const fixedNormalSlipFvPatchField<Type>& ptf
00082 )
00083 :
00084 transformFvPatchField<Type>(ptf),
00085 fixedValue_(ptf.fixedValue_)
00086 {}
00087
00088
00089 template<class Type>
00090 fixedNormalSlipFvPatchField<Type>::fixedNormalSlipFvPatchField
00091 (
00092 const fixedNormalSlipFvPatchField<Type>& ptf,
00093 const DimensionedField<Type, volMesh>& iF
00094 )
00095 :
00096 transformFvPatchField<Type>(ptf, iF),
00097 fixedValue_(ptf.fixedValue_)
00098 {}
00099
00100
00101
00102
00103 template<class Type>
00104 void fixedNormalSlipFvPatchField<Type>::autoMap
00105 (
00106 const fvPatchFieldMapper& m
00107 )
00108 {
00109 transformFvPatchField<Type>::autoMap(m);
00110 fixedValue_.autoMap(m);
00111 }
00112
00113
00114 template<class Type>
00115 void fixedNormalSlipFvPatchField<Type>::rmap
00116 (
00117 const fvPatchField<Type>& ptf,
00118 const labelList& addr
00119 )
00120 {
00121 transformFvPatchField<Type>::rmap(ptf, addr);
00122
00123 const fixedNormalSlipFvPatchField<Type>& dmptf =
00124 refCast<const fixedNormalSlipFvPatchField<Type> >(ptf);
00125
00126 fixedValue_.rmap(dmptf.fixedValue_, addr);
00127 }
00128
00129
00130 template<class Type>
00131 tmp<Field<Type> > fixedNormalSlipFvPatchField<Type>::snGrad() const
00132 {
00133 vectorField nHat = this->patch().nf();
00134 Field<Type> pif = this->patchInternalField();
00135
00136 return
00137 (
00138 (nHat*(nHat & fixedValue_) + transform(I - sqr(nHat), pif)) - pif
00139 )*this->patch().deltaCoeffs();
00140 }
00141
00142
00143 template<class Type>
00144 void fixedNormalSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes)
00145 {
00146 if (!this->updated())
00147 {
00148 this->updateCoeffs();
00149 }
00150
00151 vectorField nHat = this->patch().nf();
00152
00153 Field<Type>::operator=
00154 (
00155 nHat*(nHat & fixedValue_)
00156 + transform(I - sqr(nHat), this->patchInternalField())
00157 );
00158
00159 transformFvPatchField<Type>::evaluate();
00160 }
00161
00162
00163 template<class Type>
00164 tmp<Field<Type> > fixedNormalSlipFvPatchField<Type>::snGradTransformDiag() const
00165 {
00166 vectorField nHat = this->patch().nf();
00167 vectorField diag(nHat.size());
00168
00169 diag.replace(vector::X, mag(nHat.component(vector::X)));
00170 diag.replace(vector::Y, mag(nHat.component(vector::Y)));
00171 diag.replace(vector::Z, mag(nHat.component(vector::Z)));
00172
00173 return transformFieldMask<Type>(pow<vector, pTraits<Type>::rank>(diag));
00174 }
00175
00176
00177 template<class Type>
00178 void fixedNormalSlipFvPatchField<Type>::write(Ostream& os) const
00179 {
00180 transformFvPatchField<Type>::write(os);
00181 fixedValue_.writeEntry("fixedValue", os);
00182 }
00183
00184
00185
00186
00187 }
00188
00189
Copyright © 2000-2009 OpenCFD Ltd