File: cs_lagrangian_particle_tracking_module.h

package info (click to toggle)
code-saturne 7.0.2%2Brepack-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 62,868 kB
  • sloc: ansic: 395,271; f90: 100,755; python: 86,746; cpp: 6,227; makefile: 4,247; xml: 2,389; sh: 1,091; javascript: 69
file content (324 lines) | stat: -rw-r--r-- 11,339 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
/*============================================================================
 * Code_Saturne documentation page
 *============================================================================*/

/*
  This file is part of Code_Saturne, a general-purpose CFD tool.

  Copyright (C) 1998-2021 EDF S.A.

  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later
  version.

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
  Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/*-----------------------------------------------------------------------------*/

/*!
  \page cs_lagrangian_particle_tracking_module Parameters settings for lagrangian module

  \section cs_user_lagr_module_intro  Introduction

  This page gives some examples of settings for the stochastic lagrangian module.

  \section cs_user_lagr_module_h  Lagrangian module

  Particle tracking mode settings:

  \snippet cs_user_lagr_model.c particle_tracking_mode

  In case of restart

  \snippet cs_user_lagr_model.c particle_tracking_restart

  Specific models

  \snippet cs_user_lagr_model.c particle_tracking_specific_models

  Example of coal fouling

  \snippet cs_user_lagr_model.c coal_fouling_example

  Calculation features for the dispersed phases

  \snippet cs_user_lagr_model.c dispersed_phases

  Example of volume statistics

  \snippet cs_user_lagr_model.c V_statistics

  Options concerning the numerical treatment of the dispersed phase

  \snippet cs_user_lagr_model.c dispersed_phases_treatment

  Options concerning the treatment of specific forces

  \snippet cs_user_lagr_model.c specific_forces_treatment

  Brownian motion:

  \snippet cs_user_lagr_model.c Brownian_motion_activation

  Deposition model:

  \snippet cs_user_lagr_model.c deposition_model_activation

  Roughness resuspension model

  \snippet cs_user_lagr_model.c roughness_resuspension_model_activation

  Clogging model

  \snippet cs_user_lagr_model.c clogging_model_activation

  Deposit influence

  \snippet cs_user_lagr_model.c deposit_influence_activation

  Consolidation model:

  \snippet cs_user_lagr_model.c consolidation_model_activation

  Precipitation disolution model

  \snippet cs_user_lagr_model.c precipitation_disolution_model_activation

  Boundary statistics

  \snippet cs_user_lagr_model.c boundary_statistics

  \page cs_lagrangian_particle_tracking_bc User boundary condition definition for the Lagrangian model

  \section cs_user_lagr_boundary_conditions_h  Boundary conditions

  Lagrangian boundary conditions are based on boundary zone
  (\ref cs_boundary_zone_t) definitions. Additional information may be
  provided for Lagrangian boundary types and injections.

  As usual, definitions may be created using the GUI and extended
  with user functions.

  Access to the Lagrangian boundary conditions structure,
  which is necessary to most of the following examples, may be done as
  follows:

  \snippet cs_user_lagr_boundary_conditions.c lagr_bc_variables

  \subsection cs_user_lagr_boundary_conditions_h_zones  Boundary zones

  In this example, we assign rebound conditions to all boundary zones,
  except for an inlet and outlet type to specified zones.
  The type assigned is an integer based on the \ref cs_lagr_bc_type_t
  enumerator type.

  \snippet cs_user_lagr_boundary_conditions.c lagr_bc_define_type_1

  \subsection cs_user_lagr_boundary_conditions_h_injection  Injection sets

  In the following example, a first injection set for an inlet zone is defined.
  Note that newly injected particles may also be modified using the
  \ref cs_user_lagr_in function.

  \snippet cs_user_lagr_boundary_conditions.c lagr_bc_define_injection_1

  In the next example, a profile is assigned to the second injection set
  of an inlet zone (it is assumed this et was previously defined either
  through the GUI or user function).

  This requires first defining a profile definition function, matching
  the profile of \ref cs_lagr_injection_profile_compute_t.
  An example based on experimental profiles is given here:

  \snippet cs_user_lagr_boundary_conditions.c lagr_bc_profile_func_2

  Assigning the profile to the injection set simply requires
  assigning the function to the pointer in the injection set structure:

  \snippet cs_user_lagr_boundary_conditions.c lagr_bc_define_injection_2

  An optional user-defined input function may also be associated.

  \subsection cs_user_lagr_boundary_conditions_h_interactions  Boundary-particle interactions

  It is also possible to decide of the behavior of particle when they
  encounter a boundary (this boundary has to be of type \ref CS_LAGR_BC_USER).

  In the following example, the particle is simply deposited and marked for
  elimination:

  \snippet cs_user_lagr_boundary_conditions.c update

  \section cs_user_lagr_volume_conditions_h  Volume conditions

  Lagrangian volume conditions are based on volume zone
  (\ref cs_volume_zone_t) definitions. Additional information may be
  provided for Lagrangian injections.

  As usual, definitions may be created using the GUI and extended
  with user functions.

  Access to the Lagrangian volume conditions structure,
  which is necessary to most of the following examples, may be done as
  follows:

  \snippet cs_user_lagr_volume_conditions.c lagr_vol_cond_variables

  \subsection cs_user_lagr_volume_conditions_h_injection  Injection sets

  In the following example, we inject 1 particle set at each time step:
  \snippet cs_user_lagr_volume_conditions.c lagr_vol_define_injection_1

  \snippet cs_user_lagr_volume_conditions.c lagr_vol_define_injection_2
  In the following example, we inject 2 particle sets at computation
  initialization (i.e. at the first time step of a computation sequence
  in which the Lagrangian module is activated).
  Note that newly injected particles may also be modified using the
  \ref cs_user_lagr_in function.

  \snippet cs_user_lagr_volume_conditions.c lagr_vol_define_injection_2

  \subsection cs_user_lagr_volume_conditions_h_force  External force

  User definition of an external force field acting on the particles.

  It must be prescribed in every cell and be homogeneous to gravity (m/s^2)
  By default gravity and drag force are the only forces acting on the particles
  (the gravity components gx gy gz are assigned in the GUI or in usipsu)

  \snippet cs_user_lagr_particle.c lagr_ef

  \subsection cs_user_lagr_volume_conditions_h_imposed_motion Impose motion on a particle

  Impose the motion of a particle flagged CS_LAGR_PART_IMPOSED_MOTION by modifying the particle position and its velocity.

  \snippet cs_user_lagr_particle.c lagr_imposed_motion

  \subsection cs_user_lagr_volume_conditions_h_inj_particles Modification of newly injected particles

  User modification of newly injected particles.

  This function is called after the initialization of the new particles in
  order to modify them according to new particle profiles (injection
  profiles, position of the injection point, statistical weights,
  correction of the diameter if the standard-deviation option is activated).

  This function is called for each injection zone and set. Particles
  with ids between  pset->n_particles and  n_elts are initialized
  but may be modidied by this function.

  \snippet cs_user_lagr_particle.c lagr_inj

  Here is another example of the modification of newly injected particles:

  \snippet cs_user_lagr_particle-coal.c lagr_inj_example_coal

  \page cs_lagrangian_particle_tracking_physical_properties Particle relaxation time and thermal relaxtion for the Lagrangian model

  \section cs_user_lagr_module_time_relaxation Calculation of the particle relaxation time

  Modification of the calculation of the particle relaxation time
  with respect to the chosen formulation for the drag coefficient

  This function is called in a loop on the particles, so be careful to avoid too costly operations.

  \f$ \tau_c = \frac{m_p{C_p}_p}{PId_p^2h_e} \f$

  \f$ \tau_c \f$ : Thermal relaxation time (value to be computed)

  \f$ m_p \f$    : Particle mass

  \f$ {C_p}_p \f$  : Particle specific heat

  d_p    : Particle diameter

  h_e    : Coefficient of thermal exchange

  The coefficient of thermal exchange is calculated from a Nusselt number,
  itself evaluated by a correlation (Ranz-Marshall by default)

  \f$ \nu =  \frac{h_ed_p}{\lambda} = 2 + 0.55{\Re_e}_p^{0.5}P_{rt}^{0.33} \f$

  \f$ \lambda \f$ : Thermal conductivity of the carrier field

  \f$ {\Re_e}_p \f$  : Particle Reynolds number

  P_{rt}    : Prandtl number


  In the next example we compute the relaxation time with two different formulations
  of the drag coefficient:

  \snippet cs_user_lagr_particle.c lagr_particle_relax_time

  \section cs_user_lagr_module_thermal_relaxation Computation of the thermal relaxation time of the particles

  Modification of the computation of the thermal relaxation time
  of the particles with respect to the chosen formulation of
  the Nusselt number.

  This function is called in a loop on the particles, so be careful to avoid too costly operations.

  \snippet cs_user_lagr_particle.c lagr_thermal_relax_time


  \page cs_user_lagr_extra_operations User extra operations for the Lagrangian module

  \section cs_user_lagr_extra_operations_intro Introduction

  This page provides an example that may be used or adapted to perform extra or
  advanced extra-operations within the Lagrangian module.

  \section cs_user_lagr_extra_operations_example Example

  First we initialize some variables:

  \snippet cs_user_lagr_particle.c lagr_init

  In the next example we compute the particle mass flow rate on 4 planes

  \snippet cs_user_lagr_particle.c lagr_example

  \page cs_user_lagr_sde SDE within the Lagrangian model

  \section cs_user_lagr_sde_intro Introduction

  User integration of the SDE for the user-defined variables.

  The variables are constant by default. The SDE must be of the form:

  \f[
  \frac{dT}{dt}=\frac{T - PIP}{Tca}
  \f]

  T:   particle attribute representing the variable

  Tca: characteristic time for the sde to be prescribed in the array auxl1

  PIP: coefficient of the SDE (pseudo RHS) to be prescribed in the array auxl2.

  If the chosen scheme is first order (nordre=1) then, at the first
  and only call pip is expressed as a function of the quantities of
  the previous time step (contained in the particle data).

  If the chosen scheme is second order (nordre=2)
  then, at the first call (nor=1) pip is expressed as a function of
  the quantities of the previous time step, and at the second passage
  (nor=2) pip is expressed as a function of the quantities of the
  current time step.

  \section cs_user_lagr_sde_example Example

  Example of the integration of the SDE (Stochastic Differential Equation).

  \snippet cs_user_lagr_particle.c lagr_SDE
*/