1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "timeVaryingUniformInletOutletFvPatchField.H"
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
34 timeVaryingUniformInletOutletFvPatchField
37 const DimensionedField<Type, volMesh>& iF
40 inletOutletFvPatchField<Type>(p, iF),
46 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
47 timeVaryingUniformInletOutletFvPatchField
50 const DimensionedField<Type, volMesh>& iF,
51 const dictionary& dict
54 inletOutletFvPatchField<Type>(p, iF),
57 this->refValue() = timeSeries_(this->db().time().timeOutputValue());
58 this->refGrad() = pTraits<Type>::zero;
59 this->valueFraction() = 0.0;
61 if (dict.found("value"))
63 fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
67 fvPatchField<Type>::operator=(this->refValue());
73 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
74 timeVaryingUniformInletOutletFvPatchField
76 const timeVaryingUniformInletOutletFvPatchField<Type>& ptf,
78 const DimensionedField<Type, volMesh>& iF,
79 const fvPatchFieldMapper& mapper
82 inletOutletFvPatchField<Type>(ptf, p, iF, mapper),
83 timeSeries_(ptf.timeSeries_)
88 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
89 timeVaryingUniformInletOutletFvPatchField
91 const timeVaryingUniformInletOutletFvPatchField<Type>& ptf
94 inletOutletFvPatchField<Type>(ptf),
95 timeSeries_(ptf.timeSeries_)
100 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
101 timeVaryingUniformInletOutletFvPatchField
103 const timeVaryingUniformInletOutletFvPatchField<Type>& ptf,
104 const DimensionedField<Type, volMesh>& iF
107 inletOutletFvPatchField<Type>(ptf, iF),
108 timeSeries_(ptf.timeSeries_)
112 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
115 void Foam::timeVaryingUniformInletOutletFvPatchField<Type>::updateCoeffs()
122 this->refValue() = timeSeries_(this->db().time().timeOutputValue());
123 inletOutletFvPatchField<Type>::updateCoeffs();
128 void Foam::timeVaryingUniformInletOutletFvPatchField<Type>::write
133 fvPatchField<Type>::write(os);
134 timeSeries_.write(os);
135 this->writeEntry("value", os);
139 // ************************************************************************* //