1!-------------------------------------------------------------------------------
2
3! This file is part of Code_Saturne, a general-purpose CFD tool.
4!
5! Copyright (C) 1998-2021 EDF S.A.
6!
7! This program is free software; you can redistribute it and/or modify it under
8! the terms of the GNU General Public License as published by the Free Software
9! Foundation; either version 2 of the License, or (at your option) any later
10! version.
11!
12! This program is distributed in the hope that it will be useful, but WITHOUT
13! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14! FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15! details.
16!
17! You should have received a copy of the GNU General Public License along with
18! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
19! Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21!-------------------------------------------------------------------------------
22
23!> \file ppincl.f90
24!> General module for specific physics
25
26module ppincl
27
28  !===========================================================================
29
30  use, intrinsic :: iso_c_binding
31
32  use ppppar
33  use ppthch
34
35  !=============================================================================
36
37  implicit none
38
39  !===========================================================================
40
41  !> \defgroup ppincl General module for specific physics
42
43  !> \addtogroup ppincl
44  !> \{
45
46  !> \defgroup choice Indicator table for specific physics
47
48  !> \addtogroup choice
49  !> \{
50
51  !----------------------------------------------------------------------------
52  !--> TABLEAU INDICATEURS DU CHOIX DE LA PHYSIQUE PARTICULIERE CHOISIE
53
54  !> number of specific physics
55  integer   nmodmx
56  parameter(nmodmx = 14)
57
58  !> global indicator for speciphic physics
59  !> By default, all the indicators ippmod(i.....) are initialized to -1,
60  !> which means that no specific physics is activated.
61  !>   - Diffusion flame in the framework of “3 points” rapid complete chemistry:
62  !>  indicator ippmod(icod3p)
63  !>      - ippmod(icod3p) = 0 adiabatic conditions
64  !>      - ippmod(icod3p) = 1 permeatic conditions (enthalpy transport)
65  !>      - ippmod(icod3p) =-1 module not activated
66  !>   - Eddy Break Up pre-mixed flame: indicator ippmod(icoebu)
67  !>      - ippmod(icoebu) = 0 adiabatic conditions at constant richness
68  !>      - ippmod(icoebu) = 1 permeatic conditions at constant richness
69  !>      - ippmod(icoebu) = 2 adiabatic conditions at variable richness
70  !>      - ippmod(icoebu) = 3 permeatic conditions at variable richness
71  !>      - ippmod(icoebu) =-1 module not activated
72  !>   - Libby-Williams pre-mixed flame: indicator ippmod(icolwc)
73  !>      - ippmod(icolwc)=0 two peak model with adiabiatic conditions.
74  !>      - ippmod(icolwc)=1 two peak model with permeatic conditions.
75  !>      - ippmod(icolwc)=2 three peak model with adiabiatic conditions.
76  !>      - ippmod(icolwc)=3 three peak model with permeatic conditions.
77  !>      - ippmod(icolwc)=4 four peak model with adiabiatic conditions.
78  !>      - ippmod(icolwc)=5 four peak model with permeatic conditions.
79  !>      - ippmod(icolwc)=-1 module not activated.
80  !>   - Multi-coals and multi-classes pulverised coal combustion: indicator ippmod(iccoal)
81  !>
82  !>  The number of different coals must be inferior or equal to ncharm = 3.
83  !>  The number of particle size classes nclpch(icha) for the coal icha, must be
84  !>  inferior or equal to ncpcmx = 10.
85  !>      - ippmod(iccoal) = 0 imbalance between the temperature of the continuous and the
86  !>        solid phases
87  !>      - ippmod(iccoal) = 1 otherwise
88  !>      - ippmod(iccoal) =-1 module not activated
89  !>   - Multi-classes pulverised heavy fuel combustion: indicator ippmod(icfuel)
90  !>      - ippmod(icfuel) = 0 module activated
91  !>      - ippmod(icfuel) =-1 module not activated
92  !>   - Lagrangian modelling of multi-coals and multi-classes pulverised coal combustion:
93  !>     indicator ippmod(icpl3c) The number of different coals must be inferior or equal
94  !>     to ncharm = 3. The number of particle size classes nclpch(icha) for the coal icha,
95  !>     must be inferior or equal to ncpcmx = 10.
96  !>      - ippmod(icpl3c) = 1 coupling with the Lagrangian module, with transport of H2
97  !>      - ippmod(icpl3c) =-1 module not activated
98  !>   - Electric arcs module (Joule effect and Laplace forces): indicator ippmod(ielarc)
99  !>      - ippmod(ielarc) = 1 determination of the magnetic field by means of the Ampere’
100  !>   theorem  (not available)
101  !>      - ippmod(ielarc) = 2 determination of the magnetic field by means of the vector potential
102  !>      - ippmod(ielarc) =-1 module not activated
103  !>   - Joule effect module (Laplace forces not taken into account): indicator ippmod(ieljou)
104  !>      - ippmod(ieljou) = 1 use of a real potential
105  !>      - ippmod(ieljou) = 2 use of a complex potential
106  !>      - ippmod(ieljou) = 3 use of real potential and specific boundary conditions
107  !>  for transformers.
108  !>      - ippmod(ieljou) = 4 use of complex potential and specific boundary conditions
109  !>  for transformers.
110  !>      - ippmod(ieljou) =-1 module not activated
111  !>   - compressible flow module: indicator ippmod(icompf)
112  !>      - ippmod(icompf) = 2 module activated: homogeneous two phase model
113  !>      - ippmod(icompf) = 1 module activated: single phase model
114  !>      - ippmod(icompf) = 0 module activated: single phase barotropic model
115  !>      - ippmod(icompf) =-1 module not activated
116  !>   - atmospheric flow module: indicator ippmod(iatmos)
117  !>      - ippmod(iatmos) =-1 module not activated
118  !>      - ippmod(iatmos) = 0 standard modelling
119  !>      - ippmod(iatmos) = 1 dry atmosphere
120  !>      - ippmod(iatmos) = 2 humid atmosphere
121
122  integer(c_int), pointer, save :: ippmod(:)
123
124  !> ippmod(iphpar) is a global indicator for the specific physics:
125  !>  - 0: no specific physics
126  !>  - 1: switch on the specific physics
127  !>  - 2: switch on the specific physics plus radiative transfer
128  !>       with a parametric file
129  integer :: iphpar
130
131  !> pointer for specific physics
132  !> - ippmod(icod3p) = 0 adiabatic conditions
133  !> - ippmod(icod3p) = 1 permeatic conditions (enthalpy transport)
134  !> - ippmod(icod3p) =-1 module not activated
135  integer ::  icod3p
136
137  !> pointer to specify Eddy Break Up pre-mixed flame with indicator ippmod(icoebu)
138  !> - ippmod(icoebu) = 0 adiabatic conditions at constant richness
139  !> - ippmod(icoebu) = 1 permeatic conditions at constant richness
140  !> - ippmod(icoebu) = 2 adiabatic conditions at variable richness
141  !> - ippmod(icoebu) = 3 permeatic conditions at variable richness
142  !> - ippmod(icoebu) =-1 module not activated
143  integer ::  icoebu
144
145  !> pointer to specify Libby-Williams pre-mixed flame withy indicator ippmod(icolwc)
146  !> - ippmod(icolwc)=0 two peak model with adiabiatic conditions.
147  !> - ippmod(icolwc)=1 two peak model with permeatic conditions.
148  !> - ippmod(icolwc)=2 three peak model with adiabiatic conditions.
149  !> - ippmod(icolwc)=3 three peak model with permeatic conditions.
150  !> - ippmod(icolwc)=4 four peak model with adiabiatic conditions.
151  !> - ippmod(icolwc)=5 four peak model with permeatic conditions.
152  !> - ippmod(icolwc)=-1 module not activated.
153  integer ::  icolwc
154
155  ! TODO Modeles propres a la combustion gaz ICO...
156  integer(c_int), pointer, save ::  isoot
157
158  !> pointer to specify Joule effect module (Laplace forces not taken into account)
159  !> with indicator ippmod(ieljou):
160  !> - ippmod(ieljou) = 1 use of a real potential
161  !> - ippmod(ieljou) = 2 use of a complex potential
162  !> - ippmod(ieljou) = 3 use of real potential and specific boundary conditions
163  !>  for transformers.
164  !> - ippmod(ieljou) = 4 use of complex potential and specific boundary conditions
165  !>  for transformers.
166  !> - ippmod(ieljou) =-1 module not activated
167  integer ::  ieljou
168
169  !> pointer to specify Electric arcs module (Joule effect and Laplace forces)
170  !> with indicator ippmod(ielarc):
171  !> - ippmod(ielarc) = 1 determination of the magnetic field by means of the Ampere’
172  !> theorem  (not available)
173  !> - ippmod(ielarc) = 2 determination of the magnetic field by means of the vector potential
174  !> - ippmod(ielarc) =-1 module not activated
175  integer ::  ielarc
176
177  !> pointer to specify Lagrangian modelling of multi-coals and multi-classes pulverised coal
178  !> combustion with indicator ippmod(icpl3c).
179  !> The number of different coals must be inferior or equal
180  !>  to ncharm = 3. The number of particle size classes nclpch(icha) for the coal icha,
181  !>  must be inferior or equal to ncpcmx = 10.
182  !>  - ippmod(icpl3c) = 1 coupling with the Lagrangian module, with transport of H2
183  !>  - ippmod(icpl3c) =-1 module not activated
184  integer ::  icpl3c
185
186  !> pointer to specify multi-coals and multi-classes pulverised coal combustion
187  !> with indicator ippmod(iccoal).
188  !> The number of different coals must be inferior or equal to ncharm = 3.
189  !> The number of particle size classes nclpch(icha) for the coal icha, must be
190  !> inferior or equal to ncpcmx = 10.
191  !> - ippmod(iccoal) = 0 imbalance between the temperature of the continuous and the
192  !> solid phases
193  !> - ippmod(iccoal) = 1 otherwise
194  !> - ippmod(iccoal) =-1 module not activated
195  integer ::  iccoal
196
197  !> coal with drift (0: without drift (default), 1: with)
198  integer ::  i_comb_drift
199
200  !> pointer to specify multi-classes pulverised heavy fuel combustion
201  !> with indicator ippmod(icfuel)
202  !> - ippmod(icfuel) = 0 module activated
203  !> - ippmod(icfuel) =-1 module not activated
204  integer ::  icfuel
205
206  !> pointer to specify compressible module with indicator ippmod(icompf)
207  !>      - ippmod(icompf) = 2 module activated: homogeneous two phase model
208  !>      - ippmod(icompf) = 1 module activated: single phase model
209  !>      - ippmod(icompf) = 0 module activated: single phase barotropic model
210  !>      - ippmod(icompf) =-1 module not activated
211  integer ::  icompf
212
213  !> pointer to specify atmospheric flow module with indicator ippmod(iatmos)
214  !> - ippmod(iatmos) =-1 module not activated
215  !> - ippmod(iatmos) = 0 standard modelling
216  !> - ippmod(iatmos) = 1 dry atmosphere
217  !> - ippmod(iatmos) = 2 humid atmosphere
218  integer ::  iatmos
219
220  !> pointer to specify cooling towers module with indicator ippmod(iaeros)
221  !> - ippmod(iaeros) =-1 module not activated
222  !> - ippmod(iaeros) >= 0  activated
223  integer ::  iaeros
224
225  !> pointer to specify gas mixture module with indicator ippmod(igmix)
226  !> - ippmod(igmix) =-1 module not activated
227  !> - ippmod(igmix) = 0  Air/Helium   gas mixtures
228  !> - ippmod(igmix) = 1  Air/Hydrogen gas mixtures
229  !> - ippmod(igmix) = 2  Air/Steam    gas mixtures
230  !> - ippmod(igmix) = 3  Air/Helium/Steam gas mixtures
231  !> - ippmod(igmix) = 4  Air/Hydrogen/Steam gas mixtures
232  !> - ippmod(igmix) = 5  Air/Helium with O2 from the air deduced
233
234  integer ::  igmix
235
236  !> pointer to specify richards model
237  !> - ippmod(iricha) =-1 module not activated
238  !> - ippmod(iricha) = 1 module activated
239  integer ::  idarcy
240
241  parameter       (iphpar = 1 , icod3p = 2 ,                        &
242                   icoebu = 3 , icolwc = 4 ,                        &
243                   icpl3c = 5 , iccoal = 6 , icfuel = 7 ,           &
244                   ieljou = 8 , ielarc = 9 , icompf = 10,           &
245                   iatmos = 11, iaeros = 12,                        &
246                   igmix  = 13, idarcy = 14)
247
248  !> \}
249
250  !--> PARAMETERS ASSOCIATED WITH THE GAS MIXTURE MODELLING
251
252  !> \defgroup modelling chosen by the user
253
254  !> \addtogroup gas_mixture
255  !> \{
256
257  !> Specific condensation modelling
258  !>      if = -1 module not activated
259  !>      if =  0 condensation source terms activated
260  integer, save ::  icondb
261
262  !> Specific condensation modelling
263  !>      if = -1 module not activated
264  !>      if =  0 condensation source terms with metal
265  !>                               structures activate
266  integer, save ::  icondv
267
268  !> \}
269
270
271  !--> POINTEURS VARIABLES COMBUSTION GAZ
272
273  !> \defgroup gaz_combustion Gaz combustion variables pointers
274
275  !> \addtogroup gaz_combustion
276  !> \{
277
278  ! ---- Variables transportees
279
280  !> pointer to specify the mixing rate in isca(ifm)
281  integer, save :: ifm
282
283  !> pointer to specify the variance of the mixing rate in isca(ifp2m)
284  integer, save :: ifp2m
285
286  !> pointer to specify the fresh gas mass fraction in isca(iygfm)
287  integer, save :: iygfm
288
289  !> the intersection computation mode. If its value is:
290  !> - 1 (default), the original algorithm is used. Care should be taken to clip
291  !> the intersection on an extremity.
292  !> - 2, a new intersection algorithm is used. Caution should be used to avoid to clip
293  !> the intersection on an extremity.
294  integer, save :: icm
295
296  ! TODO
297  !> transported variable
298  integer, save :: icp2m
299
300  ! TODO
301  !> transported variable
302  integer, save :: ifpcpm
303
304  ! TODO
305  !> transported variable
306  integer, save :: iyfm
307  ! TODO
308  !> transported variable
309  integer, save :: iyfp2m
310  ! TODO
311  !> transported variable
312  integer, save :: icoyfp
313
314  ! ---- Variables d'etat
315
316  !> mass fractions :
317  !>  - iym(1): is fuel mass fraction
318  !>  - iym(2): oxidiser mass fraction
319  !>  - iym(3): product mass fraction
320  !> ibym() contains the matching field ids at boundary faces
321  integer, save :: iym(ngazgm)
322  integer, save :: ibym(ngazgm)
323
324  !> state variable (temperature)
325  integer, save :: itemp
326  !> state variable
327  integer, save :: ifmin
328  !> state variable
329  integer, save :: ifmax
330
331  !> state variable: absorption coefficient, when the radiation modelling is activated
332  integer, save :: ickabs
333
334  !> state variable:  \f$T^3\f$ term, when the radiation modelling is activated
335  integer, save :: it3m
336  !> state variable:  \f$T^4\f$ term, when the radiation modelling is activated
337  integer, save :: it4m
338
339  ! pointer for source term in combustion
340  ! TODO
341  integer, save :: itsc
342
343  !> pointer for soot precursor number in isca (isoot = 1)
344  integer, save :: inpm
345
346  !> pointer for soot mass fraction in isca (isoot = 1)
347  integer, save :: ifsm
348
349  !> \}
350
351  !--> POINTEURS VARIABLES COMBUSTION CHARBON PULVERISE
352
353  !> \defgroup coal_combustion  Pulverized coal combustion variables
354
355  !> \addtogroup coal_combustion
356  !> \{
357
358  ! ---- Variables transportees
359  !        Phase continue (melange gazeux)
360
361  !> mean value of the tracer 1 representing the light
362  !> volatiles released by the coal \c icha
363  integer, save :: if1m(ncharm)
364
365  !> mean value of the tracer 2 representing the heavy
366  !> volatiles released by the coal \c icha
367  integer, save :: if2m(ncharm)
368
369  !> mean value of the tracer 3 representing
370  !> the carbon released as CO during coke burnout
371  integer, save :: if3m
372
373  ! TODO absent de la doc utilisateur
374  !> transported variable of countinuous phase (gas mixture)
375  integer, save :: if4m
376  ! TODO absent de la doc utilisateur
377  !> transported variable of countinuous phase (gas mixture)
378  integer, save :: if5m
379  ! TODO absent de la doc utilisateur
380  !> transported variable of countinuous phase (gas mixture)
381  integer, save :: if6m
382  ! TODO absent de la doc utilisateur
383  !> transported variable of countinuous phase (gas mixture)
384  integer, save :: if7m
385  ! TODO absent de la doc utilisateur
386  !> transported variable of countinuous phase (gas mixture)
387  integer, save :: if8m
388  ! TODO absent de la doc utilisateur
389  !> transported variable of countinuous phase (gas mixture)
390  integer, save :: if9m
391
392  !> the variance associated with the tracer 4 representing the air
393  !> (the mean value of this tracer is not transported, it can be deduced directly
394  !> from the three others)
395  integer, save :: if4p2m
396
397  !> f1f2 variance
398  integer, save :: ifvp2m
399
400  !        Phase dispersee (classe de particules)
401  !> coke mass fraction related to the class icla
402  integer, save :: ixck(nclcpm)
403
404  !> reactive coal mass fraction related to the class \c icla
405  integer, save :: ixch(nclcpm)
406
407  !> number of particles of the class \c icla per kg of air-coal mixture
408  integer, save :: inp(nclcpm)
409
410  !>  mass enthalpy of the coal of class \c icla, if we are in permeatic conditions
411  integer, save :: ih2(nclcpm)
412
413  ! TODO absent de la doc utilisateur
414  !> transported variable of dispersed phase (particle class)
415  integer, save :: ixwt(nclcpm)
416
417  !> Pointer to Np*age(particles)
418  integer, save :: inagecp(nclcpm)
419
420  !> Pointer to age of bulk
421  integer, save :: iage
422
423  !>
424  integer, save :: iv_p_x(nclcpm)
425
426  !>
427  integer, save :: iv_p_y(nclcpm)
428
429  !>
430  integer, save :: iv_p_z(nclcpm)
431
432  ! ---- Variables d'etat
433  !        Phase continue (melange gazeux)
434
435  !> mass fractions:
436  !>  - iym1(1): mass fraction of \f$CH_{X1m}\f$ (light volatiles) in the gas mixture
437  !>  - iym1(2): mass fraction of \f$CH_{X2m}\f$ (heavy volatiles) in the gas mixture
438  !>  - iym1(3): mass fraction of CO in the gas mixture
439  !>  - iym1(4): mass fraction of \f$O_2\f$ in the gas mixture
440  !>  - iym1(5): mass fraction of \f$CO_2\f$ in the gas mixture
441  !>  - iym1(6): mass fraction of \f$H_2O\f$ in the gas mixture
442  !>  - iym1(7): mass fraction of \f$N_2\f$ in the gas mixture
443  integer, save :: iym1(ngazem)
444
445  ! TODO absent de la doc utilisateur
446  !> State variables of continuous phase (gas mixture)
447  integer, save :: irom1
448
449  !>  molar mass of the gas mixture
450  integer, save :: immel
451
452  !        Phase dispersee (classes de particules)
453
454  !> temperature of the particles of the class \c icla
455  integer, save :: itemp2(nclcpm)
456
457  !> density of the particles of the class \c icla
458  integer, save :: irom2(nclcpm)
459
460  !> diameter of the particles of the class \c icla
461  integer, save :: idiam2(nclcpm)
462
463  !>  solid mass fraction of the class \c icla
464  integer, save :: ix2(nclcpm)
465
466  !> disappearance rate of the reactive coal of the class \c icla
467  integer, save :: igmdch(nclcpm)
468
469  !> coke disappearance rate of the coke burnout of the class \c icla
470  integer, save :: igmhet(nclcpm)
471
472  !> Implicite part of the exchanges to the gas by molecular distribution
473  integer, save :: igmtr(nclcpm)
474
475  ! TODO absent de la doc utilisateur
476  !> State variables of dispersed phase (particles class)
477  integer, save :: ighco2(nclcpm)
478
479  !>  mass transfer caused by the release of light volatiles  of the class \c icla
480  integer, save :: igmdv1(nclcpm)
481
482  !>  mass transfer caused by the release of heavy volatiles  of the class \c icla
483  integer, save :: igmdv2(nclcpm)
484
485  ! TODO absent de la doc utilisateur
486  !> State variables of dispersed phase (particles class)
487  integer, save :: igmsec(nclcpm)
488
489  !> Used for bulk balance of Carbon
490  integer, save :: ibcarbone
491  !> Used for bulk balance of Oxygen
492  integer, save :: iboxygen
493  !> Used for bulk balance of Hydrogen
494  integer, save :: ibhydrogen
495
496  !> \}
497
498  !--> POINTEURS VARIABLES COMBUSTION FUEL
499
500  !> \defgroup fuel_combustion Fuel combustion variables
501
502  !> \addtogroup fuel_combustion
503  !> \{
504
505  ! ---- Variables transportees
506  !        Phase continue
507  ! TODO absent de la doc utilisateur
508  !> transported variable of continuous phase
509  integer, save :: ifvap
510
511  !        Phase dispersee
512  ! TODO absent de la doc utilisateur
513  !> transported variable of dispersed phase
514  integer, save :: ihlf(nclcpm)
515
516  ! TODO absent de la doc utilisateur
517  !> transported variable of dispersed phase
518  integer, save :: ixkf(nclcpm)
519
520  ! TODO absent de la doc utilisateur
521  !> transported variable of dispersed phase
522  integer, save :: ixfol(nclcpm)
523
524  ! TODO absent de la doc utilisateur
525  !> transported variable of dispersed phase
526  integer, save :: ing(nclcpm)
527
528  ! ---- Variables d'etat
529  !        Phase continue
530
531  ! TODO absent de la doc utilisateur
532  !> state variable of continuous phase
533  integer, save :: iyfol(nclcpm)
534  !        Phase dispersee
535
536  ! TODO absent de la doc utilisateur
537  !> state variable of dispersed phase
538  integer, save :: ih1hlf(nclcpm)
539  ! TODO absent de la doc utilisateur
540  !> state variable of dispersed phase
541  integer, save :: igmhtf(nclcpm)
542  ! TODO absent de la doc utilisateur
543  !> state variable of dispersed phase
544  integer, save :: igmeva(nclcpm)
545
546  !> \}
547
548
549  !> \defgroup compressible Compressible module
550
551  !> \addtogroup compressible
552  !> \{
553
554  !> specific total energy for compressible algorithm
555  integer, save :: ienerg
556
557  !> temperature deduced from the specific total energy
558  integer, save :: itempk
559
560  !> \defgroup comp_homogeneous Homogeneous two-phase flow model
561
562  !> \addtogroup comp_homogeneous
563  !> \{
564
565  !> \anchor ifracv
566  !> homogeneous model, volume fraction \f$ \alpha \f$
567  integer, save :: ifracv
568
569  !> \anchor ifracm
570  !> homogeneous model, mass fraction \f$ y \f$
571  integer, save :: ifracm
572
573  !> \anchor ifrace
574  !> homogeneous model, energy fraction \f$ z \f$
575  integer, save :: ifrace
576
577  !> \}
578
579  !> \defgroup comp_properties Physical properties
580
581  !> \addtogroup comp_properties
582  !> \{
583
584  !> additional property:
585  !>  - 0 indicates that the volume viscosity is constant and equal to
586  !> the reference volume viscosity \ref viscv0.
587  !>  - 1 indicates that the volume viscosity is variable: its
588  !> variation law must be specified in the user subroutine \ref cs_user_physical_properties.
589  !>
590  !> Always useful.
591  !> The volume viscosity \f$\kappa\f$ is defined by the formula expressing the stress:
592  !> \f{eqnarray*}{
593  !> \tens{\sigma} = -P\,\tens{Id} + \mu (\grad\,\vect{u} +
594  !> \ ^{t}\ggrad\,\vect{u})
595  !> +(\kappa-\frac{2}{3}\mu)\,\dive(\vect{u})\,\tens{Id}
596  !> \f}
597  !>
598  integer, save :: iviscv
599
600  !> \}
601  !> \}
602
603
604  !> \defgroup common Common
605
606  !> \addtogroup common
607  !> \{
608
609  ! ---- Aliases pour les conditions aux limites
610
611  !> alias for boundary conditions
612  integer, save :: irun
613
614  !> alias for boundary conditions
615  integer, save :: irunh
616
617  !> reference volume viscosity
618  real(c_double), pointer, save :: viscv0
619
620  !> pressure predicion by an evolution equation
621  integer, save :: ippred
622
623  !> indicates whether the pressure should be updated (=1) or not (=0) after the
624  !> solution of the acoustic equation always usef
625  integer, save :: igrdpp
626
627  ! --- Conditions aux limites prenant en compte l'equilibre hydrostatique
628
629  !> indicates if the boundary conditions should take into account (=1)
630  !> or not (=0) the hydrostatic balance.
631  !>
632  !> Always useful.
633  !>
634  !> In the cases where gravity is predominant, taking into account
635  !> the hydrostatic pressure allows to get rid of the disturbances which
636  !> may appear near the horizontal walls when the flow is little convective.
637  !>
638  !> Otherwise, when \ref icfgrp=0, the pressure condition is calculated
639  !> from the solution of the unidimensional Euler equations for a perfect
640  !> gas near a wall, for the variables "normal velocity", "density" and
641  !> "pressure":
642  !>
643  !> Case of an expansion (M <= 0):
644  !> \f{align*}{
645  !>    P_p &= 0 & \textrm{if } 1 + \displaystyle\frac{\gamma-1}{2}M<0
646  !> \\ P_p &= P_i \left(1 + \displaystyle\frac{\gamma-1}{2}M\right)
647  !> ^{\frac{2\gamma}{\gamma-1}} & \textrm{otherwise}
648  !> \f}
649  !>
650  !> Case of a schock (M > 0):
651  !> \f{eqnarray*}{
652  !> P_p = P_i \left(1 + \displaystyle\frac{\gamma(\gamma+1)}{4}M^2
653  !> +\gamma M \displaystyle\sqrt{1+\displaystyle\frac{(\gamma+1)^2}{16}M^2}\right)
654  !> \f}
655  !>
656  !> with \f$M = \displaystyle\frac{\vect{u}_i \cdot \vect{n}}{c_i}\f$,
657  !> internal Mach number calculated with the variables taken in the cell.
658  integer, save :: icfgrp
659
660  !> \}
661
662
663  !> \defgroup cooling Cooling Towers Pointers
664
665  !> \addtogroup cooling
666  !> \{
667
668  !> Molar mass ratio = Ratio of the molar mass (H2O) over the molar mass (air)
669  double precision :: molmass_rat
670  parameter(molmass_rat = 0.622d0)
671
672  !> \defgroup cool_transported  Transported variables
673
674  !> \addtogroup cool_transported
675  !> \{
676
677  !> Pointer to define mass fraction of liquid water which is injected in the packing
678  integer, save :: iyml
679
680  !> Pointer to define mass fraction of liquid water which is injected in the rain zones
681  integer, save :: iy_p_l
682
683  !> Pointer to define the temperature of liquide water in rain zone (in fact Y_l.T_l)
684  integer, save :: it_p_l
685
686  !> Pointer to define the temperature (property, deduced from enthalpy)
687  !> of liquid water which is injected in the packing
688  integer, save :: itml
689
690  !> Pointer to define the field enthalpy of liquid water
691  integer, save :: ihml
692
693  !> Pointer to define the air humidity
694  integer, save :: ihumid
695
696  !> Pointer to define the vertical velocity of liquid water
697  integer, save :: ivertvel
698
699  !> \}
700  !> \}
701
702  !> \defgroup enthalpy Enthalpic variables pointers
703
704  !> \addtogroup enthalpy
705  !> \{
706
707  !> enthalpy, if transported or if deduced
708  integer, save :: ihm
709
710  !> \anchor srrom
711  !> with gas combustion, pulverised coal or the electric module, \ref srrom
712  !> is the sub-relaxation coefficient for the density, following the formula:
713  !> \f$\rho^{n+1}$\,=\,srrom\,$\rho^n$+(1-srrom)\,$\rho^{n+1}\f$
714  !> hence, with a zero value, there is no sub-relaxation.
715  !> With combustion and pulverized coal, \ref srrom is initialized to
716  !> \ref cstnum::grand "-grand" and the user must specify a proper value through
717  !> the Interface or the initialization subroutine (\ref cs_user_combustion).
718  !> With gas combustion, pulverised coal or electric arcs, \ref srrom is
719  !> automatically used after the second time-step. With Joule effect,
720  !> the user decides whether or not it will be used in \ref cs_user_physical_properties
721  !> from the coding law giving the density.
722  !>
723  !> Always useful with gas combustion, pulverized coal or the electric module.
724  double precision, save :: srrom
725
726  !> \}
727
728
729  !> \defgroup boundary_conditions Boundary conditions
730
731  !> \addtogroup boundary_conditions
732  !> \{
733
734  !> imposed flow zone indicator
735  !> in a way which is similar to the process described in the framework of the EBU module,
736  !> the user chooses for every inlet face to impose the mass flow or not
737  !> (\ref iqimp "iqimp"(izone)=1 or 0). If the mass flow is imposed, the user
738  !> must set the air mass flow value \ref cpincl::qimpat "qimpat"(izone), its direction in
739  !> \ref rcodcl "rcodcl"(ifac,\ref iu), \ref rcodcl "rcodcl"(ifac,\ref iv)
740  !> and \ref rcodcl "rcodcl"(ifac,\ref iw) and the incoming
741  !> air temperature \ref cpincl::timpat "timpat"(izone) in Kelvin.
742  !> If the velocity is imposed, he has to set  \ref rcodcl "rcodcl"(ifac,\ref iu),
743  !> \ref rcodcl "rcodcl"(ifac,\ref iv), and \ref rcodcl "rcodcl"(ifac,\ref iw).
744  integer, save ::          iqimp(nozppm)
745
746  !> condition type turbulence indicator
747  !>  - 0 : given by the user
748  !>  - 1 : automatic, from hydraulic diameter and input velocity performed.
749  !>  - 2 : automatic, from turbulent intensity and input velocity performed.
750  integer, save ::          icalke(nozppm)
751
752  !> turbulent intensity (k=1.5(uref*xintur)**2)
753  double precision, save :: xintur(nozppm)
754
755  !> hydraulic diameter
756  double precision, save :: dh(nozppm)
757
758  !> index of maximum reached boundary zone
759  integer, save :: nozapm
760
761  !> number of boundary zones on current process
762  integer, save :: nzfppp
763
764  !> list of boundary zones index
765  integer, save :: ilzppp(nbzppm)
766
767  !> \}
768
769  !=============================================================================
770
771  !> \}
772
773  !=============================================================================
774
775  interface
776
777    !---------------------------------------------------------------------------
778
779    !> \cond DOXYGEN_SHOULD_SKIP_THIS
780
781    ! Interface to C function retrieving pointers to members of the
782    ! global fluid properties structure
783
784    subroutine cs_f_fluid_properties_pp_get_pointers(viscv0)   &
785      bind(C, name='cs_f_fluid_properties_pp_get_pointers')
786      use, intrinsic :: iso_c_binding
787      implicit none
788      type(c_ptr), intent(out) :: viscv0
789    end subroutine cs_f_fluid_properties_pp_get_pointers
790
791    !---------------------------------------------------------------------------
792
793    ! Interface to C function retrieving pointers to members of the
794    ! global physical model flags
795
796    subroutine cs_f_physical_model_get_pointers(p_ippmod)    &
797      bind(C, name='cs_f_physical_model_get_pointers')
798      use, intrinsic :: iso_c_binding
799      implicit none
800      type(c_ptr), intent(out) :: p_ippmod
801    end subroutine cs_f_physical_model_get_pointers
802
803    !---------------------------------------------------------------------------
804
805    ! Interface to C function retrieving pointers to members of the
806    ! global physical model flags
807
808    subroutine cs_f_combustion_model_get_pointers(p_isoot)    &
809      bind(C, name='cs_f_combustion_model_get_pointers')
810      use, intrinsic :: iso_c_binding
811      implicit none
812      type(c_ptr), intent(out) :: p_isoot
813    end subroutine cs_f_combustion_model_get_pointers
814
815    !---------------------------------------------------------------------------
816
817    !> (DOXYGEN_SHOULD_SKIP_THIS) \endcond
818
819    !---------------------------------------------------------------------------
820
821  end interface
822
823  !=============================================================================
824
825contains
826
827  !=============================================================================
828
829  !> \brief Initialize Fortran physical models properties API.
830  !> This maps Fortran pointers to global C variables.
831
832  subroutine pp_models_init
833
834    use, intrinsic :: iso_c_binding
835    implicit none
836
837    ! Local variables
838
839    type(c_ptr) :: p_viscv0, p_ippmod, p_isoot
840
841    call cs_f_fluid_properties_pp_get_pointers(p_viscv0)
842    call c_f_pointer(p_viscv0, viscv0)
843
844    call cs_f_physical_model_get_pointers(p_ippmod)
845    call cs_f_combustion_model_get_pointers(p_isoot)
846
847    call c_f_pointer(p_ippmod, ippmod, [nmodmx])
848    call c_f_pointer(p_isoot, isoot)
849
850  end subroutine pp_models_init
851
852  !=============================================================================
853
854end module ppincl
855