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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fixedProfileFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition provides a fixed value profile condition.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  profile | Profile Function1 | yes |
39  direction | Profile direction | yes |
40  origin | Profile origin | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type fixedProfile;
48  profile csvFile;
49 
50  profileCoeffs
51  {
52  nHeaderLine 0; // Number of header lines
53  refColumn 0; // Reference column index
54  componentColumns (1 2 3); // Component column indices
55  separator ","; // Optional (defaults to ",")
56  mergeSeparators no; // Merge multiple separators
57  file "Uprofile.csv"; // name of csv data file
58  outOfBounds clamp; // Optional out-of-bounds handling
59  interpolationScheme linear; // Optional interpolation scheme
60  }
61  direction (0 1 0);
62  origin 0;
63  }
64  \endverbatim
65 
66  Example setting a parabolic inlet profile for the PitzDaily case:
67  \verbatim
68  inlet
69  {
70  type fixedProfile;
71 
72  profile polynomial
73  (
74  ((1 0 0) (0 0 0))
75  ((-6200 0 0) (2 0 0))
76  );
77  direction (0 1 0);
78  origin 0.0127;
79  }
80  \endverbatim
81 
82 Note
83  The profile entry is a Function1 type. The example above gives the
84  usage for supplying csv file.
85 
86 See also
87  Foam::fixedValueFvPatchField
88  Foam::Function1Types
89  Foam::timeVaryingMappedFixedValueFvPatchField
90 
91 SourceFiles
92  fixedProfileFvPatchField.C
93 
94 \*---------------------------------------------------------------------------*/
95 
96 #ifndef fixedProfileFvPatchField_H
97 #define fixedProfileFvPatchField_H
98 
100 #include "Function1.H"
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 namespace Foam
105 {
106 
107 /*---------------------------------------------------------------------------*\
108  Class fixedProfileFvPatchField Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 template<class Type>
112 class fixedProfileFvPatchField
113 :
114  public fixedValueFvPatchField<Type>
115 {
116  // Private data
117 
118  //- Profile data
119  autoPtr<Function1<Type>> profile_;
120 
121  //- Profile direction
122  vector dir_;
123 
124  //- Profile origin
125  scalar origin_;
126 
128 public:
129 
130  //- Runtime type information
131  TypeName("fixedProfile");
132 
133 
134  // Constructors
135 
136  //- Construct from patch and internal field
138  (
139  const fvPatch&,
141  );
142 
143  //- Construct from patch and internal field and patch field
145  (
146  const fvPatch&,
148  const Field<Type>& fld
149  );
150 
151  //- Construct from patch, internal field and dictionary
153  (
154  const fvPatch&,
156  const dictionary&
157  );
158 
159  //- Construct by mapping given fixedProfileFvPatchField
160  // onto a new patch
162  (
164  const fvPatch&,
166  const fvPatchFieldMapper&
167  );
168 
169  //- Construct as copy
171  (
173  );
174 
175  //- Construct as copy setting internal field reference
177  (
180  );
181 
182  //- Return a clone
183  virtual tmp<fvPatchField<Type>> clone() const
184  {
185  return fvPatchField<Type>::Clone(*this);
186  }
187 
188  //- Clone with an internal field reference
190  (
192  ) const
193  {
194  return fvPatchField<Type>::Clone(*this, iF);
195  }
196 
197 
198  // Member functions
199 
200  // Evaluation functions
201 
202  //- Update the coefficients associated with the patch field
203  virtual void updateCoeffs();
204 
205 
206  //- Write
207  virtual void write(Ostream&) const;
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #ifdef NoRepository
218  #include "fixedProfileFvPatchField.C"
219 #endif
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #endif
224 
225 // ************************************************************************* //
fixedProfileFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
TypeName("fixedProfile")
Runtime type information.
Generic templated field type.
Definition: Field.H:62
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
A FieldMapper for finite-volume patch fields.
Vector< scalar > vector
Definition: vector.H:57
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
This boundary condition provides a fixed value profile condition.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
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: HashPtrTable.H:50
Namespace for OpenFOAM.