outletInletFvPatchField.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 "outletInletFvPatchField.H"
00028
00029
00030
00031 namespace Foam
00032 {
00033
00034
00035
00036 template<class Type>
00037 outletInletFvPatchField<Type>::outletInletFvPatchField
00038 (
00039 const fvPatch& p,
00040 const DimensionedField<Type, volMesh>& iF
00041 )
00042 :
00043 mixedFvPatchField<Type>(p, iF)
00044 {
00045 this->refValue() = *this;
00046 this->refGrad() = pTraits<Type>::zero;
00047 this->valueFraction() = 0.0;
00048 }
00049
00050
00051 template<class Type>
00052 outletInletFvPatchField<Type>::outletInletFvPatchField
00053 (
00054 const outletInletFvPatchField<Type>& ptf,
00055 const fvPatch& p,
00056 const DimensionedField<Type, volMesh>& iF,
00057 const fvPatchFieldMapper& mapper
00058 )
00059 :
00060 mixedFvPatchField<Type>(ptf, p, iF, mapper)
00061 {}
00062
00063
00064 template<class Type>
00065 outletInletFvPatchField<Type>::outletInletFvPatchField
00066 (
00067 const fvPatch& p,
00068 const DimensionedField<Type, volMesh>& iF,
00069 const dictionary& dict
00070 )
00071 :
00072 mixedFvPatchField<Type>(p, iF)
00073 {
00074 this->refValue() = Field<Type>("outletValue", dict, p.size());
00075
00076 if (dict.found("value"))
00077 {
00078 fvPatchField<Type>::operator=
00079 (
00080 Field<Type>("value", dict, p.size())
00081 );
00082 }
00083 else
00084 {
00085 fvPatchField<Type>::operator=(this->refValue());
00086 }
00087
00088 this->refGrad() = pTraits<Type>::zero;
00089 this->valueFraction() = 0.0;
00090 }
00091
00092
00093 template<class Type>
00094 outletInletFvPatchField<Type>::outletInletFvPatchField
00095 (
00096 const outletInletFvPatchField<Type>& ptf
00097 )
00098 :
00099 mixedFvPatchField<Type>(ptf)
00100 {}
00101
00102
00103 template<class Type>
00104 outletInletFvPatchField<Type>::outletInletFvPatchField
00105 (
00106 const outletInletFvPatchField<Type>& ptf,
00107 const DimensionedField<Type, volMesh>& iF
00108 )
00109 :
00110 mixedFvPatchField<Type>(ptf, iF)
00111 {}
00112
00113
00114
00115
00116 template<class Type>
00117 void outletInletFvPatchField<Type>::updateCoeffs()
00118 {
00119 if (this->updated())
00120 {
00121 return;
00122 }
00123
00124 const fvsPatchField<scalar>& phip = this->patch().lookupPatchField
00125 (
00126 "phi",
00127 reinterpret_cast<const surfaceScalarField*>(0),
00128 reinterpret_cast<const scalar*>(0)
00129 );
00130
00131 this->valueFraction() = pos(phip);
00132
00133 mixedFvPatchField<Type>::updateCoeffs();
00134 }
00135
00136
00137 template<class Type>
00138 void outletInletFvPatchField<Type>::write(Ostream& os) const
00139 {
00140 fvPatchField<Type>::write(os);
00141 this->refValue().writeEntry("outletValue", os);
00142 this->writeEntry("value", os);
00143 }
00144
00145
00146
00147
00148 }
00149
00150
Copyright © 2000-2009 OpenCFD Ltd