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 
127 
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 and return a clone
176  virtual tmp<fvPatchField<Type>> clone() const
177  {
178  return tmp<fvPatchField<Type>>
179  (
181  );
182  }
183 
184  //- Construct as copy setting internal field reference
186  (
189  );
190 
191  //- Construct and return a clone setting internal field reference
193  (
195  ) const
196  {
197  return tmp<fvPatchField<Type>>
198  (
199  new fixedProfileFvPatchField<Type>(*this, iF)
200  );
201  }
202 
203 
204  // Member functions
205 
206  // Evaluation functions
207 
208  //- Update the coefficients associated with the patch field
209  virtual void updateCoeffs();
210 
211 
212  //- Write
213  virtual void write(Ostream&) const;
214 };
215 
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace Foam
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #ifdef NoRepository
224  #include "fixedProfileFvPatchField.C"
225 #endif
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 #endif
230 
231 // ************************************************************************* //
fixedProfileFvPatchField.C
Foam::fixedProfileFvPatchField::TypeName
TypeName("fixedProfile")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Function1.H
Foam::fixedProfileFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedProfileFvPatchField.H:195
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::fixedProfileFvPatchField
This boundary condition provides a fixed value profile condition.
Definition: fixedProfileFvPatchField.H:131
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fixedProfileFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fixedProfileFvPatchField.C:145
fld
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))
Definition: gmvOutputLagrangian.H:23
Foam::fixedProfileFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedProfileFvPatchField.C:160
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fixedProfileFvPatchField::fixedProfileFvPatchField
fixedProfileFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedProfileFvPatchField.C:35
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54