All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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 public:
65 
66  //- Runtime type information
67  TypeName("mixedFixedValueSlip");
68 
69 
70  // Constructors
71 
72  //- Construct from patch and internal field
74  (
75  const fvPatch&,
77  );
78 
79  //- Construct from patch, internal field and dictionary
81  (
82  const fvPatch&,
84  const dictionary&
85  );
86 
87  //- Construct by mapping given mixedFixedValueSlipFvPatchField
88  //- Onto a new patch
90  (
92  const fvPatch&,
94  const fvPatchFieldMapper&
95  );
96 
97  //- Copy constructor
99  (
101  );
102 
103  //- Construct and return a clone
104  virtual tmp<fvPatchField<Type>> clone() const
105  {
106  return tmp<fvPatchField<Type>>
107  (
109  );
110  }
111 
112  //- Copy constructor setting internal field reference
114  (
117  );
118 
119  //- Construct and return a clone setting internal field reference
121  (
123  ) const
124  {
125  return tmp<fvPatchField<Type>>
126  (
128  );
129  }
130 
131  // Member Functions
132 
133  // Access
134 
135  //- Return false: this patch field is not altered by assignment
136  virtual bool assignable() const
137  {
138  return false;
139  }
140 
141 
142  // Mapping functions
143 
144  //- Map (and resize as needed) from self given a mapping object
145  // Used to update fields following mesh topology change
146  virtual void autoMap(const fvPatchFieldMapper&);
147 
148  //- Reverse map the given fvPatchField onto this fvPatchField
149  // Used to reconstruct fields
150  virtual void rmap(const fvPatchField<Type>&, const labelList&);
151 
152 
153  // Return defining fields
155  virtual Field<Type>& refValue()
156  {
157  return refValue_;
158  }
160  virtual const Field<Type>& refValue() const
161  {
162  return refValue_;
163  }
165  virtual scalarField& valueFraction()
166  {
167  return valueFraction_;
168  }
170  virtual const scalarField& valueFraction() const
171  {
172  return valueFraction_;
173  }
174 
175  // Evaluation functions
176 
177  //- Return gradient at boundary
178  virtual tmp<Field<Type>> snGrad() const;
179 
180  //- Evaluate the patch field
181  virtual void evaluate
182  (
183  const Pstream::commsTypes commsType=
185  );
186 
187  //- Return face-gradient transform diagonal
188  virtual tmp<Field<Type>> snGradTransformDiag() const;
189 
190 
191  //- Write
192  virtual void write(Ostream&) const;
193 
194 
195  // Member Operators
197  virtual void operator=(const UList<Type>&) {}
199  virtual void operator=(const fvPatchField<Type>&) {}
200  virtual void operator+=(const fvPatchField<Type>&) {}
201  virtual void operator-=(const fvPatchField<Type>&) {}
202  virtual void operator*=(const fvPatchField<scalar>&) {}
203  virtual void operator/=(const fvPatchField<scalar>&) {}
205  virtual void operator+=(const Field<Type>&) {}
206  virtual void operator-=(const Field<Type>&) {}
208  virtual void operator*=(const Field<scalar>&) {}
209  virtual void operator/=(const Field<scalar>&) {}
211  virtual void operator=(const Type&) {}
212  virtual void operator+=(const Type&) {}
213  virtual void operator-=(const Type&) {}
214  virtual void operator*=(const scalar) {}
215  virtual void operator/=(const scalar) {}
216 };
217 
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 } // End namespace Foam
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #ifdef NoRepository
227 #endif
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
commsTypes
Types of communications.
Definition: UPstream.H:64
virtual void operator=(const UList< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual void operator*=(const fvPatchField< scalar > &)
TypeName("mixedFixedValueSlip")
Runtime type information.
Pre-declare SubField and related Field type.
Definition: Field.H:56
virtual void operator/=(const fvPatchField< scalar > &)
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
Foam::transformFvPatchField.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void write(Ostream &) const
Write.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A class for managing temporary objects.
Definition: PtrList.H:53
virtual void operator+=(const fvPatchField< Type > &)
A mixed boundary type that blends between fixedValue and slip, as opposed to the standard mixed condi...
virtual void operator-=(const fvPatchField< Type > &)
Namespace for OpenFOAM.
mixedFixedValueSlipFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.