Introduction
User subroutines for input of calculation parameters (Fortran modules). These subroutines are called in all cases.
If the Code_Saturne GUI is used, this file is not required (but may be used to override parameters entered through the GUI, and to set parameters not accessible through the GUI).
Several routines are present in the file, each destined to defined specific parameters.
To modify the default value of parameters which do not appear in the examples provided, code should be placed as follows:
- usipsu for numerical and physical options
- usipes for input-output related options
- usppmo for specific physics options
- usipph for additional input of parameters
- usati1 for calculation options for the atmospheric module
- cs_user_combustion for calculation options for the combustion module
- uscfx1 and uscfx2 for non-standard options for the compressible module
- uscti1 for the definition of cooling tower model and exchange zones
- user_darcy_ini1 for calculation options for the Darcy module
As a convention, "specific physics" defers to the following modules only: pulverized coal, gas combustion, electric arcs.
In addition, specific routines are provided for the definition of some "specific physics" options. These routines are described at the end of this file and will be activated when the corresponding option is selected in the usppmo routine.
General options (usipsu)
All options
The following code block presents all the options available in the usipsu subroutine.
ileaux = 0
idtvar = 0
ntmabs = 10
dtref = 0.01d0
iphydr = 1
idilat = 1
ipthrm = 0
pthermax= -1.d0
sleak = 0.d0
kleak = 2.9d0
if (nmodpp.eq.0) then
itpscl = 2
endif
if (nscaus.gt.0) then
do ii = 1, nscaus
iscacp(isca(ii)) = 1
enddo
endif
iporos = 1
iccvfg = 1
if (itytur.eq.4) then
ivrtex = 1
endif
ipucou = 0
blencv(iu) = 1.0d0
blencv(iv) = 1.0d0
blencv(iw) = 1.0d0
if (nscaus.ge.1) then
do ii = 1, nscaus
blencv(isca(ii)) = 1.0d0
enddo
endif
if (nscaus.ge.1) then
do ii = 1, nscaus
epsilo(isca(ii)) = 1.d-6
enddo
endif
iswdyn(ipr) = 1
irccor = 1
if (itytur.eq.2) then
ircflu(ik) = 0
ircflu(iep) = 0
endif
reinit_turb = 1
if (itytur.eq.3) then
idirsm = 1
endif
iwallf = 5
gx = 0.d0
gy = 0.d0
gz = 0.d0
icorio = 0
call rotation_define(0.d0, 0.d0, 0.d0, &
0.d0, 0.d0, 0.d0)
ro0 = 1.17862d0
viscl0 = 1.83337d-5
cp0 = 1017.24d0
t0 = 20.d0 + 273.15d0
p0 = 1.01325d5
irovar = 1
ivivar = 1
icp = 0
xyzp0(1) = 0.d0
xyzp0(2) = 0.d0
xyzp0(3) = 0.d0
call field_get_key_id("min_scalar_clipping", kscmin)
call field_get_key_id("max_scalar_clipping", kscmax)
if (iscalt.gt.0) then
call field_set_key_double(ivarfl(isca(iscalt)), kscmin, -grand)
call field_set_key_double(ivarfl(isca(iscalt)), kscmax, +grand)
endif
do jj = 1, nscaus
if (iscavr(jj).le.0) then
call field_set_key_double(ivarfl(isca(jj)), kscmin, -grand)
call field_set_key_double(ivarfl(isca(jj)), kscmax, +grand)
endif
enddo
call field_get_key_id("min_scalar", kccmin)
call field_get_key_id("max_scalar", kccmax)
if (iscalt.gt.0) then
ivar = isca(iscalt)
ischcv(ivar) = 0
isstpc(ivar) = 3
call field_get_key_id("limiter_choice", klimiter)
call field_set_key_int(ivarfl(isca(iscalt)), klimiter, 3)
call field_set_key_double(ivarfl(ivar), kccmin, 0.d0)
call field_set_key_double(ivarfl(ivar), kccmax, 1.d0)
endif
do jj = 1, nscaus
ivar = isca(jj)
ischcv(ivar) = 0
isstpc(ivar) = 2
call field_set_key_double(ivarfl(ivar), kccmin, 0.d0)
call field_set_key_double(ivarfl(ivar), kccmax, 1.d0)
enddo
if (ippmod(icompf).ge.0) then
call field_set_key_int(ivarfl(isca(itempk)), kivisl, ifcvsl)
else if (iscalt.gt.0) then
call field_set_key_int(ivarfl(isca(iscalt)), kivisl, ifcvsl)
endif
do iscal = 1, nscaus
if (iscavr(iscal).le.0) then
ifcvsl = -1
call field_set_key_int(ivarfl(isca(iscal)), kivisl, ifcvsl)
endif
enddo
if (iscalt.gt.0) iturt(iscalt) = 10
do jj = 1, nscaus
iturt(jj) = 10
enddo
uref = 1.d0
almax = 0.5
call field_get_key_id("drift_scalar_model", keydri)
if (nscaus.ge.1) then
iscdri = 1
iscdri = ibset(iscdri, drift_scalar_add_drift_flux)
if (.false.) then
iscdri = ibset(iscdri, drift_scalar_thermophoresis)
endif
if (.false.) then
iscdri = ibset(iscdri, drift_scalar_turbophoresis)
endif
if (.false.) then
iscdri = ibset(iscdri, drift_scalar_centrifugalforce)
endif
iscal = 1
f_id = ivarfl(isca(iscal))
call field_set_key_int(f_id, keydri, iscdri)
endif
itycat = field_intensive + field_property
ityloc = 3
idim1 = 1
inoprv = .false.
call field_get_id_try('yplus', f_id)
if (f_id.lt.0) then
call field_create('yplus', itycat, ityloc, idim1, inoprv, f_id)
call field_set_key_int(f_id, keyvis, 1)
call field_set_key_int(f_id, keylog, 1)
endif
call field_get_id_try('tplus', f_id)
if (f_id.lt.0) then
call field_create('tplus', itycat, ityloc, idim1, inoprv, f_id)
call field_set_key_int(f_id, keyvis, 1)
call field_set_key_int(f_id, keylog, 1)
endif
call field_get_id_try('tstar', f_id)
if (f_id.lt.0) then
call field_create('tstar', itycat, ityloc, idim1, inoprv, f_id)
call field_set_key_int(f_id, keyvis, 1)
call field_set_key_int(f_id, keylog, 1)
endif
iescal(iescor) = 2
iescal(iestot) = 2
nalinf = 75
nalimx = 15
epalim = 1.d-5
iortvm = 0
Special fields
Enforce existence of 'tplus' and 'tstar' fields, so that a boundary temperature or Nusselt number may be computed using the post_boundary_temperature or post_boundary_nusselt subroutines. When postprocessing of these quantities is activated, those fields are present, but if we need to compute them in the cs_user_extra_operations user subroutine without postprocessing them, forcing the definition of these fields to save the values computed for the boundary layer is necessary.
itycat = field_intensive + field_property
ityloc = 3
inoprv = .false.
call field_get_id('tplus', f_id)
if (f_id.lt.0) then
call field_create('tplus', itycat, ityloc, idim1, inoprv, f_id)
endif
call field_get_id('tstar', f_id)
if (f_id.lt.0) then
call field_create('tstar', itycat, ityloc, idim1, inoprv, f_id)
endif
Save contribution of slope test for variables in special fields. These fields are automatically created, with postprocessing output enabled, if the matching variable is convected, does not use a pure upwind scheme, and has a slope test (the slope_test_upwind_id key value for a given variable's field is automatically set to the matching postprocessing field's id, or -1 if not applicable).
call field_get_key_id("slope_test_upwind_id", kislts)
do ivar = 1, nvar
call field_set_key_int(ivarfl(ivar), kislts, 0)
enddo
Input-output related examples (usipes)
Basic options
Frequency of log output.
Log (listing) verbosity.
do ii = 1, nvar
iwarni(ii) = 1
enddo
iwarni(ipr) = 2
iwarni(iu) = 2
iwarni(iv) = 2
iwarni(iw) = 2
Activate or deactivate logging output. By default, logging is active for most variables. In the following example, logging for velocity is deactivated.
f_id = ivarfl(iu)
ifllog = 0
call field_set_key_int(f_id, keyvis, ifllog)
Change a property's label (here for density, first checking if it is variable). A field's name cannot be changed, but its label, used for logging and postprocessing output, may be redefined.
if (icp.ne.0) then
f_id = iprpfl(icp)
call field_set_key_str (f_id, keylbl, 'Cp')
endif
Probes output
Probes output step.
Number of monitoring points (probes) and their positions. Limited to ncaptm=200.
ncapt = 4
tplfmt = 1
xyzcap(1,1) = 0.30d0
xyzcap(2,1) = 0.15d0
xyzcap(3,1) = 0.01d0
xyzcap(1,2) = 0.30d0
xyzcap(2,2) = 0.00d0
xyzcap(3,2) = 0.01d0
xyzcap(1,3) = 0.30d0
xyzcap(2,3) =-0.08d0
xyzcap(3,3) = 0.01d0
xyzcap(1,4) = 0.60d0
xyzcap(2,4) =-0.05d0
xyzcap(3,4) = 0.01d0
Postprocessing output
Activate or deactivate postprocessing output. By default, output is active for most variables. In the following example, the output for velocity is deactivated.
f_id = ivarfl(iu)
iflpst = 0
call field_set_key_int(f_id, keyvis, iflpst)
Activate or deactivate probes output. If ihisvr(.,1) = -1, output is done for all probes. In the following example, probes output for the velocity is restricted to the first component.
f_id = ivarfl(iu)
ipp = field_post_id(f_id)
ihisvr(ipp,1) = -1
ihisvr(ipp+1,1) = 0
ihisvr(ipp+2,1) = 0
Probes for Radiative Transfer (Luminance and radiative density flux vector) for all probes (ihisvr = -1)
call field_get_id_try('luminance', f_id)
ipp = field_post_id(f_id)
ihisvr(ipp,1) = -1
call field_get_id_try('radiative_flux', f_id)
ipp = field_post_id(f_id)
ihisvr(ipp,1) = -1
ihisvr(ipp+1,1) = -1
ihisvr(ipp+2,1) = -1
Postprocess at boundary
Force postprocessing of projection of some variables at boundary with no reconstruction. This is handled automatically if the second bit of a field's 'post_vis' key value is set to 1 (which amounts to adding 2 to that key value).
f_id = ivarfl(iu)
if (iand(iflpst, 2) .eq. 0) then
call field_get_key_int(f_id, keyvis, iflpst)
iflpst = ior(iflpst, 2)
call field_set_key_int(f_id, keyvis, iflpst)
endif
f_id = ivarfl(ipr)
if (iand(iflpst, 2) .eq. 0) then
call field_get_key_int(f_id, keyvis, iflpst)
iflpst = ior(iflpst, 2)
call field_set_key_int(f_id, keyvis, iflpst)
endif
Specific physic activation (usppmo)
The usppmo routine can be found in the cs_user_parameters.f90 file.
if (ixmlpu.eq.0) then
ippmod(icod3p) = -1
endif
if (ixmlpu.eq.0) then
ippmod(icoebu) = -1
endif
if (ixmlpu.eq.0) then
ippmod(icolwc) = -1
endif
isoot = 0
xsoot = 0.1d0
rosoot = 2000.d0
if (ixmlpu.eq.0) then
ippmod(icfuel) = -1
endif
if (ixmlpu.eq.0) then
ippmod(iccoal) = -1
endif
i_comb_drift = 1
if (ixmlpu.eq.0) then
ippmod(icpl3c) = -1
endif
if (ixmlpu.eq.0) then
ippmod(icompf) = -1
endif
if (ixmlpu.eq.0.and.ippmod(icompf).ge.0) then
ieos = 1
endif
if (ixmlpu.eq.0) then
ippmod(ieljou) = -1
endif
if (ixmlpu.eq.0) then
ippmod(ielarc) = -1
endif
if (ixmlpu.eq.0) then
ippmod(iatmos) = -1
endif
if (ixmlpu.eq.0) then
ippmod(iaeros) = -1
endif
ippmod(igmix) = 0
iirayo = 1
ippmod(idarcy) = -1
if (ixmlpu.eq.0) then
indjon = 1
endif
if (ixmlpu.eq.0) then
ieqco2 = 0
endif
if (ixmlpu.eq.0) then
if ( ippmod(icod3p).ge.0 &
.or. ippmod(icoebu).ge.0 .or. ippmod(icolwc).ge.0) then
if (indjon.eq.1) then
ficfpp = 'dp_C3P'
else
ficfpp = 'dp_C3PSJ'
endif
endif
if (ippmod(icfuel).ge.0) then
ficfpp = 'dp_FUE'
endif
if (ippmod(ielarc).ge.1) then
ficfpp = 'dp_ELE'
endif
if (ippmod(ieljou).eq.1 .or. ippmod(ieljou).eq.2) then
ficfpp = 'dp_ELE'
else if (ippmod(ieljou).eq.3 .or. ippmod(ieljou).eq.4) then
ficfpp = 'dp_transfo'
endif
if (ippmod(iatmos).ge.0) then
ficmet = 'meteo'
endif
if ( ippmod(igmix).ge.0 ) then
icond = -1
endif
endif
Additional input of parameters (usipph)
The usipph routine can be found in the cs_user_parameters.f90 file.
if (ixmlpu.eq.0) then
iturb = 21
endif
irijco = 0
itherm = 1
icavit = -1
iale = 1
Calculation options for the atmospheric module (usati1)
The usati1 routine can be found in the cs_user_parameters.f90 file.
imeteo = 1
syear = 1994
squant = 1
shour = 1
smin = 0
ssec = 0.d0
xlon = 0.d0
xlat = 45.d0
imbrication_flag = .false.
imbrication_verbose = .false.
cressman_u = .true.
cressman_v = .true.
cressman_tke = .true.
cressman_eps = .true.
cressman_theta = .true.
cressman_qw = .true.
cressman_nc = .true.
horizontal_influence_radius = 8500.d0
vertical_influence_radius = 100.d0
ichemistry = 0
ifilechemistry = 0
isepchemistry = 1
iphotolysis = 1
dtchemmax = 10.0d0
iaerosol = 1
inogaseouschemistry = 0
ncycle_aer = 1
icoag_siream = 1
icond_siream = 1
inucl_siream = 1
icut_siream = nbin_aer
Calculation options for the combustion module (cs_user_combustion)
The cs_user_combustion routine can be found in the cs_user_parameters.f90 file.
srrom = 0.8d0
diftl0 = 4.25d-5
tinfue = 436.d0
tinoxy = 353.d0
cebu = 2.5d0
vref = 60.d0
lref = 0.1d0
ta = 0.2d5
tstar= 0.12d4
Non-standard options for the compressible module (uscfx1)
The uscfx1 routine can be found in the cs_user_parameters.f90 file.
if (iihmpr.eq.0) then
ifcvsl = -1
call field_set_key_int(ivarfl(isca(itempk)), kivisl, ifcvsl)
iviscv = 0
endif
Non-standard options for the compressible module (uscfx2)
The uscfx2 routine can be found in the cs_user_parameters.f90 file.
if (iihmpr.eq.0) then
ivivar = 0
visls0(itempk) = 3.d-2
viscv0 = 0.d0
xmasmr = 0.028966
icfgrp = 1
endif
Definition of cooling tower model and exchange zones (uscti1)
The uscti1 routine can be found in the cs_user_parameters.f90 file.
iaeeri = 0
vaeeri = 13.d0
iaeerp = 5
paseri = 0.015d0
aetemx = 80.d0
aetemn = 10.d0
nbzsup = 2
lizsup(1) = 1
lizsup(2) = 2
nbzinf = 2
lizinf(1) = 1
lizinf(2) = 2
inbaei = 1000.d0
ichrze = 1
isuict = isuite
Calculation options for the Darcy module (user_darcy_ini1)
The user_darcy_ini1 routine can be found in the cs_user_parameters.f90 file.
darcy_anisotropic_permeability = 0
darcy_anisotropic_dispersion = 0
darcy_unsteady = 0
darcy_convergence_criterion = 0
darcy_gravity = 0