Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
30#include "Time.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34template<class Type>
37(
38 const faPatch& p,
40)
42 fixedValueFaPatchField<Type>(p, iF),
43 timeSeries_()
44{}
45
46
47template<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
65 }
66
68 << "Use uniformFixedValue instead." << nl
69 << " This boundary condition will be removed in the future" << endl;
70}
71
72
73template<class Type>
76(
78 const faPatch& p,
80 const faPatchFieldMapper& mapper
81)
83 fixedValueFaPatchField<Type>(ptf, p, iF, mapper),
84 timeSeries_(ptf.timeSeries_)
85{}
86
87
88template<class Type>
91(
93)
95 fixedValueFaPatchField<Type>(ptf),
96 timeSeries_(ptf.timeSeries_)
97{}
98
99
100template<class Type>
103(
106)
107:
108 fixedValueFaPatchField<Type>(ptf, iF),
109 timeSeries_(ptf.timeSeries_)
110{}
111
112
113// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114
115template<class Type>
117{
118 if (this->updated())
119 {
120 return;
121 }
122
123 faPatchField<Type>::operator==
124 (
125 timeSeries_(this->db().time().timeOutputValue())
126 );
128}
129
130
131template<class Type>
133(
134 Ostream& os
135) const
136{
138 timeSeries_.write(os);
140}
141
142
143// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const objectRegistry & db() const
The associated objectRegistry.
bool updated() const noexcept
True if the boundary condition has already been updated.
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void write(Ostream &os) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
void extrapolateInternal()
Assign the patch field from the internal field.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
fixedValueFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
A time-varying form of a uniform fixed value finite area boundary condition.
timeVaryingUniformFixedValueFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write includes "value" entry.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
#define DeprecatedInFunction(afterVersion)
Report a warning using Foam::Warning.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict