fixedProfileFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2015-2016 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 Group
28  grpGenericBoundaryConditions
29 
30 Description
31  This boundary condition provides a fixed value profile condition.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  profile | Profile Function1 | yes |
37  direction | Profile direction | yes |
38  origin | Profile origin | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  type fixedProfile;
46  profile csvFile;
47 
48  profileCoeffs
49  {
50  nHeaderLine 0; // Number of header lines
51  refColumn 0; // Reference column index
52  componentColumns (1 2 3); // Component column indices
53  separator ","; // Optional (defaults to ",")
54  mergeSeparators no; // Merge multiple separators
55  fileName "Uprofile.csv"; // name of csv data file
56  outOfBounds clamp; // Optional out-of-bounds handling
57  interpolationScheme linear; // Optional interpolation scheme
58  }
59  direction (0 1 0);
60  origin 0;
61  }
62  \endverbatim
63 
64  Example setting a parabolic inlet profile for the PitzDaily case:
65  \verbatim
66  inlet
67  {
68  type fixedProfile;
69 
70  profile polynomial
71  (
72  ((1 0 0) (0 0 0))
73  ((-6200 0 0) (2 0 0))
74  );
75  direction (0 1 0);
76  origin 0.0127;
77  }
78  \endverbatim
79 
80 Note
81  The profile entry is a Function1 type. The example above gives the
82  usage for supplying csv file.
83 
84 See also
85  Foam::fixedValueFvPatchField
86  Foam::Function1Types
87  Foam::timeVaryingMappedFixedValueFvPatchField
88 
89 SourceFiles
90  fixedProfileFvPatchField.C
91 
92 \*---------------------------------------------------------------------------*/
93 
94 #ifndef fixedProfileFvPatchField_H
95 #define fixedProfileFvPatchField_H
96 
98 #include "Function1.H"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 
105 /*---------------------------------------------------------------------------*\
106  Class fixedProfileFvPatchField Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 template<class Type>
110 class fixedProfileFvPatchField
111 :
112  public fixedValueFvPatchField<Type>
113 {
114  // Private data
115 
116  //- Profile data
117  autoPtr<Function1<Type>> profile_;
118 
119  //- Profile direction
120  vector dir_;
121 
122  //- Profile origin
123  scalar origin_;
124 
125 
126 public:
127 
128  //- Runtime type information
129  TypeName("fixedProfile");
130 
131 
132  // Constructors
133 
134  //- Construct from patch and internal field
136  (
137  const fvPatch&,
139  );
140 
141  //- Construct from patch and internal field and patch field
143  (
144  const fvPatch&,
146  const Field<Type>& fld
147  );
148 
149  //- Construct from patch, internal field and dictionary
151  (
152  const fvPatch&,
154  const dictionary&
155  );
156 
157  //- Construct by mapping given fixedProfileFvPatchField
158  // onto a new patch
160  (
162  const fvPatch&,
164  const fvPatchFieldMapper&
165  );
166 
167  //- Construct as copy
169  (
171  );
172 
173  //- Construct and return a clone
174  virtual tmp<fvPatchField<Type>> clone() const
175  {
176  return tmp<fvPatchField<Type>>
177  (
179  );
180  }
181 
182  //- Construct as copy setting internal field reference
184  (
187  );
188 
189  //- Construct and return a clone setting internal field reference
191  (
193  ) const
194  {
195  return tmp<fvPatchField<Type>>
196  (
197  new fixedProfileFvPatchField<Type>(*this, iF)
198  );
199  }
200 
201 
202  // Member functions
203 
204  // Evaluation functions
205 
206  //- Update the coefficients associated with the patch field
207  virtual void updateCoeffs();
208 
209 
210  //- Write
211  virtual void write(Ostream&) const;
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #ifdef NoRepository
222  #include "fixedProfileFvPatchField.C"
223 #endif
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
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
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
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
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.
virtual void write(Ostream &) const
Write.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.