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 | Copyright (C) 2011-2012 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::fixedJumpFvPatchField
26 
27 Group
28  grpCoupledBoundaryConditions
29 
30 Description
31  This boundary condition provides a jump condition, using the \c cyclic
32  condition as a base.
33 
34  The jump is specified as a fixed value field, applied as an offset to the
35  'owner' patch.
36 
37  \heading Patch usage
38 
39  \table
40  Property | Description | Required | Default value
41  patchType | underlying patch type should be \c cyclic| yes |
42  jump | current jump value | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  myPatch
48  {
49  type fixedJump;
50  patchType cyclic;
51  jump uniform 10;
52  }
53  \endverbatim
54 
55  The above example shows the use of a fixed jump of '10'.
56 
57 Note
58  The underlying \c patchType should be set to \c cyclic
59 
60 SeeAlso
61  Foam::jumpCyclicFvPatchField
62 
63 SourceFiles
64  fixedJumpFvPatchField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef fixedJumpFvPatchField_H
69 #define fixedJumpFvPatchField_H
70 
71 #include "jumpCyclicFvPatchField.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class fixedJumpFvPatchField Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 template<class Type>
83 class fixedJumpFvPatchField
84 :
85  public jumpCyclicFvPatchField<Type>
86 {
87 
88 protected:
89 
90  // Protected data
91 
92  //- "jump" field
93  Field<Type> jump_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("fixedJump");
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 fixedJumpFvPatchField onto a
119  // new patch
121  (
123  const fvPatch&,
125  const fvPatchFieldMapper&
126  );
127 
128  //- Construct as copy
130  (
132  );
133 
134  //- Construct and return a clone
135  virtual tmp<fvPatchField<Type> > clone() const
136  {
137  return tmp<fvPatchField<Type> >
138  (
139  new fixedJumpFvPatchField<Type>(*this)
140  );
141  }
142 
143  //- Construct as copy setting internal field reference
145  (
148  );
149 
150  //- Construct and return a clone setting internal field reference
151  virtual tmp<fvPatchField<Type> > clone
152  (
154  ) const
155  {
156  return tmp<fvPatchField<Type> >
157  (
158  new fixedJumpFvPatchField<Type>(*this, iF)
159  );
160  }
161 
162 
163  // Member functions
164 
165  // Access
166 
167  //- Return the "jump" across the patch
168  virtual tmp<Field<Type> > jump() const;
169 
170 
171  // Mapping functions
172 
173  //- Map (and resize as needed) from self given a mapping object
174  virtual void autoMap
175  (
176  const fvPatchFieldMapper&
177  );
178 
179  //- Reverse map the given fvPatchField onto this fvPatchField
180  virtual void rmap
181  (
182  const fvPatchField<Type>&,
183  const labelList&
184  );
185 
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
199 # include "fixedJumpFvPatchField.C"
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Foam::fvPatchField< Type >
Foam::fixedJumpFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: fixedJumpFvPatchField.C:130
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedJumpFvPatchField::fixedJumpFvPatchField
fixedJumpFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedJumpFvPatchField.C:32
Foam::Field< Type >
Foam::fixedJumpFvPatchField
This boundary condition provides a jump condition, using the cyclic condition as a base.
Definition: fixedJumpFvPatchField.H:97
Foam::fixedJumpFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedJumpFvPatchField.C:155
Foam::fixedJumpFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: fixedJumpFvPatchField.C:141
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::jumpCyclicFvPatchField
This boundary condition provides a base class for coupled-cyclic conditions with a specified 'jump' (...
Definition: jumpCyclicFvPatchField.H:56
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
fixedJumpFvPatchField.C
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::fixedJumpFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedJumpFvPatchField.H:149
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
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:51
Foam::fixedJumpFvPatchField::jump
virtual tmp< Field< Type > > jump() const
Return the "jump" across the patch.
Definition: fixedJumpFvPatchField.C:112
Foam::fixedJumpFvPatchField::jump_
Field< Type > jump_
"jump" field
Definition: fixedJumpFvPatchField.H:107