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 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  \heading Patch usage
34 
35  \table
36  Property | Description | Required | Default value
37  profile | Profile DataEntry | yes |
38  direction | Profile direction | yes |
39  origin | Profile origin | yes |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  myPatch
45  {
46  type fixedProfile;
47  profile csvFile;
48 
49  profileCoeffs
50  {
51  nHeaderLine 0; // Number of header lines
52  refColumn 0; // Reference column index
53  componentColumns (1 2 3); // Component column indices
54  separator ","; // Optional (defaults to ",")
55  mergeSeparators no; // Merge multiple separators
56  fileName "Uprofile.csv"; // name of csv data file
57  outOfBounds clamp; // Optional out-of-bounds handling
58  interpolationScheme linear; // Optional interpolation scheme
59  }
60  direction (0 1 0);
61  origin 0;
62  }
63  \endverbatim
64 
65  Example setting a parabolic inlet profile for the PitzDaily case:
66  \verbatim
67  inlet
68  {
69  type fixedProfile;
70 
71  profile polynomial
72  (
73  ((1 0 0) (0 0 0))
74  ((-6200 0 0) (2 0 0))
75  );
76  direction (0 1 0);
77  origin 0.0127;
78  }
79  \endverbatim
80 
81 Note
82  The profile entry is a DataEntry type. The example above gives the
83  usage for supplying csv file.
84 
85 SeeAlso
86  Foam::fixedValueFvPatchField
87  Foam::DataEntry
88  Foam::timeVaryingMappedFixedValueFvPatchField
89 
90 SourceFiles
91  fixedProfileFvPatchField.C
92 
93 \*---------------------------------------------------------------------------*/
94 
95 #ifndef fixedProfileFvPatchField_H
96 #define fixedProfileFvPatchField_H
97 
99 #include "DataEntry.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 
106 /*---------------------------------------------------------------------------*\
107  Class fixedProfileFvPatchField Declaration
108 \*---------------------------------------------------------------------------*/
109 
110 template<class Type>
111 class fixedProfileFvPatchField
112 :
113  public fixedValueFvPatchField<Type>
114 {
115  // Private data
116 
117  //- Profile data
118  autoPtr<DataEntry<Type> > profile_;
119 
120  //- Profile direction
121  vector dir_;
122 
123  //- Profile origin
124  scalar origin_;
125 
126 
127 public:
128 
129  //- Runtime type information
130  TypeName("fixedProfile");
131 
132 
133  // Constructors
134 
135  //- Construct from patch and internal field
137  (
138  const fvPatch&,
140  );
141 
142  //- Construct from patch and internal field and patch field
144  (
145  const fvPatch&,
147  const Field<Type>& fld
148  );
149 
150  //- Construct from patch, internal field and dictionary
152  (
153  const fvPatch&,
155  const dictionary&
156  );
157 
158  //- Construct by mapping given fixedProfileFvPatchField
159  // onto a new patch
161  (
163  const fvPatch&,
165  const fvPatchFieldMapper&
166  );
167 
168  //- Construct as copy
170  (
172  );
173 
174  //- Construct and return a clone
175  virtual tmp<fvPatchField<Type> > clone() const
176  {
177  return tmp<fvPatchField<Type> >
178  (
180  );
181  }
182 
183  //- Construct as copy setting internal field reference
185  (
188  );
189 
190  //- Construct and return a clone setting internal field reference
191  virtual tmp<fvPatchField<Type> > clone
192  (
194  ) const
195  {
196  return tmp<fvPatchField<Type> >
197  (
198  new fixedProfileFvPatchField<Type>(*this, iF)
199  );
200  }
201 
202 
203  // Member functions
204 
205  // Evaluation functions
206 
207  //- Update the coefficients associated with the patch field
208  virtual void updateCoeffs();
209 
210 
211  //- Write
212  virtual void write(Ostream&) const;
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #ifdef NoRepository
223 # include "fixedProfileFvPatchField.C"
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
fixedProfileFvPatchField.C
Foam::fixedProfileFvPatchField::TypeName
TypeName("fixedProfile")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedProfileFvPatchField::origin_
scalar origin_
Profile origin.
Definition: fixedProfileFvPatchField.H:143
Foam::fixedProfileFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedProfileFvPatchField.H:194
Foam::fixedProfileFvPatchField::profile_
autoPtr< DataEntry< Type > > profile_
Profile data.
Definition: fixedProfileFvPatchField.H:137
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
Foam::fixedProfileFvPatchField
This boundary condition provides a fixed value profile condition.
Definition: fixedProfileFvPatchField.H:130
DataEntry.H
Foam::Field< Type >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::fixedProfileFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fixedProfileFvPatchField.C:142
Foam::fixedProfileFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedProfileFvPatchField.C:157
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
fld
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))
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::Vector< scalar >
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::fixedProfileFvPatchField::dir_
vector dir_
Profile direction.
Definition: fixedProfileFvPatchField.H:140
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::fixedProfileFvPatchField::fixedProfileFvPatchField
fixedProfileFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedProfileFvPatchField.C:32
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51