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-2018 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 Function1 | yes |
34  direction | Profile direction | yes |
35  origin | Profile origin | yes |
36  \endtable
37 
38  Example of the boundary condition specification:
39  \verbatim
40  <patchName>
41  {
42  type fixedProfile;
43  profile csvFile;
44 
45  profileCoeffs
46  {
47  nHeaderLine 0; // Number of header lines
48  refColumn 0; // Reference column index
49  componentColumns (1 2 3); // Component column indices
50  separator ","; // Optional (defaults to ",")
51  mergeSeparators no; // Merge multiple separators
52  file "Uprofile.csv"; // name of csv data file
53  outOfBounds clamp; // Optional out-of-bounds handling
54  interpolationScheme linear; // Optional interpolation scheme
55  }
56  direction (0 1 0);
57  origin 0;
58  }
59  \endverbatim
60 
61  Example setting a parabolic inlet profile for the PitzDaily case:
62  \verbatim
63  inlet
64  {
65  type fixedProfile;
66 
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 Note
78  The profile entry is a Function1 type. The example above gives the
79  usage for supplying csv file.
80 
81 See also
82  Foam::fixedValueFvPatchField
83  Foam::Function1Types
84  Foam::timeVaryingMappedFixedValueFvPatchField
85 
86 SourceFiles
87  fixedProfileFvPatchField.C
88 
89 \*---------------------------------------------------------------------------*/
90 
91 #ifndef fixedProfileFvPatchField_H
92 #define fixedProfileFvPatchField_H
93 
95 #include "Function1.H"
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 namespace Foam
100 {
101 
102 /*---------------------------------------------------------------------------*\
103  Class fixedProfileFvPatchField Declaration
104 \*---------------------------------------------------------------------------*/
105 
106 template<class Type>
107 class fixedProfileFvPatchField
108 :
109  public fixedValueFvPatchField<Type>
110 {
111  // Private data
112 
113  //- Profile data
114  autoPtr<Function1<Type>> profile_;
115 
116  //- Profile direction
117  vector dir_;
118 
119  //- Profile origin
120  scalar origin_;
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("fixedProfile");
127 
128 
129  // Constructors
130 
131  //- Construct from patch and internal field
133  (
134  const fvPatch&,
136  );
137 
138  //- Construct from patch and internal field and patch field
140  (
141  const fvPatch&,
143  const Field<Type>& fld
144  );
145 
146  //- Construct from patch, internal field and dictionary
148  (
149  const fvPatch&,
151  const dictionary&
152  );
153 
154  //- Construct by mapping given fixedProfileFvPatchField
155  // onto a new patch
157  (
159  const fvPatch&,
161  const fvPatchFieldMapper&
162  );
163 
164  //- Construct as copy
166  (
168  );
169 
170  //- Construct and return a clone
171  virtual tmp<fvPatchField<Type>> clone() const
172  {
173  return tmp<fvPatchField<Type>>
174  (
176  );
177  }
178 
179  //- Construct as copy setting internal field reference
181  (
184  );
185 
186  //- Construct and return a clone setting internal field reference
188  (
190  ) const
191  {
192  return tmp<fvPatchField<Type>>
193  (
194  new fixedProfileFvPatchField<Type>(*this, iF)
195  );
196  }
197 
198 
199  // Member functions
200 
201  // Evaluation functions
202 
203  //- Update the coefficients associated with the patch field
204  virtual void updateCoeffs();
205 
206 
207  //- Write
208  virtual void write(Ostream&) const;
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #ifdef NoRepository
219  #include "fixedProfileFvPatchField.C"
220 #endif
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
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:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
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:57
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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
Namespace for OpenFOAM.