mixedFixedValueSlipFvPatchField.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-2023 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::mixedFixedValueSlipFvPatchField
26 
27 Description
28  A mixed boundary type that blends between fixedValue and slip, as opposed
29  to the standard mixed condition that blends between fixedValue and
30  fixedGradient; required to implement maxwellSlipU condition.
31 
32 SourceFiles
33  mixedFixedValueSlipFvPatchField.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef mixedFixedValueSlipFvPatchField_H
38 #define mixedFixedValueSlipFvPatchField_H
39 
40 #include "transformFvPatchField.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class mixedFixedValueSlipFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
53 :
54  public transformFvPatchField<Type>
55 {
56  // Private Data
57 
58  //- Value field used for boundary condition
59  Field<Type> refValue_;
60 
61  //- Fraction (0-1) of value used for boundary condition
62  scalarField valueFraction_;
63 
64 
65 protected:
66 
67  // Protected functions
68 
69  //- Construct from patch and internal field
71  (
72  const fvPatch&,
74  );
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("mixedFixedValueSlip");
81 
82 
83  // Constructors
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const fvPatch&,
90  const dictionary&
91  );
92 
93  //- Construct by mapping given mixedFixedValueSlipFvPatchField
94  // onto a new patch
96  (
98  const fvPatch&,
100  const fieldMapper&
101  );
102 
103  //- Disallow copy without setting internal field reference
105  (
107  ) = delete;
108 
109  //- Copy constructor setting internal field reference
111  (
114  );
115 
116  //- Construct and return a clone setting internal field reference
118  (
120  ) const
121  {
122  return tmp<fvPatchField<Type>>
123  (
125  );
126  }
127 
128  // Member Functions
129 
130  // Access
131 
132  //- Return false: this patch field is not altered by assignment
133  virtual bool assignable() const
134  {
135  return false;
136  }
137 
138 
139  // Mapping functions
140 
141  //- Map the given fvPatchField onto this fvPatchField
142  virtual void map(const fvPatchField<Type>&, const fieldMapper&);
143 
144  //- Reset the fvPatchField to the given fvPatchField
145  // Used for mesh to mesh mapping
146  virtual void reset(const fvPatchField<Type>&);
147 
148 
149  // Return defining fields
150 
151  virtual Field<Type>& refValue()
152  {
153  return refValue_;
154  }
155 
156  virtual const Field<Type>& refValue() const
157  {
158  return refValue_;
159  }
160 
161  virtual scalarField& valueFraction()
162  {
163  return valueFraction_;
164  }
165 
166  virtual const scalarField& valueFraction() const
167  {
168  return valueFraction_;
169  }
170 
171  // Evaluation functions
172 
173  //- Return gradient at boundary
174  virtual tmp<Field<Type>> snGrad() const;
175 
176  //- Evaluate the patch field
177  virtual void evaluate
178  (
179  const Pstream::commsTypes commsType=
181  );
182 
183  //- Return face-gradient transform diagonal
184  virtual tmp<Field<Type>> snGradTransformDiag() const;
185 
186 
187  //- Write
188  virtual void write(Ostream&) const;
189 
190 
191  // Member Operators
192 
193  virtual void operator=(const UList<Type>&) {}
194 
195  virtual void operator=(const fvPatchField<Type>&) {}
196  virtual void operator+=(const fvPatchField<Type>&) {}
197  virtual void operator-=(const fvPatchField<Type>&) {}
198  virtual void operator*=(const fvPatchField<scalar>&) {}
199  virtual void operator/=(const fvPatchField<scalar>&) {}
200 
201  virtual void operator+=(const Field<Type>&) {}
202  virtual void operator-=(const Field<Type>&) {}
203 
204  virtual void operator*=(const Field<scalar>&) {}
205  virtual void operator/=(const Field<scalar>&) {}
206 
207  virtual void operator=(const Type&) {}
208  virtual void operator+=(const Type&) {}
209  virtual void operator-=(const Type&) {}
210  virtual void operator*=(const scalar) {}
211  virtual void operator/=(const scalar) {}
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #ifdef NoRepository
223 #endif
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
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
commsTypes
Types of communications.
Definition: UPstream.H:65
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
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 mixed boundary type that blends between fixedValue and slip, as opposed to the standard mixed condi...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
mixedFixedValueSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void operator+=(const fvPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void operator/=(const fvPatchField< scalar > &)
virtual void operator*=(const fvPatchField< scalar > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator=(const UList< Type > &)
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
TypeName("mixedFixedValueSlip")
Runtime type information.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
Definition: tmp.H:55
Foam::transformFvPatchField.
Namespace for OpenFOAM.