opencmp.solvers.adaptive_transient_solvers package
Submodules
opencmp.solvers.adaptive_transient_solvers.adaptive_IMEX module
- class opencmp.solvers.adaptive_transient_solvers.adaptive_IMEX.AdaptiveIMEX(model_class, config)[source]
-
A transient solver with IMEX-based adaptive time-stepping.
Each timestep is solved with a first-order IMEX method then updated with a second order explicit solve. Two estimates of local error are made. The solution accepted as the timestep’s solution depends on which local error estimate meets the specified tolerance.
opencmp.solvers.adaptive_transient_solvers.adaptive_three_step module
- class opencmp.solvers.adaptive_transient_solvers.adaptive_three_step.AdaptiveThreeStep(model_class, config)[source]
Bases:
opencmp.solvers.adaptive_transient_solvers.base_adaptive_transient_RK.BaseAdaptiveTransientRKSolver
A transient solver with adaptive time-stepping that uses a three step method.
Each timestep is solved first with one implicit Euler solve with dt and then with two implicit Euler solves with dt/2. Local error is estimated from the L2 norm of the difference between the two final timestep solutions. If the timestep is accepted the solution using dt/2 is kept as the solution at the timestep as that should be the most accurate solution.
opencmp.solvers.adaptive_transient_solvers.adaptive_two_step module
- class opencmp.solvers.adaptive_transient_solvers.adaptive_two_step.AdaptiveTwoStep(model_class, config)[source]
-
An adaptive time-stepping solver that uses a two-step method.
Each timestep is solved first with implicit Euler (first-order) and then with Crank-Nicolson (second-order). The local error is estimated from the L2 norm of the difference between the solutions. If the timestep is accepted the implicit Euler solution is kept since implicit Euler is unconditionally stable.
opencmp.solvers.adaptive_transient_solvers.base_adaptive_transient_RK module
- class opencmp.solvers.adaptive_transient_solvers.base_adaptive_transient_RK.BaseAdaptiveTransientRKSolver(model_class, config)[source]
Bases:
opencmp.solvers.transient_RK.TransientRKSolver
,abc.ABC
A transient Runge Kutta solver with adaptive time-stepping.
- abstract _calculate_local_error()[source]
Function to calculate the local error in the time step’s solution and the norm of the time step’s solution.
- Return type
Tuple
[List
[float
],List
[float
],List
[str
]]- Returns
- Tuple[List[float], List[float], List[str]]
local_error: List of local error for each model variable as specified by model_local_error_components.
gfu_norm: List of solution norm for each model variable as specified by model_local_error_components.
component_names: List of names for the components that were tested, in the order that they were.
opencmp.solvers.adaptive_transient_solvers.base_adaptive_transient_multistep module
- class opencmp.solvers.adaptive_transient_solvers.base_adaptive_transient_multistep.BaseAdaptiveTransientMultiStepSolver(model_class, config)[source]
Bases:
opencmp.solvers.transient_multistep.TransientMultiStepSolver
,abc.ABC
A transient multistep solver with adaptive time-stepping.
- abstract _calculate_local_error()[source]
Function to calculate the local error in the time step’s solution and the norm of the time step’s solution.
- Return type
Tuple
[List
[float
],List
[float
],List
[str
]]- Returns
- Tuple[List[float], List[float], List[str]]
local_error: List of local error for each model variable as specified by model_local_error_components.
gfu_norm: List of solution norm for each model variable as specified by model_local_error_components.
component_names: List of names for the components that were tested, in the order that they were.