Skip to content

Runners

Introduction

Runners control the progression of the simulation:

  • mufem.SteadyRunner: Solves stationary problems with a fixed number of iterations.
  • mufem.UnsteadyRunner: Drives time-dependent simulations with finite time-step integration.

Both runners can be assigned to the simulation instance and executed using the .run() method.

Coefficients

Each runner registers simulation progress fields as coefficient functions:

SteadyRunner Fields
Name Field Type Description
Iteration [-] Scalar Current global iteration number in the steady-state solver.
UnsteadyRunner Fields
Name Field Type Description
Time [s] Scalar Current physical simulation time.
Iteration [-] Scalar Iteration number within the current time step.

Example

import mufem

sim = mufem.Simulation.New("Transient Example", "data/geometry.mesh")

runner = mufem.UnsteadyRunner(total_time=1.0, time_step_size=0.1, total_inner_iterations=3)

sim.set_runner(runner)

sim.run()

field_exporter = sim.get_field_exporter()
field_exporter.add_field_output("Time")
field_exporter.save()