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