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 | Copyright (C) 2015 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::faceShading
26 
27 Description
28 
29  faceShading uses the transmissivity value in the boundaryRadiationProperties
30  in order to evaluate which faces are "hit" by the "direction" vector.
31  NOTE: Only transmissivity values of zero are considered for opaque walls.
32 
33 SourceFiles
34  faceShading.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef faceShading_H
39 #define faceShading_H
40 
41 #include "fvMesh.H"
42 #include "Time.H"
43 #include "meshTools.H"
44 #include "DynamicField.H"
45 #include "labelIOList.H"
46 #include "wallPolyPatch.H"
47 #include "triSurfaceTools.H"
48 
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class faceShading Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class faceShading
60 {
61  // Private data
62 
63  //- Reference to mesh
64  const fvMesh& mesh_;
65 
66  //- Direction
68 
69  //- Faces directly hit by vector direction
71 
72 
73  // Private members
74 
75  //- Calculate ray start faces
76  void calculate();
77 
78 
79  //- Construct a triSurface from patches and faces on global local index
81  (
82  const labelHashSet& includePatches,
83  const List<labelHashSet>& includeAllFaces
84  );
85 
86  //- Write rays
87  void writeRays
88  (
89  const fileName& fName,
90  const DynamicField<point>& endCf,
91  const pointField& myFc
92  );
93 
94  //- Disallow default bitwise copy construct
95  faceShading(const faceShading&);
96 
97  //- Disallow default bitwise assignment
98  void operator=(const faceShading&);
99 
100 
101 public:
102 
103  // Declare name of the class and its debug switch
104  ClassName("faceShading");
105 
106 
107  // Constructors
108 
109  //- Construct from components
111  (
112  const fvMesh& mesh,
113  const vector dir,
114  const labelList& hitFaceList
115  );
116 
117  //- Construct from mesh and vector
119  (
120  const fvMesh& mesh,
121  const vector
122  );
123 
124 
125  //- Destructor
126  ~faceShading();
127 
128 
129  // Member Functions
130 
131  // Access
132 
133  //- const acess to direction
134  const vector direction() const
135  {
136  return direction_;
137  }
138 
139  //- Non-const access to direction
140  vector& direction()
141  {
142  return direction_;
143  }
144 
145  //- Access to rayStartFaces
146  const labelList& rayStartFaces() const
147  {
148  return rayStartFaces_;
149  }
150 
151 
152  //- Recalculate rayStartFaces using direction vector
153  void correct();
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
meshTools.H
Foam::faceShading::~faceShading
~faceShading()
Destructor.
Definition: faceShading.C:435
Foam::faceShading::faceShading
faceShading(const faceShading &)
Disallow default bitwise copy construct.
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::faceShading::ClassName
ClassName("faceShading")
wallPolyPatch.H
Foam::faceShading::rayStartFaces_
labelList rayStartFaces_
Faces directly hit by vector direction.
Definition: faceShading.H:69
Foam::faceShading::operator=
void operator=(const faceShading &)
Disallow default bitwise assignment.
Foam::HashSet< label, Hash< label > >
Foam::faceShading::rayStartFaces
const labelList & rayStartFaces() const
Access to rayStartFaces.
Definition: faceShading.H:145
Foam::faceShading::direction
vector & direction()
Non-const access to direction.
Definition: faceShading.H:139
Foam::DynamicField
Dynamically sized Field.
Definition: DynamicField.H:49
Foam::faceShading::direction
const vector direction() const
const acess to direction
Definition: faceShading.H:133
Foam::faceShading::direction_
vector direction_
Direction.
Definition: faceShading.H:66
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:57
Foam::faceShading::mesh_
const fvMesh & mesh_
Reference to mesh.
Definition: faceShading.H:63
Foam::faceShading
faceShading uses the transmissivity value in the boundaryRadiationProperties in order to evaluate whi...
Definition: faceShading.H:58
Foam::faceShading::triangulate
triSurface triangulate(const labelHashSet &includePatches, const List< labelHashSet > &includeAllFaces)
Construct a triSurface from patches and faces on global local index.
Definition: faceShading.C:72
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::faceShading::calculate
void calculate()
Calculate ray start faces.
Definition: faceShading.C:164
DynamicField.H
Foam::faceShading::writeRays
void writeRays(const fileName &fName, const DynamicField< point > &endCf, const pointField &myFc)
Write rays.
Definition: faceShading.C:46
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
labelIOList.H
Foam::faceShading::correct
void correct()
Recalculate rayStartFaces using direction vector.
Definition: faceShading.C:441
triSurfaceTools.H