Skip to content

Input File Parameters

bcaddy edited this page Mar 7, 2024 · 15 revisions

This page briefly describes parameters that may be defined in the input file. All parameters are case sensitive. Required parameters for all setups are listed first, followed by parameters required for specific Makefile flags or initial conditions. A sample parameter file can be found in the examples directory.

Required Parameters

For 1D problems, ny and nz should be set to 1. For 2D problems, nz should be set to 1.

nx: number of grid cells in the x dimension

ny: number of grid cells in the y dimension

nz: number of grid cells in the z dimension

xmin: x direction lower boundary (in code units)

ymin: y direction lower boundary (in code units)

zmin: z direction lower boundary (in code units)

xlen: x direction global domain length (in code units)

ylen: y direction global domain length (in code units)

zlen: z direction global domain length (in code units)

tout: final output time, in code units (see global.h)

outstep: time interval for output, in code units (see global.h). In the case that more than one type of output file is defined, this will correspond to the most frequent output.

gamma: ratio of specific heats, Cholla currently supports only a single gamma for all cells

init: name of initial conditions. Case sensitive. Current options include Constant, Sound_Wave, Square_Wave, Riemann, Shu_Osher, Blast_1D, KH, KH_res_ind, Rayleigh_Taylor, Gresho, Implosion_2D, Noh_2D, Noh_3D, Disk_2D, Disk_3D, Disk_3D_particles, Spherical_Overpressure_3D Spherical_Overdensity_3D, Clouds, Uniform_Grid, Zeldovich_Pancake, Chemistry_Test, Read_Grid, Read_Grid_Cat. See initial_conditions.cpp for more information about each option. Sample input parameter files for many of these problems can be found in the examples directory.

outdir: path to output directory

Boundary Conditions

Given as a number, options include 1 (periodic), 2 (reflective), 3 (transmissive), 4 (custom). Can use different boundary conditions for each boundary

xl_bcnd: lower x boundary condition

xu_bcnd: upper x boundary condition

yl_bcnd: lower y boundary condition

yu_bcnd: upper y boundary condition

zl_bcnd: lower z boundary condition

zu_bcnd: upper z boundary condition

Optional Parameters

nfile: If the Read_Grid initial conditions are used, prefix for which file to read from.

indir: If the Read_Grid initial conditions are used, path to the directory where the input file can be found.

custom_bcnd: If using a custom boundary condition, name of the boundary condition corresponding to the user-defined function, set in the Custom_Boundary function in boundary_conditions.cpp

prng_seed: The seed given to the pseudo random number generator (PRNG). If set to 0 then Cholla will generate a random seed. If set to non-zero then that will be used as the seed, making all results fully deterministic. At the time of writing the PRNG is only used for initializing particles.

n_hydro: If the desired output for the full hydro grid output is less than outstep, set this to a multiple giving the desired output candence (i.e. if outstep is 50 in code units and n_hydro is 20, full hydro grids will be output every 1000 in code units).

n_particle: As above, but for particle outputs

n_slice: As above, but for slice outputs

n_projection: As above, but for projection outputs

n_rotated_projection: As above, but for rotated projection outputs

output_always: Output grid at every timestep. Must be specified as 0 (false) or 1 (true). Useful for debugging.

legacy_flat_outdir: Output data in a single directory rather than in separate directories per time step. Likely to be deprecated in the future.

n_steps_limit: Set a limit for the number of time steps. Negative or zero values are interpreted as no limit.

Optional arguments for float32 single precision output

n_out_float32: For 0, disables f32 output. Otherwise, set to define the multiple of outstep for float32 outputs to be made (same behavior as the other n_output_type parameters above)

out_float_density: if > 0, Enables density field output

out_float_momentum_x: if > 0, Enables momentum_x field output

out_float_momentum_y: if > 0, Enables momentum_y field output

out_float_momentum_z: if > 0, Enables momentum_z field output

out_float_Energy: if > 0, Enables Energy field output

out_float_GasEnergy: if > 0, Enables GasEnergy field output

out_float_magnetic_x: if > 0, Enables magnetic_x field output

out_float_magnetic_y: if > 0, Enables magnetic_y field output

out_float_magnetic_z: if > 0, Enables magnetic_z field output

Needed for Rotated Projection Outputs

If the Makefile parameter ROTATED_PROJECTION is defined, the following parameters are needed. The rotation is about the delta axis.

delta: angle off the z-axis for projection

theta: angle off the y-axis for projection

phi: angle off the x-axis for projection

flag_delta: 1 or 2 - if 1, the assumption is that a complete grid output is being read in, and a set of rotated projections will be made corresponding to that snapshot; if 2, rotated projection outputs will be made as the simulation runs, with a frequency set by the outstep parameter

n_delta: if flag_delta is 1, how many files to output

ddelta_dt: if flag_delta is 2, how much to rotate the projection with each output; corresponds to a fraction of 2 $\pi$

Lx: Physical size (in code units) of the rotated projection output, horizontal direction

Lz: Physical size (in code units) of the rotated projection output, vertical direction

nxr: number of pixels of the rotated projection output, horizontal direction (recommended to use something slightly larger than the grid size, e.g. 1.5nx

nzr: number of pixels of the rotated projection output, vertical direction (recommended to use something slightly larger than the grid size, e.g. 1.5nz

Needed for floors

density_floor: Apply a density floor to all cells in $\textrm{g}/\textrm{cm}^{3}$. If left unspecified, the density floor is set to zero.

temperature_floor: Apply a density floor to all cells in $\textrm{K}$. If left unspecified, the temperature floor is set to zero.

scalar_floor: Apply a floor to a scalar field. The particular scalar the floor is applied to is specified using the field_num argument of Apply_Scalar_Floor when it is called in src/grid/grid3D.cpp, and should be specified with its grid_enum index (see grid_enum documentation for more info). If left unspecified, the scalar floor is set to zero.

Needed for Cosmology

If the Makefile parameter COSMOLOGY is defined, the following parameters are needed

scale_outputs_file:

Init_redshift:

End_redshift:

H0:

Omega_M:

Omega_L:

Needed for Dust

grain_radius: dust grain size in units of 0.1 micron.

Needed for manual MPI grid

If the Makefile parameter SET_MPI_GRID is defined, the following parameters are needed

n_proc_x:

n_proc_y:

n_proc_z:

Needed for tiled initial conditions

If the Makefile parameter TILED_INITIAL_CONDITIONS is set, the following parameter is needed

tile_length:

Parameters used in some initial conditions functions

rho: density, in code units. Used in Constant, Sound_Wave, and Square_Wave initial conditions among others.

vx: x velocity, in code units. Used in Constant, Sound_Wave, and Square_Wave initial conditions among others.

vy: y velocity, in code units. Used in Constant, Sound_Wave, and Square_Wave initial conditions among others.

vz: z velocity, in code units. Used in Constant, Sound_Wave, and Square_Wave initial conditions among others.

P: pressure, in code units. Used in Constant, Sound_Wave, and Square_Wave initial conditions among others.

A: wave amplitude, used in Sound_Wave and Square Wave initial conditions

Bx: Magnetic field in the X-direction, in code units. Used in most MHD initial conditions

By: Magnetic field in the Y-direction, in code units. Used in most MHD initial conditions

Bz: Magnetic field in the Z-direction, in code units. Used in most MHD initial conditions

rho_l: left state density, in code units. Used in Riemann initial conditions.

vx_l: left state velocity in the X-direction, in code units. Used in Riemann initial conditions.

vy_l: left state velocity in the Y-direction, in code units. Used in Riemann initial conditions.

vz_l: left state velocity in the Z-direction, in code units. Used in Riemann initial conditions.

P_l: left state pressure, in code units. Used in Riemann initial conditions.

Bx_l: left state magnetic field in the X-direction, in code units. Used in Riemann initial conditions.

By_l: left state magnetic field in the Y-direction, in code units. Used in Riemann initial conditions.

Bz_l: left state magnetic field in the Z-direction, in code units. Used in Riemann initial conditions.

rho_r: right state density, in code units. Used in Riemann initial conditions.

vx_r: right state velocity in the X-direction, in code units. Used in Riemann initial conditions.

vy_r: right state velocity in the Y-direction, in code units. Used in Riemann initial conditions.

vz_r: right state velocity in the Z-direction, in code units. Used in Riemann initial conditions.

P_r: right state pressure, in code units. Used in Riemann initial conditions.

Bx_r: right state magnetic field in the X-direction, in code units. Used in Riemann initial conditions.

By_r: right state magnetic field in the Y-direction, in code units. Used in Riemann initial conditions.

Bz_r: right state magnetic field in the Z-direction, in code units. Used in Riemann initial conditions.

diaph: location of the initial discontinuity, in code units. Used in Riemann initial conditions.

rEigenVec_rho: The right eigenvector value for the density, in code units. Used in the linear wave initial conditions

rEigenVec_MomentumX: The right eigenvector value for the momentum in the X-direction, in code units. Used in the linear wave initial conditions

rEigenVec_MomentumY: The right eigenvector value for the momentum in the Y-direction, in code units. Used in the linear wave initial conditions

rEigenVec_MomentumZ: The right eigenvector value for the momentum in the Z-direction, in code units. Used in the linear wave initial conditions

rEigenVec_E: The right eigenvector value for the energy, in code units. Used in the linear wave initial conditions

rEigenVec_Bx: The right eigenvector value for the magnetic field in the X-direction, in code units. Used in the linear wave initial conditions

rEigenVec_By: The right eigenvector value for the magnetic field in the Y-direction, in code units. Used in the linear wave initial conditions

rEigenVec_Bz: The right eigenvector value for the magnetic field in the Z-direction, in code units. Used in the linear wave initial conditions

pitch: The angle in radians. Used in the linear wave and circularly polarized alfven wave initial conditions.

yaw: The angle in radians. Used in the linear wave and circularly polarized alfven wave initial conditions.

polarization: The polarization. Used in the circularly polarized alfven wave initial conditions. Can only be -1 or 1 for left or right polarization.

radius: The radius of some part of the initial conditions. Used in the advecting field loop to set the radius of the loop and the MHD blast wave to set the radius of the initial overpressure region

P_blast: The pressure inside the overpressure region of a blast wave test. Used in the MHD blast wave initial conditions.

Clone this wiki locally