laserDTRM.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) 2017-2019 OpenCFD Ltd.
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::radiation::laserDTRM
28 
29 Group
30  grpRadiationModels
31 
32 Description
33  Discrete Tray Radiation Method for collimated radiation flux.
34  At the moment the particles are injected on a 2D disk in polar
35  coordinates providing starting and finish locations.
36 
37  The ray is considered planar (no area divergence is considered). This
38  model was developed to represent a collimated laser beam.
39 
40  The model is developed to work in a VOF framework, representing different
41  phases.
42 
43  Reflection models are possible to set up between phases.
44 
45  Different options are available in order to specify the power distribution
46  at the origin of the laser.
47 
48 SourceFiles
49  laserDTRM.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef radiationModellaserDTRM_H
54 #define radiationModellaserDTRM_H
55 
56 #include "radiationModel.H"
57 #include "volFields.H"
58 #include "surfaceFields.H"
59 #include "Cloud.H"
60 #include "DTRMParticle.H"
61 #include "reflectionModel.H"
62 #include "Function1.H"
63 #include "interpolation2DTable.H"
64 #include "labelField.H"
65 #include "phasePairKey.H"
66 #include "Enum.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace radiation
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class laserDTRM Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class laserDTRM
80 :
81  public radiationModel
82 {
83 public:
84 
85  // Public enumeration
86 
87  //- Modes of power distribution
89  {
94  };
95 
96 
97 private:
98 
99 
100  // Private types
101 
102  typedef
104 
105 
106  typedef
107  HashTable
108  <
110  phasePairKey,
112  > reflectionModelTable;
113 
114 
115  // Private data
116 
117  static const Enum<powerDistributionMode> powerDistNames_;
118 
119  //- Operating mode for power distribution
120  powerDistributionMode mode_;
121 
122  //- DTRM particle cloud
123  Cloud<DTRMParticle> DTRMCloud_;
124 
125  //- Number of particles
126  label nParticles_;
127 
128  //- Number of theta angles
129  label ndTheta_;
130 
131  //- Number of radials
132  label ndr_;
133 
134  //- Maximum tracking length for particles
135  scalar maxTrackLength_;
136 
137 
138  // Laser parameters
139 
140  //- Focal laser position
141  autoPtr<Function1<point>> focalLaserPosition_;
142 
143  //- Direction
144  autoPtr<Function1<vector>> laserDirection_;
145 
146  //- Focal lase radius
147  scalar focalLaserRadius_;
148 
149  //- Quality beam laser (tan of the angle between the main direction
150  // (laserDirection) and the spreading rays (0: flat, 1:fully)
151  scalar qualityBeamLaser_;
152 
153 
154  // Gaussian power distribution entries
155 
156  //- Sigma deviation
157  scalar sigma_;
158 
159  //- Peak flux for GaussianPeak mode
160  scalar I0_;
161 
162  //- Power
163  autoPtr<Function1<scalar>> laserPower_;
164 
165 
166  // Manual power distribution entries
167 
168  //- Manual power distribution table. (theta, radius)
169  autoPtr<interpolation2DTable<scalar>> powerDistribution_;
170 
171 
172  // Reflection sub-model
173 
174  //- Reflection model
175  reflectionModelTable reflections_;
176 
177  //- Reflection switch
178  bool reflectionSwitch_;
179 
180  //- Alpha value at which reflection is set
181  scalar alphaCut_;
182 
183 
184  // Fields
185 
186 
187  //- Absorption coefficient
188  volScalarField a_;
189 
190  //- Emission coefficient
191  volScalarField e_;
192 
193  //- Emission contribution
194  volScalarField E_;
195 
196  //- Volumetric heat source [W/m3]
197  volScalarField Q_;
198 
199 
200  // Private Member Functions
201 
202  //- Initialise
203  void initialise();
204 
205  //- Initialise reflection model
206  void initialiseReflection();
207 
208  //- Calculate Intensity of the laser at p(t, theta) [W/m2]
209  scalar calculateIp(scalar r, scalar theta);
210 
211  // Normal surface on the interface
212  tmp<volVectorField> nHatfv
213  (
214  const volScalarField& alpha1,
215  const volScalarField& alpha2
216  ) const;
217 
218 
219  //- No copy construct
220  laserDTRM(const laserDTRM&) = delete;
221 
222  //- No copy assignment
223  void operator=(const laserDTRM&) = delete;
224 
225 
226 public:
227 
228  //- Runtime type information
229  TypeName("laserDTRM");
230 
231 
232  // Constructors
233 
234  //- Construct from components
235  laserDTRM(const volScalarField& T);
236 
237  //- Construct from components
238  laserDTRM(const dictionary& dict, const volScalarField& T);
239 
240 
241  //- Destructor
242  virtual ~laserDTRM() = default;
243 
244 
245  // Member functions
246 
247  // Edit
248 
249  //- Solve radiation equation(s)
250  void calculate();
251 
252  //- Read radiation properties dictionary
253  bool read();
254 
255  //- Number of bands for this radiation model
256  virtual label nBands() const;
257 
258 
259  // Access
260 
261  //- Source term component (for power of T^4)
262  virtual tmp<volScalarField> Rp() const;
263 
264  //- Source term component (constant)
265  virtual tmp<DimensionedField<scalar, volMesh>> Ru() const;
266 };
267 
268 
269 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270 
271 } // End namespace radiation
272 } // End namespace Foam
273 
274 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 
276 #endif
277 
278 // ************************************************************************* //
volFields.H
Foam::Enum< powerDistributionMode >
Foam::radiation::laserDTRM::pdGaussianPeak
Definition: laserDTRM.H:92
Foam::phasePairKey::hasher
Hashing functor for phasePairKey.
Definition: phasePairKey.H:122
Foam::radiation::laserDTRM::powerDistributionMode
powerDistributionMode
Modes of power distribution.
Definition: laserDTRM.H:87
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
alpha2
const volScalarField & alpha2
Definition: setRegionFluidFields.H:9
Function1.H
Cloud.H
interpolation2DTable.H
surfaceFields.H
Foam::surfaceFields.
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
DTRMParticle.H
Foam::radiation::laserDTRM::pdManual
Definition: laserDTRM.H:90
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
reflectionModel.H
Foam::phasePairKey
An ordered or unorder pair of phase names. Typically specified as follows.
Definition: phasePairKey.H:65
Foam::radiation::laserDTRM::calculate
void calculate()
Solve radiation equation(s)
Foam::radiation::laserDTRM::Ru
virtual tmp< DimensionedField< scalar, volMesh > > Ru() const
Source term component (constant)
radiation
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::radiation::laserDTRM::~laserDTRM
virtual ~laserDTRM()=default
Destructor.
Foam::radiation::laserDTRM::Rp
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::radiation::laserDTRM::pdUniform
Definition: laserDTRM.H:91
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::autoPtr< reflectionModel >
Foam::radiation::laserDTRM::nBands
virtual label nBands() const
Number of bands for this radiation model.
Foam::radiation::radiationModel
Top level model for radiation modelling.
Definition: radiationModel.H:75
Foam::Cloud
Base cloud calls templated on particle type.
Definition: Cloud.H:55
Foam::radiation::laserDTRM::read
bool read()
Read radiation properties dictionary.
Foam::radiation::laserDTRM
Discrete Tray Radiation Method for collimated radiation flux. At the moment the particles are injecte...
Definition: laserDTRM.H:78
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::radiation::laserDTRM::pdGaussian
Definition: laserDTRM.H:89
radiationModel.H
labelField.H
Foam::radiation::laserDTRM::TypeName
TypeName("laserDTRM")
Runtime type information.
Enum.H