programmer's documentation
Input of calculation parameters (Fortran modules)

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:

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)

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 ! boundary faces
ilved = .true. ! interleaved
inoprv = .false. ! no previous time step values needed
call field_get_id('tplus', f_id)
if (f_id.lt.0) then
call field_create('tplus', itycat, ityloc, idim1, ilved, inoprv, f_id)
endif
call field_get_id('tstar', f_id)
if (f_id.lt.0) then
call field_create('tstar', itycat, ityloc, idim1, ilved, 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.

ntlist = 1

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.

nthist = 1
frhist = -1.d0

Number of monitoring points (probes) and their positions. Limited to ncaptm=100.

ncapt = 4
tplfmt = 1 ! time plot format (1: .dat, 2: .csv, 3: both)
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)
! X component
ipp = field_post_id(f_id)
ihisvr(ipp,1) = -1
! Y component
ihisvr(ipp+1,1) = -1
! Z component
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