fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / derived / timeVaryingUniformInletOutlet / timeVaryingUniformInletOutletFvPatchField.C
blobc24599d0b3a746479a5c5365dab9c6e15d4ffb21
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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"
28 #include "Time.H"
30 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
32 template<class Type>
33 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
34 timeVaryingUniformInletOutletFvPatchField
36     const fvPatch& p,
37     const DimensionedField<Type, volMesh>& iF
40     inletOutletFvPatchField<Type>(p, iF),
41     timeSeries_()
45 template<class Type>
46 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
47 timeVaryingUniformInletOutletFvPatchField
49     const fvPatch& p,
50     const DimensionedField<Type, volMesh>& iF,
51     const dictionary& dict
54     inletOutletFvPatchField<Type>(p, iF),
55     timeSeries_(dict)
57     this->refValue() = timeSeries_(this->db().time().timeOutputValue());
58     this->refGrad() = pTraits<Type>::zero;
59     this->valueFraction() = 0.0;
61     if (dict.found("value"))
62     {
63         fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
64     }
65     else
66     {
67         fvPatchField<Type>::operator=(this->refValue());
68     }
72 template<class Type>
73 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
74 timeVaryingUniformInletOutletFvPatchField
76     const timeVaryingUniformInletOutletFvPatchField<Type>& ptf,
77     const fvPatch& p,
78     const DimensionedField<Type, volMesh>& iF,
79     const fvPatchFieldMapper& mapper
82     inletOutletFvPatchField<Type>(ptf, p, iF, mapper),
83     timeSeries_(ptf.timeSeries_)
87 template<class Type>
88 Foam::timeVaryingUniformInletOutletFvPatchField<Type>::
89 timeVaryingUniformInletOutletFvPatchField
91     const timeVaryingUniformInletOutletFvPatchField<Type>& ptf
94     inletOutletFvPatchField<Type>(ptf),
95     timeSeries_(ptf.timeSeries_)
99 template<class Type>
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  * * * * * * * * * * * * * //
114 template<class Type>
115 void Foam::timeVaryingUniformInletOutletFvPatchField<Type>::updateCoeffs()
117     if (this->updated())
118     {
119         return;
120     }
122     this->refValue() = timeSeries_(this->db().time().timeOutputValue());
123     inletOutletFvPatchField<Type>::updateCoeffs();
127 template<class Type>
128 void Foam::timeVaryingUniformInletOutletFvPatchField<Type>::write
130     Ostream& os
131 ) const
133     fvPatchField<Type>::write(os);
134     timeSeries_.write(os);
135     this->writeEntry("value", os);
139 // ************************************************************************* //