Loading...
Searching...
No Matches
viewFactorModel.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) 2023-2024 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Namespace
27 Foam::VF
28
29Description
30 A namespace for various \c viewFactor model implementations.
31
32Class
33 Foam::VF::viewFactorModel
34
35Description
36 A base class for \c viewFactor models.
37
38Usage
39 Minimal example in \c <constant>/viewFactorsDict:
40 \verbatim
41 // Mandatory entries
42 writeViewFactors <bool>;
43
44 // Optional entries
45 writeRays <bool>;
46 \endverbatim
47
48 where the entries mean:
49 \table
50 Property | Description | Type | Reqd | Deflt
51 writeViewFactors | Flag to write the view factor field | bool | yes | -
52 writeRays | Flag to write the ray geometry | bool | no | false
53 \endtable
54
55SourceFiles
56 viewFactorModel.C
57 viewFactorModelNew.C
58
59\*---------------------------------------------------------------------------*/
60
61#ifndef Foam_vf_viewFactorModel_H
62#define Foam_vf_viewFactorModel_H
63
64#include "autoPtr.H"
65#include "pointField.H"
66
67// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68
69namespace Foam
70{
71
72// Forward Declarations
73class fvMesh;
74
75namespace VF
76{
77
78// Forward Declarations
79class raySearchEngine;
80
81/*---------------------------------------------------------------------------*\
82 Class viewFactorModel Declaration
83\*---------------------------------------------------------------------------*/
84
86{
87protected:
88
89 // Protected Data
90
91 //- Reference to the mesh database
92 const fvMesh& mesh_;
93
94 //- Run-time selectable ray search engine
95 autoPtr<raySearchEngine> searchEnginePtr_;
96
97 //- Flag to write the view factor field
100 //- Flag to write the ray geometry
101 bool writeRays_;
102
103
104 // Protected Member Functions
105
106 //- Write ray geometry to file
107 static void writeRays
109 const fileName& fName,
110 const pointField& compactCf,
111 const labelListList& visibleFaceFaces
112 );
114 //- Calculate the view factors using run-time selectable model
116 (
117 const labelListList& visibleFaceFaces,
118 const pointField& compactCoarseCf,
119 const vectorField& compactCoarseSf,
120 const UList<List<vector>>& compactFineSf,
121 const UList<List<point>>& compactFineCf,
122 const UList<List<point>>& compactPoints,
123 const labelUList& compactPatchId
124 ) const = 0;
125
126
127public:
128
129 //- Runtime type information
130 TypeName("viewFactorModel");
132 //- Selection table
134 (
135 autoPtr,
137 mesh,
138 (
139 const fvMesh& mesh,
140 const dictionary& dict
141 ),
142 (mesh, dict)
143 );
144
145 //- Selector
147 (
148 const fvMesh& mesh,
149 const dictionary& dict
150 );
151
152
153 // Generated Methods
154
155 //- No copy construct
156 viewFactorModel(const viewFactorModel&) = delete;
157
158 //- No copy assignment
159 void operator=(const viewFactorModel&) = delete;
160
161
162 //- Constructor
164
165 //- Destructor
166 virtual ~viewFactorModel();
167
168
169 // Public Member Functions
170
171 //- Calculate the view factors
172 virtual void calculate();
173};
174
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178} // End namespace VF
179} // End namespace Foam
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183#endif
184
185// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
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:89
Base class for ray search engines.
A base class for viewFactor models.
viewFactorModel(const fvMesh &mesh, const dictionary &dict)
Constructor.
const fvMesh & mesh_
Reference to the mesh database.
void operator=(const viewFactorModel &)=delete
No copy assignment.
viewFactorModel(const viewFactorModel &)=delete
No copy construct.
bool writeRays_
Flag to write the ray geometry.
virtual void calculate()
Calculate the view factors.
static autoPtr< viewFactorModel > New(const fvMesh &mesh, const dictionary &dict)
Selector.
declareRunTimeSelectionTable(autoPtr, viewFactorModel, mesh,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
Selection table.
virtual ~viewFactorModel()
Destructor.
TypeName("viewFactorModel")
Runtime type information.
autoPtr< raySearchEngine > searchEnginePtr_
Run-time selectable ray search engine.
static void writeRays(const fileName &fName, const pointField &compactCf, const labelListList &visibleFaceFaces)
Write ray geometry to file.
bool writeViewFactors_
Flag to write the view factor field.
virtual scalarListList calculate(const labelListList &visibleFaceFaces, const pointField &compactCoarseCf, const vectorField &compactCoarseSf, const UList< List< vector > > &compactFineSf, const UList< List< point > > &compactFineCf, const UList< List< point > > &compactPoints, const labelUList &compactPatchId) const =0
Calculate the view factors using run-time selectable model.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
dynamicFvMesh & mesh
A namespace for various viewFactor model implementations.
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
Field< vector > vectorField
Specialisation of Field<T> for vector.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68