pycanha_core.solvers — Core Solver Classes#
These are the C++ solver base classes.
- class pycanha_core.solvers.Solver#
Bases:
objectAbstract base class for thermal solvers.
Lifecycle: initialize() -> solve() -> deinitialize().
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(*args, **kwargs)#
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- class pycanha_core.solvers.SteadyStateSolver#
Bases:
SolverBase class for steady-state (time-independent) solvers.
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(*args, **kwargs)#
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- class pycanha_core.solvers.TransientSolver#
Bases:
SolverBase class for transient (time-dependent) solvers.
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(*args, **kwargs)#
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property output_config#
Reference to the output configuration.
- property output_model_name#
Name of the DataModel where output is stored.
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- set_simulation_time(self, start_time: float, end_time: float, dtime: float, output_stride: float) None#
Configure the transient simulation time window and output interval.
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- property time#
Current simulation time [s].
- property time_iter#
Current time iteration index.
- class pycanha_core.solvers.TSCN#
Bases:
TransientSolverBase class for Crank-Nicolson transient solvers.
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(*args, **kwargs)#
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property output_config#
Reference to the output configuration.
- property output_model_name#
Name of the DataModel where output is stored.
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- set_simulation_time(self, start_time: float, end_time: float, dtime: float, output_stride: float) None#
Configure the transient simulation time window and output interval.
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- property time#
Current simulation time [s].
- property time_iter#
Current time iteration index.
- class pycanha_core.solvers.TSCNRL#
Bases:
TSCNTransient Crank-Nicolson solver with radiation linearization.
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(*args, **kwargs)#
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property output_config#
Reference to the output configuration.
- property output_model_name#
Name of the DataModel where output is stored.
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- set_simulation_time(self, start_time: float, end_time: float, dtime: float, output_stride: float) None#
Configure the transient simulation time window and output interval.
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- property time#
Current simulation time [s].
- property time_iter#
Current time iteration index.
- class pycanha_core.solvers.SSLU(*args, **kwargs)#
Bases:
SteadyStateSolverSteady-state solver using sparse LU decomposition.
Solves the non-linear steady-state thermal equation iteratively using Eigen SparseLU factorization.
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(self, tmm: pycanha_core.pycanha_core.tmm.ThermalMathematicalModel) None#
Create a solver bound to a ThermalMathematicalModel.
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- class pycanha_core.solvers.TSCNRLDS(*args, **kwargs)#
Bases:
TSCNRLTransient Crank-Nicolson solver with radiation linearization and direct sparse factorization.
Uses MKL PARDISO when available, otherwise Eigen SparseLU.
- property MAX_ITERS#
Maximum number of solver iterations per step.
- __init__(self, tmm: pycanha_core.pycanha_core.tmm.ThermalMathematicalModel) None#
Create a solver bound to a ThermalMathematicalModel.
- property abstol_enrgy#
Absolute energy convergence tolerance [W].
- property abstol_temp#
Absolute temperature convergence tolerance [K].
- property eps_capacity#
Minimum thermal capacity threshold [J/K].
- property eps_coupling#
Minimum coupling value threshold.
- property eps_time#
Time step epsilon [s].
- property output_config#
Reference to the output configuration.
- property output_model_name#
Name of the DataModel where output is stored.
- property pardiso_iparm_3#
MKL PARDISO iparm[3] parameter (preconditioner control).
- set_simulation_time(self, start_time: float, end_time: float, dtime: float, output_stride: float) None#
Configure the transient simulation time window and output interval.
- property solver_converged#
Whether the solver has converged.
- property solver_initialized#
Whether initialize() has been called.
- property solver_iter#
Current solver iteration count.
- property solver_name#
Name of the solver.
- property time#
Current simulation time [s].
- property time_iter#
Current time iteration index.