Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::directionMixedFvPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 Base class for direction-mixed boundary conditions.
34
35SourceFiles
36 directionMixedFvPatchField.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef directionMixedFvPatchField_H
41#define directionMixedFvPatchField_H
42
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class directionMixedFvPatchField Declaration
52\*---------------------------------------------------------------------------*/
53
54template<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
71public:
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 as copy setting internal field reference
106 (
109 );
110
111 //- Return a clone
112 virtual tmp<fvPatchField<Type>> clone() const
113 {
114 return fvPatchField<Type>::Clone(*this);
115 }
116
117 //- Clone with an internal field reference
119 (
121 ) const
122 {
123 return fvPatchField<Type>::Clone(*this, iF);
124 }
125
127 // Member Functions
128
129 //- True: this patch field fixes a value.
130 virtual bool fixesValue() const { return true; }
131
132 //- False: this patch field is not altered by assignment.
133 virtual bool assignable() const { return false; }
135
136 // Mapping functions
137
138 //- Map (and resize as needed) from self given a mapping object
139 virtual void autoMap
140 (
141 const fvPatchFieldMapper&
142 );
143
144 //- Reverse map the given fvPatchField onto this fvPatchField
145 virtual void rmap
146 (
147 const fvPatchField<Type>&,
149 );
150
151
152 // Return defining fields
154 virtual Field<Type>& refValue()
155 {
156 return refValue_;
157 }
158
159 virtual const Field<Type>& refValue() const
160 {
161 return refValue_;
162 }
163
164 virtual Field<Type>& refGrad()
165 {
166 return refGrad_;
167 }
168
169 virtual const Field<Type>& refGrad() const
170 {
171 return refGrad_;
172 }
173
175 {
176 return valueFraction_;
177 }
179 virtual const symmTensorField& valueFraction() const
180 {
181 return valueFraction_;
182 }
184
185 // Evaluation functions
186
187 //- Return gradient at boundary
188 virtual tmp<Field<Type>> snGrad() const;
189
190 //- Evaluate the patch field
191 virtual void evaluate
192 (
193 const Pstream::commsTypes commsType =
195 );
196
197 //- Return face-gradient transform diagonal
199
200
201 //- Write
202 virtual void write(Ostream&) const;
204
205 // Member operators
206
207 virtual void operator=(const fvPatchField<Type>&) {}
208 virtual void operator+=(const fvPatchField<Type>&) {}
209 virtual void operator-=(const fvPatchField<Type>&) {}
210 virtual void operator*=(const fvPatchField<Type>&) {}
211 virtual void operator/=(const fvPatchField<Type>&) {}
212
213 virtual void operator=(const Field<Type>&) {}
214 virtual void operator+=(const Field<Type>&) {}
215 virtual void operator-=(const Field<Type>&) {}
216 virtual void operator*=(const Field<scalar>&) {}
217 virtual void operator/=(const Field<scalar>&) {}
218
219 virtual void operator=(const Type&) {}
220 virtual void operator+=(const Type&) {}
221 virtual void operator-=(const Type&) {}
222 virtual void operator*=(const scalar) {}
223 virtual void operator/=(const scalar) {}
224};
225
226
227// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228
229} // End namespace Foam
230
231// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232
233#ifdef NoRepository
235#endif
236
237// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238
239#endif
241// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
commsTypes
Communications types.
Definition UPstream.H:81
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
Definition UPstream.H:82
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual void operator/=(const Field< scalar > &)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual const Field< Type > & refGrad() const
virtual void operator+=(const Field< Type > &)
virtual const symmTensorField & valueFraction() const
virtual void operator*=(const Field< scalar > &)
virtual void operator+=(const fvPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual void operator=(const fvPatchField< Type > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator/=(const fvPatchField< Type > &)
TypeName("directionMixed")
Runtime type information.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual const Field< Type > & refValue() const
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
virtual void operator=(const Field< Type > &)
virtual void operator*=(const fvPatchField< Type > &)
virtual void operator-=(const Field< Type > &)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
directionMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
transformFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68