Defaults

The defaults are defined through a function jax_sph.defaults.set_defaults(), which takes a potentially empty omegaconf.DictConfig object and creates or overwrites the default values. One can also directly call from jax_sph.defaults import defaults, with defaults=set_defaults(), to get the default DictConfig, which we unpack below.

  1### global and hardware-related configs
  2# .yaml case configuration file
  3cfg.config = None
  4# Seed for random number generator
  5cfg.seed = 123
  6# Whether to disable jitting compilation
  7cfg.no_jit = False
  8# Which GPU to use. -1 for CPU
  9cfg.gpu = 0
 10# Data type. One of "float32" or "float64"
 11cfg.dtype = "float64"
 12# XLA memory fraction to be preallocated. The JAX default is 0.75.
 13# Should be specified before importing the library.
 14cfg.xla_mem_fraction = 0.75
 15### psysical case configuration
 16cfg.case = OmegaConf.create({})
 17# Wchich Python case file to configure.
 18cfg.case.source = None
 19# Simulation mode. One of "sim" (run simulation) or "rlx" (run relaxation)
 20cfg.case.mode = "sim"
 21# Dimension of the simulation. One of 2 or 3
 22cfg.case.dim = 3
 23# Average distance between particles [0.001, 0.1]
 24cfg.case.dx = 0.05
 25# Initial state h5 path. Overrides `r0_type`. Can be useful to restart a simulation.
 26cfg.case.state0_path = None
 27# Which properties to adopt from state0_path. Include all to restart a simulation.
 28cfg.case.state0_keys = ["r"]
 29# Position initialization type. One of "cartesian" or "relaxed". Cartesian can have
 30# `r0_noise_factor` and relaxed requires a state to be present in `data_relaxed`.
 31cfg.case.r0_type = "cartesian"
 32# How much Gaussian noise to add to r0. ( _ * dx)
 33cfg.case.r0_noise_factor = 0.0
 34# Magnitude of external force field
 35cfg.case.g_ext_magnitude = 0.0
 36# Reference dynamic viscosity. Inversely proportional to Re.
 37cfg.case.viscosity = 0.01
 38# Estimate max flow velocity to calculate artificial speed of sound.
 39cfg.case.u_ref = 1.0
 40# Reference speed of sound factor w.r.t. u_ref.
 41cfg.case.c_ref_factor = 10.0
 42# Reference density
 43cfg.case.rho_ref = 1.0
 44# Reference temperature
 45cfg.case.T_ref = 1.0
 46# Reference thermal conductivity
 47cfg.case.kappa_ref = 0.0
 48# Reference heat capacity at constant pressure
 49cfg.case.Cp_ref = 0.0
 50# case-specific variables
 51cfg.case.special = OmegaConf.create({})
 52### solver
 53cfg.solver = OmegaConf.create({})
 54# Solver name. One of "SPH" (standard SPH) or "RIE" (Riemann SPH)
 55cfg.solver.name = "SPH"
 56# Transport velocity inclusion factor [0,...,1]
 57cfg.solver.tvf = 0.0
 58# CFL condition factor
 59cfg.solver.cfl = 0.25
 60# Density evolution vs density summation
 61cfg.solver.density_evolution = False
 62# Density renormalization when density evolution
 63cfg.solver.density_renormalize = False
 64# Integration time step. If None, it is calculated from the CFL condition.
 65cfg.solver.dt = None
 66# Physical time length of simulation
 67cfg.solver.t_end = 0.2
 68# Parameter alpha of artificial viscosity term
 69cfg.solver.artificial_alpha = 0.0
 70# Whether to turn on free-slip boundary condition
 71cfg.solver.free_slip = False
 72# Riemann dissipation limiter parameter, -1 = off
 73cfg.solver.eta_limiter = 3
 74# Thermal conductivity (non-dimensional)
 75cfg.solver.kappa = 0
 76# Number of wall boundary particle layers
 77cfg.solver.n_walls = 3
 78# Whether to apply the heat conduction term
 79cfg.solver.heat_conduction = False
 80# Whether to apply boundaty conditions
 81cfg.solver.is_bc_trick = False  # new
 82### kernel
 83cfg.kernel = OmegaConf.create({})
 84# Kernel name, choose one of:
 85# "CSK" (cubic spline kernel)
 86# "QSK" (quintic spline kernel)
 87# "WC2K" (Wendland C2 kernel)
 88# "WC4K" (Wendland C4 kernel)
 89# "WC6K" (Wendland C4 kernel)
 90# "GK" (gaussian kernel)
 91# "SGK" (super gaussian kernel)
 92cfg.kernel.name = "QSK"
 93# Smoothing length factor
 94cfg.kernel.h_factor = 1.0  # new. Should default to 1.3 WC2K and 1.0 QSK
 95### equation of state
 96cfg.eos = OmegaConf.create({})
 97# EoS name. One of "Tait" or "RIEMANN"
 98cfg.eos.name = "Tait"
 99# power in the Tait equation of state
100cfg.eos.gamma = 1.0
101# background pressure factor w.r.t. p_ref
102cfg.eos.p_bg_factor = 0.0
103### neighbor list
104cfg.nl = OmegaConf.create({})
105# Neighbor list backend. One of "jaxmd_vmap", "jaxmd_scan", "matscipy"
106cfg.nl.backend = "jaxmd_vmap"
107# Number of partitions for neighbor list. Applies to jaxmd_scan only.
108cfg.nl.num_partitions = 1
109### output writing
110cfg.io = OmegaConf.create({})
111# In which format to write states. A subset of ["h5", "vtk"]
112cfg.io.write_type = []
113# Every `write_every` step will be saved
114cfg.io.write_every = 1
115# Where to write and read data
116cfg.io.data_path = "./"
117# What to print to stdout. As list of possible properties.
118cfg.io.print_props = ["Ekin", "u_max"]