time_grid
Define time grid.
- class time_grid.TimeGrid(params, x, dz, DT_funx, default_parameters, logger)[source]
Bases:
objectStore time-related parameters.
- Variables:
th (float) – Simulation time in h.
ts (float) – Simulation time in s.
dt_multiplier (float) – Factor by which default time step is multiplied (see
make_time_steps()).dt (float) – Time step size in s.
nt (int) – Number of time steps (positions in time sequence), including 0.
num_out (int) – Number of time steps where simulation results are stored and saved on file.
saved_steps (list of int) – Steps for which simulation results are stored and saved in log.
saved_th (list of float) – Times in h for which simulation results are stored and saved in log.
default_params (dict) – Parameters used when not specified in user input.
logger (
log_utils.CustomLogger) – Logger.
- __init__(params, x, dz, DT_funx, default_parameters, logger)[source]
Class constructor.
The time step dt is calculated to ensure the stability of explicit schemes, with Fourier given in default_parameters. The DT value is calculated from the initial atom fraction profile. The time step can be made smaller using the user-specified dt_multiplier or nt_multiplier.
- Parameters:
params (dict) – Time-related input parameters.
x (dict of 1D array) – Initial atom fraction profile.
dz (1D array) – Initial space step.
DT_funx (function) – Calculates tracer diffusion coefficients.
default_parameters (dict) – Parameters used when not specified in user input.
logger (
log_utils.CustomLogger) – Logger.
- Raises:
utils.UserInputError – If params contains both th and ts.
utils.UserInputError – If params contains both nt_multipler and dt_multiplier.