directionMixedFvPatchField.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::directionMixedFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  Base class for direction-mixed boundary conditions.
34 
35 SourceFiles
36  directionMixedFvPatchField.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef directionMixedFvPatchField_H
41 #define directionMixedFvPatchField_H
42 
43 #include "transformFvPatchField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class directionMixedFvPatchField Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public transformFvPatchField<Type>
58 {
59  // Private data
60 
61  //- Value field
62  Field<Type> refValue_;
63 
64  //- Normal gradient field
65  Field<Type> refGrad_;
66 
67  //- Fraction (0-1) of value used for boundary condition
68  symmTensorField valueFraction_;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("directionMixed");
75 
76 
77  // Constructors
78 
79  //- Construct from patch and internal field
81  (
82  const fvPatch&,
84  );
85 
86  //- Construct from patch, internal field and dictionary
88  (
89  const fvPatch&,
91  const dictionary&
92  );
93 
94  //- Construct by mapping given directionMixedFvPatchField onto
95  // a new patch
97  (
99  const fvPatch&,
101  const fvPatchFieldMapper&
102  );
103 
104  //- Construct and return a clone
105  virtual tmp<fvPatchField<Type>> clone() const
106  {
107  return tmp<fvPatchField<Type>>
108  (
110  );
111  }
112 
113  //- Construct as copy setting internal field reference
115  (
118  );
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
126  return tmp<fvPatchField<Type>>
127  (
128  new directionMixedFvPatchField<Type>(*this, iF)
129  );
130  }
131 
132 
133  // Member functions
134 
135  // Attributes
136 
137  //- Return true: this patch field fixes a value.
138  // Needed to check if a level has to be specified while solving
139  // Poissons equations.
140  virtual bool fixesValue() const
141  {
142  return true;
143  }
144 
145  //- Return false: this patch field is not altered by assignment
146  virtual bool assignable() const
147  {
148  return false;
149  }
150 
151 
152  // Mapping functions
153 
154  //- Map (and resize as needed) from self given a mapping object
155  virtual void autoMap
156  (
157  const fvPatchFieldMapper&
158  );
159 
160  //- Reverse map the given fvPatchField onto this fvPatchField
161  virtual void rmap
162  (
163  const fvPatchField<Type>&,
164  const labelList&
165  );
166 
167 
168  // Return defining fields
169 
170  virtual Field<Type>& refValue()
171  {
172  return refValue_;
173  }
174 
175  virtual const Field<Type>& refValue() const
176  {
177  return refValue_;
178  }
179 
180  virtual Field<Type>& refGrad()
181  {
182  return refGrad_;
183  }
184 
185  virtual const Field<Type>& refGrad() const
186  {
187  return refGrad_;
188  }
189 
190  virtual symmTensorField& valueFraction()
191  {
192  return valueFraction_;
193  }
194 
195  virtual const symmTensorField& valueFraction() const
196  {
197  return valueFraction_;
198  }
199 
200 
201  // Evaluation functions
202 
203  //- Return gradient at boundary
204  virtual tmp<Field<Type>> snGrad() const;
205 
206  //- Evaluate the patch field
207  virtual void evaluate
208  (
209  const Pstream::commsTypes commsType =
211  );
212 
213  //- Return face-gradient transform diagonal
214  virtual tmp<Field<Type>> snGradTransformDiag() const;
215 
216 
217  //- Write
218  virtual void write(Ostream&) const;
219 
220 
221  // Member operators
222 
223  virtual void operator=(const fvPatchField<Type>&) {}
224  virtual void operator+=(const fvPatchField<Type>&) {}
225  virtual void operator-=(const fvPatchField<Type>&) {}
226  virtual void operator*=(const fvPatchField<Type>&) {}
227  virtual void operator/=(const fvPatchField<Type>&) {}
228 
229  virtual void operator=(const Field<Type>&) {}
230  virtual void operator+=(const Field<Type>&) {}
231  virtual void operator-=(const Field<Type>&) {}
232  virtual void operator*=(const Field<scalar>&) {}
233  virtual void operator/=(const Field<scalar>&) {}
234 
235  virtual void operator=(const Type&) {}
236  virtual void operator+=(const Type&) {}
237  virtual void operator-=(const Type&) {}
238  virtual void operator*=(const scalar) {}
239  virtual void operator/=(const scalar) {}
240 };
241 
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 } // End namespace Foam
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #ifdef NoRepository
251 #endif
252 
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 
255 #endif
256 
257 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
Foam::UPstream::commsTypes::blocking
Foam::directionMixedFvPatchField::operator*=
virtual void operator*=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:225
directionMixedFvPatchField.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::directionMixedFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:222
Foam::directionMixedFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: directionMixedFvPatchField.C:121
Foam::directionMixedFvPatchField::operator/=
virtual void operator/=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:226
Foam::directionMixedFvPatchField::operator-=
virtual void operator-=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:224
Foam::directionMixedFvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
Definition: directionMixedFvPatchField.C:139
Foam::directionMixedFvPatchField::operator=
virtual void operator=(const Type &)
Definition: directionMixedFvPatchField.H:234
Foam::directionMixedFvPatchField::refValue
virtual const Field< Type > & refValue() const
Definition: directionMixedFvPatchField.H:174
Foam::directionMixedFvPatchField::operator+=
virtual void operator+=(const Type &)
Definition: directionMixedFvPatchField.H:235
Foam::directionMixedFvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: directionMixedFvPatchField.C:157
Foam::directionMixedFvPatchField::valueFraction
virtual const symmTensorField & valueFraction() const
Definition: directionMixedFvPatchField.H:194
Foam::directionMixedFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: directionMixedFvPatchField.C:205
Foam::directionMixedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: directionMixedFvPatchField.H:104
Foam::directionMixedFvPatchField::snGradTransformDiag
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
Definition: directionMixedFvPatchField.C:180
Foam::directionMixedFvPatchField::refGrad
virtual Field< Type > & refGrad()
Definition: directionMixedFvPatchField.H:179
Foam::directionMixedFvPatchField::TypeName
TypeName("directionMixed")
Runtime type information.
Foam::directionMixedFvPatchField::operator*=
virtual void operator*=(const Field< scalar > &)
Definition: directionMixedFvPatchField.H:231
Foam::directionMixedFvPatchField::operator=
virtual void operator=(const Field< Type > &)
Definition: directionMixedFvPatchField.H:228
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::directionMixedFvPatchField::directionMixedFvPatchField
directionMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: directionMixedFvPatchField.C:35
Foam::directionMixedFvPatchField::assignable
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
Definition: directionMixedFvPatchField.H:145
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::directionMixedFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: directionMixedFvPatchField.C:108
Foam::directionMixedFvPatchField::operator*=
virtual void operator*=(const scalar)
Definition: directionMixedFvPatchField.H:237
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:66
Foam::directionMixedFvPatchField::operator-=
virtual void operator-=(const Type &)
Definition: directionMixedFvPatchField.H:236
Foam::directionMixedFvPatchField::valueFraction
virtual symmTensorField & valueFraction()
Definition: directionMixedFvPatchField.H:189
Foam::directionMixedFvPatchField::refValue
virtual Field< Type > & refValue()
Definition: directionMixedFvPatchField.H:169
Foam::directionMixedFvPatchField::operator/=
virtual void operator/=(const Field< scalar > &)
Definition: directionMixedFvPatchField.H:232
transformFvPatchField.H
Foam::directionMixedFvPatchField::refGrad
virtual const Field< Type > & refGrad() const
Definition: directionMixedFvPatchField.H:184
Foam::List< label >
Foam::directionMixedFvPatchField::fixesValue
virtual bool fixesValue() const
Return true: this patch field fixes a value.
Definition: directionMixedFvPatchField.H:139
Foam::transformFvPatchField
Foam::transformFvPatchField.
Definition: transformFvPatchField.H:54
Foam::directionMixedFvPatchField::operator+=
virtual void operator+=(const Field< Type > &)
Definition: directionMixedFvPatchField.H:229
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::directionMixedFvPatchField::operator-=
virtual void operator-=(const Field< Type > &)
Definition: directionMixedFvPatchField.H:230
Foam::directionMixedFvPatchField::operator+=
virtual void operator+=(const fvPatchField< Type > &)
Definition: directionMixedFvPatchField.H:223
Foam::directionMixedFvPatchField
Base class for direction-mixed boundary conditions.
Definition: directionMixedFvPatchField.H:54
Foam::directionMixedFvPatchField::operator/=
virtual void operator/=(const scalar)
Definition: directionMixedFvPatchField.H:238
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54