fixedProfileFvPatchField.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) 2015-2016 OpenFOAM Foundation
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::fixedProfileFvPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This boundary condition provides a fixed value profile condition.
34
35Usage
36 \table
37 Property | Description | Required | Default value
38 profile | Profile Function1 | yes |
39 direction | Profile direction | yes |
40 origin | Profile origin | yes |
41 \endtable
42
43 Example of the boundary condition specification:
44 \verbatim
45 <patchName>
46 {
47 type fixedProfile;
48 profile csvFile;
49
50 profileCoeffs
51 {
52 nHeaderLine 0; // Number of header lines
53 refColumn 0; // Reference column index
54 componentColumns (1 2 3); // Component column indices
55 separator ","; // Optional (defaults to ",")
56 mergeSeparators no; // Merge multiple separators
57 file "Uprofile.csv"; // name of csv data file
58 outOfBounds clamp; // Optional out-of-bounds handling
59 interpolationScheme linear; // Optional interpolation scheme
60 }
61 direction (0 1 0);
62 origin 0;
63 }
64 \endverbatim
65
66 Example setting a parabolic inlet profile for the PitzDaily case:
67 \verbatim
68 inlet
69 {
70 type fixedProfile;
71
72 profile polynomial
73 (
74 ((1 0 0) (0 0 0))
75 ((-6200 0 0) (2 0 0))
76 );
77 direction (0 1 0);
78 origin 0.0127;
79 }
80 \endverbatim
81
82Note
83 The profile entry is a Function1 type. The example above gives the
84 usage for supplying csv file.
85
86See also
87 Foam::fixedValueFvPatchField
88 Foam::Function1Types
89 Foam::timeVaryingMappedFixedValueFvPatchField
90
91SourceFiles
92 fixedProfileFvPatchField.C
93
94\*---------------------------------------------------------------------------*/
95
96#ifndef fixedProfileFvPatchField_H
97#define fixedProfileFvPatchField_H
98
100#include "Function1.H"
101
102// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103
104namespace Foam
105{
106
107/*---------------------------------------------------------------------------*\
108 Class fixedProfileFvPatchField Declaration
109\*---------------------------------------------------------------------------*/
110
111template<class Type>
112class fixedProfileFvPatchField
113:
114 public fixedValueFvPatchField<Type>
115{
116 // Private data
117
118 //- Profile data
119 autoPtr<Function1<Type>> profile_;
120
121 //- Profile direction
122 vector dir_;
123
124 //- Profile origin
125 scalar origin_;
126
127
128public:
129
130 //- Runtime type information
131 TypeName("fixedProfile");
132
133
134 // Constructors
135
136 //- Construct from patch and internal field
138 (
139 const fvPatch&,
141 );
142
143 //- Construct from patch and internal field and patch field
145 (
146 const fvPatch&,
148 const Field<Type>& fld
149 );
151 //- Construct from patch, internal field and dictionary
153 (
154 const fvPatch&,
156 const dictionary&
157 );
158
159 //- Construct by mapping given fixedProfileFvPatchField
160 // onto a new patch
162 (
164 const fvPatch&,
166 const fvPatchFieldMapper&
167 );
168
169 //- Construct as copy
171 (
173 );
174
175 //- Construct and return a clone
176 virtual tmp<fvPatchField<Type>> clone() const
177 {
179 (
181 );
182 }
183
184 //- Construct as copy setting internal field reference
186 (
189 );
190
191 //- Construct and return a clone setting internal field reference
193 (
195 ) const
196 {
198 (
199 new fixedProfileFvPatchField<Type>(*this, iF)
200 );
201 }
202
203
204 // Member functions
205
206 // Evaluation functions
207
208 //- Update the coefficients associated with the patch field
209 virtual void updateCoeffs();
210
212 //- Write
213 virtual void write(Ostream&) const;
214};
215
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219} // End namespace Foam
220
221// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222
223#ifdef NoRepository
225#endif
226
227// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228
229#endif
230
231// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-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.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition provides a fixed value profile condition.
TypeName("fixedProfile")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73