timeVaryingUniformFixedValueFaPatchField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 Wikki Ltd
9  Copyright (C) 2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "Time.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 template<class Type>
37 (
38  const faPatch& p,
40 )
41 :
42  fixedValueFaPatchField<Type>(p, iF),
43  timeSeries_()
44 {}
45 
46 
47 template<class Type>
50 (
51  const faPatch& p,
53  const dictionary& dict
54 )
55 :
56  fixedValueFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
57  timeSeries_(dict)
58 {
59  if (!this->readValueEntry(dict))
60  {
61  // Ensure field has reasonable initial values
62  this->extrapolateInternal();
63 
64  updateCoeffs();
65  }
66 
68  << "Use uniformFixedValue instead." << nl
69  << " This boundary condition will be removed in the future" << endl;
70 }
71 
72 
73 template<class Type>
76 (
78  const faPatch& p,
80  const faPatchFieldMapper& mapper
81 )
82 :
83  fixedValueFaPatchField<Type>(ptf, p, iF, mapper),
84  timeSeries_(ptf.timeSeries_)
85 {}
86 
87 
88 template<class Type>
91 (
93 )
94 :
95  fixedValueFaPatchField<Type>(ptf),
96  timeSeries_(ptf.timeSeries_)
97 {}
98 
99 
100 template<class Type>
103 (
106 )
107 :
108  fixedValueFaPatchField<Type>(ptf, iF),
109  timeSeries_(ptf.timeSeries_)
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 
115 template<class Type>
117 {
118  if (this->updated())
119  {
120  return;
121  }
122 
124  (
125  timeSeries_(this->db().time().timeOutputValue())
126  );
128 }
129 
130 
131 template<class Type>
133 (
134  Ostream& os
135 ) const
136 {
138  timeSeries_.write(os);
140 }
141 
142 
143 // ************************************************************************* //
dictionary dict
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
virtual void write(Ostream &os) const
Write.
Definition: faPatchField.C:253
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A time-varying form of a uniform fixed value finite area boundary condition.
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
friend Ostream & operator(Ostream &, const faPatchField< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
Definition: faPatchField.H:317
void extrapolateInternal()
Assign the patch field from the internal field.
Definition: faPatchField.C:60
#define DeprecatedInFunction(afterVersion)
Report a warning using Foam::Warning.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
timeVaryingUniformFixedValueFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: faPatchField.C:234
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
volScalarField & p
A FieldMapper for finite-area patch fields.
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
Definition: faPatchField.C:30