5.16.2. Appendix 5.2: IHX Matrix Solution Algorithm

The solution of the matrix represented by Eq. (5.4-44) through Eq. (5.4-47) and whose coefficients are given in Section 5.16.1 is accomplished by Gaussian elimination, making use of the zeros present in the matrix. It is presented as an algorithm as it is coded in subroutine TSIHX. The arrows in the following mean replacement of what is on the left by the expression on the right.

\(\text{JMAX}\) = the number of nodes in the primary and intermediate coolant

\(\text{JMAX} - 1\) = the number of nodes in the shell and tube

  1. Set \(j\) = 1.

  2. Multiply Eq. (5.4-44) by \(\frac{1}{a_{1} \left( j \right)}\)

    \(a_{2}\left( j \right) \rightarrow \frac{a_{2}\left( j \right)}{a_{1}\left( j \right)};a_{3}\left( j \right) \rightarrow \frac{a_{3}\left( j \right)}{a_{1}\left( j \right)} ;\ a_{4}\left( j \right) \rightarrow \frac{a_{4}\left( j \right)}{a_{1}\left( j \right)};a_{5} = \frac{a_{5}\left( j \right)}{a_{1}\left( j \right)};\ a_{1}\left( j \right) \rightarrow 1\);

  3. \(e_{1}\left( j \right) \rightarrow e_{1}\left( j \right) - e_{3}\left( j \right)a_{2}\left( j \right)\)

    \(e_{7}\left( j \right) \rightarrow e_{7}\left( j \right) - \ e_{3}\left( j \right)a_{3}\left( j \right)\);

    \(e_{8}\left( j \right) \rightarrow e_{8}\left( j \right) - e_{8}\left( j \right)e_{4}\left( j \right)\);

    \(e_{3}\left( j \right) \rightarrow 0\);

  4. Multiply non-zero coefficients in Eq. (5.4-45) by \({1}{e_{1} \left( j \right)}\).

    \(e_{5}\left( j \right) \ \longrightarrow \ \ \frac{e_{5}\left( j \right)}{e_{1}\left( j \right)} \ ;\ \ e_{7}\left( j \right) \longrightarrow \ \ \frac{e_{7}\left( j \right)}{e_{1}\left( j \right)} \ ;\)

    \(e_{8}\left( j \right) \ \longrightarrow \ \ \frac{e_{8}\left( j \right)}{e_{1}\left( j \right)} \ ;\ \ e_{10}\left( j \right) \longrightarrow \ \ \frac{e_{10}\left( j \right)}{e_{1}\left( j \right)}\)

    \(e_{1}\left( j \right) \ \longrightarrow \ \ 1\)

  5. \(c_{1}\left( j \right) \ \longrightarrow \ \ c_{1}\left( j \right) \ - c_{2}\left( j \right) e_{5}\left( j \right)\)

    \(c_{3}\left( j \right) \ \longrightarrow \ \ c_{3}\left( j \right) \ - c_{2}\left( j \right) e_{7}\left( j \right)\)

    \(c_{4}\left( j \right) \ \longrightarrow \ \ c_{4}\left( j \right) \ - c_{2}\left( j \right) e_{10}\left( j \right)\)

    \(c_{6}\left( j \right) \ \longrightarrow \ \ c_{6}\left( j \right) \ - c_{2}\left( j \right) e_{8}\left( j \right)\)

    \(c_{2}\left( j \right) \ \longrightarrow \ \ 0\)

    \(f_{1}\left( j \right) \ \longrightarrow \ \ f_{1}\left( j \right) \ - f_{7}\left( j \right) e_{10}\left( j \right)\)

    \(f_{3}\left( j \right) \ \longrightarrow \ \ f_{3}\left( j \right) \ - f_{7}\left( j \right) e_{5}\left( j \right)\)

    \(f_{6}\left( j \right) \ \longrightarrow \ \ f_{6}\left( j \right) \ - f_{7}\left( j \right) e_{8}\left( j \right)\)

    \(f_{8}\left( j \right) \ \longrightarrow \ \ f_{8}\left( j \right) \ - f_{7}\left( j \right) e_{7}\left( j \right)\)

    \(f_{7}\left( j \right) \ \longrightarrow \ \ 0\)

    \(e_{1}\left( j + 1 \right) \ \longrightarrow \ \ e_{1}\left( j + 1 \right) \ - e_{6}\left( j + 1 \right) e_{7}\left( j \right)\)

    \(e_{4}\left( j + 1 \right) \ \longrightarrow \ \ e_{4}\left( j + 1 \right) \ - e_{6}\left( j + 1 \right) e_{5}\left( j \right)\)

    \(e_{8}\left( j + 1 \right) \ \longrightarrow \ \ e_{8}\left( j + 1 \right) \ - e_{6}\left( j + 1 \right) e_{8}\left( j \right)\)

    \(e_{9}\left( j + 1 \right) \ \longrightarrow \ \ e_{9}\left( j + 1 \right) \ - e_{6}\left( j + 1 \right) e_{10}\left( j \right)\)

    \(e_{6}\left( j + 1 \right) \ \longrightarrow \ \ 0\)

  6. Multiply non-zero coefficients in Eq. (5.4-46) by \(\frac{1}{c_{1} \left( j \right)}\).

    \(c_{3}\left( j \right) \ \longrightarrow \ \ \frac{c_{3}\left( j \right)}{c_{1}\left( j \right)} \ ;\ \ c_{4}\left( j \right) \longrightarrow \ \ \frac{c_{4}\left( j \right)}{c_{1}\left( j \right)}\)

    \(c_{5}\left( j \right) \ \longrightarrow \ \ \frac{c_{5}\left( j \right)}{c_{1}\left( j \right)} \ ;\ \ c_{6}\left( j \right) \longrightarrow \ \ \frac{c_{6}\left( j \right)}{c_{1}\left( j \right)}\)

    \(c_{5}\left( j \right) \ \longrightarrow \ \ \frac{c_{5}\left( j \right)}{c_{1}\left( j \right)} \ ;\ \ c_{6}\left( j \right) \longrightarrow \ \ \frac{c_{6}\left( j \right)}{c_{1}\left( j \right)}\)

  7. \(f_{1}\left( j \right) \ \longrightarrow \ \ f_{1}\left( j \right) \ - f_{3}\left( j \right) C_{4}\left( j \right)\)

    \(f_{8}\left( j \right) \ \longrightarrow \ \ f_{8}\left( j \right) \ - f_{3}\left( j \right) C_{3}\left( j \right)\)

    \(f_{5}\left( j \right) \ \longrightarrow \ \ f_{5}\left( j \right) \ - f_{3}\left( j \right) C_{5}\left( j \right)\)

    \(f_{6}\left( j \right) \ \longrightarrow \ \ f_{6}\left( j \right) \ - f_{3}\left( j \right) C_{6}\left( j \right)\)

    \(f_{3}\left( j \right) \ \longrightarrow \ \ 0\)

    \(e_{1}\left( j + 1 \right) \ \longrightarrow \ \ e_{1}\left( j + 1 \right) \ - e_{4}\left( j + 1 \right) c_{3}\left( j \right)\)

    \(e_{9}\left( j + 1 \right) \ \longrightarrow \ \ e_{9}\left( j + 1 \right) \ - e_{4}\left( j + 1 \right) c_{4}\left( j \right)\)

    \(e_{10}\left( j + 1 \right) \ \longrightarrow \ \ e_{10}\left( j + 1 \right) \ - e_{4}\left( j + 1 \right) c_{5}\left( j \right)\)

    \(e_{8}\left( j + 1 \right) \ \longrightarrow \ \ e_{8}\left( j + 1 \right) \ - e_{4}\left( j + 1 \right) c_{6}\left( j \right)\)

    \(e_{4}\left( j + 1 \right) \ \longrightarrow \ 0\)

    \(f_{1}\left( j + 1 \right) \ \longrightarrow \ \ f_{1}\left( j + 1 \right) \ - f_{2}\left( j + 1 \right) c_{5}\left( j \right)\)

    \(f_{4}\left( j + 1 \right) \ \longrightarrow \ \ f_{4}\left( j + 1 \right) \ - f_{2}\left( j + 1 \right) c_{4}\left( j \right)\)

    \(f_{7}\left( j + 1 \right) \ \longrightarrow \ \ f_{7}\left( j + 1 \right) \ - f_{2}\left( j + 1 \right) c_{3}\left( j \right)\)

    \(f_{6}\left( j + 1 \right) \ \longrightarrow \ \ f_{6}\left( j + 1 \right) \ - f_{2}\left( j + 1 \right) c_{6}\left( j \right)\)

    \(f_{2}\left( j + 1 \right) \ \longrightarrow \ \ 0\)

  8. Multiply non-zero coefficients in Eq. (5.4-47) by \(\frac{1}{f_{1} \left( j \right)}\).

    \(f_{5}\left( j \right) \ \longrightarrow \ \ \frac{f_{5}\left( j \right)}{f_{1}\left( j \right)} \ ;\ \ f_{6}\left( j \right) \longrightarrow \ \ \frac{f_{6}\left( j \right)}{f_{1}\left( j \right)} ;\)

    \(f_{8}\left( j \right) \ \longrightarrow \ \ \frac{f_{8}\left( j \right)}{f_{1}\left( j \right)} \ ;\ \ f_{1}\left( j \right) \longrightarrow \ 1\)

  9. \(e_{1}\left( j + 1 \right) \ \longrightarrow \ \ e_{1}\left( j + 1 \right) \ - e_{9}\left( j + 1 \right) f_{5}\left( j \right)\)

    \(e_{10}\left( j + 1 \right) \ \longrightarrow \ \ e_{10}\left( j + 1 \right) \ - e_{9}\left( j + 1 \right) f_{5}\left( j \right)\)

    \(e_{8}\left( j + 1 \right) \ \longrightarrow \ \ e_{8}\left( j + 1 \right) \ - e_{9}\left( j + 1 \right) f_{6}\left( j \right)\)

    \(e_{9}\left( j + 1 \right) \ \longrightarrow \ 0\)

    \(f_{1}\left( j + 1 \right) \ \longrightarrow \ \ f_{1}\left( j + 1 \right) \ - f_{4}\left( j + 1 \right) f_{5}\left( j \right)\)

    \(f_{7}\left( j + 1 \right) \ \longrightarrow \ \ f_{7}\left( j + 1 \right) \ - f_{4}\left( j + 1 \right) f_{8}\left( j \right)\)

    \(f_{6}\left( j + 1 \right) \ \longrightarrow \ \ f_{6}\left( j + 1 \right) \ - f_{4}\left( j + 1 \right) f_{6}\left( j \right)\)

    \(f_{4}\left( j + 1 \right) \ \longrightarrow \ \ 0\)

  10. Set \(j\ \ \longrightarrow \ \ j + 1\)

  11. If \(j < \text{JMAX}\), go to step 2

  12. Multiply the non-zero coefficients in Eq. (5.4-47) by \(\frac{1}{f_{1} \left( j \right)}\)

    \(f_{6}\left( j \right) \ \longrightarrow \ \ \frac{f_{6}\left( j \right)}{f_{1}\left( j \right)} \ ;\ \ f_{7}\left( j \right) \longrightarrow \ \ \frac{f_{7}\left( j \right)}{f_{1}\left( j \right)} ;\ \ f_{1} \left( j \right) \longrightarrow \ 1\)

  13. \(e_{1}\left( j \right) \ \longrightarrow \ \ e_{1}\left( j \right) \ - e_{10}\left( j \right) f_{7}\left( j \right)\)

    \(e_{8}\left( j \right) \ \longrightarrow \ \ e_{8}\left( j \right) \ - e_{10}\left( j \right) f_{6}\left( j \right)\)

    \(e_{10}\left( j \right) \ \longrightarrow \ \ 0\)

  14. \(e_{8}\left( j \right) \ \longrightarrow \ \ \frac{e_{8}\left( j \right)}{e_{1}\left( j \right)} \ ;\ \ e_{1}\left( j \right) \longrightarrow \ 1\)

  15. \(\Delta T_{\text{CP}}\left( j \right) = e_{8}\left( j \right)\)

    \(\Delta T_{\text{CT}}\left( j \right) = f_{6}\left( j \right) - f_{7}\left( j \right)\Delta T_{\text{CS}}\left( j \right)\)

  16. Set \(j\ \ \longrightarrow \ \ j - 1\)

  17. If \(j < 1\), go to step 23

  18. \(\Delta T_{\text{CT}}\left( j \right) = f_{6}\left( j \right) - f_{5}\left( j \right)\Delta T_{\text{CT}}\left( j + 1 \right) - f_{8}\left( j \right)\Delta T_{\text{CS}}\left( j + 1 \right)\)

  19. \(\Delta T_{\text{TU}}\left( j \right) = C_{6}\left( j \right) - C_{3}\left( j \right)\Delta T_{\text{CS}}\left( j + 1 \right) - C_{4}\left( j \right)\Delta T_{\text{CS}}\left( j + 1 \right) - C_{5}\left( j \right)\Delta T_{\text{CT}}\left( j + 1 \right)\)

  20. \(\Delta T_{\text{CS}}\left( j \right) = e_{8}\left( j \right) - e_{5}\left( j \right)\Delta T_{\text{TU}}\left( j \right) - e_{7}\left( j \right)\Delta T_{\text{CS}}\left( j + 1 \right) - e_{10}\left( j \right)\Delta T_{\text{CT}}\left( j \right)\)

  21. \(\Delta T_{\text{SH}}\left( j \right) = a_{4}\left( j \right) - a_{2}\left( j \right)\Delta T_{\text{CS}}\left( j \right) - a_{3}\left( j \right)\Delta T_{\text{CS}}\left( j + 1 \right)\)

  22. Go to step 16

  23. End