enex_analysis.tdma

TDMA (Tri-Diagonal Matrix Algorithm) solver and related utilities.

Provides: - TDMA: solve tri-diagonal systems via matrix inversion - _add_loop_advection_terms: inject forced-convection advection

terms into TDMA coefficient arrays

Functions

TDMA(a, b, c, d)

Solve tri-diagonal matrix system using TDMA (Tri-Diagonal Matrix Algorithm).

enex_analysis.tdma.TDMA(a, b, c, d)[source]

Solve tri-diagonal matrix system using TDMA (Tri-Diagonal Matrix Algorithm).

Reference: https://doi.org/10.1016/j.ijheatmasstransfer.2017.09.057 [Appendix B - Eq.(B7)]

Parameters:
  • a (np.ndarray) – Lower diagonal elements (length N-1)

  • b (np.ndarray) – Main diagonal elements (length N)

  • c (np.ndarray) – Upper diagonal elements (length N-1)

  • d (np.ndarray) – Right-hand side vector (length N)

Returns:

Solution vector (next time step temperatures)

Return type:

np.ndarray

Notes

If boundary conditions are not None, additional thermal resistances are added to the leftmost and rightmost columns, and surface temperatures are recalculated considering boundary layer thermal resistance.