Loading...
Searching...
No Matches
uniformFixedValueFaPatchField.H
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) 2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::uniformFixedValueFaPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This boundary condition provides a uniform fixed value condition.
34
35Usage
36 \table
37 Property | Description | Required | Default
38 uniformValue | uniform value | yes |
39 value | initial field value | optional |
40 \endtable
41
42 Example of the boundary condition specification:
43 \verbatim
44 <patchName>
45 {
46 type uniformFixedValue;
47 uniformValue constant 0.2;
48 }
49 \endverbatim
50
51Note
52 The uniformValue entry is a Function1 type,
53 able to describe time varying functions.
54 The example above gives the usage for supplying a constant value.
55
56 The \c value entry (optional) is used for the initial values.
57 Otherwise the \c uniformValue is evaluated.
58 In some cases (eg, coded or expression entries with references to other
59 fields) this can be problematic and the \c value entry will be needed.
60
61See also
62 Foam::Function1Types
63 Foam::fixedValueFaPatchField
64
65SourceFiles
66 uniformFixedValueFaPatchField.C
67
68\*---------------------------------------------------------------------------*/
69
70#ifndef Foam_uniformFixedValueFaPatchField_H
71#define Foam_uniformFixedValueFaPatchField_H
72
74#include "Function1.H"
75
76// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77
78namespace Foam
79{
80
81/*---------------------------------------------------------------------------*\
82 Class uniformFixedValueFaPatchField Declaration
83\*---------------------------------------------------------------------------*/
84
85template<class Type>
87:
88 public fixedValueFaPatchField<Type>
89{
90 // Private Data
91
92 //- Function providing the value
93 autoPtr<Function1<Type>> refValueFunc_;
94
95
96public:
97
98 //- Runtime type information
99 TypeName("uniformFixedValue");
100
101
102 // Constructors
103
104 //- Construct from patch and internal field
106 (
107 const faPatch&,
109 );
110
111 //- Construct from patch and internal field and patch field
114 const faPatch&,
116 const Field<Type>& fld
117 );
118
119 //- Construct from patch, internal field and dictionary
121 (
122 const faPatch&,
124 const dictionary&
125 );
126
127 //- Construct by mapping onto a new patch
129 (
131 const faPatch&,
133 const faPatchFieldMapper&
134 );
135
136 //- Construct as copy
138 (
140 );
141
142 //- Construct as copy setting internal field reference
144 (
147 );
148
149 //- Return clone
150 virtual tmp<faPatchField<Type>> clone() const
151 {
152 return faPatchField<Type>::Clone(*this);
153 }
154
155 //- Clone with an internal field reference
157 (
159 ) const
160 {
161 return faPatchField<Type>::Clone(*this, iF);
162 }
163
164
165 // Member Functions
166
167 //- Update the coefficients associated with the patch field
168 virtual void updateCoeffs();
169
170 //- Write includes "value" entry
171 virtual void write(Ostream& os) const;
172};
173
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177} // End namespace Foam
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#ifdef NoRepository
183#endif
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187#endif
188
189// ************************************************************************* //
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-area patch fields.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
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 class for managing temporary objects.
Definition tmp.H:75
This boundary condition provides a uniform fixed value condition.
virtual tmp< faPatchField< Type > > clone() const
Return clone.
TypeName("uniformFixedValue")
Runtime type information.
uniformFixedValueFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Clone with an internal field reference.
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68