fixedProfileFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fixedProfileFvPatchField
26 
27 Description
28  This boundary condition provides a fixed value profile condition.
29 
30 Usage
31  \table
32  Property | Description | Required | Default value
33  profile | Profile function | yes |
34  direction | Direction of the line along which the profile is \\
35  evaluated | yes |
36  origin | Origin of the line along which the profile is \\
37  evaluated | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type fixedProfile;
45  profile table;
46  profileCoeffs
47  {
48  file "UProfile";
49  format csv;
50  nHeaderLine 0;
51  columns (0 (1 2 3));
52  separator ",";
53  mergeSeparators no;
54  outOfBounds clamp;
55  interpolationScheme linear;
56  }
57  direction (0 1 0);
58  origin 0;
59  }
60  \endverbatim
61 
62  Example setting a parabolic inlet profile for the pitzDaily case:
63  \verbatim
64  inlet
65  {
66  type fixedProfile;
67  profile polynomial
68  (
69  ((1 0 0) (0 0 0))
70  ((-6200 0 0) (2 0 0))
71  );
72  direction (0 1 0);
73  origin 0.0127;
74  }
75  \endverbatim
76 
77 See also
78  Foam::Function1s
79 
80 SourceFiles
81  fixedProfileFvPatchField.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef fixedProfileFvPatchField_H
86 #define fixedProfileFvPatchField_H
87 
89 #include "Function1.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class fixedProfileFvPatchField Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 template<class Type>
101 class fixedProfileFvPatchField
102 :
103  public fixedValueFvPatchField<Type>
104 {
105  // Private Data
106 
107  //- Profile function
108  autoPtr<Function1<Type>> profile_;
109 
110  //- Origin of the line along which the profile is evaluated
111  scalar origin_;
112 
113  //- Direction of the line along which the profile is evaluated
114  vector direction_;
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("fixedProfile");
121 
122 
123  // Constructors
124 
125  //- Construct from patch, internal field and dictionary
127  (
128  const fvPatch&,
130  const dictionary&
131  );
132 
133  //- Construct by mapping given fixedProfileFvPatchField
134  // onto a new patch
136  (
138  const fvPatch&,
140  const fieldMapper&
141  );
142 
143  //- Disallow copy without setting internal field reference
145  (
147  ) = delete;
148 
149  //- Copy constructor setting internal field reference
151  (
154  );
155 
156  //- Construct and return a clone setting internal field reference
158  (
160  ) const
161  {
162  return tmp<fvPatchField<Type>>
163  (
164  new fixedProfileFvPatchField<Type>(*this, iF)
165  );
166  }
167 
168 
169  // Member Functions
170 
171  // Evaluation functions
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176 
177  //- Write
178  virtual void write(Ostream&) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #ifdef NoRepository
189  #include "fixedProfileFvPatchField.C"
190 #endif
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
This boundary condition provides a fixed value profile condition.
TypeName("fixedProfile")
Runtime type information.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fixedProfileFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:216
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49