File: cs_lagr.h

package info (click to toggle)
code-saturne 4.3.3%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 77,992 kB
  • sloc: ansic: 281,257; f90: 122,305; python: 56,490; makefile: 3,915; xml: 3,285; cpp: 3,183; sh: 1,139; lex: 176; yacc: 101; sed: 16
file content (1549 lines) | stat: -rw-r--r-- 49,885 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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
#ifndef __CS_LAGR_H__
#define __CS_LAGR_H__

/*============================================================================
 * Functions and types for the Lagrangian module
 *============================================================================*/

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

  Copyright (C) 1998-2016 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.
*/

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

#include "cs_defs.h"

#include "assert.h"
#include "cs_base.h"
#include "cs_field.h"

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

BEGIN_C_DECLS

/*============================================================================
 * Type definitions
 *============================================================================*/

/*! Lagrangian boundary condition types */

typedef enum {

  CS_LAGR_INLET = 1,
  CS_LAGR_OUTLET = 2,
  CS_LAGR_REBOUND = 3,
  CS_LAGR_DEPO1 = 4,
  CS_LAGR_DEPO2 = 5,
  CS_LAGR_FOULING = 7,
  CS_LAGR_JBORD1 = 8,
  CS_LAGR_JBORD2 = 9,
  CS_LAGR_JBORD3 = 10,
  CS_LAGR_JBORD4 = 11,
  CS_LAGR_JBORD5 = 12,
  CS_LAGR_DEPO_DLVO = 13,
  CS_LAGR_SYM = 14

} cs_lagr_bc_type_t;

/*! Lagrangian deposition state */

typedef enum {
  CS_LAGR_PART_IN_FLOW        = 0,
  CS_LAGR_PART_DEPOSITED      = 1,
  CS_LAGR_PART_ROLLING        = 2,
  CS_LAGR_PART_NO_MOTION      = 10,
  CS_LAGR_PART_IMPOSED_MOTION = 11
} cs_lagr_deposition_state_t;

/*! Fxed maximum sizes */
/*---------------------*/

typedef struct {

  int nusbrd;  /*!< maximum number of additional user
                    particle/boundary interactions */

  int nflagm;  /*!< maximum number of boundary zones */
  int ndlaim;  /*!< maximum number of particle integer data */

  int nvgaus; /*!< number of gaussian random variables by particle */
  int nbrgau;

  int ncharm2; /*!< maximum number of coal classes */
  int nlayer;  /*!< maximal number of coal layers */

} cs_lagr_const_dim_t;

/*! General dimensions */
/*---------------------*/

typedef struct {

  int   ntersl;  /*!< number of source terms for return coupling */
  int   nvisbr;  /*!< number of volume statistics */

} cs_lagr_dim_t;

/*! Time and coupling scheme for the Lagrangian module */
/*-----------------------------------------------------*/

typedef struct {

  /*! Lagrangian module status.
     the different values correspond to the following coupling:
     - 0: Lagrangian module off
     - 1: Lagrangian two-phase flow in one-way coupling (no influence of
          the particles on the continuous phase)
     - 2 Lagrangian two-phase flow with two-way coupling (influence of
         the particles on the dynamics of the continuous phase). Dynamics,
         temperature and mass may be coupled independently.
     - 3 Lagrangian two-phase flow on frozen continuous phase. This option
         only only be used in case of a calculation restart. All the
         Eulerian fields are frozen (including the scalar fields).
         This option automatically implies \ref iccvfg = 1 */
  int  iilagr;

  /*  indicates the steady (=1) or unsteady (=0) state of the
      continuous phase flow
      in particular, \ref isttio = 1 is needed in order to:
      calculate steady statistics in the volume or at the boundaries
      (starting respectively from the iterations \ref nstist)
      and calculate time-averaged two-way coupling source terms (from the
      time step \ref nstits).
      Useful if \ref iilagr=1 or \ref iilagr=2 (if \ref iilagr=3,
      then \ref isttio=1 automatically) */
  int  isttio;

  /*! activation (=1) or not (=0) of a Lagrangian calculation restart.
    The calculation restart file read when this option is activated
    only contains the data related to the particles (see also \ref isuist)
    the global calculation must also be a restart calculation
  */
  int  isuila;

  /*! trajectory algorithm order in time */
  int  t_order;

  /*! activates (>0) or not (=0) the complete turbulent dispersion model.
    When \ref modcpl is strictly positive, its value is interpreted as the
    absolute Lagrangian time step number (including restarts) after which the
    complete model is applied.
    Since the complete model uses volume statistics, \ref modcpl must
    either be 0 or be larger than \ref idstnt. */
  int     modcpl;

  /*!  direction (1=x, 2=y, 3=z) of the complete model.
    it corresponds to the main directions of the flow.
    Useful if \ref modcpl > 0 */
  int     idirla;

  /*!  activation (=1) or not (=0) of the particle turbulent dispersion.
    The turbulent dispersion is compatible only with the RANS turbulent models
    (\f$k-\varepsilon\f$, \f$R_{ij}-\varepsilon\f$, v2f or \f$k-\omega\f$).
    (\ref iturb=20, 21, 30, 31, 50 or 60). */
  int     idistu;

  /*! \ref idiffl=1 suppresses the crossing trajectory effect, making
    turbulent dispersion for the particles identical to the turbulent
    diffusion of fluid particles.
    Useful if \ref idistu=1 */
  int     idiffl;

  /*! activation (=1) or not (=0) of the solution of a Poisson's equation for
    the correction of the particle instantaneous velocities
    (in order to obtain a null divergence).
    this option is not validated and reserved to the development team.
    Do not change the default value */
  int     ilapoi;

  /*! activation (=1) or not (=0) of the added-mass term.
   \f[ \DP{u_p} = - \dfrac{1}{\rho_p} \grad P + \dfrac{u_s-u_p}{\tau_p}
         + g
         +1/2 C_A \dfrac{\rho_f}{\rho_p} \left( \dfrac{Du}{Dt}-\DP{u_p} \right)
   \f]
   and
    \f[ \rho_f \dfrac{Du}{Dt} \simeq  - \grad P + \rho_f g \f]
   with \f$ C_A = 1\f$. Then
    \f[ \DP{u_p} = - \dfrac{1}{\rho_p} \dfrac{1+C_A/2}
                                        {1+C_A/2\dfrac{\rho_f}{\rho_p}} \grad P
            + \dfrac{u_s-u_p}{\widetilde{\tau}_p}
            + g
    \f]
   with
   \f[ \widetilde{\tau_p} = (1 + C_A /2 \dfrac{\rho_f}{\rho_p}) \tau_p \f] */
  int     iadded_mass;

  /*! Added-mass constant (\f$ C_A = 1\f$) */
  cs_real_t        added_mass_const;

} cs_lagr_time_scheme_t;

/*! Main physical model parameters for the Lagrangian module */
/*-----------------------------------------------------------*/

typedef struct {

  /*! activates (>0) or deactivates (=0) the physical models associated to the
    particles:
    - 1: allows to associate with the particles evolution equations on
         their temperature (in degrees Celsius), their diameter and
         their mass
    - = 2: the particles are pulverised coal particles.
    Evolution equations on temperature (in degree Celsius), mass of
    reactive coal, mass of char and diameter of the shrinking core are
    associated with the particles. This option is available only if the
    continuous phase represents a pulverised coal flame. */
  int  physical_model;  /* FIXME: => enum: CS_LAGR_PHYS_STD,
                                           CS_LAGR_PHYS_COAL,
                                           CS_LAGR_PHYS_HEAT... */
  int  n_temperature_layers;

  int  deposition;
  int  dlvo;

  /*! - 0: no DLVO conditions with roughness surface
      - 1: DLVO conditions with roughness surface */
  int  roughness;

  /*!- 0: no resuspension model
     - 1: resuspension model */
  int  resuspension;

  /* - 0: no clogging model
     - 1: clogging model */
  int  clogging;

  int  precipitation;
  int  fouling;

  int  n_stat_classes;
  int  n_user_variables;

} cs_lagr_model_t;

/* ========================================================================== */

typedef struct {

  /*! total number of injected particles, since the beginning,
    including calculation restarts */
  cs_gnum_t   n_g_cumulative_total;

  /*! total number of failed particles, since the beginning,
    including calculation restarts */
  cs_gnum_t   n_g_cumulative_failed;

  /*! total number of particles */
  cs_gnum_t   n_g_total;

  /*! total number of particles*/
  cs_gnum_t   n_g_new;

  /*! number of exited particles*/
  cs_gnum_t   n_g_exit;

  /*! number of deposited particles */
  cs_gnum_t   n_g_deposited;

  /*! number of fouling particles */
  cs_gnum_t   n_g_fouling;

  /*! number of re-entrained particles*/
  cs_gnum_t   n_g_resuspended;

  /*! total number of failed particles */
  cs_gnum_t   n_g_failed;

  /*! total weight of particles*/
  cs_real_t   w_total;

  /*! weight of new particles*/
  cs_real_t   w_new;

  /*! weight of exited particles*/
  cs_real_t   w_exit;

  /*! weight of deposited particles */
  cs_real_t   w_deposited;

  /*! number of fouling particles */
  cs_real_t   w_fouling;

  /*! weight of resuspended particles */
  cs_real_t   w_resuspended;

} cs_lagr_particle_counter_t;

/* ========================================================================== */

typedef struct {

  /*  activation (=1) or not (=0) of an evolution equation on the particle
      temperature (in degrees Celsius).
      Useful if \ref physical_model=1 and if there is a thermal scalar associated with
      the continuous phase
  */
  int   itpvar;

  /*  activation (=1) or not (=0) of an evolution equation on the particle
      diameter. Useful if \ref physical_model = 1
  */
  int   idpvar;

  /*  activation (=1) or not (=0) of an evolution equation on the particle mass
      Useful if \ref physical_model = 1
  */
  int   impvar;

  /*  initialization temperature (in degree Celsius) for the particles already
      present in the calculation domain when an evolution equation on
      the particle temperature is activated during a calculation (\ref physical_model =
      1 and \ref itpvar = 1).
      Useful if \ref isuila = 1 and \ref itpvar = 0 in the previous calculation
  */
  cs_real_t          tpart;

  /* initialization value for the specific heat (\f$ J.kg^{-1}.K^{-1} \f$)
     of the particles already present
     in the calculation domain when an evolution equation
     on the particle temperature is activated during a calculation
     (\ref physical_model = 1 and \ref itpvar = 1).
     Useful if \ref isuila = 1 and \ref itpvar = 0 in the previous calculation
  */
  cs_real_t          cppart;

} cs_lagr_specific_physics_t;

/* ========================================================================== */

typedef struct {

  /* - 0: no resuspension model
     - 1: resuspension model */
  int   ireent;

  /*  - 0: no head losses calculation for influence of the deposit on the flow
      - 1: head losses calculation for influence of the deposit on the flow */
  int   iflow;

  /* Parameters of the particle resuspension model*/
  cs_real_t          espasg;
  cs_real_t          denasp;
  cs_real_t          modyeq;
  cs_real_t          rayasp;
  cs_real_t          rayasg;

} cs_lagr_reentrained_model_t;

/* ========================================================================== */

typedef struct {

  /* number of particle classes*/
  int   nbrclas;
  /* diameter of particles formed by precipitation*/
  cs_real_t          diameter;
  /* density of particles formed by precipitation*/
  cs_real_t          rho;
  /* number of precipitated particles */
  int   *nbprec;
  /*  */
  cs_real_t          *solub;
  /* number of precipitated particles */
  cs_real_t          *mp_diss;

} cs_lagr_precipitation_model_t;

/* ========================================================================== */

typedef struct {

  /* Parameter of the particle clogging model */
  cs_real_t          jamlim;
  cs_real_t          mporos;
  cs_real_t          csthpp;

} cs_lagr_clogging_model_t;

/* ========================================================================== */

typedef struct {

  /* current step id (for 2nd order scheme) */
  int    nor;

  /* duration of a Lagrangian iteration */
  cs_real_t          dtp;

  /* physical time of the Lagrangian simulation */
  cs_real_t          ttclag;

} cs_lagr_time_step_t;

/* ========================================================================== */

typedef struct {

  /*! number of particles per class and per boundary zone */
  cs_lnum_t  nb_part;

  /*! injection frequency
    (if < 0, particles are introduced only at first iteration) */
  int        injection_frequency;

  /*! velocity condition type:
    - -1 imposed fluid velocity (from cell velocity)
    -  0 imposed fluid velocity along the normal of the boundary face, with \ref iuno norm.
    -  1 imposed velocity: \ref iupt \ref ivpt \ref iwpt must be given.
    -  2 velocity profile given by user.*/
  int        velocity_profile;

  /*! distribution profile:
    - 1 uniform distribution,
    - 2 presence rate profile given by user.*/
  int        distribution_profile;

  /*! temperature profile:
    - 1 constant temperature profile
    - 2 temperature profile given by the user */
  int        temperature_profile;

  /*! type of user profiles:
    - 1: flat diameter profile
    - 2: user profile to be defined in cs_user_lagr_boundary_conditions */
  int        diameter_profile;

  /*! type of coal initial composition (if \ref physical_model=2)
    - 1: coal initial composition is given by DP_FCP
    - 0: user profile to be defined cs_user_lagr_boundary_conditions */
  int        coal_profile;

  /*! coal number of the particle (if \ref physical_model=2)*/
  int        coal_number;

  /*! statistics group number */
  int        cluster;

  /*! particle velocity magnitude */
  cs_real_t  velocity_magnitude;

  /*! particle velocity components by class and zone */
  cs_real_t  velocity[3];

  /*! particle temperature (size: n_layer) */
  cs_real_t  *temperature;

  /*! particle diameter */
  cs_real_t   diameter;

  /*! particle diameter variance */
  cs_real_t   diameter_variance;

  /*! density */
  cs_real_t   density;

  /*! fouling index */
  cs_real_t   foul_index;

  /*! particle specific heat */
  cs_real_t   cp;

  /*! particle weight */
  cs_real_t   stat_weight;

  /*! flow rate */
  cs_real_t   flow_rate;

  /*! particle emissivity */
  cs_real_t   emissivity;

  /*! water mass fraction in coal particles */
  cs_real_t   water_mass_fraction;

  /*! active coal mass fraction in coal particles */
  cs_real_t  *coal_mass_fraction;

  /*! coke mass fraction in coal particles */
  cs_real_t  *coke_mass_fraction;

  /*! diameter of shrinking core */
  cs_real_t   shrinking_diameter;

  /*! initial particle diameter (for coal particles) */
  cs_real_t   initial_diameter;

  /*! coke density after pyrolysis (for coal particles) */
  cs_real_t  *coke_density;

} cs_lagr_zone_class_data_t;

/* ========================================================================== */

/* ========================================================================== */

typedef struct {

  /*! activation (=1) or not (=0) of the two-way coupling on the dynamics
    of the continuous phase.
    Useful if \ref iilagr = 2 and \ref iccvfg = 0 */
  int  ltsdyn;

  /*! activation (=1) or not (=0) of the two-way coupling on the mass.
    Useful if \ref iilagr = 2, \ref physical_model = 1 and \ref impvar = 1 */
  int  ltsmas;

  /*  if \ref physical_model = 1 and \ref itpvar = 1, \ref ltsthe
   activates (=1) or not (=0) the two-way coupling on temperature.
   if \ref physical_model = 2, \ref ltsthe activates (=1) or not (=0) the
   two-way coupling on the eulerian variables related to pulverised
   coal combustion.
   Useful if \ref iilagr = 2 */
  int  ltsthe;

  /*! explicit source term for the continuous phase X velocity */
  int  itsvx;

  /*! explicit source term for the continuous phase Y velocity */
  int  itsvy;

  /*! explicit source term for the continuous phase Z velocity */
  int  itsvz;

  /*! implicit source term for the continuous phase velocity and
    for the turbulent energy if the \f$k-\varepsilon\f$ model is used */
  int  itsli;

  /*  explicit source term for the turbulent dissipation and the
   turbulent energy if the \f$k-\varepsilon\f$ turbulence model is used
   for the continuous phase */
  int  itske;

  /*! source term for the Reynolds stress
    and the turbulent dissipation if the \f$R_{ij}-\varepsilon\f$
    turbulence model is used for the continuous phase */
  int  itsr11;

  /*! source term for the Reynolds stress
    and the turbulent dissipation if the \f$R_{ij}-\varepsilon\f$
    turbulence model is used for the continuous phase */
  int  itsr12;

  /*! source term for the Reynolds stress
    and the turbulent dissipation if the \f$R_{ij}-\varepsilon\f$
    turbulence model is used for the continuous phase */
  int  itsr13;

  /*! source term for the Reynolds stress
    and the turbulent dissipation if the \f$R_{ij}-\varepsilon\f$
    turbulence model is used for the continuous phase */
  int  itsr22;

  /*! source term for the Reynolds stress
    and the turbulent dissipation if the \f$R_{ij}-\varepsilon\f$
    turbulence model is used for the continuous phase */
  int  itsr23;

  /*! source term for the Reynolds stress
   and the turbulent dissipation if the \f$R_{ij}-\varepsilon\f$
   turbulence model is used for the continuous phase */
  int  itsr33;

  /*! explicit thermal source term for the thermal scalar of
    the continuous phase */
  int  itste;

  /*! implicit thermal source term for the thermal scalar of
    the continuous phase */
  int  itsti;

  /*! mass source term */
  int  itsmas;

  /*  source term for the light volatile matters */
//TODO
  int  *itsmv1;//ncharm2

  /*  source term for the heavy volatile matters */
//TODO
  int  *itsmv2;//ncharm2

  /*! source term for the carbon released during heterogeneous combustion */
  int  itsco;

  /*! variance of the air scalar */
  int  itsfp4;

  /*! number of absolute time steps (including the restarts)
    after which a time-average of the two-way coupling source terms is
    calculated.
    indeed, if the flow is steady (\ref isttio=1), the average quantities
    that appear in the two-way coupling source terms can be calculated over
    different time steps, in order to get a better precision.
    if the number of absolute time steps is strictly inferior to
    \ref nstits, the code considers that the flow has not yet reached its
    steady state (transition period) and the averages appearing in the source
    terms are reinitialized at each time step, as it is the case for unsteady
    flows (\ref isttio=0).
    Useful if \ref iilagr = 2 and \ref isttio = 1 */
  int  nstits;

  /*! number of time steps for source terms accumulations */
  int  npts;

  /*! number of cells, whose vulumetric rate DODO
      (concentration ?)is greather than 0.8 */
  int  ntxerr;

  /*! maximum volumetric concentration reached */
  cs_real_t      vmax;

  /*! maximum massic concentration reached */
  cs_real_t      tmamax;

  /*! source term values */
  cs_real_t     *st_val;

} cs_lagr_source_terms_t;

/* ========================================================================== */

/* Structures useful to deal with boundary conditions
   For USLABO => _boundary_track_treatment */

typedef struct {

  int         n_b_zones;       /* NFRLAG */
  int         n_b_max_zones;

  cs_lnum_t  *b_zone_id;       /* ILFLAG */
  int        *b_zone_classes;  /* IUSNCL */
  int        *b_zone_natures;  /* IUSCLB */

  int        *b_face_zone_id;  /* IFRLAG */

  bool        steady_bndy_conditions;

  cs_real_t  *particle_flow_rate; /* DEBLAG -> post-processing use */

} cs_lagr_bdy_condition_t;

/* Structures useful to deal with iternal conditions */

typedef struct {

  int  *i_face_zone_id;

} cs_lagr_internal_condition_t;

/* ========================================================================== */

typedef struct {

  /*  activates (=1) or not (=0) the option of coal particle fouling.
   It then is necessary to specify the domain boundaries
   on which fouling may take place. Useful if \ref physical_model = 2*/
  int  iencra;

  /*  encrustation data*/
  int  npencr;
  // TODO cf particles->n_part_fou in cs_lagr_tracking.c

  /*  encrustation data*/
//TODO
  cs_real_t  *enc1;//ncharm2
  /*  encrustation data*/
//TODO
  cs_real_t  *enc2;//ncharm2

  /*  limit temperature (in degree Celsius) below which the coal particles do
   not cause any fouling (if the fouling model is activated).
   Useful if \ref physical_model = 2 and \ref iencra = 1*/
//TODO
  cs_real_t  *tprenc;//ncharm2

  /*  ash critical viscosity in \f$ kg.m^{-1}.s^{-1} \f$, in the fouling model
   cf J.D. Watt et T. Fereday (J.Inst.Fuel, Vol.42-p99).
   Useful if \ref physical_model = 2 and \ref iencra = 1*/
//TODO
  cs_real_t  *visref;//ncharm2

  /*  encrustation data */
  cs_real_t  dnpenc;

} cs_lagr_encrustation_t;

/* ========================================================================== */

typedef struct {

  /*! Hamaker constant for the particle/fluid/substrate system */
  cs_real_t  cstham;

  /*! Retardation wavelength for VDW forces
      for the particle/fluid/substrate system */
  cs_real_t  lambda_vdw;

  /*! Dielectric constant of the fluid */
  cs_real_t  epseau;

  /*! Electrokinetic potential of the first solid - particle */
  cs_real_t  phi_p;

  /*! Electrokinetic potential of the second solid - surface */
  cs_real_t  phi_s;

  /*! Valence of ions in the solution (used for EDL forces) */
  cs_real_t  valen;

  /*! Ionic force */
  cs_real_t  fion;

} cs_lagr_physico_chemical_t;

/* ========================================================================== */

typedef struct {

  /* brownnian motion activation */
  int  lamvbr;

} cs_lagr_brownian_t;

/* ========================================================================== */

typedef struct {

  /*! number of additional user data to record for the calculation
    of additional boundary statistics in \ref bound_stat.
    Useful if \ref iensi3=1 */
  int  nusbor;

  /*! number of iterations during which steady boundary statistics have
    been accumulated.
    Useful if \ref iensi3=1, \ref isttio=1 and \ref nstist inferior
    or equal to the current time step.
    \ref npstf is initialized and updated automatically by the code,
    its value is not to be modified by the user */
  int  npstf;

  /*! number of iterations during which boundary statistics have
    been calculated
    (the potential iterations during which unsteady
    statistics have been calculated are counted in \ref npstft).
    Useful if \ref iensi3=1.
    \ref npstft is initialized and updated automatically by the code,
    its value is not to be modified by the user */
  int  npstft;

  /*! activation (=1) or not (=0) of the recording of the number of
    particle/boundary interactions, and of the calculation of the associated
    boundary statistics.
    \ref inbrbd = 1 is a compulsory condition to use the particulate average
    \ref imoybr = 2.
    Useful if \ref iensi3=1 */
  int  inbrbd;

  /*!  activation (=1) or not (=0) of the recording of the particulate mass flow
    related to the particle/boundary interactions, and of the calculation of
    the associated boundary statistics.
    \ref inbrbd = 1 is a compulsory condition to use \ref iflmbd=1.
    Useful if \ref iensi3=1 and \ref inbrbd=1 */
  int  iflmbd;

  /*!  activation (=1) or not (=0) of the recording of the angle between a
    particle trajectory and a boundary face involved in a particle/boundary
    interaction, and of the calculation of the associated boundary statistics.
    Useful if \ref iensi3=1 */
  int  iangbd;

  /*!  activation (=1) or not (=0) of the recording of the velocity of a particle
    involved in a particle/boundary interaction, and of the calculation of
    the associated boundary statistics.
    Useful if \ref iensi3=1 */
  int  ivitbd;

  /*!  activation (=1) or not (=0) of the recording of clogging parameters
    involved in a particle/boundary interaction, and of the calculation of
    the associated boundary statistics.
    Useful if \ref iensi3=1 */
  int  iclgst;

  /*! flag for number of recorded particle/boundary interactions with fouling */
  int  iencnbbd;

  /*! flag for mass of fouled coal particles */
  int  iencmabd;

  /*! flag for diameter of fouled coal particles */
  int  iencdibd;

  /*! flag for coke fraction of fouled coal particles */
  int  iencckbd;

  /*!  id for number of particle/boundary interactions */
  int  inbr;

  /*!  id for particle mass flow at the boundary faces */
  int  iflm;

  /*!  id for mean interaction angle with the boundary faces */
  int  iang;

  /*!  id for mean interaction velocity with the boundary faces */
  int  ivit;

  /*!  id for number of resuspended particles */
  int  ires;

  /*!  id for mass flow of resuspended particles at the boundary faces */
  int  iflres;

  /*! flag for number of recorded particle/boundary interactions with fouling */
  int  iencnb;

  /*! id for mass of fouled coal particles */
  int  iencma;

  /*! id for diameter of fouled coal particles */
  int  iencdi;

  /*! id for coke fraction of fouled coal particles */
  int  iencck;

  /*!  supplementary user boundary statistics */
  int  *iusb;

  /*  the recordings in \ref bound_stat at every particle/boundary interaction are
      cumulated values (possibly reset to zero at every iteration in the
      unsteady case). They must therefore be divided by a quantity to
      get boundary statistics. The user can choose between two average types:
      - = 0: no average is applied to the recorded cumulated values.
      - = 1: a time-average is calculated. The cumulated value
             is divided by the physical duration in the case of steady
             averages (\ref isttio=1). The cumulated value is divided by the
             value of the last time step in the case of unsteady averages
             (\ref isttio=0), and also in the case of steady averages while the
             absolute iteration number is inferior to \ref nstist.
      - = 2: a particulate average is calculated. The cumulated value is divided
             by the number of particle/boundary interactions (in terms of
             statistical weight) recorded in \ref bound_stat "bound_stat"(nfabor,inbr).
             This average can only be calculated when \ref inbrbd=1.
             Only the cumulated value is recorded in the restart file.
             Useful if \ref iensi3=1 */
  int  *imoybr;

  /*! id for number of deposited particles */
  int  inclg;

  /*! id for particle deposition part */
  int  inclgt;

  /*! id for particle deposition time */
  int  iclogt;

  /*! id for particle consolidation height */
  int  iclogh;

  /*! id for particle surface coverage */
  int  iscovc;

  /* id for mean of particle deposition height */
  int  ihdepm;

  /* id for variance of particle deposition height */
  int  ihdepv;

  /* id for mean diameter of deposited particles */
  int  ihdiam;

  /* id for sum of deposited particle diameters */
  int  ihsum;

  /*!  if the recording of the boundary statistics is steady, \ref tstatp
    contains the cumulated physical duration of the recording of the boundary
    statistics.
    if the recording of the boundary statisticss is unsteady, then
    \ref tstat=dtp (it is the Lagrangian time step, because the
    statistics are reset to zero at every time step).
    Useful if \ref iensi3=1 */
  cs_real_t        tstatp;

  /*!  name of the boundary statistics, displayed in the log
    and the post-processing files.
    Useful if \ref iensi3=1.
    Warning: this name is also used to reference information in the restart
    file (\ref isuist =1). If the name of a variable is changed between two
    calculations, it will not be possible to read its value from the restart
    file */
  char           **nombrd;

} cs_lagr_boundary_interactions_t;

/* ========================================================================== */

typedef struct {

  /* \anchor iensi3
     activation (=1) or not (=0) of the recording of the particle/boundary
     interactions in  \ref bound_stat, and of the calculation of the
     statistics at the corresponding boundaries.
     By default, the statistics are unsteady (reset to zero at every
     time step). They may be steady if \ref isttio=1 (i.e.
     calculation of a cumulated value over time, and then calculation of an
     average over time or over the number of interactions with the boundary).*/
  int  iensi3;

  /* associates (=1) or not (=0) the variable "velocity of the locally
     undisturbed fluid flow field" with the output of particles or
     trajectories. */
  int  ivisv1;

  /* associates (=1) or not (=0) the variable "particle velocity"
     with the output of particles or trajectories. */
  int  ivisv2;

  /* associates (=1) or not (=0) the variable "residence time"
     with the output of particles or trajectories. */
  int  ivistp;

  /* associates (=1) or not (=0) the variable "particle diameter"
     with the output of particles or trajectories. */
  int  ivisdm;

  /* associates (=1) or not (=0) the variable "particle temperature"
     with the output of particles or trajectories. */
  int  iviste;

  /* associates (=1) or not (=0) the variable "particle mass"
     with the output of particles or trajectories. */
  int  ivismp;

  /* associates (=1) or not (=0) the variable "shrinking core diameter of
     the coal particles" with the output of particles or trajectories.
     useful only if \ref physical_model = 2 */
  int  ivisdk;

  /* associates (=1) or not (=0) the variable "mass of reactive coal of the
     coal particles" with the output of particles or trajectories.
     useful only if \ref physical_model = 2 */
  int  ivisch;

  /* associates (=1) or not (=0) the variable "mass of coal of the
     coal particles" with the output of particles or trajectories.
     useful only if \ref physical_model = 2 */
  int  ivisck;

  /*! TODO */
  int  iviswat;

} cs_lagr_visualization_t;

/* ========================================================================== */

typedef struct {

  /* Turbulence model */
  int iturb;
  int itytur;

  /* cpincl */
  int ncharb;

  /* ppppar */
  int ncharm;
  int nozppm;

  /* radiation */
  int iirayo;

  /* icp */
  int icp;

  /* diftl0 */
  cs_real_t diftl0;

  /* cmu */
  cs_real_t cmu;

  /* visls0 */
  cs_real_t visls0;

  /*****************
   * Useful fields *
   *****************/

  /* wall ustar */
  cs_real_t *uetbor;

  /* Fluid density */
  cs_field_t *cromf;

  /* Fluid pressure */
  cs_field_t *pressure;

  /* Fluid temparature */
  cs_field_t *scal_t;
  cs_field_t *temperature;
  cs_field_t *t_gaz;

  /* Fluid velocity */
  cs_field_t *vel;

  /* Fluid viscosity */
  cs_field_t *viscl;

  /* Fluid viscosity */
  cs_field_t *cpro_viscls;

  /* Fluid specific heat capacity */
  cs_field_t *cpro_cp;

  /* Radiat.       */
  cs_field_t *luminance;

  /* Combustion    */
  cs_field_t *x_oxyd;
  cs_field_t *x_eau;
  cs_field_t *x_m;

  /* Turbulence */
  /* Turbulent intensity */
  cs_field_t *cvar_k;

  /* Turbulent dissipation */
  cs_field_t *cvar_ep;

  /* Omega from k-omega SST model*/
  cs_field_t *cvar_omg;

  /* Reynolds stress component Rxx */
  cs_field_t *cvar_r11;
  /* Reynolds stress component Ryy */
  cs_field_t *cvar_r22;
  /* Reynolds stress component Rzz */
  cs_field_t *cvar_r33;

} cs_lagr_extra_module_t;

/* external data relative to coal combustion */

typedef struct {

  int         ih2o;   // cpincl
  int         io2;    // cpincl
  int         ico;    // cpincl

  int         iatc;   // ppthch
  cs_real_t   prefth; // ppthch
  cs_real_t   trefth; // ppthch

  int         natom;  // = 5;
  cs_real_t  *wmolat; // dim = natom

  int         ngazem; // = 20;
  cs_real_t  *wmole;  // ngazem
  int        *iym1;

  int         ncharm;  // cpincl
  cs_real_t  *a1ch;   // ncharm
  cs_real_t  *h02ch;
  cs_real_t  *e1ch;   //
  cs_real_t  *a2ch;   //
  cs_real_t  *e2ch;   //
  cs_real_t  *y1ch;   //
  cs_real_t  *y2ch;   //
  cs_real_t  *cp2ch;  //
  cs_real_t  *ahetch; //
  cs_real_t  *ehetch; //
  cs_real_t  *rho0ch; //
  cs_real_t  *xwatch; //
  cs_real_t  *xashch; //
  cs_real_t  *thcdch; //

} cs_lagr_coal_comb_t;

/*============================================================================
 * Global variables
 *============================================================================*/

/*! Fixed constants */

extern const cs_lagr_const_dim_t   *cs_glob_lagr_const_dim;

/*! General dimensions */

extern cs_lagr_dim_t           *cs_glob_lagr_dim;

/*! Time and Lagrangian-Eulerian coupling scheme */
extern cs_lagr_time_scheme_t   *cs_glob_lagr_time_scheme;

/*! Main Lagragian physical model parameters */
extern cs_lagr_model_t         *cs_glob_lagr_model;

/*! Read-only pointer to global particle counter */
extern const cs_lagr_particle_counter_t      *cs_glob_lagr_particle_counter;

/* Lagrangian log output every frequency_n time steps */

extern int cs_glob_lagr_log_frequency_n;

/* Statisics on borders*/
extern cs_real_t *bound_stat;

extern int cs_glob_lagr_nzone_max;
extern int cs_glob_lagr_nclass_max;

extern cs_lagr_specific_physics_t            *cs_glob_lagr_specific_physics;
extern cs_lagr_reentrained_model_t           *cs_glob_lagr_reentrained_model;
extern cs_lagr_precipitation_model_t         *cs_glob_lagr_precipitation_model;
extern cs_lagr_clogging_model_t              *cs_glob_lagr_clogging_model;
extern cs_lagr_time_step_t                   *cs_glob_lagr_time_step;
extern cs_lagr_source_terms_t                *cs_glob_lagr_source_terms;
extern cs_lagr_encrustation_t                *cs_glob_lagr_encrustation;
extern cs_lagr_physico_chemical_t            *cs_glob_lagr_physico_chemical;
extern cs_lagr_brownian_t                    *cs_glob_lagr_brownian;
extern cs_lagr_boundary_interactions_t       *cs_glob_lagr_boundary_interactions;

extern cs_lagr_extra_module_t                *cs_glob_lagr_extra_module;
extern cs_lagr_coal_comb_t                   *cs_glob_lagr_coal_comb;

extern cs_lagr_bdy_condition_t               *cs_glob_lagr_bdy_conditions;
extern cs_lagr_internal_condition_t          *cs_glob_lagr_internal_conditions;
extern cs_lagr_zone_class_data_t             *lagr_zone_class_data;

/* Unit normals and offsets of boundary faces */
extern cs_real_4_t   *cs_glob_lagr_b_u_normal;

/* Projection matrices for global to local coordinates on boundary faces */
extern cs_real_33_t  *cs_glob_lagr_b_face_proj;

/*============================================================================
 * Public function prototypes
 *============================================================================*/

/*----------------------------------------------------------------------------*/
/*!
 * \brief Provide access to class/boundary zone parameters structure
 *
 * \param[in]    iclass     particle class number
 * \param[in]    izone      boundary zone number
 *
 * \return
 *   pointer to particle class and boundary zone structure of parameters
 */
/* ----------------------------------------------------------------------------*/

cs_lagr_zone_class_data_t *
cs_lagr_get_zone_class_data(int  iclass,
                            int  izone);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set injection parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   number     pointer to number of particles to inject
 * \param[in]   freq       pointer to injection frequency
 * \param[in]   stat       pointer to statistical groups id
 *
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_injection(int  iclass,
                                 int  izone,
                                 int  number,
                                 int  freq,
                                 int  stat);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set temperature parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   profile    temperature profile
 * \param[in]   temp       pointer to temperature values
 * \param[in]   emissivity emissivity value
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_temperature(int         iclass,
                                   int         izone,
                                   int         profile,
                                   cs_real_t  *temp,
                                   cs_real_t   emissivity);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set temperature parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   cp         pointer to specific heat value
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_cp(int        iclass,
                          int        izone,
                          cs_real_t  cp);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set coal parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   profile    coal profile
 * \param[in]   number     coal number
 * \param[in]   temp       pointer to temperature array
 * \param[in]   coal_mf    pointer to coal mass fraction
 * \param[in]   coke_mf    pointer to coke mass fraction
 * \param[in]   coke_density  pointer to coke density after pyrolysis
 * \param[in]   water_mf   pointer to water mass fraction
 * \param[in]   shrink_diam  pointer to coke shrinking diameter
 * \param[in]   init_diam  pointer to initial particle diameter
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_coal(int         iclass,
                            int         izone,
                            int         profile,
                            int         number,
                            cs_real_t  *temp,
                            cs_real_t  *coal_mf,
                            cs_real_t  *coke_mf,
                            cs_real_t  *coke_density,
                            cs_real_t   water_mf,
                            cs_real_t   shrink_diam,
                            cs_real_t   init_diam);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set coal parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   profile    pointer to flag for flow and stat weight profile
 * \param[in]   weight     pointer to stat weight value
 * \param[in]   flow       pointer to mass flow rate value
 *
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_stat(int        iclass,
                            int        izone,
                            int        profile,
                            cs_real_t  weight,
                            cs_real_t  flow);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set diameter parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   profile    pointer to flag for diameter profile
 * \param[in]   diam       pointer to diameter value
 * \param[in]   diam_dev   pointer to diameter standard deviation value
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_diam(int        iclass,
                            int        izone,
                            int        profile,
                            cs_real_t  diam,
                            cs_real_t  diam_dev);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set density for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   density    pointer to density value
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_density(int        iclass,
                               int        izone,
                               cs_real_t  density);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set density for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   density    pointer to density value
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_foul_index(int        iclass,
                                  int        izone,
                                  cs_real_t  foul_index);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Set velocity parameters for a given class and boundary zone
 *
 * \param[in]   iclass     class number
 * \param[in]   izone      boundary zone number
 * \param[in]   profile    pointer to velocity profile
 * \param[in]   velocity   pointer to velocity values array
 */
/*----------------------------------------------------------------------------*/

void
cs_lagr_set_zone_class_velocity(int        iclass,
                                int        izone,
                                int        profile,
                                cs_real_t  velocity[]);

/*----------------------------------------------------------------------------
 * \brief Initialize Lagrangian module parameters for a given set of data
 *
 *
 *----------------------------------------------------------------------------*/

cs_lagr_zone_class_data_t *
cs_lagr_init_zone_class_new(int       iclass,
                            int       izone);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Get read/write pointer to global particle counter
 *
 * \return
 *   pointer to lagrangian particle counter structure
 */
/*----------------------------------------------------------------------------*/

cs_lagr_particle_counter_t *
cs_lagr_get_particle_counter(void);

/*----------------------------------------------------------------------------*/
/*!
  \brief Update global particle counter
 *
 * All fields handled in the local particle set are updated relative
 * to that data (using global sums).
 *
 * \return  pointer to lagrangian particle counter structure
 */
/*----------------------------------------------------------------------------*/

cs_lagr_particle_counter_t *
cs_lagr_update_particle_counter(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_particle_counter_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_specific_physics_t *
cs_get_lagr_specific_physics(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_reentrained_model_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_reentrained_model_t *
cs_get_lagr_reentrained_model(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_precipitation_model_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_precipitation_model_t *
cs_get_lagr_precipitation_model(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_clogging_model_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_clogging_model_t *
cs_get_lagr_clogging_model(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_time_step_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_time_step_t *
cs_get_lagr_time_step(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_source_terms_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_source_terms_t *
cs_get_lagr_source_terms(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_encrustation_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_encrustation_t *
cs_get_lagr_encrustation(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_physico_chemical_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_physico_chemical_t *
cs_get_lagr_physico_chemical(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_brownian_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_brownian_t *
cs_get_lagr_brownian(void);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Return pointer to the main internal conditions structure.
 *
 * \return
 *   pointer to current internal_contditions or NULL
 */
/*----------------------------------------------------------------------------*/

cs_lagr_internal_condition_t  *
cs_lagr_get_internal_conditions(void);

/*----------------------------------------------------------------------------*/
/*!
 * \brief Return pointer to the main boundary conditions structure.
 *
 * \return
 *   pointer to current bdy_conditions or NULL
 */
/*----------------------------------------------------------------------------*/

cs_lagr_bdy_condition_t *
cs_lagr_get_bdy_conditions(void);

/*----------------------------------------------------------------------------
 * Destroy finalize the global cs_lagr_bdy_condition_t structure.
 *----------------------------------------------------------------------------*/

void
cs_lagr_finalize_bdy_cond(void);

/*----------------------------------------------------------------------------
 * Destroy finalize the global cs_lagr_internal_condition_t structure.
 *----------------------------------------------------------------------------*/

void
cs_lagr_finalize_internal_cond(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_boundary_interactions_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_boundary_interactions_t *
cs_get_lagr_boundary_interactions(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_visualization_t
 *
 * needed to initialize structure with GUI
 *----------------------------------------------------------------------------*/

cs_lagr_visualization_t *
cs_get_lagr_visualization(void);

/*----------------------------------------------------------------------------
 * Provide access to cs_lagr_extra_module_t
 *
 *----------------------------------------------------------------------------*/

cs_lagr_extra_module_t *
cs_get_lagr_extra_module(void);

/*--------------------------------------------------------------------
 * Execute one time step of the Lagrangian model.
 *
 * This is the main function for that model.
 *
 *  parameters:
 *    itypfb <-- boundary face types
 *    dt     <-- time step (per cell)
 *-------------------------------------------------------------------- */

void
cs_lagr_solve_time_step(const int         itypfb[],
                        const cs_real_t  *dt);

/*----------------------------------------------------------------------------
 * Return pointers to lagrangian arrays
 *
 * This function is intended for use by Fortran wrappers.
 *
 * parameters:
 *   dim_bound_stat   --> dimensions for bound_stat pointer
 *   p_bound_stat     --> bound_stat pointer
 *----------------------------------------------------------------------------*/

void
cs_lagr_init_c_arrays(int          dim_cs_glob_lagr_source_terms[2],
                      cs_real_t  **p_cs_glob_lagr_source_terms);


/*----------------------------------------------------------------------------
 * Free lagrangian arrays
 *
 * This function is intended for use by Fortran wrappers.
 *----------------------------------------------------------------------------*/
void
cs_lagr_finalize(void);

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

END_C_DECLS

#endif /* __CS_LAGR_H__ */