All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2020 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:
120  //- Runtime type information
121  TypeName("fixedProfile");
122 
123 
124  // Constructors
125 
126  //- Construct from patch and internal field
128  (
129  const fvPatch&,
131  );
132 
133  //- Construct from patch and internal field and patch field
135  (
136  const fvPatch&,
138  const Field<Type>& fld
139  );
140 
141  //- Construct from patch, internal field and dictionary
143  (
144  const fvPatch&,
146  const dictionary&
147  );
148 
149  //- Construct by mapping given fixedProfileFvPatchField
150  // onto a new patch
152  (
154  const fvPatch&,
156  const fvPatchFieldMapper&
157  );
158 
159  //- Disallow copy without setting internal field reference
161  (
163  ) = delete;
164 
165  //- Copy constructor setting internal field reference
167  (
170  );
171 
172  //- Construct and return a clone setting internal field reference
174  (
176  ) const
177  {
178  return tmp<fvPatchField<Type>>
179  (
180  new fixedProfileFvPatchField<Type>(*this, iF)
181  );
182  }
183 
184 
185  // Member Functions
186 
187  // Evaluation functions
188 
189  //- Update the coefficients associated with the patch field
190  virtual void updateCoeffs();
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #ifdef NoRepository
205  #include "fixedProfileFvPatchField.C"
206 #endif
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************************************************************* //
fixedProfileFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
TypeName("fixedProfile")
Runtime type information.
Pre-declare SubField and related Field type.
Definition: Field.H:56
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
This boundary condition provides a fixed value profile condition.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void write(Ostream &) const
Write.
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.