My Project
programmer's documentation
Functions/Subroutines
cs_user_physical_properties.f90 File Reference

Definition of physical variable laws. More...

Functions/Subroutines

subroutine usphyv (nvar, nscal, mbrom, dt)
 Definition of physical variable laws. More...
 
subroutine usvist (nvar, nscal, ncepdp, ncesmp, icepdc, icetsm, itypsm, dt, ckupdc, smacel)
 Modify turbulent viscosity. More...
 
subroutine ussmag (nvar, nscal, ncepdp, ncesmp, icepdc, icetsm, itypsm, dt, ckupdc, smacel, mijlij, mijmij)
 user modification of the Smagorinsky constant in the case of a dynamic model More...
 
subroutine usvima
 User subroutine dedicated the use of ALE (Arbitrary Lagrangian Eulerian Method): fills mesh viscosity arrays. More...
 
subroutine usatph
 usatph More...
 

Detailed Description

Definition of physical variable laws.

See Define user laws for physical properties for examples.

Function/Subroutine Documentation

◆ usatph()

subroutine usatph ( )

usatph

User subroutine dedicated to modifie physical properties of the atmospheric module

This subroutine is called at beginning of each time step at the end of atphyv.

◆ usphyv()

subroutine usphyv ( integer  nvar,
integer  nscal,
integer  mbrom,
double precision, dimension(ncelet)  dt 
)

Definition of physical variable laws.

Warning

It is forbidden to modify turbulent viscosity visct here (a specific subroutine is dedicated to that: usvist)

  • icp = 0 must have been specified in usipsu if we wish to define a variable specific heat cpro_cp (otherwise: memory overwrite).
  • the kivisl field integer key (diffusivity_id) must have been specified in usipsu if we wish to define a variable viscosity viscls.
Remarks
  • This routine is called at the beginning of each time step Thus, AT THE FIRST TIME STEP (non-restart case), the only values initialized before this call are those defined
  • We may define here variation laws for cell properties, for:
    • density: rom kg/m3
    • density at boundary faces: romb kg/m3)
    • molecular viscosity: cpro_viscl kg/(m s)
    • specific heat: cpro_cp J/(kg degrees)
    • diffusivities associated with scalars: cpro_vscalt kg/(m s)

Warning: if the scalar is the temperature, cpro_vscalt corresponds to its conductivity (Lambda) in W/(m K)

The types of boundary faces at the previous time step are available (except at the first time step, where arrays itypfb and itrifb have not been initialized yet)

It is recommended to keep only the minimum necessary in this file (i.e. remove all unused example code)

Cells identification

Cells may be identified using the getcel subroutine. The syntax of this subroutine is described in the cs_user_boundary_conditions subroutine, but a more thorough description can be found in the user guide.

Parameters
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[in]mbromindicator of filling of romb array
[in]dttime step (per cell)

◆ ussmag()

subroutine ussmag ( integer  nvar,
integer  nscal,
integer  ncepdp,
integer  ncesmp,
integer, dimension(ncepdp)  icepdc,
integer, dimension(ncesmp)  icetsm,
integer, dimension(ncesmp,nvar itypsm,
double precision, dimension(ncelet)  dt,
double precision, dimension(6,ncepdp)  ckupdc,
double precision, dimension(ncesmp,nvar smacel,
double precision, dimension(ncelet)  mijlij,
double precision, dimension(ncelet)  mijmij 
)

user modification of the Smagorinsky constant in the case of a dynamic model

       SMAGOR = Mij.Lij / Mij.Mij

The local avergaes of the numerator and denominator are done before calling this subroutine, so

         SMAGOR = < Mij.Lij > / < Mij.Mij >

In this subroutine, Mij.Lij and Mij.Mij are passed as arguments before the local average.

Parameters
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[in]ncepdpnumber of cells with head loss
[in]ncesmpnumber of cells with mass source term
[in]icepdchead loss cell numbering
[in]icetsmnumbering of cells with mass source term
[in]itypsmkind of mass source for each variable (cf. Examples of data settings for mass source terms (cs_user_mass_source_terms.f90))
[in]dttime step (per cell)
[in]ckupdcwork array for head loss terms
[in]smacelvalues of variables related to mass source term. If ivar=ipr, smacel=mass flux
[in]mijlijmij.lij before the local averaging
[in]mijmijmij.mij before the local averaging

◆ usvima()

subroutine usvima ( )

User subroutine dedicated the use of ALE (Arbitrary Lagrangian Eulerian Method): fills mesh viscosity arrays.

Here one can modify mesh viscosity value to prevent cells and nodes from huge displacements in awkward areas, such as boundary layer for example.

This subroutine is called once per computation, before restart files are read, so the mesh is always in the initial position at this stage.

Note that by default, the mesh viscosity is initialized to a uniform value of 1.

◆ usvist()

subroutine usvist ( integer  nvar,
integer  nscal,
integer  ncepdp,
integer  ncesmp,
integer, dimension(ncepdp)  icepdc,
integer, dimension(ncesmp)  icetsm,
integer, dimension(ncesmp,nvar itypsm,
double precision, dimension(ncelet)  dt,
double precision, dimension(6,ncepdp)  ckupdc,
double precision, dimension(ncesmp,nvar smacel 
)

Modify turbulent viscosity.

This subroutine is called at beginning of each time step after the computation of the turbulent viscosity (physical quantities have already been computed in usphyv).

Turbulent viscosity $ \mu_T $ (kg/(m s)) can be modified.

A modification of the turbulent viscosity can lead to very significant differences betwwen solutions and even give wrong results.

This subroutine is therefore reserved to expert users.

Parameters
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[in]ncepdpnumber of cells with head loss
[in]ncesmpnumber of cells with mass source term
[in]icepdchead loss cell numbering
[in]icetsmnumbering of cells with mass source term
[in]itypsmkind of mass source for each variable (cf. Examples of data settings for mass source terms (cs_user_mass_source_terms.f90))
[in]dttime step (per cell)
[in]ckupdcwork array for head loss terms
[in]smacelvalues of variables related to mass source term. If ivar=ipr, smacel=mass flux