patchInjectionBase.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) 2013-2022 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::patchInjectionBase
26 
27 Description
28  Base class for patch-based injection models.
29 
30  Class handles injecting at a random point adjacent to the patch faces to
31  provide a more stochastic view of the injection process. Patch faces are
32  triangulated, and area fractions accumulated. The fractional areas are
33  then applied to determine across which face a parcel is to be injected.
34 
35 SourceFiles
36  PatchInjectionBase.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef patchInjectionBase_H
41 #define patchInjectionBase_H
42 
43 #include "word.H"
44 #include "labelList.H"
45 #include "scalarList.H"
46 #include "vectorList.H"
47 #include "faceList.H"
48 #include "triFaceList.H"
49 #include "barycentric.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 // Forward class declarations
57 class polyMesh;
58 class fvMesh;
59 class Random;
60 
61 /*---------------------------------------------------------------------------*\
62  Class patchInjectionBase Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 {
67 protected:
68 
69  // Protected data
70 
71  //- Patch name
72  const word patchName_;
73 
74  //- Patch ID
75  const label patchId_;
76 
77  //- Cumulative sum of the total patch areas in each process
79 
80  //- Cumulative sum of the face areas in the patch
82 
83  //- Cumulative sum of the triangle areas in each patch face
85 
86 
87 public:
88 
89  // Constructors
90 
91  //- Construct from mesh and patch name
92  patchInjectionBase(const polyMesh& mesh, const word& patchName);
93 
94  //- Copy constructor
96 
97 
98  //- Destructor
99  virtual ~patchInjectionBase();
100 
101 
102  // Member Functions
103 
104  //- Update patch geometry and derived info for injection locations
105  virtual void topoChange(const polyMesh& mesh);
106 
107  //- Set the injection position and owner cell, tetFace and tetPt
108  virtual void setPositionAndCell
109  (
110  const fvMesh& mesh,
111  Random& rnd,
112  barycentric& coordinates,
113  label& celli,
114  label& tetFacei,
115  label& tetPti,
116  label& facei
117  );
118 };
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
Random number generator.
Definition: Random.H:58
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Base class for patch-based injection models.
scalarList sumFaceArea_
Cumulative sum of the face areas in the patch.
scalarList sumProcArea_
Cumulative sum of the total patch areas in each process.
virtual ~patchInjectionBase()
Destructor.
const word patchName_
Patch name.
scalarListList sumFaceTriArea_
Cumulative sum of the triangle areas in each patch face.
const label patchId_
Patch ID.
patchInjectionBase(const polyMesh &mesh, const word &patchName)
Construct from mesh and patch name.
virtual void setPositionAndCell(const fvMesh &mesh, Random &rnd, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
Set the injection position and owner cell, tetFace and tetPt.
virtual void topoChange(const polyMesh &mesh)
Update patch geometry and derived info for injection locations.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59