uniformJumpFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2024 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::uniformJumpFvPatchField
26 
27 Description
28  This boundary condition provides a jump condition, using the \c cyclic
29  condition as a base. The jump is specified as the difference between the
30  neighbour patch and the owner patch value (i.e., neighbour minus owner).
31  The jump value is uniform across the patches, and can vary in time.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  patchType | underlying patch type (should be \c cyclic) | yes |
37  jumpTable | jump value | yes |
38  \endtable
39 
40  Example of the boundary condition specification with a constant jump:
41  \verbatim
42  <patchName>
43  {
44  type uniformJump;
45  patchType cyclic;
46  jumpTable constant 10;
47  }
48  \endverbatim
49 
50  Example of the boundary condition specification with a time-varying jump:
51  \verbatim
52  <patchName>
53  {
54  type uniformJump;
55  patchType cyclic;
56  jumpTable
57  {
58  type table;
59  values
60  (
61  (0 0)
62  (0.1 10)
63  (0.9 10)
64  (1 0)
65  );
66  }
67  }
68  \endverbatim
69 
70 See also
71  Foam::fixedJumpFvPatchField
72  Foam::Function1s
73 
74 SourceFiles
75  uniformJumpFvPatchField.C
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef uniformJumpFvPatchField_H
80 #define uniformJumpFvPatchField_H
81 
82 #include "fixedJumpFvPatchField.H"
83 #include "Function1.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class uniformJumpFvPatchField Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 template<class Type>
95 class uniformJumpFvPatchField
96 :
97  public fixedJumpFvPatchField<Type>
98 {
99 protected:
100 
101  // Protected data
102 
103  //- The "jump" table
104  autoPtr<Function1<Type>> jumpTable_;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("uniformJump");
111 
112 
113  // Constructors
114 
115  //- Construct from patch, internal field and dictionary
117  (
118  const fvPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given uniformJumpFvPatchField onto a
124  // new patch
126  (
128  const fvPatch&,
130  const fieldMapper&
131  );
132 
133  //- Disallow copy without setting internal field reference
135 
136  //- Copy constructor setting internal field reference
138  (
141  );
142 
143  //- Construct and return a clone setting internal field reference
145  (
147  ) const
148  {
149  return tmp<fvPatchField<Type>>
150  (
151  new uniformJumpFvPatchField<Type>(*this, iF)
152  );
153  }
154 
155 
156  // Member Functions
157 
158  //- Update the coefficients
159  virtual void updateCoeffs();
160 
161  //- Write
162  virtual void write(Ostream&) const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #ifdef NoRepository
173  #include "uniformJumpFvPatchField.C"
174 #endif
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:204
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
This boundary condition provides a jump condition, using the cyclic condition as a base....
virtual void write(Ostream &) const
Write.
uniformJumpFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients.
autoPtr< Function1< Type > > jumpTable_
The "jump" table.
TypeName("uniformJump")
Runtime type information.
Namespace for OpenFOAM.