Loading...
Searching...
No Matches
fvcSurfaceOps.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) 2024 M.Janssens
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
26InNamespace
27 Foam::fvc
28
29Description
30 Surface integrate surfaceField creating a volField.
31 Surface sum a surfaceField creating a volField.
32
33SourceFiles
34 fvcSurfaceOps.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_fvcSurfaceOps_H
39#define Foam_fvcSurfaceOps_H
40
41#include "primitiveFieldsFwd.H"
42#include "volFieldsFwd.H"
43#include "surfaceFieldsFwd.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
50//- In-place operations on Fields. Add to FieldFunctions.C ?
51#define INPLACE_PRODUCT_OPERATOR(product, CombineOp, Op, OpFunc) \
52 \
53template<class Type1, class Type2> \
54void OpFunc \
55( \
56 Field<typename product<Type1, Type2>::type>& result, \
57 const UList<Type1>& f1, \
58 const UList<Type2>& f2 \
59) \
60{ \
61 typedef typename product<Type1, Type2>::type resultType; \
62 TFOR_ALL_F_OP_F_OP_F \
63 (resultType, result, CombineOp, Type1, f1, Op, Type2, f2) \
64}
69
70#undef INPLACE_PRODUCT_OPERATOR
71
72
73
74/*---------------------------------------------------------------------------*\
75 Namespace fvc functions Declaration
76\*---------------------------------------------------------------------------*/
77
78namespace fvc
79{
80 // Interpolation
81
82 //- Interpolate to face (using cop) and additional face field
83 template<class Type, class FType, class ResultType, class CellToFaceOp>
84 void interpolate
85 (
86 const surfaceScalarField& lambdas,
89 const CellToFaceOp& cop,
91 );
92
93 //- Interpolate to face (using cop)
94 template
95 <
96 class Type0,
97 class Type1,
98 class ResultType,
99 class CellToFaceOp
100 >
101 void interpolate
102 (
103 const surfaceScalarField& weights,
106 const CellToFaceOp& cop,
108 );
109
110
111 // Interpolation and accumulation
112
113 //- Interpolate to face (using cop) and accumulate.
114 template<class Type, class ResultType, class CellToFaceOp>
115 void surfaceSum
116 (
117 const surfaceScalarField& lambdas,
119 const CellToFaceOp& cop,
121 const bool doCorrectBoundaryConditions = true
122 );
123
124 //- Interpolate to face (using cop) and accumulate. Additional
125 //- face field
126 template<class Type, class FType, class ResultType, class CellToFaceOp>
127 void surfaceSum
128 (
129 const surfaceScalarField& lambdas,
132 const CellToFaceOp& cop,
134 const bool doCorrectBoundaryConditions = true
135 );
136
137 //- Interpolate to face (using cop) and accumulate. Additional
138 //- face fields
139 template
140 <
141 class Type,
142 class FType0,
143 class FType1,
144 class ResultType,
145 class CellToFaceOp
146 >
147 void surfaceSum
148 (
149 const surfaceScalarField& lambdas,
151
154
155 const CellToFaceOp& cop,
156
158 const bool doCorrectBoundaryConditions = true
159 );
160
161 //- Interpolate to face (using cop) and apply Gauss. Note: uses V(),
162 // not Vsc()
163 template<class Type, class ResultType, class CellToFaceOp>
164 void GaussOp
165 (
166 const surfaceScalarField& lambdas,
168 const CellToFaceOp& cop,
170 );
171
172
173 // Difference and accumulation
174
175 //- sum of snGrad
176 template<class Type, class ResultType, class CellToFaceOp>
177 void surfaceSnSum
178 (
179 const surfaceScalarField& deltaCoeffs,
181
182 const CellToFaceOp& cop,
183
186 );
187 //- sum of snGrad with additional surface field
188 template<class Type, class ResultType, class CellToFaceOp>
189 void surfaceSnSum
190 (
191 const surfaceScalarField& deltaCoeffs,
194
195 const CellToFaceOp& cop,
196
199 );
200
201 //- sum of snGrad with additional (interpolated) volField
202 template<class Type, class GType, class ResultType, class CellToFaceOp>
203 void surfaceSnSum
204 (
205 const surfaceScalarField& gammaWeights,
207
208 const surfaceScalarField& deltaCoeffs,
210
211 const CellToFaceOp& cop,
212
215 );
216
217 //- sum of snGrad with additional (interpolated) volfields
218 template
219 <
220 class Type,
221 class GType0,
222 class GType1,
223 class ResultType,
224 class CellToFaceOp
225 >
226 void surfaceSnSum
227 (
228 const surfaceScalarField& weights,
229
232
233 const surfaceScalarField& deltaCoeffs,
235
236 const CellToFaceOp& cop,
237
240 );
241
242 //- sum of snGrad with additional surface field
243 template<class Type, class GType, class ResultType, class CellToFaceOp>
244 void surfaceSnSum
245 (
246 const surfaceScalarField& gammaWeights,
248
249 const surfaceScalarField& deltaCoeffs,
251
253
254 const CellToFaceOp& cop,
255
258 );
259
260
261 // Other
262
263 //- Interpolate to face (using cop) and apply distribution vectors
264 template<class Type, class ResultType, class CellToFaceOp>
265 void surfaceOp
266 (
268 const surfaceVectorField& ownLs,
269 const surfaceVectorField& neiLs,
270 const CellToFaceOp& cop,
272 );
273}
274
275
276// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
277
278} // End namespace Foam
279
280// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281
282#ifdef NoRepository
283 #include "fvcSurfaceOps.C"
284#endif
285
286// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
287
288#endif
289
290// ************************************************************************* //
Generic GeometricField class.
const scalar gamma
Definition EEqn.H:9
#define INPLACE_PRODUCT_OPERATOR(product, CombineOp, Op, OpFunc)
In-place operations on Fields. Add to FieldFunctions.C ?
Namespace of functions to calculate explicit derivatives.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
void GaussOp(const surfaceScalarField &lambdas, const GeometricField< Type, fvPatchField, volMesh > &vf, const CombineOp &cop, GeometricField< ResultType, fvPatchField, volMesh > &result)
void surfaceOp(const GeometricField< Type, fvPatchField, volMesh > &vf, const surfaceVectorField &ownLs, const surfaceVectorField &neiLs, const CombineOp &cop, GeometricField< ResultType, fvPatchField, volMesh > &result)
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void surfaceSnSum(const surfaceScalarField &deltaCoeffs, const GeometricField< Type, fvPatchField, volMesh > &vf, const CellToFaceOp &cop, GeometricField< ResultType, fvPatchField, volMesh > &result, const bool doCorrectBoundaryConditions)
sum of snGrad
Namespace for OpenFOAM.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
void multiplyAdd(Field< typename outerProduct< Type1, Type2 >::type > &result, const UList< Type1 > &f1, const UList< Type2 > &f2)
static void doCorrectBoundaryConditions(bool correctBCs, VolumeField< Type > &field)
void multiplySubtract(Field< typename outerProduct< Type1, Type2 >::type > &result, const UList< Type1 > &f1, const UList< Type2 > &f2)
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Forwards and collection of common volume field types.