1
/*============================================================================
3
* This file is part of the Code_Saturne Kernel, element of the
4
* Code_Saturne CFD tool.
6
* Copyright (C) 1998-2009 EDF S.A., France
8
* contact: saturne-support@edf.fr
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.
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.
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
26
*============================================================================*/
28
/*============================================================================
29
* Management of the GUI parameters file: specific physics
30
*============================================================================*/
32
#if defined(HAVE_CONFIG_H)
33
#include "cs_config.h"
36
/*----------------------------------------------------------------------------
37
* Standard C library headers
38
*----------------------------------------------------------------------------*/
48
/*----------------------------------------------------------------------------
50
*----------------------------------------------------------------------------*/
53
#include <bft_error.h>
54
#include <bft_printf.h>
56
/*----------------------------------------------------------------------------
58
*----------------------------------------------------------------------------*/
60
#include "fvm_selector.h"
62
/*----------------------------------------------------------------------------
64
*----------------------------------------------------------------------------*/
67
#include "mei_evaluate.h"
70
/*----------------------------------------------------------------------------
72
*----------------------------------------------------------------------------*/
75
#include "cs_gui_util.h"
76
#include "cs_gui_variables.h"
78
#include "cs_prototypes.h"
80
/*----------------------------------------------------------------------------
81
* Header for the current file
82
*----------------------------------------------------------------------------*/
84
#include "cs_gui_specific_physics.h"
86
/*----------------------------------------------------------------------------*/
90
/*=============================================================================
91
* Local Macro Definitions
92
*============================================================================*/
94
/* debugging switch */
97
/*============================================================================
98
* Private function definitions
99
*============================================================================*/
101
/*-----------------------------------------------------------------------------
102
* Return the activated specific physics scalar number
103
*----------------------------------------------------------------------------*/
106
_scalar_number(const char* model)
111
path = cs_xpath_init_path();
112
cs_xpath_add_element(&path, "thermophysical_models");
113
cs_xpath_add_element(&path, model);
114
cs_xpath_add_element(&path, "scalar");
116
nb = cs_gui_get_nb_element(path);
123
/*============================================================================
124
* Public Fortran function definitions
125
*============================================================================*/
127
/*-----------------------------------------------------------------------------
128
* Predefined physics indicator.
135
* INTEGER IPPMOD <-- specific physics indicator array
136
* INTEGER ICOD3P --> diffusion flame in fast complete chemistry
137
* INTEGER ICODEQ --> diffusion flame in fast chemistry towards balance
138
* INTEGER ICOEBU --> Eddy Break Up premixing flame
139
* INTEGER ICOBML --> Bray - Moss - Libby premixing flame
140
* INTEGER ICOLWC --> Libby Williams premixing flame
141
* INTEGER ICP3PL --> Coal combustion. Combustible moyen local
142
* INTEGER ICPL3C --> Coal combustion coupled with lagrangien approach
143
* INTEGER ICFUEL --> Fuel combustion
144
* INTEGER IELJOU --> Joule effect
145
* INTEGER IELARC --> electrical arc
146
* INTEGER IELION --> ionique mobility
147
* INTEGER ICOMPF --> compressible without shock
148
* INTEGER IATMOS --> atmospheric flows
149
* INTEGER IAEROS --> cooling tower
150
* INTEGER INDJON --> INDJON=1: a JANAF enthalpy-temperature
151
* tabulation is used. INDJON=1: users tabulation
152
* INTEGER IEQCO2 --> CO2 massic fraction transport
154
*----------------------------------------------------------------------------*/
156
void CS_PROCF (uippmo, UIPPMO)(int *const ippmod,
177
cs_var_t *vars = cs_glob_var;
179
ippmod[*icod3p - 1] = -1;
180
ippmod[*icodeq - 1] = -1;
181
ippmod[*icoebu - 1] = -1;
182
ippmod[*icobml - 1] = -1;
183
ippmod[*icolwc - 1] = -1;
184
ippmod[*icp3pl - 1] = -1;
185
ippmod[*icpl3c - 1] = -1;
186
ippmod[*icfuel - 1] = -1;
187
ippmod[*ieljou - 1] = -1;
188
ippmod[*ielarc - 1] = -1;
189
ippmod[*ielion - 1] = -1;
190
ippmod[*icompf - 1] = -1;
191
ippmod[*iatmos - 1] = -1;
192
ippmod[*iaeros - 1] = -1;
197
/* Look for the active specific physics and give the value of the associated
199
isactiv = cs_gui_get_activ_thermophysical_model();
203
if (cs_gui_strcmp(vars->model, "pulverized_coal"))
205
if (cs_gui_strcmp(vars->model_value, "coal_homo"))
206
ippmod[*icp3pl - 1] = 0;
207
else if (cs_gui_strcmp(vars->model_value, "coal_homo2"))
208
ippmod[*icp3pl - 1] = 1;
210
bft_error(__FILE__, __LINE__, 0,
211
_("Invalid coal model: %s.\n"), vars->model_value);
213
else if (cs_gui_strcmp(vars->model, "atmospheric_flows"))
215
if (cs_gui_strcmp(vars->model_value, "constant"))
216
ippmod[*iatmos - 1] = 0;
217
else if (cs_gui_strcmp(vars->model_value, "dry"))
218
ippmod[*iatmos - 1] = 1;
219
else if (cs_gui_strcmp(vars->model_value, "humid"))
220
ippmod[*iatmos - 1] = 2;
222
bft_error(__FILE__, __LINE__, 0,
223
_("Invalid atmospheric flow model: %s.\n"),
227
/* If the model is active, one only takes the specific physics scalars */
228
nscapp = _scalar_number(vars->model);
231
vars->nscapp = nscapp;
234
bft_printf("==>UIPPMO\n");
237
bft_printf("--thermophysical model: %s\n", vars->model);
238
bft_printf("--thermophysical value: %s\n", vars->model_value);
239
bft_printf("--model scalars number: %i\n", vars->nscapp);
245
/*----------------------------------------------------------------------------
246
* Density under relaxation
250
* SUBROUTINE UICPI1 (SRROM)
252
* DOUBLE PRECISION SRROM <-- density relaxation
253
*----------------------------------------------------------------------------*/
255
void CS_PROCF (uicpi1, UICPI1) (double *const srrom)
257
cs_gui_numerical_double_parameters("density_relaxation", srrom);
260
bft_printf("==>UICPI1\n");
261
bft_printf("--srrom = %f\n", *srrom);
265
/*-----------------------------------------------------------------------------
266
* Indirection between the solver numbering and the XML one
267
* for physical properties of the activated specific physics
268
*----------------------------------------------------------------------------*/
270
void CS_PROCF (uicppr, UICPPR) (const int *const nclass,
271
const int *const nsalpp,
272
const int *const nsalto,
273
const int *const ippmod,
274
const int *const icp3pl,
275
const int *const ipppro,
276
const int *const ipproc,
277
const int *const ihtco2,
278
const int *const itemp1,
279
const int *const irom1,
280
const int *const iym1,
281
const int *const immel,
282
const int *const itemp2,
283
const int *const ix2,
284
const int *const irom2,
285
const int *const idiam2,
286
const int *const igmdch,
287
const int *const igmdv1,
288
const int *const igmdv2,
289
const int *const igmhet,
290
const int *const ighco2,
291
const int *const igmsec)
298
cs_var_t *vars = cs_glob_var;
301
vars->nprop += *nsalpp;
302
vars->nsalpp = *nsalpp;
304
BFT_REALLOC(vars->properties_ipp, vars->nprop, int);
305
BFT_REALLOC(vars->propce, vars->nprop, int);
306
BFT_REALLOC(vars->properties_name, vars->nprop, char*);
309
vars->properties_ipp[n] = ipppro[ ipproc[ *itemp1 -1 ]-1 ];
310
vars->propce[n] = *itemp1;
311
BFT_MALLOC(vars->properties_name[n], strlen("Temp_GAZ")+1, char);
312
strcpy(vars->properties_name[n++], "Temp_GAZ");
315
vars->properties_ipp[n] = ipppro[ ipproc[ *irom1 -1 ]-1 ];
316
vars->propce[n] = *irom1;
317
BFT_MALLOC(vars->properties_name[n], strlen("ROM_GAZ")+1, char);
318
strcpy(vars->properties_name[n++], "ROM_GAZ");
321
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[0] -1 ]-1 ];
322
vars->propce[n] = iym1[0];
323
BFT_MALLOC(vars->properties_name[n], strlen("YM_CHx1m")+1, char);
324
strcpy(vars->properties_name[n++], "YM_CHx1m");
327
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[1] -1 ]-1 ];
328
vars->propce[n] = iym1[1];
329
BFT_MALLOC(vars->properties_name[n], strlen("YM_CHx2m")+1, char);
330
strcpy(vars->properties_name[n++], "YM_CHx2m");
333
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[2] -1 ]-1 ];
334
vars->propce[n] = iym1[2];
335
BFT_MALLOC(vars->properties_name[n], strlen("YM_CO")+1, char);
336
strcpy(vars->properties_name[n++], "YM_CO");
339
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[3] -1 ]-1 ];
340
vars->propce[n] = iym1[3];
341
BFT_MALLOC(vars->properties_name[n], strlen("YM_O2")+1, char);
342
strcpy(vars->properties_name[n++], "YM_O2");
345
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[4] -1 ]-1 ];
346
vars->propce[n] = iym1[4];
347
BFT_MALLOC(vars->properties_name[n], strlen("YM_CO2")+1, char);
348
strcpy(vars->properties_name[n++], "YM_CO2");
351
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[5] -1 ]-1 ];
352
vars->propce[n] = iym1[5];
353
BFT_MALLOC(vars->properties_name[n], strlen("YM_H2O")+1, char);
354
strcpy(vars->properties_name[n++], "YM_H2O");
357
vars->properties_ipp[n] = ipppro[ ipproc[ iym1[6] -1 ]-1 ];
358
vars->propce[n] = iym1[6];
359
BFT_MALLOC(vars->properties_name[n], strlen("YM_N2")+1, char);
360
strcpy(vars->properties_name[n++], "YM_N2");
363
vars->properties_ipp[n] = ipppro[ ipproc[ *immel -1 ]-1 ];
364
vars->propce[n] = *immel;
365
BFT_MALLOC(vars->properties_name[n], strlen("XM")+1, char);
366
strcpy(vars->properties_name[n++], "XM");
368
/* ITEMP2 loop on classes */
369
BFT_MALLOC(name, strlen("Temp_CP")+1 + 2, char);
370
BFT_MALLOC(snumpp, 1 + 2, char);
371
strcpy(name, "Temp_CP");
372
for (i = 0; i < *nclass; i++) {
373
sprintf(snumpp, "%2.2i", i+1);
374
strcat(name, snumpp);
376
vars->properties_ipp[n] = ipppro[ ipproc[ itemp2[i] -1 ]-1 ];
377
vars->propce[n] = itemp2[i];
378
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
379
strcpy(vars->properties_name[n++], name);
381
strcpy(name, "Temp_CP");
384
/* IX2 loop on classes */
385
BFT_REALLOC(name, strlen("Frm_CP")+1 + 2, char);
386
strcpy(name, "Frm_CP");
387
for (i = 0; i < *nclass; i++) {
388
sprintf(snumpp, "%2.2i", i+1);
389
strcat(name, snumpp);
391
vars->properties_ipp[n] = ipppro[ ipproc[ ix2[i] -1 ]-1 ];
392
vars->propce[n] = ix2[i];
393
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
394
strcpy(vars->properties_name[n++], name);
396
strcpy(name, "Frm_CP");
399
/* IROM2 loop on classes */
400
BFT_REALLOC(name, strlen("Rho_CP")+1 + 2, char);
401
strcpy(name, "Rho_CP");
402
for (i = 0; i < *nclass; i++) {
403
sprintf(snumpp, "%2.2i", i+1);
404
strcat(name, snumpp);
406
vars->properties_ipp[n] = ipppro[ ipproc[ irom2[i] -1 ]-1 ];
407
vars->propce[n] = irom2[i];
408
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
409
strcpy(vars->properties_name[n++], name);
411
strcpy(name, "Rho_CP");
414
/* IDIAM2 loop on classes */
415
BFT_REALLOC(name, strlen("Dia_CK")+1 + 2, char);
416
strcpy(name, "Dia_CK");
417
for (i = 0; i < *nclass; i++) {
418
sprintf(snumpp, "%2.2i", i+1);
419
strcat(name, snumpp);
421
vars->properties_ipp[n] = ipppro[ ipproc[ idiam2[i] -1 ]-1 ];
422
vars->propce[n] = idiam2[i];
423
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
424
strcpy(vars->properties_name[n++], name);
426
strcpy(name, "Dia_CK");
429
/* IGMDCH loop on classes */
430
BFT_REALLOC(name, strlen("Ga_DCH")+1 + 2, char);
431
strcpy(name, "Ga_DCH");
432
for (i = 0; i < *nclass; i++) {
433
sprintf(snumpp, "%2.2i", i+1);
434
strcat(name, snumpp);
436
vars->properties_ipp[n] = ipppro[ ipproc[ igmdch[i] -1 ]-1 ];
437
vars->propce[n] = igmdch[i];
438
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
439
strcpy(vars->properties_name[n++], name);
441
strcpy(name, "Ga_DCH");
444
/* IGMDV1 loop on classes */
445
BFT_REALLOC(name, strlen("Ga_DV1")+1 + 2, char);
446
strcpy(name, "Ga_DV1");
447
for (i = 0; i < *nclass; i++) {
448
sprintf(snumpp, "%2.2i", i+1);
449
strcat(name, snumpp);
451
vars->properties_ipp[n] = ipppro[ ipproc[ igmdv1[i] -1 ]-1 ];
452
vars->propce[n] = igmdv1[i];
453
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
454
strcpy(vars->properties_name[n++], name);
456
strcpy(name, "Ga_DV1");
459
/* IGMDV2 loop on classes */
460
BFT_REALLOC(name, strlen("Ga_DV2")+1 + 2, char);
461
strcpy(name, "Ga_DV2");
462
for (i = 0; i < *nclass; i++) {
463
sprintf(snumpp, "%2.2i", i+1);
464
strcat(name, snumpp);
466
vars->properties_ipp[n] = ipppro[ ipproc[ igmdv2[i] -1 ]-1 ];
467
vars->propce[n] = igmdv2[i];
468
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
469
strcpy(vars->properties_name[n++], name);
471
strcpy(name, "Ga_DV2");
474
/* IGMHET loop on classes */
475
BFT_REALLOC(name, strlen("Ga_HET_O2")+1 + 2, char);
476
strcpy(name, "Ga_HET_O2");
477
for (i = 0; i < *nclass; i++) {
478
sprintf(snumpp, "%2.2i", i+1);
479
strcat(name, snumpp);
481
vars->properties_ipp[n] = ipppro[ ipproc[ igmhet[i] -1 ]-1 ];
482
vars->propce[n] = igmhet[i];
483
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
484
strcpy(vars->properties_name[n++], name);
486
strcpy(name, "Ga_HET_O2");
491
/* IGHCO2 loop on classes */
492
BFT_REALLOC(name, strlen("Ga_HET_CO2")+1 + 2, char);
493
strcpy(name, "Ga_HET_CO2");
494
for (i = 0; i < *nclass; i++)
496
sprintf(snumpp, "%2.2i", i+1);
497
strcat(name, snumpp);
499
vars->properties_ipp[n] = ipppro[ ipproc[ ighco2[i] -1 ]-1 ];
500
vars->propce[n] = ighco2[i];
501
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
502
strcpy(vars->properties_name[n++], name);
504
strcpy(name, "Ga_HET_CO2");
508
if (ippmod[*icp3pl -1] == 1)
510
/* IGMSEC loop on classes */
511
BFT_REALLOC(name, strlen("Ga_SEC")+1 + 2, char);
512
strcpy(name, "Ga_SEC");
513
for (i = 0; i < *nclass; i++)
515
sprintf(snumpp, "%2.2i", i+1);
516
strcat(name, snumpp);
518
vars->properties_ipp[n] = ipppro[ ipproc[ igmsec[i] -1 ]-1 ];
519
vars->propce[n] = igmsec[i];
520
BFT_MALLOC(vars->properties_name[n], strlen(name)+1, char);
521
strcpy(vars->properties_name[n++], name);
523
strcpy(name, "Ga_SEC");
530
if (n != vars->nsalpp)
531
bft_error(__FILE__, __LINE__, 0,
532
_("number of properties is not correct: %i instead of: %i\n"),
536
bft_printf("==>UICPPR\n");
537
bft_printf("-->nombre de proprietes = %i\n", vars->nprop);
538
for (i=0 ; i<vars->nprop ; i++)
539
bft_printf("-->properties_ipp[%i]: %i propce[%i]: %i "
540
"properties_name[%i]: %s\n",
541
i, vars->properties_ipp[i],
543
i, vars->properties_name[i]);
547
/*------------------------------------------------------------------------------
548
* Indirection between the solver numbering and the XML one
549
* for the model scalar
550
*----------------------------------------------------------------------------*/
552
void CS_PROCF (uicpsc, UICPSC) (const int *const ncharb,
553
const int *const nclass,
554
const int *const noxyd,
555
const int *const ippmod,
556
const int *const icp3pl,
557
const int *const ieqco2,
558
const int *const ihtco2,
559
const int *const ihm,
560
const int *const inp,
561
const int *const ixch,
562
const int *const ixck,
563
const int *const ixwt,
564
const int *const ih2,
565
const int *const if1m,
566
const int *const if2m,
567
const int *const if3m,
568
const int *const if3mc2,
569
const int *const if4p2m,
570
const int *const if5m,
571
const int *const if6m,
572
const int *const if7m,
573
const int *const iyco2)
577
char *snumsca = NULL;
579
cs_var_t *vars = cs_glob_var;
581
if (vars->nscaus > 0) {
582
BFT_REALLOC(vars->label, vars->nscapp + vars->nscaus, char*);
584
BFT_MALLOC(vars->label, vars->nscapp, char*);
588
BFT_MALLOC(vars->label[*ihm -1], strlen("Enthalpy")+1, char);
589
strcpy(vars->label[*ihm -1], "Enthalpy");
591
/* Loop on classes IH2, INP, IXCH, IXCK */
592
BFT_MALLOC(snumsca, 1 + 2, char);
595
BFT_MALLOC(name, strlen("ENT_CP")+1 + 2, char);
596
strcpy(name, "ENT_CP");
597
for (i = 0; i < *nclass; i++) {
598
sprintf(snumsca,"%2.2i", i+1);
599
strcat(name, snumsca);
601
BFT_MALLOC(vars->label[ih2[i] -1], strlen(name)+1, char);
602
strcpy(vars->label[ih2[i] -1], name);
604
strcpy(name, "ENT_CP");
608
BFT_REALLOC(name, strlen("NP_CP")+1 + 2, char);
609
strcpy(name, "NP_CP");
610
for (i = 0; i < *nclass; i++) {
611
sprintf(snumsca,"%2.2i", i+1);
612
strcat(name, snumsca);
614
BFT_MALLOC(vars->label[inp[i] -1], strlen(name)+1, char);
615
strcpy(vars->label[inp[i] -1], name);
617
strcpy(name, "NP_CP");
621
BFT_REALLOC(name, strlen("XCH_CP")+1 + 2, char);
622
strcpy(name, "XCH_CP");
623
for (i = 0; i < *nclass; i++) {
624
sprintf(snumsca,"%2.2i", i+1);
625
strcat(name, snumsca);
627
BFT_MALLOC(vars->label[ixch[i] -1], strlen(name)+1, char);
628
strcpy(vars->label[ixch[i] -1], name);
630
strcpy(name, "XCH_CP");
634
BFT_REALLOC(name, strlen("XCK_CP")+1 + 2, char);
635
strcpy(name, "XCK_CP");
636
for (i = 0; i < *nclass; i++) {
637
sprintf(snumsca,"%2.2i", i+1);
638
strcat(name, snumsca);
640
BFT_MALLOC(vars->label[ixck[i] -1], strlen(name)+1, char);
641
strcpy(vars->label[ixck[i] -1], name);
643
strcpy(name, "XCK_CP");
646
/* Loop on coals IFM1 IFM2 */
648
BFT_REALLOC(name, strlen("Fr_MV1")+1 + 2, char);
649
strcpy(name, "Fr_MV1");
650
for (i = 0; i < *ncharb; i++) {
651
sprintf(snumsca,"%2.2i",i+1);
652
strcat(name, snumsca);
654
BFT_MALLOC(vars->label[if1m[i] -1], strlen(name)+1, char);
655
strcpy(vars->label[if1m[i] -1], name);
657
strcpy(name, "Fr_MV1");
660
BFT_REALLOC(name, strlen("Fr_MV2")+1 + 2, char);
661
strcpy(name, "Fr_MV2");
662
for (i = 0; i < *ncharb; i++) {
663
sprintf(snumsca,"%2.2i",i+1);
664
strcat(name, snumsca);
666
BFT_MALLOC(vars->label[if2m[i] -1], strlen(name)+1, char);
667
strcpy(vars->label[if2m[i] -1], name);
669
strcpy(name, "Fr_MV2");
673
BFT_MALLOC(vars->label[*if3m -1], strlen("Fr_HET_O2")+1, char);
674
strcpy(vars->label[*if3m -1], "Fr_HET_O2");
679
BFT_MALLOC(vars->label[*if3mc2 -1], strlen("Fr_HET_CO2")+1, char);
680
strcpy(vars->label[*if3mc2 -1], "Fr_HET_CO2");
684
BFT_MALLOC(vars->label[*if4p2m -1], strlen("Var_AIR")+1, char);
685
strcpy(vars->label[*if4p2m -1], "Var_AIR");
687
if (ippmod[*icp3pl -1] == 1)
690
BFT_MALLOC(name, strlen("XWT_CP")+1 + 2, char);
691
strcpy(name, "XWT_CP");
692
for (i = 0; i < *nclass; i++)
694
sprintf(snumsca,"%2.2i", i+1);
695
strcat(name, snumsca);
697
BFT_MALLOC(vars->label[ixwt[i] -1], strlen(name)+1, char);
698
strcpy(vars->label[ixwt[i] -1], name);
699
strcpy(name, "XWT_CP");
703
BFT_MALLOC(vars->label[*if5m -1], strlen("FR_H20")+1, char);
704
strcpy(vars->label[*if5m -1], "FR_H20");
711
BFT_MALLOC(vars->label[*if6m -1], strlen("FR_OXYD2")+1, char);
712
strcpy(vars->label[*if6m -1], "FR_OXYD2");
718
BFT_MALLOC(vars->label[*if7m -1], strlen("FR_OXYD3")+1, char);
719
strcpy(vars->label[*if7m -1], "FR_OXYD3");
725
BFT_MALLOC(vars->label[*iyco2 -1], strlen("FR_CO2")+1, char);
726
strcpy(vars->label[*iyco2 -1], "FR_CO2");
733
bft_printf("==>UICPSC\n");
734
for (i=0; i< vars->nscaus+vars->nscapp; i++)
735
bft_printf("--label of scalar[%i]: %s\n", i, vars->label[i]);
740
/*----------------------------------------------------------------------------
741
* Atmospheric flows: read of meteorological file of data
747
* integer imeteo <-- on/off index
748
*----------------------------------------------------------------------------*/
750
void CS_PROCF (uiati1, UIATI1) (int *const imeteo)
755
path = cs_xpath_init_path();
756
cs_xpath_add_elements(&path, 3, "thermophysical_models",
760
cs_xpath_add_attribute(&path, "status");
761
if (cs_gui_get_status(path, &status))
766
bft_printf("==>UIATI1\n");
767
bft_printf("--imeteo = %i\n", *imeteo);
771
/*----------------------------------------------------------------------------
772
* Atmospheric flows: indirection between the solver numbering and the XML one
773
* for physical properties.
781
* integer ippmod --> specific physics indicator array
782
* integer iatmos --> index for atmospheric flow
785
* integer itempc --> index for real temperature
786
* integer iliqwt --> index for liquid water
787
*----------------------------------------------------------------------------*/
789
void CS_PROCF (uiatpr, UIATPR) (const int *const nsalpp,
790
const int *const nsalto,
791
const int *const ippmod,
792
const int *const iatmos,
793
const int *const ipppro,
794
const int *const ipproc,
795
const int *const itempc,
796
const int *const iliqwt)
799
cs_var_t *vars = cs_glob_var;
802
vars->nprop += *nsalpp;
803
vars->nsalpp = *nsalpp;
805
BFT_REALLOC(vars->properties_ipp, vars->nprop, int);
806
BFT_REALLOC(vars->propce, vars->nprop, int);
807
BFT_REALLOC(vars->properties_name, vars->nprop, char*);
810
vars->properties_ipp[n] = ipppro[ ipproc[ *itempc -1 ]-1 ];
811
vars->propce[n] = *itempc;
812
BFT_MALLOC(vars->properties_name[n], strlen("real_temperature")+1, char);
813
strcpy(vars->properties_name[n++], "real_temperature");
815
if (ippmod[*iatmos -1] == 2)
818
vars->properties_ipp[n] = ipppro[ ipproc[ *iliqwt -1 ]-1 ];
819
vars->propce[n] = *iliqwt;
820
BFT_MALLOC(vars->properties_name[n], strlen("liquid_water")+1, char);
821
strcpy(vars->properties_name[n++], "liquid_water");
826
bft_printf("==>UIATPR\n");
827
bft_printf("-->nombre de proprietes = %i\n", vars->nprop);
828
for (i=0 ; i<vars->nprop ; i++)
829
bft_printf("-->properties_ipp[%i]: %i propce[%i]: %i "
830
"properties_name[%i]: %s\n",
831
i, vars->properties_ipp[i],
833
i, vars->properties_name[i]);
838
/*----------------------------------------------------------------------------
839
* Atmospheric flows: indirection between the solver numbering and the XML one
840
* for models scalars.
846
* integer ippmod --> specific physics indicator array
847
* integer iatmos --> index for atmospheric flow
848
* integer itempp --> index for potential temperature
849
* integer itempl --> index for liquid potential temperature
850
* integer itotwt --> index for total water content
851
* integer intdrp --> index for total number of droplets
852
*----------------------------------------------------------------------------*/
854
void CS_PROCF (uiatsc, UIATSC) (const int *const ippmod,
855
const int *const iatmos,
856
const int *const itempp,
857
const int *const itempl,
858
const int *const itotwt,
859
const int *const intdrp)
861
cs_var_t *vars = cs_glob_var;
863
if (vars->nscaus > 0)
865
BFT_REALLOC(vars->label, vars->nscapp + vars->nscaus, char*);
869
BFT_MALLOC(vars->label, vars->nscapp, char*);
872
if (ippmod[*iatmos -1] == 1)
875
BFT_MALLOC(vars->label[*itempp -1], strlen("potential_temperature")+1, char);
876
strcpy(vars->label[*itempp -1], "potential_temperature");
878
else if (ippmod[*iatmos -1] == 2)
881
BFT_MALLOC(vars->label[*itempl -1], strlen("liquid_potential_temperature")+1, char);
882
strcpy(vars->label[*itempl -1], "liquid_potential_temperature");
885
BFT_MALLOC(vars->label[*itotwt -1], strlen("total_water")+1, char);
886
strcpy(vars->label[*itotwt -1], "total_water");
889
BFT_MALLOC(vars->label[*intdrp -1], strlen("number_of_droplets")+1, char);
890
strcpy(vars->label[*intdrp -1], "number_of_droplets");
895
bft_printf("==>UIATSC\n");
896
for (i=0; i< vars->nscaus+vars->nscapp; i++)
897
bft_printf("--label of scalar[%i]: %s\n", i, vars->label[i]);
902
/*============================================================================
903
* Public function definitions
904
*============================================================================*/
906
/*-----------------------------------------------------------------------------
907
* Return the name of a thermophysical model.
910
* model_thermo --> thermophysical model
911
*----------------------------------------------------------------------------*/
914
cs_gui_get_thermophysical_model(const char *const model_thermo)
919
path = cs_xpath_init_path();
920
cs_xpath_add_elements(&path, 2, "thermophysical_models", model_thermo);
921
cs_xpath_add_attribute(&path, "model");
923
model = cs_gui_get_attribute_value(path);
930
/*-----------------------------------------------------------------------------
931
* Return 1 if a specific physics model is activated. Store in the global
933
* vars->model <= thermophysical model
934
* vars->model_value <= related model name
935
*----------------------------------------------------------------------------*/
938
cs_gui_get_activ_thermophysical_model(void)
943
cs_var_t *vars = cs_glob_var;
945
const char *name[] = { "pulverized_coal",
948
"atmospheric_flows" };
949
int name_nbr = sizeof(name) / sizeof(name[0]);
951
if (vars->model != NULL && vars->model_value != NULL)
959
vars->model_value = NULL;
962
for (i = 0; i < name_nbr; i++)
964
value = cs_gui_get_thermophysical_model(name[i]);
966
if (value && !cs_gui_strcmp(value, "off"))
968
BFT_MALLOC(vars->model, strlen(name[i])+1, char);
969
strcpy(vars->model, name[i]);
971
BFT_MALLOC(vars->model_value, strlen(value)+1, char);
972
strcpy(vars->model_value, value);
984
/*----------------------------------------------------------------------------*/