fixedJumpFvPatchField.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) 2011-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::fixedJumpFvPatchField
28 
29 Group
30  grpCoupledBoundaryConditions
31 
32 Description
33  This boundary condition provides a jump condition, using the \c cyclic
34  condition as a base.
35 
36  The jump is specified as a fixed value field, applied as an offset to the
37  'owner' patch.
38 
39 Usage
40  \table
41  Property | Description | Required | Default value
42  patchType | underlying patch type should be \c cyclic| yes |
43  jump | current jump value | yes |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type fixedJump;
51  patchType cyclic;
52  jump uniform 10;
53  }
54  \endverbatim
55 
56  The above example shows the use of a fixed jump of '10'.
57 
58 Note
59  The underlying \c patchType should be set to \c cyclic
60 
61 See also
62  Foam::jumpCyclicFvPatchField
63 
64 SourceFiles
65  fixedJumpFvPatchField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef fixedJumpFvPatchField_H
70 #define fixedJumpFvPatchField_H
71 
72 #include "jumpCyclicFvPatchField.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class fixedJumpFvPatchField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 template<class Type>
84 class fixedJumpFvPatchField
85 :
86  public jumpCyclicFvPatchField<Type>
87 {
88 
89 protected:
90 
91  // Protected data
92 
93  //- "jump" field
94  Field<Type> jump_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("fixedJump");
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given fixedJumpFvPatchField onto a
120  // 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<fvPatchField<Type>> clone() const
137  {
138  return tmp<fvPatchField<Type>>
139  (
140  new fixedJumpFvPatchField<Type>(*this)
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  {
157  return tmp<fvPatchField<Type>>
158  (
159  new fixedJumpFvPatchField<Type>(*this, iF)
160  );
161  }
162 
163 
164  // Member functions
165 
166  // Access
167 
168  //- Return the "jump" across the patch
169  virtual tmp<Field<Type>> jump() const;
170 
171 
172  // Mapping functions
173 
174  //- Map (and resize as needed) from self given a mapping object
175  virtual void autoMap
176  (
177  const fvPatchFieldMapper&
178  );
179 
180  //- Reverse map the given fvPatchField onto this fvPatchField
181  virtual void rmap
182  (
183  const fvPatchField<Type>&,
184  const labelList&
185  );
186 
187 
188  //- Write
189  virtual void write(Ostream&) const;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #ifdef NoRepository
200  #include "fixedJumpFvPatchField.C"
201 #endif
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
Foam::fixedJumpFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: fixedJumpFvPatchField.C:132
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fixedJumpFvPatchField::fixedJumpFvPatchField
fixedJumpFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedJumpFvPatchField.C:34
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fixedJumpFvPatchField
This boundary condition provides a jump condition, using the cyclic condition as a base.
Definition: fixedJumpFvPatchField.H:98
Foam::fixedJumpFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedJumpFvPatchField.C:157
Foam::fixedJumpFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: fixedJumpFvPatchField.C:143
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::jumpCyclicFvPatchField
This boundary condition provides a base class for coupled-cyclic conditions with a specified 'jump' (...
Definition: jumpCyclicFvPatchField.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fixedJumpFvPatchField.C
Foam::List< label >
Foam::fixedJumpFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedJumpFvPatchField.H:150
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::fixedJumpFvPatchField::TypeName
TypeName("fixedJump")
Runtime type information.
jumpCyclicFvPatchField.H
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::fixedJumpFvPatchField::jump
virtual tmp< Field< Type > > jump() const
Return the "jump" across the patch.
Definition: fixedJumpFvPatchField.C:114
Foam::fixedJumpFvPatchField::jump_
Field< Type > jump_
"jump" field
Definition: fixedJumpFvPatchField.H:108