~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/base/cs_gui_particles.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
/*============================================================================
29
 
 * Management of the GUI parameters file: particles tracking
30
 
 *============================================================================*/
31
 
 
32
 
#if defined(HAVE_CONFIG_H)
33
 
#include "cs_config.h"
34
 
#endif
35
 
 
36
 
/*----------------------------------------------------------------------------
37
 
 * Standard C library headers
38
 
 *----------------------------------------------------------------------------*/
39
 
 
40
 
#include <stdio.h>
41
 
#include <stdlib.h>
42
 
#include <string.h>
43
 
#include <assert.h>
44
 
 
45
 
/*----------------------------------------------------------------------------
46
 
 * BFT library headers
47
 
 *----------------------------------------------------------------------------*/
48
 
 
49
 
#include <bft_mem.h>
50
 
#include <bft_error.h>
51
 
#include <bft_printf.h>
52
 
 
53
 
/*----------------------------------------------------------------------------
54
 
 * Local headers
55
 
 *----------------------------------------------------------------------------*/
56
 
 
57
 
#include "cs_base.h"
58
 
#include "cs_gui.h"
59
 
#include "cs_gui_util.h"
60
 
#include "cs_gui_boundary_conditions.h"
61
 
 
62
 
/*----------------------------------------------------------------------------
63
 
 * Header for the current file
64
 
 *----------------------------------------------------------------------------*/
65
 
 
66
 
#include "cs_gui_particles.h"
67
 
 
68
 
/*----------------------------------------------------------------------------*/
69
 
 
70
 
BEGIN_C_DECLS
71
 
 
72
 
/*=============================================================================
73
 
 * Local Macro Definitions
74
 
 *============================================================================*/
75
 
 
76
 
/* debugging switch */
77
 
#define _XML_DEBUG_ 0
78
 
 
79
 
/*
80
 
  rcodcl[ k * dim1 *dim2 + j *dim1 + i]
81
 
  iuslag (iclas,izone,ijnbp)
82
 
  iuslag[ijnbp][izone][iclas]
83
 
  iuslag[ijnbp*nclagm*nflagm + izone*nclagm + iclas]
84
 
  iuslag[ijnbp*nclagm*nflagm + izone*nclagm + iclas]
85
 
 
86
 
  F77: IUSLAG(ICLAS, IZONE, I)
87
 
  C  : &iuslag[i][izone][iclas] = &iuslag[ i*(*nclagm)*(*nflagm) + izone*(*nclagm) + iclas]
88
 
*/
89
 
 
90
 
/* simplfied access for fortran arrays */
91
 
#define IUSLAG(I_,J_,K_) (*(iuslag +I_*(*nclagm)*(*nflagm) +J_*(*nclagm) +K_))
92
 
#define RUSLAG(I_,J_,K_) (*(ruslag +I_*(*nclagm)*(*nflagm) +J_*(*nclagm) +K_))
93
 
 
94
 
/*============================================================================
95
 
 * Local Structure Definitions
96
 
 *============================================================================*/
97
 
 
98
 
/*----------------------------------------------------------------------------
99
 
 * Structures associated to lagrangian particles definition
100
 
 *----------------------------------------------------------------------------*/
101
 
 
102
 
typedef struct {
103
 
  char       **label;             /* label for each boundary zone                    */
104
 
  char       **nature;            /* nature for each boundary zone                   */
105
 
  char       **p_nature;          /* specific nature of the boundary for particles   */
106
 
  int         *n_classes;         /* number of classes for each zone                 */
107
 
  int        **n_particles;       /* number of particles for each class              */
108
 
  int        **frequency;         /* frequency of injection for each class           */
109
 
  int        **statistical_groups;/* frequency of injection for each class           */
110
 
  double     **statistical_weight;/* number of real particles for numerical particles*/
111
 
  double     **mass_flow_rate;    /* mass flow rate of particles                     */
112
 
  double     **density;           /* density for each class                          */
113
 
  double     **diameter;          /* diameter for each class                         */
114
 
  double     **standard_deviation;/* standard deviation of diameter for each class   */
115
 
  double     **specific_heat;     /* specific heat for each class                    */
116
 
  double     **emissivity;        /* emissivity for each class                       */
117
 
#if defined(HAVE_MEI)
118
 
#if 0
119
 
  mei_tree_t **velocity;          /* formula for norm or mass flow rate of velocity  */
120
 
  mei_tree_t **direction;         /* formula for direction of velocity               */
121
 
#endif
122
 
#endif
123
 
} cs_particles_boundary_t;
124
 
 
125
 
/*----------------------------------------------------------------------------
126
 
 * Private global variables for the treatment
127
 
 * of NOMLAG, NOMLAV and NOMBRD (characters fortran arrays).
128
 
 *----------------------------------------------------------------------------*/
129
 
 
130
 
static int      _max_mean_vars = 0;
131
 
static int      _last_mean_var = 0;
132
 
static char  ** _array_mean_varname = NULL;
133
 
 
134
 
static int      _max_variance_vars = 0;
135
 
static int      _last_variance_var = 0;
136
 
static char  ** _array_variance_varname = NULL;
137
 
 
138
 
static int      _max_boundary_vars = 0;
139
 
static int      _last_boundary_var = 0;
140
 
static char  ** _array_boundary_varname = NULL;
141
 
 
142
 
/*============================================================================
143
 
 * Static global variables
144
 
 *============================================================================*/
145
 
 
146
 
/* Pointer on the main boundaries structure */
147
 
 
148
 
extern cs_boundary_t *boundaries;
149
 
 
150
 
/*============================================================================
151
 
 * Private function definitions
152
 
 *============================================================================*/
153
 
 
154
 
/*-----------------------------------------------------------------------------
155
 
 * Return value of the particles model
156
 
 *----------------------------------------------------------------------------*/
157
 
 
158
 
static void
159
 
_get_particles_model(const char *const model, int *const imodel)
160
 
{
161
 
  char *path;
162
 
  char *attr;
163
 
 
164
 
  path = cs_xpath_init_path();
165
 
  cs_xpath_add_elements(&path, 2, "lagrangian", model);
166
 
  cs_xpath_add_attribute(&path, "model");
167
 
  attr = cs_gui_get_attribute_value(path);
168
 
 
169
 
  if (attr != NULL) {
170
 
    if (cs_gui_strcmp(attr, "off"))
171
 
      *imodel = 0;
172
 
    else if (cs_gui_strcmp(attr, "one_way"))
173
 
      *imodel = 1;
174
 
    else if (cs_gui_strcmp(attr, "two_way"))
175
 
      *imodel = 2;
176
 
    else if (cs_gui_strcmp(attr, "frozen"))
177
 
      *imodel = 3;
178
 
    else if (cs_gui_strcmp(attr, "thermal"))
179
 
      *imodel = 1;
180
 
    else if (cs_gui_strcmp(attr, "coal"))
181
 
      *imodel = 2;
182
 
    BFT_FREE(attr);
183
 
  }
184
 
  BFT_FREE(path);
185
 
}
186
 
 
187
 
/*-----------------------------------------------------------------------------
188
 
 * Return value of the parameter of the character type for lagrangian
189
 
 *
190
 
 *   parameters:
191
 
 *   keyword   <--   value of parameter
192
 
 *   nbr       -->   size of the labels list
193
 
 *   ...       -->   list of labels in the path
194
 
 *----------------------------------------------------------------------------*/
195
 
 
196
 
static void
197
 
_get_status(int *const keyword, const int nbr, ...)
198
 
{
199
 
  va_list list;
200
 
 
201
 
  char *elt = NULL;
202
 
  char *path;
203
 
  int i;
204
 
  int result;
205
 
 
206
 
  path = cs_xpath_init_path();
207
 
 
208
 
  va_start(list, nbr);
209
 
 
210
 
  for(i=0; i<nbr; i++) {
211
 
 
212
 
    elt = va_arg(list, char *);
213
 
 
214
 
    if (elt != NULL) {
215
 
 
216
 
      BFT_REALLOC(path,
217
 
                  strlen(path)+ strlen(elt)+ strlen("/") +1,
218
 
                  char);
219
 
 
220
 
      strcat(path, "/");
221
 
      strcat(path, elt);
222
 
    }
223
 
  }
224
 
  va_end(list);
225
 
 
226
 
  cs_xpath_add_attribute(&path, "status");
227
 
  if(cs_gui_get_status(path, &result))
228
 
    *keyword = result;
229
 
 
230
 
  BFT_FREE(path);
231
 
}
232
 
 
233
 
/*-----------------------------------------------------------------------------
234
 
 * Return integer parameters for lagrangian
235
 
 *
236
 
 *   parameters:
237
 
 *   keyword   <--   value of parameter
238
 
 *   nbr       -->   size of the labels list
239
 
 *   ...       -->   list of labels in the path
240
 
 *----------------------------------------------------------------------------*/
241
 
 
242
 
static void
243
 
_get_int(int *const keyword, const int nbr, ...)
244
 
{
245
 
  va_list list;
246
 
 
247
 
  char *elt = NULL;
248
 
  char *path;
249
 
  int value = 0;
250
 
  int i;
251
 
 
252
 
  path = cs_xpath_init_path();
253
 
 
254
 
  va_start(list, nbr);
255
 
 
256
 
  for(i=0; i<nbr; i++) {
257
 
 
258
 
    elt = va_arg(list, char *);
259
 
 
260
 
    if (elt != NULL) {
261
 
 
262
 
      BFT_REALLOC(path,
263
 
                  strlen(path)+ strlen(elt)+ strlen("/") +1,
264
 
                  char);
265
 
 
266
 
      strcat(path, "/");
267
 
      strcat(path, elt);
268
 
    }
269
 
  }
270
 
  va_end(list);
271
 
  cs_xpath_add_function_text(&path);
272
 
 
273
 
  if (cs_gui_get_int(path, &value))
274
 
    *keyword = value;
275
 
 
276
 
  BFT_FREE(path);
277
 
 
278
 
}
279
 
 
280
 
 
281
 
/*-----------------------------------------------------------------------------
282
 
 * Return float parameters for lagrangian
283
 
 *
284
 
 *   parameters:
285
 
 *   keyword   <--   value of parameter
286
 
 *   nbr       -->   size of the labels list
287
 
 *   ...       -->   list of labels in the path
288
 
 *----------------------------------------------------------------------------*/
289
 
 
290
 
static void
291
 
_get_double(double *const keyword, const int nbr, ...)
292
 
{
293
 
  va_list list;
294
 
 
295
 
  char *elt = NULL;
296
 
  char *path;
297
 
  double value = 0;
298
 
  int i;
299
 
 
300
 
  path = cs_xpath_init_path();
301
 
 
302
 
  va_start(list, nbr);
303
 
 
304
 
  for(i=0; i<nbr; i++) {
305
 
 
306
 
    elt = va_arg(list, char *);
307
 
 
308
 
    if (elt != NULL) {
309
 
 
310
 
      BFT_REALLOC(path,
311
 
                  strlen(path)+ strlen(elt)+ strlen("/") +1,
312
 
                  char);
313
 
 
314
 
      strcat(path, "/");
315
 
      strcat(path, elt);
316
 
    }
317
 
  }
318
 
  va_end(list);
319
 
 
320
 
  cs_xpath_add_function_text(&path);
321
 
 
322
 
  if (cs_gui_get_double(path, &value))
323
 
    *keyword = value;
324
 
 
325
 
  BFT_FREE(path);
326
 
}
327
 
 
328
 
/*-----------------------------------------------------------------------------
329
 
 * Return value of the attribute of the character type for larangian
330
 
 *
331
 
 *   parameters:
332
 
 *   param     <--   name of the attribute
333
 
 *   nbr       -->   size of the labels list
334
 
 *   ...       -->   list of labels in the path
335
 
 *----------------------------------------------------------------------------*/
336
 
 
337
 
static char*
338
 
_get_attr(const char *const param, const int nbr, ...)
339
 
{
340
 
  va_list list;
341
 
 
342
 
  int i;
343
 
  char *elt = NULL;
344
 
  char *path;
345
 
  char *name;
346
 
 
347
 
  path = cs_xpath_init_path();
348
 
 
349
 
  va_start(list, nbr);
350
 
 
351
 
  for(i=0; i<nbr; i++) {
352
 
 
353
 
    elt = va_arg(list, char *);
354
 
 
355
 
    if (elt != NULL) {
356
 
 
357
 
      BFT_REALLOC(path,
358
 
                  strlen(path)+ strlen(elt)+ strlen("/") +1,
359
 
                  char);
360
 
 
361
 
      strcat(path, "/");
362
 
      strcat(path, elt);
363
 
    }
364
 
  }
365
 
  va_end(list);
366
 
 
367
 
  cs_xpath_add_attribute(&path, param);
368
 
 
369
 
  name = cs_gui_get_attribute_value(path);
370
 
 
371
 
  BFT_FREE(path);
372
 
 
373
 
  return name;
374
 
}
375
 
 
376
 
/*-----------------------------------------------------------------------------
377
 
 * Return float parameters for coal parameters
378
 
 *
379
 
 *   parameters:
380
 
 *    param         -->   value to modify
381
 
 *    name          -->   name of property
382
 
 *    icoal         -->   number of coal
383
 
 *----------------------------------------------------------------------------*/
384
 
 
385
 
static void
386
 
_get_coal_double(double *const param, const char *const name, int icoal)
387
 
{
388
 
  double result = 0;
389
 
  char *path = NULL;
390
 
  char scoal[2];
391
 
 
392
 
  sprintf(scoal, "%i", icoal);
393
 
 
394
 
  path = cs_xpath_init_path();
395
 
  cs_xpath_add_elements(&path, 4, "lagrangian", "particles_models", "coal_fouling", name);
396
 
  cs_xpath_add_test_attribute(&path, "coal", scoal);
397
 
  cs_xpath_add_function_text(&path);
398
 
 
399
 
  if (cs_gui_get_double(path, &result))
400
 
    *param = result;
401
 
 
402
 
  BFT_FREE(path);
403
 
}
404
 
 
405
 
/*-----------------------------------------------------------------------------
406
 
 * Return status and label of the property for post treatment
407
 
 *
408
 
 *   parameters:
409
 
 *    type          -->   type of property ('volume' or 'boundary')
410
 
 *    name          -->   name of property
411
 
 *    list_value    <--   status for listing
412
 
 *    record_value  <--   status for post processing
413
 
 *----------------------------------------------------------------------------*/
414
 
 
415
 
static char*
416
 
_get_char_post(const char *const type,
417
 
               const char *const name,
418
 
               int  *list_value,
419
 
               int  *record_value)
420
 
{
421
 
  char *path, *path1, *path2 = NULL;
422
 
  char *label = NULL;
423
 
  int result;
424
 
 
425
 
  *list_value = 1;
426
 
  *record_value = 1;
427
 
 
428
 
  path = cs_xpath_init_path();
429
 
  cs_xpath_add_elements(&path, 4, "lagrangian", "statistics", type, "property");
430
 
  cs_xpath_add_test_attribute(&path, "name", name);
431
 
  BFT_MALLOC(path1, strlen(path)+1, char);
432
 
  strcpy(path1, path);
433
 
  BFT_MALLOC(path2, strlen(path)+1, char);
434
 
  strcpy(path2, path);
435
 
  cs_xpath_add_attribute(&path, "label");
436
 
  label = cs_gui_get_attribute_value(path);
437
 
 
438
 
  if (cs_gui_strcmp(type, "volume")) {
439
 
 
440
 
    cs_xpath_add_element(&path1, "monitoring_point");
441
 
    cs_xpath_add_attribute(&path1, "status");
442
 
    if (cs_gui_get_status(path1, &result))
443
 
      *list_value = result;
444
 
  }
445
 
 
446
 
  else if (cs_gui_strcmp(type, "boundary")) {
447
 
 
448
 
    cs_xpath_add_element(&path1, "listing_printing");
449
 
    cs_xpath_add_attribute(&path1, "status");
450
 
    if (cs_gui_get_status(path1, &result))
451
 
      *list_value = result;
452
 
 
453
 
    cs_xpath_add_element(&path2, "postprocessing_recording");
454
 
    cs_xpath_add_attribute(&path2, "status");
455
 
    if (cs_gui_get_status(path2, &result))
456
 
      *record_value = -1;
457
 
  }
458
 
 
459
 
  BFT_FREE(path);
460
 
  BFT_FREE(path1);
461
 
  BFT_FREE(path2);
462
 
 
463
 
  return label;
464
 
}
465
 
 
466
 
/*-----------------------------------------------------------------------------
467
 
 * Copy a variable name to the variable names array
468
 
 *
469
 
 * parameters:
470
 
 *   varname        -->  name or label of the variable/scalar/property
471
 
 *   ipp            -->  index from the fortran array associated to varname
472
 
 *----------------------------------------------------------------------------*/
473
 
 
474
 
static void
475
 
_copy_mean_varname(char *varname, int ipp)
476
 
{
477
 
  size_t  l;
478
 
  assert(ipp > 0);
479
 
 
480
 
  if (ipp < 1 || ipp > _last_mean_var+1)
481
 
    bft_error(__FILE__, __LINE__, 0,
482
 
              _("Variable index %i out of bounds (1 to %i)"),
483
 
              ipp, _last_mean_var);
484
 
 
485
 
  l = strlen(varname);
486
 
 
487
 
  if (_array_mean_varname[ipp-1] == NULL)
488
 
    BFT_MALLOC(_array_mean_varname[ipp-1], l + 1, char);
489
 
 
490
 
  else if (strlen(_array_mean_varname[ipp-1]) != l)
491
 
    BFT_REALLOC(_array_mean_varname[ipp-1], l + 1, char);
492
 
 
493
 
  strcpy(_array_mean_varname[ipp-1], varname);
494
 
}
495
 
 
496
 
/*-----------------------------------------------------------------------------
497
 
 * Copy a variable name to the variance variable names array
498
 
 *
499
 
 * parameters:
500
 
 *   varname        -->  name or label of the variable/scalar/property
501
 
 *   ipp            -->  index from the fortran array associated to varname
502
 
 *----------------------------------------------------------------------------*/
503
 
 
504
 
static void
505
 
_copy_variance_varname(char *varname, int ipp)
506
 
{
507
 
  size_t  l;
508
 
  assert(ipp > 0);
509
 
 
510
 
  if (ipp < 1 || ipp > _last_variance_var+1)
511
 
    bft_error(__FILE__, __LINE__, 0,
512
 
              _("Variable index %i out of bounds (1 to %i)"),
513
 
              ipp, _last_variance_var);
514
 
 
515
 
  l = strlen(varname);
516
 
 
517
 
  if (_array_variance_varname[ipp-1] == NULL)
518
 
    BFT_MALLOC(_array_variance_varname[ipp-1], l + 1, char);
519
 
 
520
 
  else if (strlen(_array_variance_varname[ipp-1]) != l)
521
 
    BFT_REALLOC(_array_variance_varname[ipp-1], l + 1, char);
522
 
 
523
 
  strcpy(_array_variance_varname[ipp-1], varname);
524
 
}
525
 
 
526
 
/*-----------------------------------------------------------------------------
527
 
 * Copy a variable name to the variance variable names array
528
 
 *
529
 
 * parameters:
530
 
 *   varname        -->  name or label of the variable/scalar/property
531
 
 *   ipp            -->  index from the fortran array associated to varname
532
 
 *----------------------------------------------------------------------------*/
533
 
 
534
 
static void
535
 
_copy_boundary_varname(char *varname, int ipp)
536
 
{
537
 
  size_t  l;
538
 
  assert(ipp > 0);
539
 
 
540
 
  if (ipp < 1 || ipp > _last_boundary_var+1)
541
 
    bft_error(__FILE__, __LINE__, 0,
542
 
              _("Variable index %i out of bounds (1 to %i)"),
543
 
              ipp, _last_boundary_var);
544
 
 
545
 
  l = strlen(varname);
546
 
 
547
 
  if (_array_boundary_varname[ipp-1] == NULL)
548
 
    BFT_MALLOC(_array_boundary_varname[ipp-1], l + 1, char);
549
 
 
550
 
  else if (strlen(_array_boundary_varname[ipp-1]) != l)
551
 
    BFT_REALLOC(_array_boundary_varname[ipp-1], l + 1, char);
552
 
 
553
 
  strcpy(_array_boundary_varname[ipp-1], varname);
554
 
}
555
 
 
556
 
/*============================================================================
557
 
 * Public Fortran function definitions
558
 
 *============================================================================*/
559
 
 
560
 
/*----------------------------------------------------------------------------
561
 
 * Copy variable name from Fortran to C
562
 
 *----------------------------------------------------------------------------*/
563
 
 
564
 
void CS_PROCF(fclag1, FCLAG1)
565
 
(
566
 
 const char          *const fstr,    /* --> Fortran string */
567
 
 int                 *const len,     /* --> String Length  */
568
 
 int                 *const var_id   /* --> Variable Id (1 to n) */
569
 
 CS_ARGF_SUPP_CHAINE
570
 
)
571
 
{
572
 
  int i, i1, i2, l;
573
 
  char *cstr = NULL;
574
 
 
575
 
  assert(*var_id > 0);
576
 
 
577
 
  /* Resize array if necessary */
578
 
 
579
 
  if (*var_id > _max_mean_vars) {
580
 
 
581
 
    if (_max_mean_vars == 0)
582
 
      _max_mean_vars = 16;
583
 
 
584
 
    while (_max_mean_vars <= *var_id)
585
 
      _max_mean_vars *= 2;
586
 
 
587
 
    BFT_REALLOC(_array_mean_varname, _max_mean_vars, char *);
588
 
    for (i = _last_mean_var; i < _max_mean_vars; i++)
589
 
      _array_mean_varname[i] = NULL;
590
 
  }
591
 
 
592
 
  /* Compute string length (removing start or end blanks) */
593
 
 
594
 
  for (i1 = 0;
595
 
       i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
596
 
       i1++);
597
 
 
598
 
  for (i2 = *len - 1;
599
 
       i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
600
 
       i2--);
601
 
 
602
 
  l = i2 - i1 + 1;
603
 
 
604
 
  /* Should be called once per variable only */
605
 
  assert(_array_mean_varname[*var_id - 1] == NULL);
606
 
 
607
 
  if (l > 0) {
608
 
 
609
 
    /* Allocate and copy */
610
 
    BFT_MALLOC(cstr, l + 1, char);
611
 
 
612
 
  for (i = 0 ; i < l ; i++, i1++)
613
 
    cstr[i] = fstr[i1];
614
 
 
615
 
  cstr[l] = '\0';
616
 
 
617
 
    _array_mean_varname[*var_id - 1] = cstr;
618
 
 
619
 
  }
620
 
 
621
 
  /* Update variable counter */
622
 
  _last_mean_var = *var_id;
623
 
}
624
 
 
625
 
/*----------------------------------------------------------------------------
626
 
 * Copy variable name from Fortran to C
627
 
 *----------------------------------------------------------------------------*/
628
 
 
629
 
void CS_PROCF(fclag2, FCLAG2)
630
 
(
631
 
 const char          *const fstr,    /* --> Fortran string */
632
 
 int                 *const len,     /* --> String Length  */
633
 
 int                 *const var_id   /* --> Variable Id (1 to n) */
634
 
 CS_ARGF_SUPP_CHAINE
635
 
)
636
 
{
637
 
  int i, i1, i2, l;
638
 
  char *cstr = NULL;
639
 
 
640
 
  assert(*var_id > 0);
641
 
 
642
 
  /* Resize array if necessary */
643
 
 
644
 
  if (*var_id > _max_variance_vars) {
645
 
 
646
 
    if (_max_variance_vars == 0)
647
 
      _max_variance_vars = 16;
648
 
 
649
 
    while (_max_variance_vars <= *var_id)
650
 
      _max_variance_vars *= 2;
651
 
 
652
 
    BFT_REALLOC(_array_variance_varname, _max_variance_vars, char *);
653
 
    for (i = _last_variance_var; i < _max_variance_vars; i++)
654
 
      _array_variance_varname[i] = NULL;
655
 
  }
656
 
 
657
 
  /* Compute string length (removing start or end blanks) */
658
 
 
659
 
  for (i1 = 0;
660
 
       i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
661
 
       i1++);
662
 
 
663
 
  for (i2 = *len - 1;
664
 
       i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
665
 
       i2--);
666
 
 
667
 
  l = i2 - i1 + 1;
668
 
 
669
 
  /* Should be called once per variable only */
670
 
  assert(_array_variance_varname[*var_id - 1] == NULL);
671
 
 
672
 
  if (l > 0) {
673
 
 
674
 
    /* Allocate and copy */
675
 
    BFT_MALLOC(cstr, l + 1, char);
676
 
 
677
 
  for (i = 0 ; i < l ; i++, i1++)
678
 
    cstr[i] = fstr[i1];
679
 
 
680
 
  cstr[l] = '\0';
681
 
 
682
 
    _array_variance_varname[*var_id - 1] = cstr;
683
 
 
684
 
  }
685
 
 
686
 
  /* Update variable counter */
687
 
  _last_variance_var = *var_id;
688
 
 
689
 
}
690
 
 
691
 
/*----------------------------------------------------------------------------
692
 
 * Copy variable name from Fortran to C
693
 
 *----------------------------------------------------------------------------*/
694
 
 
695
 
void CS_PROCF(fclag3, FCLAG3)
696
 
(
697
 
 const char          *const fstr,    /* --> Fortran string */
698
 
 int                 *const len,     /* --> String Length  */
699
 
 int                 *const var_id   /* --> Variable Id (1 to n) */
700
 
 CS_ARGF_SUPP_CHAINE
701
 
)
702
 
{
703
 
  int i, i1, i2, l;
704
 
  char *cstr = NULL;
705
 
 
706
 
  assert(*var_id > 0);
707
 
 
708
 
  /* Resize array if necessary */
709
 
 
710
 
  if (*var_id > _max_boundary_vars) {
711
 
 
712
 
    if (_max_boundary_vars == 0)
713
 
      _max_boundary_vars = 16;
714
 
 
715
 
    while (_max_boundary_vars <= *var_id)
716
 
      _max_boundary_vars *= 2;
717
 
 
718
 
    BFT_REALLOC(_array_boundary_varname, _max_boundary_vars, char *);
719
 
    for (i = _last_boundary_var; i < _max_boundary_vars; i++)
720
 
      _array_boundary_varname[i] = NULL;
721
 
  }
722
 
 
723
 
  /* Compute string length (removing start or end blanks) */
724
 
 
725
 
  for (i1 = 0;
726
 
       i1 < *len && (fstr[i1] == ' ' || fstr[i1] == '\t');
727
 
       i1++);
728
 
 
729
 
  for (i2 = *len - 1;
730
 
       i2 > i1 && (fstr[i2] == ' ' || fstr[i2] == '\t');
731
 
       i2--);
732
 
 
733
 
  l = i2 - i1 + 1;
734
 
 
735
 
  /* Should be called once per variable only */
736
 
  assert(_array_boundary_varname[*var_id - 1] == NULL);
737
 
 
738
 
  if (l > 0) {
739
 
 
740
 
    /* Allocate and copy */
741
 
    BFT_MALLOC(cstr, l + 1, char);
742
 
 
743
 
  for (i = 0 ; i < l ; i++, i1++)
744
 
    cstr[i] = fstr[i1];
745
 
 
746
 
  cstr[l] = '\0';
747
 
 
748
 
    _array_boundary_varname[*var_id - 1] = cstr;
749
 
 
750
 
  }
751
 
 
752
 
  /* Update variable counter */
753
 
  _last_boundary_var = *var_id;
754
 
 
755
 
}
756
 
 
757
 
/*----------------------------------------------------------------------------
758
 
 * Copy variable name from C to Fortran
759
 
 *----------------------------------------------------------------------------*/
760
 
 
761
 
void CS_PROCF(cfname, CFNAME)
762
 
(
763
 
 int           *const flag,    /* --> flag for array = 1, 2, or 3 */
764
 
 char          *const fstr,    /* --> Fortran string */
765
 
 int           *const len,     /* --> String Length  */
766
 
 int           *const var_id   /* --> Variable Id (1 to n) */
767
 
 CS_ARGF_SUPP_CHAINE
768
 
)
769
 
{
770
 
  int i;
771
 
  int l = 0;
772
 
  char *cstr = NULL;
773
 
 
774
 
  assert( *flag==1 || *flag==2 || *flag==3 );
775
 
 
776
 
  /* Check that variable name was set and copy string */
777
 
 
778
 
  switch(*flag) {
779
 
  case 1:
780
 
    if (*var_id < 1 || *var_id > _last_mean_var)
781
 
      bft_error(__FILE__, __LINE__, 0,
782
 
                _("Name of variable %i was never set.\n"), *var_id);
783
 
    cstr = _array_mean_varname[*var_id - 1];
784
 
    break;
785
 
  case 2:
786
 
    if (*var_id < 1 || *var_id > _last_variance_var)
787
 
      bft_error(__FILE__, __LINE__, 0,
788
 
               _("Name of variable %i was never set.\n"), *var_id);
789
 
    cstr = _array_variance_varname[*var_id - 1];
790
 
    break;
791
 
  case 3:
792
 
    if (*var_id < 1 || *var_id > _last_boundary_var)
793
 
      bft_error(__FILE__, __LINE__, 0,
794
 
                _("Name of variable %i was never set.\n"), *var_id);
795
 
    cstr = _array_boundary_varname[*var_id - 1];
796
 
    break;
797
 
  }
798
 
 
799
 
  if (cstr != NULL) {
800
 
 
801
 
  /* Compute string length (removing start or end blanks) */
802
 
 
803
 
  l = strlen(cstr);
804
 
  if (l > *len)
805
 
    l = *len;
806
 
 
807
 
    for (i = 0; i < l; i++)
808
 
      fstr[i] = cstr[i];
809
 
 
810
 
  }
811
 
 
812
 
  /* Pad with blanks if necessary */
813
 
 
814
 
  for (i = l; i < *len; i++)
815
 
    fstr[i] = ' ';
816
 
}
817
 
 
818
 
/*----------------------------------------------------------------------------
819
 
 * Fortran Interface:
820
 
 *
821
 
 * SUBROUTINE UILAG1
822
 
 * *****************
823
 
 *
824
 
 * INTEGER          IILAGR     <--   type of lagrangian model used
825
 
 * INTEGER          ISUILA     <--   lagrangian restart
826
 
 * INTEGER          ISUIST     <--   lagrangian restart for statistics
827
 
 * INTEGER          NBPMAX     <--   maximum number of particles
828
 
 * INTEGER          ISTTIO     <--   stationnary calculus
829
 
 * INTEGER          INJCON     <--   continuous injection of particles
830
 
 * INTEGER          IPHYLA     <--   physical model for particles
831
 
 * INTEGER          IDPVAR     <--   equation on diameter if iphyla = 1
832
 
 * INTEGER          IMPVAR     <--   equation on mass if iphyla = 1
833
 
 * INTEGER          ITPVAR     <--   equation on temperature if iphyla = 1
834
 
 * INTEGER          IENCRA     <--   coal fouliing if iphyla = 2
835
 
 * DOUBLE           TPRENC     <--   particle coal temperature if iphyla = 2
836
 
 * DOUBLE           VISREF     <--   particle critical viscosity if iphyla = 2
837
 
 * DOUBLE           ENC1       <--   Watt and Fereday coefficient 1
838
 
 * DOUBLE           ENC2       <--   Watt and Fereday coefficient 2
839
 
 * INTEGER          NSTITS     <--   iteration number for instationnary
840
 
 * INTEGER          LTSDYN     <--   reverse coupling on dynamic
841
 
 * INTEGER          LTSMAS     <--   reverse coupling on mass
842
 
 * INTEGER          LTSTHE     <--   reverse coupling on temperature
843
 
 * INTEGER          NORDRE     <--   stochastic  differential equation order
844
 
 * INTEGER          IDISTU     <--   particle turbulent dispersion
845
 
 * INTEGER          IDIFFL     <--   particle fluid diffusion
846
 
 * INTEGER          MODCPL     <--   complete turbulent dispersion model
847
 
 * INTEGER          IDIRLA     <--   direction of the complete model
848
 
 * INTEGER          IENSI1     <--   post-processing in trajectory mode
849
 
 * INTEGER          IENSI2     <--   post-processing in movement mode
850
 
 * INTEGER          NTLAL      <--   listing printing frequency
851
 
 * INTEGER          NBVIS      <--   number of particles for display
852
 
 * INTEGER          NVISLA     <--   output period for post-processing
853
 
 * INTEGER          IVISV1     <--   display of variable 'fluid velocity'
854
 
 * INTEGER          IVISV2     <--   display of variable 'particles velocity'
855
 
 * INTEGER          IVISTP     <--   display of variable 'resident time'
856
 
 * INTEGER          IVISDM     <--   display of variable 'particle diameter'
857
 
 * INTEGER          IVISTE     <--   display of variable 'particle temperature'
858
 
 * INTEGER          IVISMP     <--   display of variable 'particle mass'
859
 
 * INTEGER          IVISHP     <--   display of variable 'coal temp. particle'
860
 
 * INTEGER          IVISDK     <--   display of variable 'core diameter of part.'
861
 
 * INTEGER          IVISCH     <--   display of variable 'mass of reactive coal'
862
 
 * INTEGER          IVISCK     <--   display of variable 'mass of char'
863
 
 * INTEGER          ISTALA     <--   calculation of volumic statistics
864
 
 * INTEGER          NBCLST     <--   number of particle clusters
865
 
 * INTEGER          SEUIL      <--   limit statistical weight value for volumic stat.
866
 
 * INTEGER          IDSTNT     <--   iteration number for volumic statistics
867
 
 * CHAR             NOMLAG     <--   mean variable name of volumic statistics
868
 
 * CHAR             NOMLAV     <--   variance variable name of volumic statistics
869
 
 * INTEGER          IHSLAG     <--   output of variable
870
 
 * INTEGER          IENSI3     <--   calculation of boundaries statistics
871
 
 * INTEGER          SEUILF     <--   limit statistical weight value for boundaries stat.
872
 
 * INTEGER          NSTBOR     <--   iteration number for boundaries statistics
873
 
 * INTEGER          INBRBD     <--   recording of particle/boundary interactions
874
 
 * INTEGER          IFLMBD     <--   recording of mass flow related to interactions
875
 
 * INTEGER          IANGBD     <--   recording of angle between particle traj./boundary
876
 
 * INTEGER          IVITBD     <--   recording of velocity of particle in an interaction
877
 
 * INTEGER          IENCBD     <--   recording of mass of coal particles
878
 
 * CHAR             NOMBRD     <--   variable name of boundaries statistics
879
 
 * INTEGER          IMOYBR     <--   cumulated value for particule/boundary interaction
880
 
 *----------------------------------------------------------------------------*/
881
 
 
882
 
void CS_PROCF (uilag1, UILAG1) (int *const iilagr,
883
 
                                int *const isuila,
884
 
                                int *const isuist,
885
 
                                int *const nbpmax,
886
 
                                int *const isttio,
887
 
                                int *const injcon,
888
 
                                int *const iphyla,
889
 
                                int *const idpvar,
890
 
                                int *const itpvar,
891
 
                                int *const impvar,
892
 
                                int *const iencra,
893
 
                                double tprenc[],
894
 
                                double visref[],
895
 
                                double enc1[],
896
 
                                double enc2[],
897
 
                                int *const nstits,
898
 
                                int *const ltsdyn,
899
 
                                int *const ltsmas,
900
 
                                int *const ltsthe,
901
 
                                int *const nordre,
902
 
                                int *const idistu,
903
 
                                int *const idiffl,
904
 
                                int *const modcpl,
905
 
                                int *const idirla,
906
 
                                int *const iensi1,
907
 
                                int *const iensi2,
908
 
                                int *const ntlal,
909
 
                                int *const nbvis,
910
 
                                int *const nvisla,
911
 
                                int *const ivisv1,
912
 
                                int *const ivisv2,
913
 
                                int *const ivistp,
914
 
                                int *const ivisdm,
915
 
                                int *const iviste,
916
 
                                int *const ivismp,
917
 
                                int *const ivishp,
918
 
                                int *const ivisdk,
919
 
                                int *const ivisch,
920
 
                                int *const ivisck,
921
 
                                int *const istala,
922
 
                                int *const nbclst,
923
 
                                double *const seuil,
924
 
                                int *const idstnt,
925
 
                                int ihslag[],
926
 
                                int *const iensi3,
927
 
                                double *const seuilf,
928
 
                                int *const nstbor,
929
 
                                int *const inbrbd,
930
 
                                int *const iflmbd,
931
 
                                int *const iangbd,
932
 
                                int *const ivitbd,
933
 
                                int *const iencbd,
934
 
                                int imoybr[])
935
 
{
936
 
  int i, icoal, ncoals = 0;
937
 
  int list_ind, record_ind = 1;
938
 
  char *label = NULL;
939
 
  char *attr = NULL;
940
 
  char *path1 = NULL;
941
 
  char *fmt, *opt;
942
 
 
943
 
  attr = _get_attr("model", 1, "lagrangian");
944
 
  if (attr == NULL || cs_gui_strcmp(attr, "off"))
945
 
  {
946
 
      *iilagr = 0;
947
 
#if _XML_DEBUG_
948
 
      bft_printf("==>UILAG1\n");
949
 
      bft_printf("--iilagr = %i\n", *iilagr);
950
 
#endif
951
 
      BFT_FREE(attr);
952
 
      return;
953
 
  }
954
 
 
955
 
  /* Global settings */
956
 
 
957
 
  _get_particles_model("coupling_mode", iilagr);
958
 
  _get_status(isuila, 2, "lagrangian", "restart");
959
 
  _get_status(isttio, 2, "lagrangian", "carrier_field_stationary");
960
 
  _get_status(injcon, 2, "lagrangian", "continuous_injection");
961
 
  _get_int(nbpmax,    2, "lagrangian", "particles_max_number");
962
 
 
963
 
  /* Particles model */
964
 
 
965
 
  _get_particles_model("particles_models", iphyla);
966
 
 
967
 
  switch (*iphyla) {
968
 
  case 1:
969
 
    _get_status(idpvar, 3, "lagrangian", "particles_models", "break_up");
970
 
    _get_status(impvar, 3, "lagrangian", "particles_models", "evaporation");
971
 
    _get_status(itpvar, 3, "lagrangian", "particles_models", "thermal");
972
 
    /*
973
 
    if (*itpvar == 1) {
974
 
        _get_double(tpart,  4, "lagrangian", "particles_models", "thermal", "particle_temperature");
975
 
        _get_double(cppart, 4, "lagrangian", "particles_models", "thermal", "particle_specific_heat");
976
 
    }
977
 
    */
978
 
    break;
979
 
  case 2:
980
 
    _get_status(iencra, 3, "lagrangian", "particles_models", "coal_fouling");
981
 
    path1 = cs_xpath_init_path();
982
 
    cs_xpath_add_elements(&path1, 4, "lagrangian", "particles_models", "coal_fouling", "threshold_temperature");
983
 
    ncoals = cs_gui_get_nb_element(path1);
984
 
    BFT_FREE(path1);
985
 
 
986
 
    for (icoal=1; icoal <= ncoals; icoal++)
987
 
    {
988
 
        _get_coal_double(&tprenc[icoal-1], "threshold_temperature", icoal);
989
 
        _get_coal_double(&visref[icoal-1], "critical_viscosity",    icoal);
990
 
        _get_coal_double(&enc1[icoal-1], "fouling_coefficient_1", icoal);
991
 
        _get_coal_double(&enc2[icoal-1], "fouling_coefficient_2", icoal);
992
 
    }
993
 
    break;
994
 
  }
995
 
 
996
 
  /* Two-way coupling */
997
 
 
998
 
  if (*iilagr == 2) {
999
 
    _get_int(nstits, 3, "lagrangian", "two_way_coupling", "iteration_start");
1000
 
    _get_status(ltsdyn, 3, "lagrangian", "two_way_coupling", "dynamic");
1001
 
    _get_status(ltsmas, 3, "lagrangian", "two_way_coupling", "mass");
1002
 
    _get_status(ltsthe, 3, "lagrangian", "two_way_coupling", "thermal");
1003
 
  }
1004
 
 
1005
 
  /* Numerical modeling */
1006
 
 
1007
 
  attr = _get_attr("choice", 2, "lagrangian", "scheme_order");
1008
 
  if (attr) {
1009
 
    *nordre = atoi(attr);
1010
 
    BFT_FREE(attr);
1011
 
  }
1012
 
  attr = _get_attr("choice", 2, "lagrangian", "complete_model_direction");
1013
 
  if (attr) {
1014
 
    *idirla = atoi(attr);
1015
 
    BFT_FREE(attr);
1016
 
  }
1017
 
  _get_status(idistu, 2, "lagrangian", "turbulent_dispersion");
1018
 
  _get_status(idiffl, 2, "lagrangian", "fluid_particles_turbulent_diffusion");
1019
 
  _get_int(modcpl, 2, "lagrangian", "complete_model");
1020
 
 
1021
 
  /* Output */
1022
 
 
1023
 
  _get_status(iensi1, 3, "lagrangian", "output", "trajectory");
1024
 
  _get_status(iensi2, 3, "lagrangian", "output", "particles");
1025
 
  _get_status(ivisv1, 3, "lagrangian", "output", "velocity_fluid_seen");
1026
 
  _get_status(ivisv2, 3, "lagrangian", "output", "velocity_particles");
1027
 
  _get_status(ivistp, 3, "lagrangian", "output", "resident_time");
1028
 
  _get_status(ivisdm, 3, "lagrangian", "output", "diameter");
1029
 
  _get_status(iviste, 3, "lagrangian", "output", "temperature");
1030
 
  _get_status(ivismp, 3, "lagrangian", "output", "mass");
1031
 
 
1032
 
  if (*iphyla == 2) {
1033
 
    _get_status(ivishp, 3, "lagrangian", "output", "coal_temperature");
1034
 
    _get_status(ivisdk, 3, "lagrangian", "output", "shrinking_core_diameter");
1035
 
    _get_status(ivisch, 3, "lagrangian", "output", "raw_coal_mass_fraction");
1036
 
    _get_status(ivisck, 3, "lagrangian", "output", "char_mass_fraction");
1037
 
  }
1038
 
 
1039
 
  _get_int(nbvis,  3, "lagrangian", "output", "number_of_particles");
1040
 
  _get_int(nvisla, 3, "lagrangian", "output", "postprocessing_frequency");
1041
 
  _get_int(ntlal,  3, "lagrangian", "output", "listing_printing_frequency");
1042
 
  fmt = _get_attr("choice", 3, "lagrangian", "output", "postprocessing_format");
1043
 
  opt = _get_attr("choice", 3, "lagrangian", "output", "postprocessing_options");
1044
 
  BFT_FREE(fmt);
1045
 
  BFT_FREE(opt);
1046
 
 
1047
 
  /* Statistics */
1048
 
 
1049
 
  _get_int(nbclst, 3, "lagrangian", "statistics", "statistics_groups_of_particles");
1050
 
  _get_status(isuist, 3, "lagrangian", "statistics", "restart");
1051
 
  _get_status(istala, 3, "lagrangian", "statistics", "volume");
1052
 
 
1053
 
  if (*istala == 1) {
1054
 
    _get_double(seuil, 4, "lagrangian", "statistics", "volume", "threshold_volume");
1055
 
    _get_int(idstnt, 4, "lagrangian", "statistics", "volume", "iteration_start_volume");
1056
 
 
1057
 
    /* labels */
1058
 
 
1059
 
    label = _get_char_post("volume", "mean_velocity_U", &list_ind, &record_ind);
1060
 
    if (label) _copy_mean_varname(label, 1);
1061
 
    ihslag[1] = list_ind;
1062
 
 
1063
 
    label = _get_char_post("volume", "variance_velocity_U", &list_ind, &record_ind);
1064
 
    if (label) _copy_variance_varname(label, 1);
1065
 
 
1066
 
    label = _get_char_post("volume", "mean_velocity_V", &list_ind, &record_ind);
1067
 
    if (label) _copy_mean_varname(label, 2);
1068
 
    ihslag[2] = list_ind;
1069
 
 
1070
 
    label = _get_char_post("volume", "variance_velocity_V", &list_ind, &record_ind);
1071
 
    if (label) _copy_variance_varname(label, 2);
1072
 
 
1073
 
    label = _get_char_post("volume", "mean_velocity_W", &list_ind, &record_ind);
1074
 
    if (label) _copy_mean_varname(label, 3);
1075
 
    ihslag[3] = list_ind;
1076
 
 
1077
 
    label = _get_char_post("volume", "variance_velocity_W", &list_ind, &record_ind);
1078
 
    if (label) _copy_variance_varname(label, 3);
1079
 
 
1080
 
    label = _get_char_post("volume", "mean_mass_fraction", &list_ind, &record_ind);
1081
 
    if (label) _copy_mean_varname(label, 4);
1082
 
    ihslag[4] = list_ind;
1083
 
 
1084
 
    label = _get_char_post("volume", "variance_mass_fraction", &list_ind, &record_ind);
1085
 
    if (label) _copy_variance_varname(label, 4);
1086
 
 
1087
 
    label = _get_char_post("volume", "mean_resident_time", &list_ind, &record_ind);
1088
 
    if (label) _copy_mean_varname(label, 5);
1089
 
    ihslag[5] = list_ind;
1090
 
 
1091
 
    label = _get_char_post("volume", "variance_resident_time", &list_ind, &record_ind);
1092
 
    if (label) _copy_variance_varname(label, 5);
1093
 
 
1094
 
    i = 5;
1095
 
 
1096
 
    if (*iphyla == 1) {
1097
 
 
1098
 
      if (*itpvar == 1) {
1099
 
        i++;
1100
 
        label = _get_char_post("volume",  "mean_temperature", &list_ind, &record_ind);
1101
 
        if (label) _copy_mean_varname(label, i);
1102
 
        ihslag[i] = list_ind;
1103
 
 
1104
 
        label = _get_char_post("volume", "variance_temperature", &list_ind, &record_ind);
1105
 
        if (label) _copy_variance_varname(label, i);
1106
 
      }
1107
 
 
1108
 
      if (*idpvar == 1) {
1109
 
        i++;
1110
 
        label = _get_char_post("volume", "mean_diameter", &list_ind, &record_ind);
1111
 
        if (label) _copy_mean_varname(label, i);
1112
 
        ihslag[i] = list_ind;
1113
 
 
1114
 
        label = _get_char_post("volume", "variance_diameter", &list_ind, &record_ind);
1115
 
        if (label) _copy_variance_varname(label, i);
1116
 
      }
1117
 
    }
1118
 
 
1119
 
    else if (*iphyla == 2) {
1120
 
      /*
1121
 
      i++;
1122
 
      label = _get_char_post("volume", "coal_temperature", &list_ind, &record_ind);
1123
 
      if (label) _copy_mean_varname(label, i);
1124
 
 
1125
 
      label = _get_char_post("volume", "coal_temperature", &list_ind, &record_ind);
1126
 
      if (label) _copy_variance_varname(label, i);
1127
 
      */
1128
 
      i++;
1129
 
      label = _get_char_post("volume", "mean_shrinking_core_diameter", &list_ind, &record_ind);
1130
 
      if (label) _copy_mean_varname(label, i);
1131
 
      ihslag[i] = list_ind;
1132
 
 
1133
 
      label = _get_char_post("volume", "variance_shrinking_core_diameter", &list_ind, &record_ind);
1134
 
      if (label) _copy_variance_varname(label, i);
1135
 
 
1136
 
      i++;
1137
 
      label = _get_char_post("volume", "mean_raw_coal_mass_fraction", &list_ind, &record_ind);
1138
 
      if (label) _copy_mean_varname(label, i);
1139
 
      ihslag[i] = list_ind;
1140
 
 
1141
 
      label = _get_char_post("volume", "variance_raw_coal_mass_fraction", &list_ind, &record_ind);
1142
 
      if (label) _copy_variance_varname(label, i);
1143
 
 
1144
 
      i++;
1145
 
      label = _get_char_post("volume", "mean_char_mass_fraction", &list_ind, &record_ind);
1146
 
      if (label) _copy_mean_varname(label, i);
1147
 
      ihslag[i] = list_ind;
1148
 
 
1149
 
      label = _get_char_post("volume", "variance_char_mass_fraction", &list_ind, &record_ind);
1150
 
      if (label) _copy_variance_varname(label, i);
1151
 
    }
1152
 
 
1153
 
    i++;
1154
 
    label = _get_char_post("volume", "statistical_weight", &list_ind, &record_ind);
1155
 
    if (label) _copy_mean_varname(label, i);
1156
 
    ihslag[i] = list_ind;
1157
 
  }
1158
 
 
1159
 
  _get_status(iensi3, 3, "lagrangian", "statistics", "boundary");
1160
 
 
1161
 
  if (*iensi3 == 1) {
1162
 
 
1163
 
    _get_double(seuilf, 4, "lagrangian", "statistics", "boundary", "threshold_boundary");
1164
 
    _get_int(nstbor, 4, "lagrangian", "statistics", "boundary", "iteration_start_boundary");
1165
 
 
1166
 
    i = 0;
1167
 
 
1168
 
    label = _get_char_post("boundary", "impacts", inbrbd, &record_ind);
1169
 
    if (*inbrbd) {
1170
 
      i++;
1171
 
      if (label) _copy_boundary_varname(label, i);
1172
 
      imoybr[i] = record_ind;
1173
 
    }
1174
 
 
1175
 
    label = _get_char_post("boundary", "mass_flux", iflmbd, &record_ind);
1176
 
    if (*iflmbd) {
1177
 
      i++;
1178
 
      if (label) _copy_boundary_varname(label, i);
1179
 
      imoybr[i] = record_ind;
1180
 
    }
1181
 
 
1182
 
    label = _get_char_post("boundary", "angle", iangbd, &record_ind);
1183
 
    if (*iangbd) {
1184
 
      i++;
1185
 
      if (label) _copy_boundary_varname(label, i);
1186
 
      imoybr[i] = record_ind;
1187
 
    }
1188
 
 
1189
 
    label = _get_char_post("boundary", "velocity", ivitbd, &record_ind);
1190
 
    if (*ivitbd) {
1191
 
      i++;
1192
 
      if (label) _copy_boundary_varname(label, i);
1193
 
      imoybr[i] = record_ind;
1194
 
    }
1195
 
    label = _get_char_post("boundary", "coal_fouling", iencbd, &record_ind);
1196
 
    if (*iencbd) {
1197
 
      i++;
1198
 
      if (label) _copy_boundary_varname(label, i);
1199
 
      imoybr[i] = record_ind;
1200
 
    }
1201
 
  }
1202
 
  BFT_FREE(label);
1203
 
 
1204
 
#if _XML_DEBUG_
1205
 
  bft_printf("==>UILAG1\n");
1206
 
  bft_printf("--iilagr = %i\n", *iilagr);
1207
 
  bft_printf("--isuila = %i\n", *isuila);
1208
 
  bft_printf("--isttio = %i\n", *isttio);
1209
 
  bft_printf("--nbpmax = %i\n", *nbpmax);
1210
 
  bft_printf("--isttio = %i\n", *isttio);
1211
 
  bft_printf("--injcon = %i\n", *injcon);
1212
 
  bft_printf("--iphyla = %i\n", *iphyla);
1213
 
  switch(*iphyla) {
1214
 
  case 0:
1215
 
    break;
1216
 
  case 1:
1217
 
    bft_printf("--idpvar = %i\n", *idpvar);
1218
 
    bft_printf("--impvar = %i\n", *impvar);
1219
 
    bft_printf("--itpvar = %i\n", *itpvar);
1220
 
    break;
1221
 
  case 2:
1222
 
    bft_printf("--iencra = %i\n", *iencra);
1223
 
    for (icoal=1; icoal<=ncoals; icoal++)
1224
 
      {
1225
 
        bft_printf("--tprenc[%i] = %f\n", icoal, tprenc[icoal-1]);
1226
 
        bft_printf("--visref[%i] = %f\n", icoal, visref[icoal-1]);
1227
 
        bft_printf("--enc1[%i] = %f\n", icoal, enc1[icoal-1]);
1228
 
        bft_printf("--enc2[%i] = %f\n", icoal, enc2[icoal-1]);
1229
 
      }
1230
 
    break;
1231
 
  }
1232
 
 
1233
 
  if (*iilagr == 2) {
1234
 
    bft_printf("--nstits = %i\n", *nstits);
1235
 
    bft_printf("--ltsdyn = %i\n", *ltsdyn);
1236
 
    bft_printf("--ltsmas = %i\n", *ltsmas);
1237
 
    bft_printf("--ltsthe = %i\n", *ltsthe);
1238
 
  }
1239
 
 
1240
 
  bft_printf("--nordre = %i\n", *nordre);
1241
 
  bft_printf("--idistu = %i\n", *idistu);
1242
 
  bft_printf("--idiffl = %i\n", *idiffl);
1243
 
  bft_printf("--modcpl = %i\n", *modcpl);
1244
 
  bft_printf("--idirla = %i\n", *idirla);
1245
 
 
1246
 
  bft_printf("--iensi1 = %i\n", *iensi1);
1247
 
  bft_printf("--iensi2 = %i\n", *iensi2);
1248
 
  bft_printf("--ivisv1 = %i\n", *ivisv1);
1249
 
  bft_printf("--ivisv2 = %i\n", *ivisv2);
1250
 
  bft_printf("--ivistp = %i\n", *ivistp);
1251
 
  bft_printf("--ivisdm = %i\n", *ivisdm);
1252
 
  bft_printf("--iviste = %i\n", *iviste);
1253
 
  bft_printf("--ivismp = %i\n", *ivismp);
1254
 
 
1255
 
  if (*iphyla == 2) {
1256
 
    bft_printf("--ivishp = %i\n", *ivishp);
1257
 
    bft_printf("--ivisdk = %i\n", *ivisdk);
1258
 
    bft_printf("--ivisch = %i\n", *ivisch);
1259
 
    bft_printf("--ivisck = %i\n", *ivisck);
1260
 
  }
1261
 
 
1262
 
  bft_printf("--nbvis  = %i\n", *nbvis);
1263
 
  bft_printf("--nvisla = %i\n", *nvisla);
1264
 
 
1265
 
  bft_printf("--isuist = %i\n", *isuist);
1266
 
  bft_printf("--nbclst = %i\n", *nbclst);
1267
 
 
1268
 
  bft_printf("--istala = %i\n", *istala);
1269
 
  if (*istala == 1) {
1270
 
    bft_printf("--idstnt = %i\n", *idstnt);
1271
 
    bft_printf("--seuil  = %f\n", *seuil);
1272
 
 
1273
 
    /*
1274
 
    bft_printf("--i        nomlag             nomlav              ihslag\n");
1275
 
    for (i=1; i <= 5; i++)
1276
 
      bft_printf("  %i %30s %30s %5i\n", i, nomlag[i], nomlav[i], ihslag[i]);
1277
 
    i = 5;
1278
 
    if (*iphyla == 1) {
1279
 
      if (*itpvar == 1) {
1280
 
        i++;
1281
 
        bft_printf("  %i %s %s \n", i, nomlag[i], nomlav[i]);
1282
 
      }
1283
 
      if (*idpvar == 1) {
1284
 
        i++;
1285
 
        bft_printf("  %i %s %s \n", i, nomlag[i], nomlav[i]);
1286
 
      }
1287
 
    }
1288
 
    else if (*iphyla == 2) {
1289
 
      //i++;
1290
 
      //bft_printf("  %i %s %s \n", i, nomlag[i], nomlav[i]);
1291
 
      i++;
1292
 
      bft_printf("  %i %s %s \n", i, nomlag[i], nomlav[i]);
1293
 
      i++;
1294
 
      bft_printf("  %i %s %s \n", i, nomlag[i], nomlav[i]);
1295
 
      i++;
1296
 
      bft_printf("  %i %s %s \n", i, nomlag[i], nomlav[i]);
1297
 
    }
1298
 
    i++;
1299
 
    bft_printf("  %i %s \n", i, nomlag[i]);
1300
 
    */
1301
 
  }
1302
 
 
1303
 
  bft_printf("--iensi3 = %i\n", *iensi3);
1304
 
  if (*iensi3 == 1) {
1305
 
    bft_printf("--nstbor = %i\n", *nstbor);
1306
 
    bft_printf("--seuilf = %f\n", *seuilf);
1307
 
    bft_printf("--inbrbd = %i\n", *inbrbd);
1308
 
    bft_printf("--iflmbd = %i\n", *iflmbd);
1309
 
    bft_printf("--iangbd = %i\n", *iangbd);
1310
 
    bft_printf("--ivitbd = %i\n", *ivitbd);
1311
 
    bft_printf("--iencbd = %i\n", *iencbd);
1312
 
  }
1313
 
 
1314
 
#endif
1315
 
 
1316
 
}
1317
 
 
1318
 
/*-----------------------------------------------------------------------------
1319
 
 * Fortran Interface:
1320
 
 *
1321
 
 * subroutine uilag2
1322
 
 * *****************
1323
 
 *
1324
 
 * integer          nfabor  -->  number of boundary faces
1325
 
 * integer          nozppm  -->  max number of boundary conditions zone
1326
 
 * integer          nclagm  -->  max number of classes
1327
 
 * integer          nflagm  -->  max number of boundaries
1328
 
 * integer          iphyla  -->  physica model associated to the particles
1329
 
 * integer          iusncl  <--  array for particles class(es) number
1330
 
 * integer          iusclb  <--  array for particles boundary conditions
1331
 
 * integer          iuslag  <--  array for integer variables
1332
 
 * double precision ruslag  <--  array for real variables
1333
 
 *----------------------------------------------------------------------------*/
1334
 
 
1335
 
 
1336
 
void CS_PROCF (uilag2, UILAG2) (const int *const nfabor,
1337
 
                                const int *const nozppm,
1338
 
                                const int *const nclagm,
1339
 
                                const int *const nflagm,
1340
 
                                const int *const nbclst,
1341
 
                                const int *const ientrl,
1342
 
                                const int *const isortl,
1343
 
                                const int *const idepo1,
1344
 
                                const int *const idepo2,
1345
 
                                const int *const idepo3,
1346
 
                                const int *const idepfa,
1347
 
                                const int *const iencrl,
1348
 
                                const int *const irebol,
1349
 
                                const int *const iphyla,
1350
 
                                const int *const ijnbp,
1351
 
                                const int *const ijfre,
1352
 
                                const int *const iclst,
1353
 
                                const int *const ijuvw,
1354
 
                                const int *const iuno,
1355
 
                                const int *const iupt,
1356
 
                                const int *const ivpt,
1357
 
                                const int *const iwpt,
1358
 
                                const int *const ijprpd,
1359
 
                                const int *const ipoit,
1360
 
                                const int *const idebt,
1361
 
                                const int *const ijprdp,
1362
 
                                const int *const idpt,
1363
 
                                const int *const ivdpt,
1364
 
                                const int *const iropt,
1365
 
                                const int *const ijprtp,
1366
 
                                const int *const itpt,
1367
 
                                const int *const icpt,
1368
 
                                const int *const iepsi,
1369
 
                                const int *const ihpt,
1370
 
                                const int *const inuchl,
1371
 
                                const int *const imcht,
1372
 
                                const int *const imckt,
1373
 
                                int     ichcor[],
1374
 
                                int     cp2ch[],
1375
 
                                int     diam20[],
1376
 
                                int     rho0ch[],
1377
 
                                int     xashch[],
1378
 
                                int     ifrlag[],
1379
 
                                int     iusncl[],
1380
 
                                int     iusclb[],
1381
 
                                int     iuslag[],
1382
 
                                double  ruslag[])
1383
 
{
1384
 
  int izone, zones;
1385
 
  int iclas;
1386
 
  int ielt, ifac, nelt = 0;
1387
 
  char *interaction = NULL;
1388
 
  char sclass[10];
1389
 
  char *path1, *path2;
1390
 
  char *choice;
1391
 
  int *faces_list = NULL;
1392
 
 
1393
 
  zones = cs_gui_boundary_zones_number();
1394
 
 
1395
 
  /* First iteration only: memory allocation */
1396
 
 
1397
 
  /*
1398
 
    if (boundaries == NULL)
1399
 
      _init_boundaries(nfabor, nozppm);
1400
 
  */
1401
 
 
1402
 
 
1403
 
  for (izone=0; izone < zones; izone++) {
1404
 
 
1405
 
    faces_list = cs_gui_get_faces_list(izone,
1406
 
                                       boundaries->label[izone],
1407
 
                                       *nfabor, *nozppm, &nelt);
1408
 
 
1409
 
    for ( ielt=0; ielt < nelt; ielt++ ) {
1410
 
      ifac = faces_list[ielt];
1411
 
      ifrlag[ifac-1] = izone+1;
1412
 
    }
1413
 
 
1414
 
    path2 = cs_xpath_init_path();
1415
 
    cs_xpath_add_elements(&path2, 2, "boundary_conditions", boundaries->nature[izone]);
1416
 
    cs_xpath_add_test_attribute(&path2, "label", boundaries->label[izone]);
1417
 
    cs_xpath_add_element(&path2, "particles");
1418
 
 
1419
 
    BFT_MALLOC(path1, strlen(path2)+1, char);
1420
 
    strcpy(path1, path2);
1421
 
    cs_xpath_add_attribute(&path1, "choice");
1422
 
    interaction = cs_gui_get_attribute_value(path1);
1423
 
 
1424
 
    if (interaction != NULL) {
1425
 
 
1426
 
      if (cs_gui_strcmp(interaction, "inlet")) {
1427
 
 
1428
 
        iusclb[izone] = *ientrl;
1429
 
        strcpy(path1, path2);
1430
 
        cs_xpath_add_element(&path1, "class");
1431
 
        iusncl[izone] = cs_gui_get_nb_element(path1);
1432
 
        strcpy(path1, path2);
1433
 
 
1434
 
        for (iclas=0; iclas < iusncl[izone]; iclas++) {
1435
 
 
1436
 
          sprintf(sclass, "class[%i]", iclas+1);
1437
 
          BFT_REALLOC(path2, 20+strlen(boundaries->nature[izone])+10+strlen(boundaries->label[izone])+13+strlen(sclass)+1, char);
1438
 
          strcpy(path2, "");
1439
 
          sprintf(path2,
1440
 
                  "boundary_conditions/%s[@label='%s']/particles/%s",
1441
 
                  boundaries->nature[izone],
1442
 
                  boundaries->label[izone],
1443
 
                  sclass);
1444
 
 
1445
 
          _get_int(&IUSLAG((*ijnbp -1), izone, iclas), 2, path2, "number");
1446
 
          _get_int(&IUSLAG((*ijfre -1), izone, iclas), 2, path2, "frequency");
1447
 
          _get_int(&IUSLAG((*iclst -1), izone, iclas), 2, path2, "statistical_groups");
1448
 
 
1449
 
          /* velocity */
1450
 
 
1451
 
          choice = _get_attr("choice", 2, path2, "velocity");
1452
 
 
1453
 
          if (cs_gui_strcmp(choice, "fluid"))
1454
 
            /* iuslag[3*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = -1; */
1455
 
            IUSLAG((*ijuvw -1), izone, iclas) = -1;
1456
 
 
1457
 
          else if (cs_gui_strcmp(choice, "norm")) {
1458
 
            IUSLAG((*ijuvw -1), izone, iclas) = 0;
1459
 
            /* _get_double(&ruslag[1*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "norm"); */
1460
 
            _get_double(&RUSLAG((*iuno -1), izone, iclas), 3, path2, "velocity", "norm");
1461
 
          }
1462
 
          else if (cs_gui_strcmp(choice, "components")) {
1463
 
            /* _get_double(&ruslag[1*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "velocity_x"); */
1464
 
            /*_get_double(&ruslag[2*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "velocity_y"); */
1465
 
            /* _get_double(&ruslag[3*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 3, path2, "velocity", "velocity_z"); */
1466
 
            IUSLAG((*ijuvw -1), izone, iclas) = 1;
1467
 
            _get_double(&RUSLAG((*iupt -1), izone, iclas), 3, path2, "velocity", "velocity_x");
1468
 
            _get_double(&RUSLAG((*ivpt -1), izone, iclas), 3, path2, "velocity", "velocity_y");
1469
 
            _get_double(&RUSLAG((*iwpt -1), izone, iclas), 3, path2, "velocity", "velocity_z");
1470
 
          }
1471
 
          else if (cs_gui_strcmp(choice, "subroutine"))
1472
 
            IUSLAG((*ijuvw -1), izone, iclas) = 2;
1473
 
 
1474
 
          /* statistical_weight, mass_flow_rate*/
1475
 
 
1476
 
          choice = _get_attr("choice", 2, path2, "statistical_weight");
1477
 
 
1478
 
          if (cs_gui_strcmp(choice, "prescribed")) {
1479
 
            /* iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1; */
1480
 
            /* _get_double(&ruslag[10*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "statistical_weight"); */
1481
 
            IUSLAG((*ijprpd -1), izone, iclas) = 1;
1482
 
            _get_double(&RUSLAG((*ipoit -1), izone, iclas), 2, path2, "statistical_weight");
1483
 
            RUSLAG((*idebt -1), izone, iclas) = 0;
1484
 
          }
1485
 
          else if (cs_gui_strcmp(choice, "rate")) {
1486
 
            /* iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1; */
1487
 
            /* _get_double(&ruslag[11*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "mass_flow_rate"); */
1488
 
            IUSLAG((*ijprpd -1), izone, iclas) = 1;
1489
 
            _get_double(&RUSLAG((*idebt -1), izone, iclas), 2, path2, "mass_flow_rate");
1490
 
            RUSLAG((*ipoit -1), izone, iclas) = 1;
1491
 
          }
1492
 
          else if (cs_gui_strcmp(choice, "subroutine")) {
1493
 
            /* iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 2; */
1494
 
            /* _get_double(&ruslag[10*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "statistical_weight"); */
1495
 
            IUSLAG((*ijprpd -1), izone, iclas) = 2;
1496
 
            _get_double(&RUSLAG((*ipoit -1), izone, iclas), 2, path2, "statistical_weight");
1497
 
            RUSLAG((*idebt -1), izone, iclas) = 0;
1498
 
          }
1499
 
 
1500
 
          /* diameter */
1501
 
 
1502
 
          choice = _get_attr("choice", 2, path2, "diameter");
1503
 
 
1504
 
          if (cs_gui_strcmp(choice, "prescribed")) {
1505
 
            /* iuslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1; */
1506
 
            /* _get_double(&ruslag[5*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "diameter"); */
1507
 
            /* _get_double(&ruslag[6*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "diameter_standard_deviation"); */
1508
 
            IUSLAG((*ijprdp -1), izone, iclas) = 1;
1509
 
            _get_double(&RUSLAG((*idpt -1), izone, iclas), 2, path2, "diameter");
1510
 
            _get_double(&RUSLAG((*ivdpt -1), izone, iclas), 2, path2, "diameter_standard_deviation");
1511
 
 
1512
 
          }
1513
 
          else if (cs_gui_strcmp(choice, "subroutine"))
1514
 
            IUSLAG((*ijprdp -1), izone, iclas) = 2;
1515
 
 
1516
 
          /* density */
1517
 
 
1518
 
          /* _get_double(&ruslag[7*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "density"); */
1519
 
          _get_double(&RUSLAG((*iropt -1), izone, iclas), 2, path2, "density");
1520
 
 
1521
 
          if (*iphyla == 1) {
1522
 
 
1523
 
            /* temperature, specific_heat, emissivity */
1524
 
 
1525
 
            choice = _get_attr("choice", 2, path2, "temperature");
1526
 
 
1527
 
            if (cs_gui_strcmp(choice, "prescribed")) {
1528
 
              /* iuslag[4*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas] = 1; */
1529
 
              /* _get_double(&ruslag[4*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "temperature"); */
1530
 
              IUSLAG((*ijprtp -1), izone, iclas) = 1;
1531
 
              _get_double(&RUSLAG((*itpt -1), izone, iclas), 2, path2, "temperature");
1532
 
            }
1533
 
            else if (cs_gui_strcmp(choice, "subroutine"))
1534
 
              IUSLAG((*ijprtp -1), izone, iclas) = 2;
1535
 
 
1536
 
            /* _get_double(&ruslag[8*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "specific_heat"); */
1537
 
            /* _get_double(&ruslag[9*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "emissivity"); */
1538
 
            _get_double(&RUSLAG((*icpt -1), izone, iclas), 2, path2, "specific_heat");
1539
 
            _get_double(&RUSLAG((*iepsi -1), izone, iclas), 2, path2, "emissivity");
1540
 
          }
1541
 
 
1542
 
          /* coal */
1543
 
 
1544
 
          if (*iphyla == 2) {
1545
 
            /* _get_int(&iuslag[6*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "coal_number"); */
1546
 
            /* _get_double(&ruslag[12*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "coal_temperature"); */
1547
 
            /* _get_double(&ruslag[13*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "raw_coal_mass_fraction"); */
1548
 
            /* _get_double(&ruslag[14*(*nclagm)*(*nflagm)+izone*(*nclagm)+iclas], 2, path2, "char_mass_fraction"); */
1549
 
            _get_int(&IUSLAG((*inuchl -1), izone, iclas), 2, path2, "coal_number");
1550
 
            _get_double(&RUSLAG((*ihpt -1), izone, iclas), 2, path2, "coal_temperature");
1551
 
            _get_double(&RUSLAG((*imcht -1), izone, iclas), 2, path2, "raw_coal_mass_fraction");
1552
 
            _get_double(&RUSLAG((*imckt -1), izone, iclas), 2, path2, "char_mass_fraction");
1553
 
          }
1554
 
        }
1555
 
      }
1556
 
 
1557
 
      else if(cs_gui_strcmp(interaction, "outlet"))
1558
 
        iusclb[izone] = *isortl;
1559
 
 
1560
 
      else if(cs_gui_strcmp(interaction, "bounce"))
1561
 
        iusclb[izone] = *irebol;
1562
 
 
1563
 
      else if(cs_gui_strcmp(interaction, "deposit1"))
1564
 
        iusclb[izone] = *idepo1;
1565
 
 
1566
 
      else if(cs_gui_strcmp(interaction, "deposit2"))
1567
 
        iusclb[izone] = *idepo2;
1568
 
 
1569
 
      else if(cs_gui_strcmp(interaction, "deposit3"))
1570
 
        iusclb[izone] = *idepo3;
1571
 
 
1572
 
      else if(cs_gui_strcmp(interaction, "fouling") && *iphyla == 2)
1573
 
        iusclb[izone] = *iencrl;
1574
 
 
1575
 
      else if(cs_gui_strcmp(interaction, "fouling") && (*iphyla == 0  || *iphyla == 1))
1576
 
        iusclb[izone] = *idepfa;
1577
 
 
1578
 
   }
1579
 
   BFT_FREE(path1);
1580
 
   BFT_FREE(path2);
1581
 
 }
1582
 
 
1583
 
#if _XML_DEBUG_
1584
 
  bft_printf("==>UILAG2\n");
1585
 
  for (izone=0; izone<zones; izone++) {
1586
 
 
1587
 
    bft_printf("--iusclb[%i] = %i has %i class(es) \n", izone, iusclb[izone], iusncl[izone]);
1588
 
 
1589
 
    for (iclas=0; iclas < iusncl[izone]; iclas++) {
1590
 
 
1591
 
      bft_printf("--zone %i : class number %i \n", izone, iusncl[izone]);
1592
 
      bft_printf("--        : label    %s \n", boundaries->label[izone]);
1593
 
      bft_printf("--        : nature   %s \n", boundaries->nature[izone]);
1594
 
      bft_printf("--        : p_nature %i \n", iusclb[izone]);
1595
 
 
1596
 
      if ( (iusclb[izone] == *ientrl) && (iusncl[izone] != 0) ) {
1597
 
        bft_printf("---number = %i \n", IUSLAG((*ijnbp -1), izone, iclas));
1598
 
        bft_printf("---frequency = %i \n", IUSLAG((*ijfre -1), izone, iclas));
1599
 
        bft_printf("---statistical_groups = %i \n", IUSLAG((*iclst -1), izone, iclas));
1600
 
 
1601
 
        bft_printf("---velocity choice: %i  (-1: fluid, 0: norm, 1: components, 2: subroutine)\n", IUSLAG((*ijuvw -1), izone, iclas));
1602
 
 
1603
 
        if (IUSLAG((*ijuvw -1), izone, iclas) == 0)
1604
 
 
1605
 
          bft_printf("----norm = %f \n", RUSLAG((*iuno -1), izone, iclas));
1606
 
 
1607
 
        else if (IUSLAG((*ijuvw -1), izone, iclas) == 1) {
1608
 
 
1609
 
          bft_printf("----u = %f \n", RUSLAG((*iupt -1), izone, iclas));
1610
 
          bft_printf("----v = %f \n", RUSLAG((*ivpt -1), izone, iclas));
1611
 
          bft_printf("----w = %f \n", RUSLAG((*iwpt -1), izone, iclas));
1612
 
        }
1613
 
 
1614
 
        bft_printf("---statistical weight choice: %i  (1: prescribed, 2: subroutine)\n", IUSLAG((*ijprpd -1), izone, iclas));
1615
 
 
1616
 
        if (IUSLAG((*ijprpd -1), izone, iclas) == 1) {
1617
 
          bft_printf("----statistical weight = %f \n", RUSLAG((*ipoit -1), izone, iclas));
1618
 
          bft_printf("----mass flow rate = %f \n", RUSLAG((*idebt -1), izone, iclas));
1619
 
        }
1620
 
 
1621
 
        bft_printf("---diameter choice = %i (1: prescribed, 2: subroutine)\n", IUSLAG((*ijprdp -1), izone, iclas));
1622
 
 
1623
 
        if (IUSLAG((*ijprdp -1), izone, iclas) == 1) {
1624
 
          bft_printf("----diameter = %f \n", RUSLAG((*idpt -1), izone, iclas));
1625
 
          bft_printf("----standard deviation = %f \n", RUSLAG((*ivdpt -1), izone, iclas));
1626
 
        }
1627
 
 
1628
 
        bft_printf("---density = %f \n", RUSLAG((*iropt -1), izone, iclas));
1629
 
 
1630
 
        if (*iphyla == 1) {
1631
 
 
1632
 
          bft_printf("---temperature choice = %i (1: prescribed, 2: subroutine)\n", IUSLAG((*ijprtp -1), izone, iclas));
1633
 
 
1634
 
          if (IUSLAG((*ijprtp -1), izone, iclas) == 1)
1635
 
            bft_printf("----temperature = %f \n", RUSLAG((*itpt -1), izone, iclas));
1636
 
 
1637
 
          bft_printf("---specific heat = %f \n", RUSLAG((*icpt -1), izone, iclas));
1638
 
          bft_printf("---emissivity = %f \n", RUSLAG((*iepsi -1), izone, iclas));
1639
 
        }
1640
 
 
1641
 
        if (*iphyla == 2) {
1642
 
          bft_printf("---coal number = %i \n",            IUSLAG((*inuchl -1), izone, iclas));
1643
 
          bft_printf("---coal temperature = %f \n",       RUSLAG((*ihpt -1), izone, iclas));
1644
 
          bft_printf("---raw coal mass fraction = %f \n", RUSLAG((*imcht -1), izone, iclas));
1645
 
          bft_printf("---char mass fraction = %f \n",     RUSLAG((*imckt -1), izone, iclas));
1646
 
        }
1647
 
      }
1648
 
    }
1649
 
  }
1650
 
#endif
1651
 
}
1652
 
 
1653
 
/*----------------------------------------------------------------------------*/
1654
 
 
1655
 
END_C_DECLS