Skip to main content

Dictionary

The Dictionary block is a top-level section of the CHAMPS+ input file that lets users define named constants and expressions for use elsewhere in the input. It acts like a lightweight, built-in variable system and calculator.

Purpose

  • Centralize key physical or numerical parameters (e.g., reference temperature, gas constant, Reynolds number).
  • Avoid repeating the same value in multiple places.
  • Perform algebra or more complex expressions directly inside the input file.
  • Parameterize a simulation (e.g. domain size depends on Mach number, etc).

Once defined, these names can be referenced anywhere in the input file by their name or by qualified paths (e.g. Qinf::pinf).

Basic Structure

Dictionary
{
name1 = <expression>
name2 = <expression>
...
}

Each line assigns a name to an expression.
Expressions can be:

  • Literals — numbers like 100.0.
  • Constants — mathematical constants such as #pi or #e.
  • Mathematical expressions — e.g. mach*sqrt(gamma*Rgas*Tref).
  • References to other Dictionary entries — use them like variables.

Example

Dictionary
{
Tref = 100.0
gamma = 1.4
Rgas = 287.15
mach = 6.0
aoa = 12.5
reynolds = 23000000
umag = mach*sqrt(gamma*Rgas*Tref)
Lscale = 1.0
dxmin = 0.001
Qinf
{
pinf = 10000.0
Tinf = Tref
uinf = umag*cos(aoa*#pi/180.0)
vinf = umag*sin(aoa*#pi/180.0)
winf = 0.0
rhoinf = Qinf::pinf/(Rgas*Tref)
}
}

Usage in Other Blocks

Dictionary values can be used in many other places elsewhere in the input, for example:

  • Grid refinement: distance = "25*dxmin".
  • Physical properties: visc = "Qinf::rhoinf*umag*Lscale/reynolds".
  • Initial conditions: U = "Qinf::uinf*tanh(dist/0.01)".