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-2024 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 and internal field and patch field
127  (
128  const fvPatch&,
130  const Field<Type>& fld
131  );
132 
133  //- Construct from patch, internal field and dictionary
135  (
136  const fvPatch&,
138  const dictionary&
139  );
140 
141  //- Construct by mapping given fixedProfileFvPatchField
142  // onto a new patch
144  (
146  const fvPatch&,
148  const fieldMapper&
149  );
150 
151  //- Disallow copy without setting internal field reference
153  (
155  ) = delete;
156 
157  //- Copy constructor setting internal field reference
159  (
162  );
163 
164  //- Construct and return a clone setting internal field reference
166  (
168  ) const
169  {
170  return tmp<fvPatchField<Type>>
171  (
172  new fixedProfileFvPatchField<Type>(*this, iF)
173  );
174  }
175 
176 
177  // Member Functions
178 
179  // Evaluation functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184 
185  //- Write
186  virtual void write(Ostream&) const;
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #ifdef NoRepository
197  #include "fixedProfileFvPatchField.C"
198 #endif
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
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:83
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: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.
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.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:204
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