cutPolyIntegral.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) 2022-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 Namespace
25  Foam::cutPoly
26 
27 Description
28  Functions for computing integrals over cut faces and cells
29 
30 SourceFiles
31  cutPolyIntegralTemplates.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cutPolyIntegral_H
36 #define cutPolyIntegral_H
37 
38 #include "cutPolyValue.H"
39 
40 #include <tuple>
41 #include <type_traits>
42 #include <utility>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace cutPoly
49 {
50 
51 //- Compute the face-area and face-area-integrals of the given properties over
52 // a face
53 template<template<class> class FaceValues, class ... Types>
56 (
57  const FaceValues<point>& fPs,
58  const point& fPAvg,
59  const std::tuple<FaceValues<Types> ...>& fPsis,
60  const std::tuple<Types ...>& fPsiAvg
61 );
62 
63 //- Compute the face-area and face-area-integral of the given property over
64 // a cut-face. ToDo: Make variadic as faceAreaIntegral.
65 template<class Type>
67 (
68  const face& f,
69  const vector& fArea,
70  const Type& fPsi,
71  const List<labelPair>& fCuts,
72  const pointField& ps,
73  const Field<Type>& pPsis,
74  const scalarField& pAlphas,
75  const scalar isoAlpha,
76  const bool below
77 );
78 
79 //- Compute the cell-volume and cell-volume-integral of the given property over
80 // a cut-cell. ToDo: Make variadic as faceAreaIntegral.
81 template<class Type>
83 (
84  const cell& c,
85  const cellEdgeAddressing& cAddr,
86  const scalar cVolume,
87  const Type& cPsi,
88  const labelListList& cCuts,
89  const faceUList& fs,
90  const vectorField& fAreas,
91  const vectorField& fCentres,
92  const vectorField& fPsis,
93  const vectorField& fCutAreas,
94  const vectorField& fCutPsis,
95  const pointField& ps,
96  const Field<Type>& pPsis,
97  const scalarField& pAlphas,
98  const scalar isoAlpha,
99  const bool below
100 );
101 
102 } // End namespace cutPoly
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #ifdef NoRepository
108  #include "cutPolyIntegralTemplates.C"
109 #endif
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:66
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:74
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:60
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:76
const dimensionedScalar c
Speed of light in a vacuum.
std::tuple< vector, typename outerProduct< vector, Types >::type ... > faceAreaIntegral(const FaceValues< point > &fPs, const point &fPAvg, const std::tuple< FaceValues< Types > ... > &fPsis, const std::tuple< Types ... > &fPsiAvg)
Compute the face-area and face-area-integrals of the given properties over.
Tuple2< scalar, Type > cellCutVolumeIntegral(const cell &c, const cellEdgeAddressing &cAddr, const scalar cVolume, const Type &cPsi, const labelListList &cCuts, const faceUList &fs, const vectorField &fAreas, const vectorField &fCentres, const vectorField &fPsis, const vectorField &fCutAreas, const vectorField &fCutPsis, const pointField &ps, const Field< Type > &pPsis, const scalarField &pAlphas, const scalar isoAlpha, const bool below)
Compute the cell-volume and cell-volume-integral of the given property over.
Tuple2< vector, typename outerProduct< vector, Type >::type > faceCutAreaIntegral(const face &f, const vector &fArea, const Type &fPsi, const List< labelPair > &fCuts, const pointField &ps, const Field< Type > &pPsis, const scalarField &pAlphas, const scalar isoAlpha, const bool below)
Compute the face-area and face-area-integral of the given property over.
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
labelList f(nPoints)