faceShading.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) 2015 OpenFOAM Foundation
9  Copyright (C) 2017-2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::faceShading
29 
30 Description
31 
32  faceShading uses the transmissivity value in the boundaryRadiationProperties
33  in order to evaluate which faces are "hit" by the "direction" vector.
34  NOTE: Only transmissivity values of zero are considered for opaque walls.
35 
36 SourceFiles
37  faceShading.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef faceShading_H
42 #define faceShading_H
43 
44 #include "fvMesh.H"
45 #include "Time.H"
46 #include "meshTools.H"
47 #include "DynamicField.H"
48 #include "labelIOList.H"
49 #include "wallPolyPatch.H"
50 #include "triSurfaceTools.H"
51 
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class faceShading Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class faceShading
63 {
64  // Private data
65 
66  //- Reference to mesh
67  const fvMesh& mesh_;
68 
69  //- Direction
70  vector direction_;
71 
72  //- Faces directly hit by vector direction
73  labelList rayStartFaces_;
74 
75 
76  // Private members
77 
78  //- Calculate ray start faces
79  void calculate();
80 
81 
82  //- Construct a triSurface from patches and faces on global local index
83  triSurface triangulate
84  (
85  const labelHashSet& includePatches,
86  const List<labelHashSet>& includeAllFaces
87  );
88 
89  //- Write rays
90  void writeRays
91  (
92  const fileName& fName,
93  const DynamicField<point>& endCf,
94  const pointField& myFc
95  );
96 
97  //- No copy construct
98  faceShading(const faceShading&) = delete;
99 
100  //- No copy assignment
101  void operator=(const faceShading&) = delete;
102 
103 
104 public:
105 
106  // Declare name of the class and its debug switch
107  ClassName("faceShading");
108 
109 
110  // Constructors
111 
112  //- Construct from components
114  (
115  const fvMesh& mesh,
116  const vector dir,
117  const labelList& hitFaceList
118  );
119 
120  //- Construct from mesh and vector
122  (
123  const fvMesh& mesh,
124  const vector
125  );
126 
127 
128  //- Destructor
129  ~faceShading() = default;
130 
131 
132  // Member Functions
133 
134  // Access
135 
136  //- const access to direction
137  const vector direction() const
138  {
139  return direction_;
140  }
141 
142  //- Non-const access to direction
143  vector& direction()
144  {
145  return direction_;
146  }
147 
148  //- Access to rayStartFaces
149  const labelList& rayStartFaces() const
150  {
151  return rayStartFaces_;
152  }
153 
154 
155  //- Recalculate rayStartFaces using direction vector
156  void correct();
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
meshTools.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::faceShading::ClassName
ClassName("faceShading")
wallPolyPatch.H
Foam::HashSet< label, Hash< label > >
Foam::faceShading::rayStartFaces
const labelList & rayStartFaces() const
Access to rayStartFaces.
Definition: faceShading.H:148
Foam::faceShading::direction
vector & direction()
Non-const access to direction.
Definition: faceShading.H:142
Foam::DynamicField
Dynamically sized Field.
Definition: DynamicField.H:49
Foam::faceShading::direction
const vector direction() const
const access to direction
Definition: faceShading.H:136
Foam::Field< vector >
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:76
Foam::faceShading::~faceShading
~faceShading()=default
Destructor.
Foam::faceShading
faceShading uses the transmissivity value in the boundaryRadiationProperties in order to evaluate whi...
Definition: faceShading.H:61
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Time.H
DynamicField.H
Foam::Vector< scalar >
Foam::List< label >
labelIOList.H
Foam::faceShading::correct
void correct()
Recalculate rayStartFaces using direction vector.
Definition: faceShading.C:409
triSurfaceTools.H