pyopensn.solver.TimeDependentSourceSolver
- class pyopensn.solver.TimeDependentSourceSolver
Time dependent solver.
Wrapper of
opensn::TimeDependentSourceSolver.- Advance(self: pyopensn.solver.TimeDependentSourceSolver) None
Advance the solver by a single timestep.
This method uses the configured dt and theta values and will return immediately if the stop time has already been reached. Calling it repeatedly allows users to write custom python time loops.
- Execute(self: pyopensn.solver.Solver) None
Execute the solver.
- Initialize(self: pyopensn.solver.Solver) None
Initialize the solver.
- SetPostAdvanceCallback(*args, **kwargs)
Overloaded function.
SetPostAdvanceCallback(self: pyopensn.solver.TimeDependentSourceSolver, arg0: std::function<void ()>) -> None
Register a callback that runs after each call to
Advance().- callbackOptional[Callable[[], None]]
Function invoked after the solver advances a timestep. Pass None to clear.
SetPostAdvanceCallback(self: pyopensn.solver.TimeDependentSourceSolver, arg0: None) -> None
Clear the PostAdvance callback by passing None.
- SetPreAdvanceCallback(*args, **kwargs)
Overloaded function.
SetPreAdvanceCallback(self: pyopensn.solver.TimeDependentSourceSolver, arg0: std::function<void ()>) -> None
Register a callback that runs before each call to
Advance().- callbackOptional[Callable[[], None]]
Function invoked before the solver advances a timestep. Pass None to clear.
SetPreAdvanceCallback(self: pyopensn.solver.TimeDependentSourceSolver, arg0: None) -> None
Clear the PreAdvance callback by passing None.
- SetTheta(self: pyopensn.solver.TimeDependentSourceSolver, arg0: float) None
Set the theta parameter used by
Advance().- Parameters:
theta (float) – Theta value between 0 and 1.
- SetTimeStep(self: pyopensn.solver.TimeDependentSourceSolver, arg0: float) None
Set the timestep size used by
Advance().- Parameters:
dt (float) – New timestep size.
- __init__(self: pyopensn.solver.TimeDependentSourceSolver, **kwargs) None
Construct a time dependent solver.
- Parameters:
pyopensn.solver.LBSProblem (LBSProblem) – Existing LBSProblem instance.
dt (float, optional, default=1.0) – Time step size used during the simulation.
stop_time (float, optional, default=1.0) – Simulation end time.