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 #include "timeVaryingUniformInletOutletFvPatchField.H"
00027 #include <OpenFOAM/Time.H>
00028 
00029 
00030 
00031 template<class Type>
00032 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
00033 timeVaryingUniformInletOutletFvPatchField
00034 (
00035     const fvPatch& p,
00036     const DimensionedField<Type, volMesh>& iF
00037 )
00038 :
00039     inletOutletFvPatchField<Type>(p, iF),
00040     timeSeries_()
00041 {}
00042 
00043 
00044 template<class Type>
00045 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
00046 timeVaryingUniformInletOutletFvPatchField
00047 (
00048     const fvPatch& p,
00049     const DimensionedField<Type, volMesh>& iF,
00050     const dictionary& dict
00051 )
00052 :
00053     inletOutletFvPatchField<Type>(p, iF),
00054     timeSeries_(dict)
00055 {
00056     this->refValue() = timeSeries_(this->db().time().timeOutputValue());
00057     this->refGrad() = pTraits<Type>::zero;
00058     this->valueFraction() = 0.0;
00059 
00060     if (dict.found("value"))
00061     {
00062         fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
00063     }
00064     else
00065     {
00066         fvPatchField<Type>::operator=(this->refValue());
00067     }
00068 }
00069 
00070 
00071 template<class Type>
00072 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
00073 timeVaryingUniformInletOutletFvPatchField
00074 (
00075     const timeVaryingUniformInletOutletFvPatchField<Type>& ptf,
00076     const fvPatch& p,
00077     const DimensionedField<Type, volMesh>& iF,
00078     const fvPatchFieldMapper& mapper
00079 )
00080 :
00081     inletOutletFvPatchField<Type>(ptf, p, iF, mapper),
00082     timeSeries_(ptf.timeSeries_)
00083 {}
00084 
00085 
00086 template<class Type>
00087 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
00088 timeVaryingUniformInletOutletFvPatchField
00089 (
00090     const timeVaryingUniformInletOutletFvPatchField<Type>& ptf
00091 )
00092 :
00093     inletOutletFvPatchField<Type>(ptf),
00094     timeSeries_(ptf.timeSeries_)
00095 {}
00096 
00097 
00098 template<class Type>
00099 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
00100 timeVaryingUniformInletOutletFvPatchField
00101 (
00102     const timeVaryingUniformInletOutletFvPatchField<Type>& ptf,
00103     const DimensionedField<Type, volMesh>& iF
00104 )
00105 :
00106     inletOutletFvPatchField<Type>(ptf, iF),
00107     timeSeries_(ptf.timeSeries_)
00108 {}
00109 
00110 
00111 
00112 
00113 template<class Type>
00114 void Foam::timeVaryingUniformInletOutletFvPatchField<Type>::updateCoeffs()
00115 {
00116     if (this->updated())
00117     {
00118         return;
00119     }
00120 
00121     this->refValue() = timeSeries_(this->db().time().timeOutputValue());
00122     inletOutletFvPatchField<Type>::updateCoeffs();
00123 }
00124 
00125 
00126 template<class Type>
00127 void Foam::timeVaryingUniformInletOutletFvPatchField<Type>::write
00128 (
00129     Ostream& os
00130 ) const
00131 {
00132     fvPatchField<Type>::write(os);
00133     timeSeries_.write(os);
00134     this->writeEntry("value", os);
00135 }
00136 
00137 
00138