.. _assigning_parameters: Simulation Parameters ========================= When simulating an infusion using Lizzy, there are some simulation parameters which are assigned globally in the model. These control the frequency of solution write-outs, fill tolerance, and sensor behaviour. These parameters are stored in a :class:`~lizzy.datatypes.SimulationParameters` data class. The parameters that are stored in the class are the following: - :attr:`~lizzy.datatypes.SimulationParameters.output_interval`: The interval of simulation time between solution write-outs [s] if no other conditions trigger a write-out. Default: -1 (write-out every numerical time step, usually undesired) - :attr:`~lizzy.datatypes.SimulationParameters.fill_tolerance`: Tolerance on the fill factor to consider a CV as filled. A CV is considered filled when its fill factor reaches ``1 - fill_tolerance``. Default: 0.01 (i.e., filled when fill factor >= 0.99). - :attr:`~lizzy.datatypes.SimulationParameters.end_step_when_sensor_triggered`: If True, whenever a sensor is reached for the first time by the fluid, the current solution step is ended and a write-out is created. Default: False - :attr:`~lizzy.datatypes.SimulationParameters.lightweight`: If True, the solver will not pack fields into a :class:`~lizzy.datatypes.Solution` after each solve step, saving memory and computation time but making impossible to save results to file. :meth:`~lizzy.LizzyModel.save_results` cannot be used in lightweight mode. Default: False Assigning simulation parameters -------------------------------- The following operations are to be performed **before** the solver is initialised by calling :meth:`~lizzy.LizzyModel.initialise_solver`. Each simulation parameter can be assigned to the model by keyword, using the :meth:`~lizzy.LizzyModel.set_simulation_parameters` method: .. code-block:: model.set_simulation_parameters(output_interval=100) In this example, we have told the solver to save a solution state every 100 seconds of simulation time. To print the currently assigned simulation parameters to the console, we can use the :meth:`~lizzy.LizzyModel.print_simulation_parameters` method: .. code-block:: >>> model.print_simulation_parameters() >>> Currently assigned simulation parameters: - "output_interval": 100 [s], - "fill_tolerance": 0.01, - "end_step_when_sensor_triggered": False,