fixedJumpFvPatchField.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) 2011-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::fixedJumpFvPatchField
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 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  patchType | underlying patch type (should be \c cyclic) | yes |
36  jump | jump value | yes |
37  \endtable
38 
39  Example of the boundary condition specification:
40  \verbatim
41  <patchName>
42  {
43  type fixedJump;
44  patchType cyclic;
45  jump uniform 10;
46  }
47  \endverbatim
48 
49 See also
50  Foam::jumpCyclicFvPatchField
51 
52 SourceFiles
53  fixedJumpFvPatchField.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef fixedJumpFvPatchField_H
58 #define fixedJumpFvPatchField_H
59 
60 #include "jumpCyclicFvPatchField.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class fixedJumpFvPatchField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class Type>
72 class fixedJumpFvPatchField
73 :
74  public jumpCyclicFvPatchField<Type>
75 {
76  // Private data
77 
78  //- The "jump" field. Applied to the owner field when transforming
79  // to the neighbour side. Negated when transforming the other way.
80  // Only has a valid value on the owner patch.
81  Field<Type> jump_;
82 
83 
84 protected:
85 
86  // Protected functions
87 
88  //- Access the jump to modify it
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("fixedJump");
96 
97  // Constructors
98 
99  //- Construct from patch, internal field and dictionary
101  (
102  const fvPatch&,
104  const dictionary&,
105  const bool jumpRequired=true
106  );
107 
108  //- Construct by mapping given fixedJumpFvPatchField onto a
109  // new patch
111  (
113  const fvPatch&,
115  const fieldMapper&
116  );
117 
118  //- Disallow copy without setting internal field reference
120  (
122  ) = delete;
123 
124  //- Copy constructor setting internal field reference
126  (
129  );
130 
131  //- Construct and return a clone setting internal field reference
133  (
135  ) const
136  {
137  return tmp<fvPatchField<Type>>
138  (
139  new fixedJumpFvPatchField<Type>(*this, iF)
140  );
141  }
142 
143 
144  // Member Functions
145 
146  // Access
147 
148  //- Return the "jump"
149  virtual tmp<Field<Type>> jump() const;
150 
151 
152  // Mapping functions
153 
154  //- Map the given fvPatchField onto this fvPatchField
155  virtual void map(const fvPatchField<Type>&, const fieldMapper&);
156 
157  //- Reset the fvPatchField to the given fvPatchField
158  // Used for mesh to mesh mapping
159  virtual void reset(const fvPatchField<Type>&);
160 
161 
162  //- Write
163  virtual void write(Ostream&) const;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #ifdef NoRepository
174  #include "fixedJumpFvPatchField.C"
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:83
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
This boundary condition provides a jump condition, using the cyclic condition as a base....
TypeName("fixedJump")
Runtime type information.
virtual void write(Ostream &) const
Write.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
fixedJumpFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &, const bool jumpRequired=true)
Construct from patch, internal field and dictionary.
virtual tmp< Field< Type > > jump() const
Return the "jump".
Field< Type > & jumpRef()
Access the jump to modify it.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
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
Namespace for OpenFOAM.