Monte Carlo Configuration

The montecarlo section describes the parameters for the Monte Carlo radiation transport and convergence criteria:

The seed parameter seeds the random number generator first for the creation of the packets (\(\nu\) and \(\mu\)) and then the interactions in the actual Monte Carlo process. The no_of_packets parameter can take a float number for input convenience and gives the number of packets normally used in each Monte Carlo loop. The parameters last_no_of_packets and no_of_virtual_packets influence the last run of the Monte Carlo loop (which calculates the final spectrum!) when the radiation field should have converged. last_no_of_packets is normally higher than no_of_packets to create a less noisy output spectrum. no_of_virtual_packets can also be set to greater than 0 (a useful number is 3) to use the Virtual Packet formalism. Increasing this number drastically increases computational costs (and memory requirements if they are logged). The iterations parameter describes the maximum number of Monte Carlo loops executed in a simulation before it ends. Convergence criteria can be used to make the simulation stop sooner when the convergence threshold has been reached (see Updating Plasma and Convergence).

Convergence Strategy

The convergence_criteria section has a type keyword. Currently, one type is allowed: damped. All convergence criteria can be specified separately for the three variables for which convergence can be checked (t_inner, t_rad, ws) by specifying subsections in the convergence_criteria of the same name. These then override the defaults. Two more schemas are presented that further explain the damped and custom convergence strategies:

damped only has one parameter damping-constant and does not check for convergence. This can be used to fix the temperature of the inner boundary.

Parallel Execution with Numba

The montecarlo section of the Configuration file accepts the parameter nthreads which sets the number of threads to be used for parallelisation. Setting the value of the parameter between 1 and the environment variable NUMBA_NUM_THREADS (which is, by default, the number of CPU cores on your system) will automatically invoke Numba to parallelise the code. (See Configuration (Required Input) section).