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-2023 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  refColumn 0;
52  componentColumns (1 2 3);
53  separator ",";
54  mergeSeparators no;
55  outOfBounds clamp;
56  interpolationScheme linear;
57  }
58  direction (0 1 0);
59  origin 0;
60  }
61  \endverbatim
62 
63  Example setting a parabolic inlet profile for the pitzDaily case:
64  \verbatim
65  inlet
66  {
67  type fixedProfile;
68  profile polynomial
69  (
70  ((1 0 0) (0 0 0))
71  ((-6200 0 0) (2 0 0))
72  );
73  direction (0 1 0);
74  origin 0.0127;
75  }
76  \endverbatim
77 
78 See also
79  Foam::Function1s
80 
81 SourceFiles
82  fixedProfileFvPatchField.C
83 
84 \*---------------------------------------------------------------------------*/
85 
86 #ifndef fixedProfileFvPatchField_H
87 #define fixedProfileFvPatchField_H
88 
90 #include "Function1.H"
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 namespace Foam
95 {
96 
97 /*---------------------------------------------------------------------------*\
98  Class fixedProfileFvPatchField Declaration
99 \*---------------------------------------------------------------------------*/
100 
101 template<class Type>
102 class fixedProfileFvPatchField
103 :
104  public fixedValueFvPatchField<Type>
105 {
106  // Private Data
107 
108  //- Profile function
109  autoPtr<Function1<Type>> profile_;
110 
111  //- Origin of the line along which the profile is evaluated
112  scalar origin_;
113 
114  //- Direction of the line along which the profile is evaluated
115  vector direction_;
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("fixedProfile");
122 
123 
124  // Constructors
125 
126  //- Construct from patch and internal field and patch field
128  (
129  const fvPatch&,
131  const Field<Type>& fld
132  );
133 
134  //- Construct from patch, internal field and dictionary
136  (
137  const fvPatch&,
139  const dictionary&
140  );
141 
142  //- Construct by mapping given fixedProfileFvPatchField
143  // onto a new patch
145  (
147  const fvPatch&,
149  const fvPatchFieldMapper&
150  );
151 
152  //- Disallow copy without setting internal field reference
154  (
156  ) = delete;
157 
158  //- Copy constructor setting internal field reference
160  (
163  );
164 
165  //- Construct and return a clone setting internal field reference
167  (
169  ) const
170  {
171  return tmp<fvPatchField<Type>>
172  (
173  new fixedProfileFvPatchField<Type>(*this, iF)
174  );
175  }
176 
177 
178  // Member Functions
179 
180  // Evaluation functions
181 
182  //- Update the coefficients associated with the patch field
183  virtual void updateCoeffs();
184 
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198  #include "fixedProfileFvPatchField.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
This boundary condition provides a fixed value profile condition.
TypeName("fixedProfile")
Runtime type information.
virtual void write(Ostream &) const
Write.
fixedProfileFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const Field< Type > &fld)
Construct from patch and internal field and patch field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:203
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49