faceReflecting.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) 2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::faceReflecting
28 
29 Description
30 
31  Calculates the reflecting faces from specular surfaces. It only
32  takes into account the first reflection coming from a surface hit
33  by the primary Sun hit faces.
34 
35 SourceFiles
36  faceReflecting.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef faceReflecting_H
41 #define faceReflecting_H
42 
43 #include "fvMesh.H"
44 #include "wallPolyPatch.H"
45 #include "triSurfaceTools.H"
46 #include "vectorList.H"
48 #include "faceShading.H"
49 #include "solarCalculator.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class faceReflecting Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class faceReflecting
61 {
62  // Private data
63 
64  //- Reference to mesh
65  const fvMesh& mesh_;
66 
67  //- Number of solid angles in theta
68  label nTheta_;
69 
70  //- Number of solid angles in phi
71  label nPhi_ ;
72 
73  //- Total number of rays (1 per direction)
74  label nRay_;
75 
76  //- Discretised angles for reflected rays
77  vectorList refDiscAngles_;
78 
79  //- Spectral distribution for the integrated solar heat flux
80  const scalarList& spectralDistribution_;
81 
82  //- Net reflected radiative heat flux [W/m2]
83  PtrList<volScalarField> qreflective_;
84 
85  //- Primary hits faces
86  const faceShading& directHitFaces_;
87 
88  //- Distributed surface for ray tracing
90 
91  //- Faces from which rays are shot
92  autoPtr<labelList> shootFacesIds_;
93 
94  //- Face centres from which rays are shot
96 
97  //- Face normal from which rays are shot
99 
100  //- Solar calculator
101  const solarCalculator& solarCalc_;
102 
103  //- Shooting rays pacthes
104  labelHashSet includePatches_;
105 
106  //- Map from triSurface Index to global
107  labelList mapTriToGlobal_;
108 
109 
110  // Private members
111 
112  //- Calculate ray start faces
113  void calculate();
114 
115  //- Initialise model
116  void initialise(const dictionary& dict);
117 
118 
119  //- No copy construct
120  faceReflecting(const faceReflecting&) = delete;
121 
122  //- No copy assignment
123  void operator=(const faceReflecting&) = delete;
124 
125 
126 public:
127 
128  // Declare name of the class and its debug switch
129  ClassName("faceReflecting");
130 
131 
132  // Constructors
133 
134  //- Construct from components
136  (
137  const fvMesh& mesh,
138  const faceShading& directHiyFaces,
139  const solarCalculator& ,
140  const scalarList& spectralDistribution,
141  const dictionary& dict
142  );
143 
144 
145 
146  //- Destructor
147  ~faceReflecting() = default;
148 
149 
150  // Member Functions
151 
152  // Const access to qreflective
153  const volScalarField& qreflective(const label bandI) const
154  {
155  return qreflective_[bandI];
156  }
157 
158 
159  //- Correct reflected flux
160  void correct();
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
distributedTriSurfaceMesh.H
vectorList.H
Foam::faceReflecting::~faceReflecting
~faceReflecting()=default
Destructor.
wallPolyPatch.H
Foam::HashSet< label, Hash< label > >
Foam::faceReflecting
Calculates the reflecting faces from specular surfaces. It only takes into account the first reflecti...
Definition: faceReflecting.H:59
Foam::solarCalculator
A solar calculator model providing models for the solar direction and solar loads.
Definition: solarCalculator.H:444
Foam::faceReflecting::qreflective
const volScalarField & qreflective(const label bandI) const
Definition: faceReflecting.H:152
Foam::faceShading
faceShading uses the transmissivity value in the boundaryRadiationProperties in order to evaluate whi...
Definition: faceShading.H:61
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
faceShading.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
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
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< vector >
solarCalculator.H
Foam::GeometricField< scalar, fvPatchField, volMesh >
triSurfaceTools.H
Foam::faceReflecting::correct
void correct()
Correct reflected flux.
Definition: faceReflecting.C:573
Foam::faceReflecting::ClassName
ClassName("faceReflecting")