uniformNormalFixedValueFvPatchVectorField.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) 2019 OpenCFD Ltd.
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::uniformNormalFixedValueFvPatchVectorField
28 
29 Group
30  grpGenericBoundaryConditions grpInletBoundaryConditions
31 
32 Description
33  This boundary condition provides a uniform surface-normal
34  vector boundary condition by its magnitude.
35 
36 Usage
37  \table
38  Property | Description | Required | Default
39  uniformValue | uniform value | yes |
40  ramp | time-based ramping | no |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type uniformNormalFixedValue;
48  uniformValue constant -10; // 10 INTO the domain
49  }
50  \endverbatim
51 
52 Note
53  Sign conventions:
54  - the value is positive for outward-pointing vectors
55 
56 See also
57  Foam::Function1Types
58  Foam::fixedValueFvPatchField
59  Foam::surfaceNormalFixedValueFvPatchVectorField
60  Foam::uniformFixedValueFvPatchVectorField
61 
62 SourceFiles
63  uniformNormalFixedValueFvPatchVectorField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef uniformNormalFixedValueFvPatchVectorField_H
68 #define uniformNormalFixedValueFvPatchVectorField_H
69 
70 #include "fvPatchFields.H"
72 #include "PatchFunction1.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class uniformNormalFixedValueFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class uniformNormalFixedValueFvPatchVectorField
84 :
85  public fixedValueFvPatchVectorField
86 {
87  // Private Data
88 
89  autoPtr<PatchFunction1<scalar>> uniformValue_;
90 
91  //- Optional time ramping
92  autoPtr<Function1<scalar>> ramp_;
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("uniformNormalFixedValue");
99 
100 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const fvPatch&,
108  );
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const fvPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping given
119  // uniformNormalFixedValueFvPatchVectorField
120  // onto a new patch
122  (
124  const fvPatch&,
126  const fvPatchFieldMapper&
127  );
128 
129  //- Construct as copy
131  (
133  );
134 
135  //- Construct and return a clone
136  virtual tmp<fvPatchVectorField> clone() const
137  {
139  (
141  );
142  }
143 
144  //- Construct as copy setting internal field reference
146  (
149  );
150 
151  //- Construct and return a clone setting internal field reference
153  (
155  ) const
156  {
158  (
160  (
161  *this,
162  iF
163  )
164  );
165  }
166 
167 
168  // Member Functions
169 
170  // Mapping Functions
171 
172  //- Map (and resize as needed) from self given a mapping object
173  virtual void autoMap
174  (
175  const fvPatchFieldMapper&
176  );
177 
178  //- Reverse map the given fvPatchField onto this fvPatchField
179  virtual void rmap
180  (
181  const fvPatchVectorField&,
182  const labelList&
183  );
184 
185 
186  // Evaluation Functions
187 
188  //- Update the coefficients associated with the patch field
189  virtual void updateCoeffs();
190 
191 
192  //- Write
193  virtual void write(Ostream& os) const;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::uniformNormalFixedValueFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformNormalFixedValueFvPatchVectorField.C:158
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::uniformNormalFixedValueFvPatchVectorField::TypeName
TypeName("uniformNormalFixedValue")
Runtime type information.
Foam::uniformNormalFixedValueFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: uniformNormalFixedValueFvPatchVectorField.H:150
PatchFunction1.H
Foam::uniformNormalFixedValueFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: uniformNormalFixedValueFvPatchVectorField.C:128
Foam::uniformNormalFixedValueFvPatchVectorField
This boundary condition provides a uniform surface-normal vector boundary condition by its magnitude.
Definition: uniformNormalFixedValueFvPatchVectorField.H:97
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::uniformNormalFixedValueFvPatchVectorField::uniformNormalFixedValueFvPatchVectorField
uniformNormalFixedValueFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: uniformNormalFixedValueFvPatchVectorField.C:37
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::uniformNormalFixedValueFvPatchVectorField::write
virtual void write(Ostream &os) const
Write.
Definition: uniformNormalFixedValueFvPatchVectorField.C:179
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
fvPatchFields.H
Foam::List< label >
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::uniformNormalFixedValueFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: uniformNormalFixedValueFvPatchVectorField.C:144