My Project
programmer's documentation
How to name common local variables ?

The following table provides a non-exhaustive list of local variables which are used in the code in a recurring manner.

Fortran code C code Description
iel cell_id Cell index
ifac face_id Face index
ig g_id Interior face number of associated groups (OpenMP)
it t_id Interior face number of threads (OpenMP)
idimtr tr_dim Indicator for tensor perodicity of rotation
flumas i_massflux Mass flux at interior faces
flumab b_massflux Mass flux at boundary faces
viscf i_visc $ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $
at interior faces for the r.h.s.
viscb b_visc $ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $
at border faces for the r.h.s.
smbrp rhs Right hand side $ \vect{Rhs} $

Local naming convention for fields (Fotran and C)

Rules have been stablished for local names denoting fields, depending on their nature. The convention, applying both in Fortran and in C, is as follows:

  • The first letter of the name indicates the location at which the field values are defined:
    • c for values at the cell centers.
    • i for values at the interior faces.
    • b for values at the boundary faces.
  • The next three letters indicate if the field is a variable (at the current time step or the previous time step) or a property:
    • var for variables at the current time step.
    • vara for variables at the previous time step.
    • pro for properties.
  • An underscore _ follows.
  • Finally, the short name of the variable/property is specified. This short name is built from the variable/property Fortran index, removing the i at the beginning of the word.

The following examples ilustrate this convention:

cvar_pr: Values of the variable pressure field defined at the cell centers, at the current time step.
cvara_pr: Values of the variable pressure field defined at the cell centers, at the previous time step.
cpro_cp: Values of the property specific heat defined field at the cell centers.