diff --git a/docs/advanced_tutorials/develop_components.rst b/docs/advanced_tutorials/develop_components.rst index 69a2467b6..51cdcbb8a 100644 --- a/docs/advanced_tutorials/develop_components.rst +++ b/docs/advanced_tutorials/develop_components.rst @@ -245,7 +245,7 @@ like this: :start-after: [sec_6] :end-before: [sec_7] -Once a again, it is recommended to test the code. +Once again, it is recommended to test the code. .. dropdown:: Display source code for testing the model diff --git a/docs/api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT.svg b/docs/api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT.svg new file mode 100644 index 000000000..7dd064945 --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT.svg @@ -0,0 +1,1243 @@ + + + + + + + + 2026-05-17T17:20:48.508075 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..00dcc1e2c --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT_darkmode.svg @@ -0,0 +1,1243 @@ + + + + + + + + 2026-05-17T17:20:50.430346 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT.svg b/docs/api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT.svg new file mode 100644 index 000000000..bad1c226d --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT.svg @@ -0,0 +1,1268 @@ + + + + + + + + 2026-05-17T17:20:48.583283 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..0d2aee3e5 --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT_darkmode.svg @@ -0,0 +1,1268 @@ + + + + + + + + 2026-05-17T17:20:50.527659 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT.svg b/docs/api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT.svg new file mode 100644 index 000000000..7bda1ad3f --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT.svg @@ -0,0 +1,1195 @@ + + + + + + + + 2026-05-17T17:20:48.660336 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..e362fe4a6 --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT_darkmode.svg @@ -0,0 +1,1195 @@ + + + + + + + + 2026-05-17T17:20:50.608533 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT.svg b/docs/api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT.svg new file mode 100644 index 000000000..9edf55795 --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT.svg @@ -0,0 +1,1175 @@ + + + + + + + + 2026-05-17T17:20:48.426411 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..52e7210ed --- /dev/null +++ b/docs/api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT_darkmode.svg @@ -0,0 +1,1175 @@ + + + + + + + + 2026-05-17T17:20:50.348081 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Compressor_eta_s_char_DEFAULT.svg b/docs/api/_images/characteristics/Compressor_eta_s_char_DEFAULT.svg new file mode 100644 index 000000000..e5ef339bb --- /dev/null +++ b/docs/api/_images/characteristics/Compressor_eta_s_char_DEFAULT.svg @@ -0,0 +1,1179 @@ + + + + + + + + 2026-05-17T17:20:48.290355 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Compressor_eta_s_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Compressor_eta_s_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..4aa6d924d --- /dev/null +++ b/docs/api/_images/characteristics/Compressor_eta_s_char_DEFAULT_darkmode.svg @@ -0,0 +1,1179 @@ + + + + + + + + 2026-05-17T17:20:50.182906 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Condenser_kA_char1_DEFAULT.svg b/docs/api/_images/characteristics/Condenser_kA_char1_DEFAULT.svg new file mode 100644 index 000000000..8e76d6817 --- /dev/null +++ b/docs/api/_images/characteristics/Condenser_kA_char1_DEFAULT.svg @@ -0,0 +1,1220 @@ + + + + + + + + 2026-05-17T17:20:49.094203 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Condenser_kA_char1_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Condenser_kA_char1_DEFAULT_darkmode.svg new file mode 100644 index 000000000..eade1514e --- /dev/null +++ b/docs/api/_images/characteristics/Condenser_kA_char1_DEFAULT_darkmode.svg @@ -0,0 +1,1220 @@ + + + + + + + + 2026-05-17T17:20:51.070969 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Condenser_kA_char2_DEFAULT.svg b/docs/api/_images/characteristics/Condenser_kA_char2_DEFAULT.svg new file mode 100644 index 000000000..2f0a4ffc5 --- /dev/null +++ b/docs/api/_images/characteristics/Condenser_kA_char2_DEFAULT.svg @@ -0,0 +1,1256 @@ + + + + + + + + 2026-05-17T17:20:49.200571 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Condenser_kA_char2_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Condenser_kA_char2_DEFAULT_darkmode.svg new file mode 100644 index 000000000..215e9a0d3 --- /dev/null +++ b/docs/api/_images/characteristics/Condenser_kA_char2_DEFAULT_darkmode.svg @@ -0,0 +1,1256 @@ + + + + + + + + 2026-05-17T17:20:51.147817 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Desuperheater_kA_char1_DEFAULT.svg b/docs/api/_images/characteristics/Desuperheater_kA_char1_DEFAULT.svg new file mode 100644 index 000000000..36c9776cb --- /dev/null +++ b/docs/api/_images/characteristics/Desuperheater_kA_char1_DEFAULT.svg @@ -0,0 +1,1266 @@ + + + + + + + + 2026-05-17T17:20:49.326415 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Desuperheater_kA_char1_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Desuperheater_kA_char1_DEFAULT_darkmode.svg new file mode 100644 index 000000000..3820a74e5 --- /dev/null +++ b/docs/api/_images/characteristics/Desuperheater_kA_char1_DEFAULT_darkmode.svg @@ -0,0 +1,1266 @@ + + + + + + + + 2026-05-17T17:20:51.247667 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Desuperheater_kA_char2_DEFAULT.svg b/docs/api/_images/characteristics/Desuperheater_kA_char2_DEFAULT.svg new file mode 100644 index 000000000..9f51fe376 --- /dev/null +++ b/docs/api/_images/characteristics/Desuperheater_kA_char2_DEFAULT.svg @@ -0,0 +1,1256 @@ + + + + + + + + 2026-05-17T17:20:49.420527 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Desuperheater_kA_char2_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Desuperheater_kA_char2_DEFAULT_darkmode.svg new file mode 100644 index 000000000..81106b30f --- /dev/null +++ b/docs/api/_images/characteristics/Desuperheater_kA_char2_DEFAULT_darkmode.svg @@ -0,0 +1,1256 @@ + + + + + + + + 2026-05-17T17:20:51.354922 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID.svg new file mode 100644 index 000000000..83e7cae09 --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID.svg @@ -0,0 +1,1315 @@ + + + + + + + + 2026-05-17T17:20:48.811887 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID_darkmode.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID_darkmode.svg new file mode 100644 index 000000000..2c716b5df --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID_darkmode.svg @@ -0,0 +1,1315 @@ + + + + + + + + 2026-05-17T17:20:50.782961 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT.svg new file mode 100644 index 000000000..0eee2da1c --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT.svg @@ -0,0 +1,1266 @@ + + + + + + + + 2026-05-17T17:20:48.736267 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT_darkmode.svg new file mode 100644 index 000000000..9a7206088 --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT_darkmode.svg @@ -0,0 +1,1266 @@ + + + + + + + + 2026-05-17T17:20:50.688109 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT.svg new file mode 100644 index 000000000..467ffaebb --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT.svg @@ -0,0 +1,1256 @@ + + + + + + + + 2026-05-17T17:20:48.897348 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT_darkmode.svg new file mode 100644 index 000000000..1c2444870 --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT_darkmode.svg @@ -0,0 +1,1256 @@ + + + + + + + + 2026-05-17T17:20:50.895666 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID.svg new file mode 100644 index 000000000..6ec25ca19 --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID.svg @@ -0,0 +1,1348 @@ + + + + + + + + 2026-05-17T17:20:48.994731 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID_darkmode.svg b/docs/api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID_darkmode.svg new file mode 100644 index 000000000..692a3123c --- /dev/null +++ b/docs/api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID_darkmode.svg @@ -0,0 +1,1348 @@ + + + + + + + + 2026-05-17T17:20:50.990143 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Pipe_kA_char_DEFAULT.svg b/docs/api/_images/characteristics/Pipe_kA_char_DEFAULT.svg new file mode 100644 index 000000000..29497a595 --- /dev/null +++ b/docs/api/_images/characteristics/Pipe_kA_char_DEFAULT.svg @@ -0,0 +1,1265 @@ + + + + + + + + 2026-05-17T17:20:49.625334 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Pipe_kA_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Pipe_kA_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..2dc4d002e --- /dev/null +++ b/docs/api/_images/characteristics/Pipe_kA_char_DEFAULT_darkmode.svg @@ -0,0 +1,1265 @@ + + + + + + + + 2026-05-17T17:20:51.640450 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Pump_eta_s_char_DEFAULT.svg b/docs/api/_images/characteristics/Pump_eta_s_char_DEFAULT.svg new file mode 100644 index 000000000..6366b4ce7 --- /dev/null +++ b/docs/api/_images/characteristics/Pump_eta_s_char_DEFAULT.svg @@ -0,0 +1,1246 @@ + + + + + + + + 2026-05-17T17:20:48.358508 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Pump_eta_s_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Pump_eta_s_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..455141bfc --- /dev/null +++ b/docs/api/_images/characteristics/Pump_eta_s_char_DEFAULT_darkmode.svg @@ -0,0 +1,1246 @@ + + + + + + + + 2026-05-17T17:20:50.264843 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT.svg b/docs/api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT.svg new file mode 100644 index 000000000..850db8f1d --- /dev/null +++ b/docs/api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT.svg @@ -0,0 +1,1265 @@ + + + + + + + + 2026-05-17T17:20:49.505332 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..5a194b889 --- /dev/null +++ b/docs/api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT_darkmode.svg @@ -0,0 +1,1265 @@ + + + + + + + + 2026-05-17T17:20:51.493868 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Turbine_eta_s_char_DEFAULT.svg b/docs/api/_images/characteristics/Turbine_eta_s_char_DEFAULT.svg new file mode 100644 index 000000000..97d8e9813 --- /dev/null +++ b/docs/api/_images/characteristics/Turbine_eta_s_char_DEFAULT.svg @@ -0,0 +1,1216 @@ + + + + + + + + 2026-05-17T17:20:48.146680 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Turbine_eta_s_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/Turbine_eta_s_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..5588a06fa --- /dev/null +++ b/docs/api/_images/characteristics/Turbine_eta_s_char_DEFAULT_darkmode.svg @@ -0,0 +1,1216 @@ + + + + + + + + 2026-05-17T17:20:50.022952 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Turbine_eta_s_char_TRAUPEL.svg b/docs/api/_images/characteristics/Turbine_eta_s_char_TRAUPEL.svg new file mode 100644 index 000000000..08724ce85 --- /dev/null +++ b/docs/api/_images/characteristics/Turbine_eta_s_char_TRAUPEL.svg @@ -0,0 +1,1224 @@ + + + + + + + + 2026-05-17T17:20:48.220892 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/Turbine_eta_s_char_TRAUPEL_darkmode.svg b/docs/api/_images/characteristics/Turbine_eta_s_char_TRAUPEL_darkmode.svg new file mode 100644 index 000000000..33e4954c3 --- /dev/null +++ b/docs/api/_images/characteristics/Turbine_eta_s_char_TRAUPEL_darkmode.svg @@ -0,0 +1,1224 @@ + + + + + + + + 2026-05-17T17:20:50.105238 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT.svg b/docs/api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT.svg new file mode 100644 index 000000000..55d68656c --- /dev/null +++ b/docs/api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT.svg @@ -0,0 +1,1369 @@ + + + + + + + + 2026-05-17T17:20:49.943153 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT_darkmode.svg new file mode 100644 index 000000000..3a78359d9 --- /dev/null +++ b/docs/api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT_darkmode.svg @@ -0,0 +1,1369 @@ + + + + + + + + 2026-05-17T17:20:51.936205 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT.svg b/docs/api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT.svg new file mode 100644 index 000000000..9d8e7d879 --- /dev/null +++ b/docs/api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT.svg @@ -0,0 +1,1318 @@ + + + + + + + + 2026-05-17T17:20:49.849850 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT_darkmode.svg new file mode 100644 index 000000000..c9dbce80e --- /dev/null +++ b/docs/api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT_darkmode.svg @@ -0,0 +1,1318 @@ + + + + + + + + 2026-05-17T17:20:51.840218 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT.svg b/docs/api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT.svg new file mode 100644 index 000000000..4e493c8fd --- /dev/null +++ b/docs/api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT.svg @@ -0,0 +1,1120 @@ + + + + + + + + 2026-05-17T17:20:49.747199 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT_darkmode.svg b/docs/api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT_darkmode.svg new file mode 100644 index 000000000..ed6e61e3f --- /dev/null +++ b/docs/api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT_darkmode.svg @@ -0,0 +1,1120 @@ + + + + + + + + 2026-05-17T17:20:51.745661 + image/svg+xml + + + Matplotlib v3.10.9, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/_images/combustion_engine_Q1_char_DEFAULT.svg b/docs/api/_images/combustion_engine_Q1_char_DEFAULT.svg deleted file mode 100644 index be6cddf44..000000000 --- a/docs/api/_images/combustion_engine_Q1_char_DEFAULT.svg +++ /dev/null @@ -1,1217 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:49.925059 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/combustion_engine_Q2_char_DEFAULT.svg b/docs/api/_images/combustion_engine_Q2_char_DEFAULT.svg deleted file mode 100644 index edcde8b56..000000000 --- a/docs/api/_images/combustion_engine_Q2_char_DEFAULT.svg +++ /dev/null @@ -1,1240 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:50.216704 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/combustion_engine_Qloss_char_DEFAULT.svg b/docs/api/_images/combustion_engine_Qloss_char_DEFAULT.svg deleted file mode 100644 index 8881833ca..000000000 --- a/docs/api/_images/combustion_engine_Qloss_char_DEFAULT.svg +++ /dev/null @@ -1,1169 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:50.555853 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/combustion_engine_tiP_char_DEFAULT.svg b/docs/api/_images/combustion_engine_tiP_char_DEFAULT.svg deleted file mode 100644 index 36c7cbc9c..000000000 --- a/docs/api/_images/combustion_engine_tiP_char_DEFAULT.svg +++ /dev/null @@ -1,1147 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:49.639983 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/CombustionChamber.svg b/docs/api/_images/components/CombustionChamber.svg similarity index 100% rename from docs/api/_images/CombustionChamber.svg rename to docs/api/_images/components/CombustionChamber.svg diff --git a/docs/api/_images/CombustionChamber_darkmode.svg b/docs/api/_images/components/CombustionChamber_darkmode.svg similarity index 100% rename from docs/api/_images/CombustionChamber_darkmode.svg rename to docs/api/_images/components/CombustionChamber_darkmode.svg diff --git a/docs/api/_images/CombustionEngine.svg b/docs/api/_images/components/CombustionEngine.svg similarity index 100% rename from docs/api/_images/CombustionEngine.svg rename to docs/api/_images/components/CombustionEngine.svg diff --git a/docs/api/_images/CombustionEngine_darkmode.svg b/docs/api/_images/components/CombustionEngine_darkmode.svg similarity index 100% rename from docs/api/_images/CombustionEngine_darkmode.svg rename to docs/api/_images/components/CombustionEngine_darkmode.svg diff --git a/docs/api/_images/Compressor.svg b/docs/api/_images/components/Compressor.svg similarity index 100% rename from docs/api/_images/Compressor.svg rename to docs/api/_images/components/Compressor.svg diff --git a/docs/api/_images/Compressor_darkmode.svg b/docs/api/_images/components/Compressor_darkmode.svg similarity index 100% rename from docs/api/_images/Compressor_darkmode.svg rename to docs/api/_images/components/Compressor_darkmode.svg diff --git a/docs/api/_images/Condenser.svg b/docs/api/_images/components/Condenser.svg similarity index 100% rename from docs/api/_images/Condenser.svg rename to docs/api/_images/components/Condenser.svg diff --git a/docs/api/_images/Condenser_darkmode.svg b/docs/api/_images/components/Condenser_darkmode.svg similarity index 100% rename from docs/api/_images/Condenser_darkmode.svg rename to docs/api/_images/components/Condenser_darkmode.svg diff --git a/docs/api/_images/DropletSeparator.svg b/docs/api/_images/components/DropletSeparator.svg similarity index 100% rename from docs/api/_images/DropletSeparator.svg rename to docs/api/_images/components/DropletSeparator.svg diff --git a/docs/api/_images/DropletSeparator_darkmode.svg b/docs/api/_images/components/DropletSeparator_darkmode.svg similarity index 100% rename from docs/api/_images/DropletSeparator_darkmode.svg rename to docs/api/_images/components/DropletSeparator_darkmode.svg diff --git a/docs/api/_images/Drum.svg b/docs/api/_images/components/Drum.svg similarity index 100% rename from docs/api/_images/Drum.svg rename to docs/api/_images/components/Drum.svg diff --git a/docs/api/_images/Drum_darkmode.svg b/docs/api/_images/components/Drum_darkmode.svg similarity index 100% rename from docs/api/_images/Drum_darkmode.svg rename to docs/api/_images/components/Drum_darkmode.svg diff --git a/docs/api/_images/FuelCell.svg b/docs/api/_images/components/FuelCell.svg similarity index 100% rename from docs/api/_images/FuelCell.svg rename to docs/api/_images/components/FuelCell.svg diff --git a/docs/api/_images/FuelCell_darkmode.svg b/docs/api/_images/components/FuelCell_darkmode.svg similarity index 100% rename from docs/api/_images/FuelCell_darkmode.svg rename to docs/api/_images/components/FuelCell_darkmode.svg diff --git a/docs/api/_images/Generator.svg b/docs/api/_images/components/Generator.svg similarity index 100% rename from docs/api/_images/Generator.svg rename to docs/api/_images/components/Generator.svg diff --git a/docs/api/_images/Generator_darkmode.svg b/docs/api/_images/components/Generator_darkmode.svg similarity index 100% rename from docs/api/_images/Generator_darkmode.svg rename to docs/api/_images/components/Generator_darkmode.svg diff --git a/docs/api/_images/HeatExchanger.svg b/docs/api/_images/components/HeatExchanger.svg similarity index 100% rename from docs/api/_images/HeatExchanger.svg rename to docs/api/_images/components/HeatExchanger.svg diff --git a/docs/api/_images/HeatExchanger_darkmode.svg b/docs/api/_images/components/HeatExchanger_darkmode.svg similarity index 100% rename from docs/api/_images/HeatExchanger_darkmode.svg rename to docs/api/_images/components/HeatExchanger_darkmode.svg diff --git a/docs/api/_images/Merge.svg b/docs/api/_images/components/Merge.svg similarity index 100% rename from docs/api/_images/Merge.svg rename to docs/api/_images/components/Merge.svg diff --git a/docs/api/_images/Merge_darkmode.svg b/docs/api/_images/components/Merge_darkmode.svg similarity index 100% rename from docs/api/_images/Merge_darkmode.svg rename to docs/api/_images/components/Merge_darkmode.svg diff --git a/docs/api/_images/Motor.svg b/docs/api/_images/components/Motor.svg similarity index 100% rename from docs/api/_images/Motor.svg rename to docs/api/_images/components/Motor.svg diff --git a/docs/api/_images/Motor_darkmode.svg b/docs/api/_images/components/Motor_darkmode.svg similarity index 100% rename from docs/api/_images/Motor_darkmode.svg rename to docs/api/_images/components/Motor_darkmode.svg diff --git a/docs/api/_images/Node.svg b/docs/api/_images/components/Node.svg similarity index 100% rename from docs/api/_images/Node.svg rename to docs/api/_images/components/Node.svg diff --git a/docs/api/_images/Node_darkmode.svg b/docs/api/_images/components/Node_darkmode.svg similarity index 100% rename from docs/api/_images/Node_darkmode.svg rename to docs/api/_images/components/Node_darkmode.svg diff --git a/docs/api/_images/ParabolicTrough.svg b/docs/api/_images/components/ParabolicTrough.svg similarity index 100% rename from docs/api/_images/ParabolicTrough.svg rename to docs/api/_images/components/ParabolicTrough.svg diff --git a/docs/api/_images/ParabolicTrough_darkmode.svg b/docs/api/_images/components/ParabolicTrough_darkmode.svg similarity index 100% rename from docs/api/_images/ParabolicTrough_darkmode.svg rename to docs/api/_images/components/ParabolicTrough_darkmode.svg diff --git a/docs/api/_images/Pipe.svg b/docs/api/_images/components/Pipe.svg similarity index 100% rename from docs/api/_images/Pipe.svg rename to docs/api/_images/components/Pipe.svg diff --git a/docs/api/_images/Pipe_darkmode.svg b/docs/api/_images/components/Pipe_darkmode.svg similarity index 100% rename from docs/api/_images/Pipe_darkmode.svg rename to docs/api/_images/components/Pipe_darkmode.svg diff --git a/docs/api/_images/components/PolynomialCompressor.svg b/docs/api/_images/components/PolynomialCompressor.svg new file mode 100644 index 000000000..328c86ad2 --- /dev/null +++ b/docs/api/_images/components/PolynomialCompressor.svg @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + in1 + out1 + + + + + diff --git a/docs/api/_images/PolynomialCompressorWithCooling.svg b/docs/api/_images/components/PolynomialCompressorWithCooling.svg similarity index 100% rename from docs/api/_images/PolynomialCompressorWithCooling.svg rename to docs/api/_images/components/PolynomialCompressorWithCooling.svg diff --git a/docs/api/_images/PolynomialCompressorWithCooling_darkmode.svg b/docs/api/_images/components/PolynomialCompressorWithCooling_darkmode.svg similarity index 100% rename from docs/api/_images/PolynomialCompressorWithCooling_darkmode.svg rename to docs/api/_images/components/PolynomialCompressorWithCooling_darkmode.svg diff --git a/docs/api/_images/components/PolynomialCompressor_darkmode.svg b/docs/api/_images/components/PolynomialCompressor_darkmode.svg new file mode 100644 index 000000000..6a52860bc --- /dev/null +++ b/docs/api/_images/components/PolynomialCompressor_darkmode.svg @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + in1 + out1 + + + + + diff --git a/docs/api/_images/PowerBus.svg b/docs/api/_images/components/PowerBus.svg similarity index 100% rename from docs/api/_images/PowerBus.svg rename to docs/api/_images/components/PowerBus.svg diff --git a/docs/api/_images/PowerBus_darkmode.svg b/docs/api/_images/components/PowerBus_darkmode.svg similarity index 100% rename from docs/api/_images/PowerBus_darkmode.svg rename to docs/api/_images/components/PowerBus_darkmode.svg diff --git a/docs/api/_images/Pump.svg b/docs/api/_images/components/Pump.svg similarity index 100% rename from docs/api/_images/Pump.svg rename to docs/api/_images/components/Pump.svg diff --git a/docs/api/_images/Pump_darkmode.svg b/docs/api/_images/components/Pump_darkmode.svg similarity index 100% rename from docs/api/_images/Pump_darkmode.svg rename to docs/api/_images/components/Pump_darkmode.svg diff --git a/docs/api/_images/SolarCollector.svg b/docs/api/_images/components/SolarCollector.svg similarity index 100% rename from docs/api/_images/SolarCollector.svg rename to docs/api/_images/components/SolarCollector.svg diff --git a/docs/api/_images/SolarCollector_darkmode.svg b/docs/api/_images/components/SolarCollector_darkmode.svg similarity index 100% rename from docs/api/_images/SolarCollector_darkmode.svg rename to docs/api/_images/components/SolarCollector_darkmode.svg diff --git a/docs/api/_images/Splitter.svg b/docs/api/_images/components/Splitter.svg similarity index 100% rename from docs/api/_images/Splitter.svg rename to docs/api/_images/components/Splitter.svg diff --git a/docs/api/_images/Splitter_darkmode.svg b/docs/api/_images/components/Splitter_darkmode.svg similarity index 100% rename from docs/api/_images/Splitter_darkmode.svg rename to docs/api/_images/components/Splitter_darkmode.svg diff --git a/docs/api/_images/SubsystemInterface.svg b/docs/api/_images/components/SubsystemInterface.svg similarity index 100% rename from docs/api/_images/SubsystemInterface.svg rename to docs/api/_images/components/SubsystemInterface.svg diff --git a/docs/api/_images/SubsystemInterface_darkmode.svg b/docs/api/_images/components/SubsystemInterface_darkmode.svg similarity index 100% rename from docs/api/_images/SubsystemInterface_darkmode.svg rename to docs/api/_images/components/SubsystemInterface_darkmode.svg diff --git a/docs/api/_images/Turbine.svg b/docs/api/_images/components/Turbine.svg similarity index 100% rename from docs/api/_images/Turbine.svg rename to docs/api/_images/components/Turbine.svg diff --git a/docs/api/_images/Turbine_darkmode.svg b/docs/api/_images/components/Turbine_darkmode.svg similarity index 100% rename from docs/api/_images/Turbine_darkmode.svg rename to docs/api/_images/components/Turbine_darkmode.svg diff --git a/docs/api/_images/Valve.svg b/docs/api/_images/components/Valve.svg similarity index 100% rename from docs/api/_images/Valve.svg rename to docs/api/_images/components/Valve.svg diff --git a/docs/api/_images/Valve_darkmode.svg b/docs/api/_images/components/Valve_darkmode.svg similarity index 100% rename from docs/api/_images/Valve_darkmode.svg rename to docs/api/_images/components/Valve_darkmode.svg diff --git a/docs/api/_images/WaterElectrolyzer.svg b/docs/api/_images/components/WaterElectrolyzer.svg similarity index 100% rename from docs/api/_images/WaterElectrolyzer.svg rename to docs/api/_images/components/WaterElectrolyzer.svg diff --git a/docs/api/_images/WaterElectrolyzer_darkmode.svg b/docs/api/_images/components/WaterElectrolyzer_darkmode.svg similarity index 100% rename from docs/api/_images/WaterElectrolyzer_darkmode.svg rename to docs/api/_images/components/WaterElectrolyzer_darkmode.svg diff --git a/docs/api/_images/compressor_char_map_eta_s_DEFAULT.svg b/docs/api/_images/compressor_char_map_eta_s_DEFAULT.svg deleted file mode 100644 index db74cedd4..000000000 --- a/docs/api/_images/compressor_char_map_eta_s_DEFAULT.svg +++ /dev/null @@ -1,1339 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:54.418743 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/compressor_char_map_pr_DEFAULT.svg b/docs/api/_images/compressor_char_map_pr_DEFAULT.svg deleted file mode 100644 index 1c4eb2737..000000000 --- a/docs/api/_images/compressor_char_map_pr_DEFAULT.svg +++ /dev/null @@ -1,1288 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:54.117674 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/compressor_eta_s_char_DEFAULT.svg b/docs/api/_images/compressor_eta_s_char_DEFAULT.svg deleted file mode 100644 index 92410167f..000000000 --- a/docs/api/_images/compressor_eta_s_char_DEFAULT.svg +++ /dev/null @@ -1,1153 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:49.089746 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/condenser_kA_char1_DEFAULT.svg b/docs/api/_images/condenser_kA_char1_DEFAULT.svg deleted file mode 100644 index 093d82a7e..000000000 --- a/docs/api/_images/condenser_kA_char1_DEFAULT.svg +++ /dev/null @@ -1,1192 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:52.018820 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/condenser_kA_char2_DEFAULT.svg b/docs/api/_images/condenser_kA_char2_DEFAULT.svg deleted file mode 100644 index 45cbc0715..000000000 --- a/docs/api/_images/condenser_kA_char2_DEFAULT.svg +++ /dev/null @@ -1,1228 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:52.315853 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/desuperheater_kA_char1_DEFAULT.svg b/docs/api/_images/desuperheater_kA_char1_DEFAULT.svg deleted file mode 100644 index 807e45ff0..000000000 --- a/docs/api/_images/desuperheater_kA_char1_DEFAULT.svg +++ /dev/null @@ -1,1238 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:52.606623 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/desuperheater_kA_char2_DEFAULT.svg b/docs/api/_images/desuperheater_kA_char2_DEFAULT.svg deleted file mode 100644 index d2044cfcc..000000000 --- a/docs/api/_images/desuperheater_kA_char2_DEFAULT.svg +++ /dev/null @@ -1,1228 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:52.897985 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/heat_exchanger_kA_char1_CONDENSING_FLUID.svg b/docs/api/_images/heat_exchanger_kA_char1_CONDENSING_FLUID.svg deleted file mode 100644 index e5060033f..000000000 --- a/docs/api/_images/heat_exchanger_kA_char1_CONDENSING_FLUID.svg +++ /dev/null @@ -1,1286 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:51.122179 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/heat_exchanger_kA_char1_DEFAULT.svg b/docs/api/_images/heat_exchanger_kA_char1_DEFAULT.svg deleted file mode 100644 index 4263bbabc..000000000 --- a/docs/api/_images/heat_exchanger_kA_char1_DEFAULT.svg +++ /dev/null @@ -1,1238 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:50.850120 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/heat_exchanger_kA_char2_DEFAULT.svg b/docs/api/_images/heat_exchanger_kA_char2_DEFAULT.svg deleted file mode 100644 index e8f6dac81..000000000 --- a/docs/api/_images/heat_exchanger_kA_char2_DEFAULT.svg +++ /dev/null @@ -1,1228 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:51.420125 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/heat_exchanger_kA_char2_EVAPORATING_FLUID.svg b/docs/api/_images/heat_exchanger_kA_char2_EVAPORATING_FLUID.svg deleted file mode 100644 index 71c5d30a1..000000000 --- a/docs/api/_images/heat_exchanger_kA_char2_EVAPORATING_FLUID.svg +++ /dev/null @@ -1,1314 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:51.714769 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/heat_exchanger_simple_kA_char_DEFAULT.svg b/docs/api/_images/heat_exchanger_simple_kA_char_DEFAULT.svg deleted file mode 100644 index 37dc99757..000000000 --- a/docs/api/_images/heat_exchanger_simple_kA_char_DEFAULT.svg +++ /dev/null @@ -1,1237 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:53.173456 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/pipe_kA_char_DEFAULT.svg b/docs/api/_images/pipe_kA_char_DEFAULT.svg deleted file mode 100644 index dbe561891..000000000 --- a/docs/api/_images/pipe_kA_char_DEFAULT.svg +++ /dev/null @@ -1,1237 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:53.469877 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/pump_eta_s_char_DEFAULT.svg b/docs/api/_images/pump_eta_s_char_DEFAULT.svg deleted file mode 100644 index f8296ca6c..000000000 --- a/docs/api/_images/pump_eta_s_char_DEFAULT.svg +++ /dev/null @@ -1,1218 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:49.379518 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/turbine_eta_s_char_DEFAULT.svg b/docs/api/_images/turbine_eta_s_char_DEFAULT.svg deleted file mode 100644 index a91c1e02c..000000000 --- a/docs/api/_images/turbine_eta_s_char_DEFAULT.svg +++ /dev/null @@ -1,1188 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:48.510952 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/turbine_eta_s_char_TRAUPEL.svg b/docs/api/_images/turbine_eta_s_char_TRAUPEL.svg deleted file mode 100644 index cbe77ec21..000000000 --- a/docs/api/_images/turbine_eta_s_char_TRAUPEL.svg +++ /dev/null @@ -1,1196 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:48.810737 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/_images/water_electrolyzer_eta_char_DEFAULT.svg b/docs/api/_images/water_electrolyzer_eta_char_DEFAULT.svg deleted file mode 100644 index 75e85daeb..000000000 --- a/docs/api/_images/water_electrolyzer_eta_char_DEFAULT.svg +++ /dev/null @@ -1,1094 +0,0 @@ - - - - - - - - - 2021-04-28T14:52:53.820381 - image/svg+xml - - - Matplotlib v3.3.3, https://matplotlib.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/api/data.rst b/docs/api/data.rst index 5271748f1..79d500352 100644 --- a/docs/api/data.rst +++ b/docs/api/data.rst @@ -1,160 +1,337 @@ -.. _data_label: - -tespy.data module -================= - -Default characteristics ------------------------ - -Characteristic lines -^^^^^^^^^^^^^^^^^^^^ -**turbine** - -.. figure:: _images/turbine_eta_s_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". - :align: center - - Reference: Generic data. - -.. figure:: _images/turbine_eta_s_char_TRAUPEL.svg - :alt: Characteristic line "TRAUPEL" for parameter "eta_s_char". - :align: center - - Reference: :cite:`Traupel2001`. - -**compressor** - -.. figure:: _images/compressor_eta_s_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". - :align: center - - Reference: Generic data. - -**pump** - -.. figure:: _images/pump_eta_s_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". - :align: center - - Reference: Generic data. - -**combustion engine** - -.. figure:: _images/combustion_engine_tiP_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "tiP_char". - :align: center - - Reference: Generic data. - -.. figure:: _images/combustion_engine_Q1_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "Q1_char". - :align: center - - Reference: Generic data. - -.. figure:: _images/combustion_engine_Q2_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "Q2_char". - :align: center - - Reference: Generic data. - -.. figure:: _images/combustion_engine_Qloss_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "Qloss_char". - :align: center - - Reference: Generic data. - -**heat exchanger** - -.. figure:: _images/heat_exchanger_kA_char1_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char1". - :align: center - - Reference: Generic data. - -.. figure:: _images/heat_exchanger_kA_char1_CONDENSING_FLUID.svg - :alt: Characteristic line "CONDENSING FLUID" for parameter "kA_char1". - :align: center - - Reference: Generic data. - -.. figure:: _images/heat_exchanger_kA_char2_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char2". - :align: center - - Reference: Generic data. - -.. figure:: _images/heat_exchanger_kA_char2_EVAPORATING_FLUID.svg - :alt: Characteristic line "EVAPORATING FLUID" for parameter "kA_char2". - :align: center - - Reference: Generic data. - -**condenser** - -.. figure:: _images/condenser_kA_char1_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char1". - :align: center - - Reference: Generic data. - -.. figure:: _images/condenser_kA_char2_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char2". - :align: center - - Reference: Generic data. - -**desuperheater** - -.. figure:: _images/desuperheater_kA_char1_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char1". - :align: center - - Reference: Generic data. - -.. figure:: _images/desuperheater_kA_char2_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char2". - :align: center - - Reference: Generic data. - -**heat exchanger simple** - -.. figure:: _images/heat_exchanger_simple_kA_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char". - :align: center - - Reference: Generic data. - -**pipe** - -.. figure:: _images/pipe_kA_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "kA_char". - :align: center - - Reference: Generic data. - -**water electrolyzer** - -.. figure:: _images/water_electrolyzer_eta_char_DEFAULT.svg - :alt: Characteristic line "DEFAULT" for parameter "eta_char". - :align: center - - Reference: Generic data. - -Characteristic maps -^^^^^^^^^^^^^^^^^^^ - -**compressor** - -.. figure:: _images/compressor_char_map_pr_DEFAULT.svg - :alt: Characteristic map "DEFAULT" for parameter "char_map_pr". - :align: center - - Reference: :cite:`Plis2016`. - -.. figure:: _images/compressor_char_map_eta_s_DEFAULT.svg - :alt: Characteristic map "DEFAULT" for parameter "char_map_eta_s". - :align: center - - Reference: :cite:`Plis2016`. +.. _data_label: + +tespy.data module +================= + +Module contents +--------------- + +.. automodule:: tespy.data + :members: + :undoc-members: + :show-inheritance: + +Default characteristics +----------------------- + +Characteristic lines +^^^^^^^^^^^^^^^^^^^^ +**Turbine** + +.. figure:: /api/_images/characteristics/Turbine_eta_s_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Turbine_eta_s_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Turbine_eta_s_char_TRAUPEL.svg + :alt: Characteristic line "TRAUPEL" for parameter "eta_s_char". + :align: center + :figclass: only-light + + Reference: :cite:`Traupel2001`. + +.. figure:: /api/_images/characteristics/Turbine_eta_s_char_TRAUPEL_darkmode.svg + :alt: Characteristic line "TRAUPEL" for parameter "eta_s_char". + :align: center + :figclass: only-dark + + Reference: :cite:`Traupel2001`. + +**Compressor** + +.. figure:: /api/_images/characteristics/Compressor_eta_s_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Compressor_eta_s_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**Pump** + +.. figure:: /api/_images/characteristics/Pump_eta_s_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Pump_eta_s_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_s_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**CombustionEngine** + +.. figure:: /api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "tiP_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_tiP_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "tiP_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "Q1_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_Q1_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "Q1_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "Q2_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_Q2_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "Q2_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "Qloss_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/CombustionEngine_Qloss_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "Qloss_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**HeatExchanger** + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char1". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char1_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char1". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID.svg + :alt: Characteristic line "CONDENSING FLUID" for parameter "kA_char1". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char1_CONDENSING_FLUID_darkmode.svg + :alt: Characteristic line "CONDENSING FLUID" for parameter "kA_char1". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char2". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char2_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char2". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID.svg + :alt: Characteristic line "EVAPORATING FLUID" for parameter "kA_char2". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/HeatExchanger_kA_char2_EVAPORATING_FLUID_darkmode.svg + :alt: Characteristic line "EVAPORATING FLUID" for parameter "kA_char2". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**Condenser** + +.. figure:: /api/_images/characteristics/Condenser_kA_char1_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char1". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Condenser_kA_char1_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char1". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Condenser_kA_char2_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char2". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Condenser_kA_char2_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char2". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**Desuperheater** + +.. figure:: /api/_images/characteristics/Desuperheater_kA_char1_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char1". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Desuperheater_kA_char1_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char1". + :align: center + :figclass: only-dark + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Desuperheater_kA_char2_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char2". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Desuperheater_kA_char2_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char2". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**SimpleHeatExchanger** + +.. figure:: /api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/SimpleHeatExchanger_kA_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**Pipe** + +.. figure:: /api/_images/characteristics/Pipe_kA_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/Pipe_kA_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "kA_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +**WaterElectrolyzer** + +.. figure:: /api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_char". + :align: center + :figclass: only-light + + Reference: Generic data. + +.. figure:: /api/_images/characteristics/WaterElectrolyzer_eta_char_DEFAULT_darkmode.svg + :alt: Characteristic line "DEFAULT" for parameter "eta_char". + :align: center + :figclass: only-dark + + Reference: Generic data. + +Characteristic maps +^^^^^^^^^^^^^^^^^^^ + +**TurboCompressor** + +.. figure:: /api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT.svg + :alt: Characteristic map "DEFAULT" for parameter "char_map_pr". + :align: center + :figclass: only-light + + Reference: :cite:`Plis2016`. + +.. figure:: /api/_images/characteristics/TurboCompressor_char_map_pr_DEFAULT_darkmode.svg + :alt: Characteristic map "DEFAULT" for parameter "char_map_pr". + :align: center + :figclass: only-dark + + Reference: :cite:`Plis2016`. + +.. figure:: /api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT.svg + :alt: Characteristic map "DEFAULT" for parameter "char_map_eta_s". + :align: center + :figclass: only-light + + Reference: :cite:`Plis2016`. + +.. figure:: /api/_images/characteristics/TurboCompressor_char_map_eta_s_DEFAULT_darkmode.svg + :alt: Characteristic map "DEFAULT" for parameter "char_map_eta_s". + :align: center + :figclass: only-dark + + Reference: :cite:`Plis2016`. + diff --git a/docs/building_blocks/networks.rst b/docs/building_blocks/networks.rst index cdf2c77dc..10c50982b 100644 --- a/docs/building_blocks/networks.rst +++ b/docs/building_blocks/networks.rst @@ -643,7 +643,7 @@ added a convergence check. applied: * Cut off fluid mass fractions smaller than 0 and larger than 1. This way a - mass fraction of a single fluid component never exceeds oxygenthese boundaries. + mass fraction of a single fluid component never exceeds these boundaries. * Check, whether the fluid properties of pure fluids are within the available ranges of CoolProp and readjust the values if not. @@ -748,14 +748,14 @@ connections to the network. **Presolving** -In the first part of the presovling phase, the variable space reduction is +In the first part of the presolving phase, the variable space reduction is performed. TESPy will prompt errors, in case the parameter specifications in context of the topology lead to an infeasibility in any of the variables. This can be, for example - a circular linear dependency between a set of variables. Typically, the mass flow can be over-determined by not including a :code:`CycleCloser` component - in a circular network. For example, ff you are modeling a cycle, e.g. the + in a circular network. For example, if you are modeling a cycle, e.g. the Clausius Rankine cycle, you need to make a cut in the cycle using the :code:`CycleCloser` or a :code:`Sink` and a :code:`Source` not to over-determine the system. Have a look in the diff --git a/docs/conf.py b/docs/conf.py index e3a27ae27..fc609febb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,20 +19,13 @@ from tespy.tools.data_containers import GroupedComponentCharacteristics as dc_gcc from tespy.tools.data_containers import GroupedComponentProperties as dc_gcp from tespy.tools.data_containers import SimpleDataContainer as dc_simple +from tespy.tools.schema import _instantiate_component DOCS_ROOT_PATH = os.path.join(os.path.dirname(__file__)) API_PATH = os.path.join(DOCS_ROOT_PATH, "api") TESPY_PATH = os.path.join(DOCS_ROOT_PATH, "..", "src", "tespy") -def _create_component_instances() -> dict: - instances = {} - for cls_name, cls_ref in component_registry.items.items(): - instances[cls_name] = cls_ref(cls_name) - - return instances - - def _create_connection_instances() -> dict: instances = {} for cls_name, cls_ref in connection_registry.items.items(): @@ -64,24 +57,58 @@ def _get_eq_reference(datacontainer): return ":py:meth:`" + basename.split(".")[-1] + " <" + eq_reference + ">`" +def _collect_constraints(instance): + """Return (unconditional, conditional) constraint dicts. + + Conditional constraints are those that only appear when an energy connector + (power or heat) is attached. + """ + instance.power_outl = [] + instance.power_inl = [] + instance.heat_outl = [] + instance.heat_inl = [] + base = instance.get_mandatory_constraints() + + # A single sentinel object is enough — get_mandatory_constraints() only + # checks len(self.power_outl/inl) > 0, it never accesses list elements. + _sentinel = [object()] + instance.power_outl = _sentinel + instance.power_inl = _sentinel + instance.heat_outl = _sentinel + instance.heat_inl = _sentinel + with_power = instance.get_mandatory_constraints() + + # Restore to empty so the instance is left in a neutral state. + instance.power_outl = [] + instance.power_inl = [] + instance.heat_outl = [] + instance.heat_inl = [] + + unconditional = {} + conditional = {} + for key, value in with_power.items(): + eq_reference = _get_eq_reference(value) + entry = {"eq_reference": eq_reference, "description": value.description} + if key in base: + unconditional[key] = entry + else: + conditional[key] = entry + + return unconditional, conditional + + def collect_component_parameters(instance): grouped_parameters = {} parameters_with_equation = {} characteristic_lines_and_maps = {} - constraints = {} - for key, value in instance.get_mandatory_constraints().items(): - eq_reference = _get_eq_reference(value) - constraints[key] = { - "eq_reference": eq_reference, - "description": value.description - } + unconditional_constraints, conditional_constraints = _collect_constraints(instance) for key, value in instance.parameters.items(): eq_reference = _get_eq_reference(value) if isinstance(value, dc_cp): - if value._potential_var: + if value._allows_var: key = key + " [1]_" parameters_with_equation[key] = { "eq_reference": eq_reference, @@ -107,7 +134,7 @@ def collect_component_parameters(instance): "elements": ", ".join([f":code:`{element}`" for element in value.elements]) } - return constraints, parameters_with_equation, grouped_parameters, characteristic_lines_and_maps + return unconditional_constraints, conditional_constraints, parameters_with_equation, grouped_parameters, characteristic_lines_and_maps def collect_connection_parameters(instance): @@ -154,37 +181,37 @@ def _indent_block(s: str, spaces: int) -> str: def create_tabular_component_views(): - instances = _create_component_instances() + from tespy.components.component import Component + path = os.path.join(DOCS_ROOT_PATH, "building_blocks", "_components_overview.rst") modules = {} - for cls_name, instance in instances.items(): - # this is required to collect the mandatory constraints - # it will keep the power balance equation between the component and the - # (optionally) attached PowerConnection out of the list of equations - # TODO: Find a better solution - instance.power_outl = [] - instance.power_inl = [] - instance.heat_outl = [] - instance.heat_inl = [] + for cls_name, cls_ref in component_registry.items.items(): + # _instantiate_component returns None for classes with a static + # get_parameters(); in that case we still need a probe instance for + # get_mandatory_constraints(), so we create one the same way. + instance = _instantiate_component(cls_ref) + if instance is None: + instance = cls_ref.__new__(cls_ref) + Component.__init__(instance, "_docs_probe_") - cls_ref = instance.__class__ cls_module = cls_ref.__module__ parent_module = ".".join(cls_ref.__module__.split(".")[:-1]) if parent_module not in modules: modules[parent_module] = {} - constraints, parameters, parameter_groups, characteristic_lines = collect_component_parameters(instance) + constraints, conditional_constraints, parameters, parameter_groups, characteristic_lines = collect_component_parameters(instance) modules[parent_module][cls_name] = _indent_block("\n", 4) modules[parent_module][cls_name] += _indent_block(f".. dropdown:: {cls_name}" + "\n" * 2, 8) modules[parent_module][cls_name] += _indent_block( - f"Class documentation and example: :py:class:`{cls_name} <{cls_module}.{cls_name}>`", 8 + f"**Class documentation and example:** :py:class:`{cls_name} <{cls_module}.{cls_name}>`", 8 ) outputs = { "Table of constraints": constraints, + "Table of constraints (active when energy connector is attached)": conditional_constraints, "Table of parameters": parameters, "Table of parameter groups": parameter_groups, "Table of characteristic lines and maps": characteristic_lines, @@ -246,7 +273,7 @@ def create_tabular_connection_views(): parameters = collect_connection_parameters(instance) classes[cls_name] = "\n" - classes[cls_name] += (f"Class documentation and example: :py:class:`{cls_name} <{cls_module}.{cls_name}>`") + classes[cls_name] += (f"**Class documentation and example:** :py:class:`{cls_name} <{cls_module}.{cls_name}>`") outputs = { "Table of parameters": parameters diff --git a/docs/scripts/docstring_updater.py b/docs/scripts/docstring_updater.py new file mode 100644 index 000000000..11dadf2ab --- /dev/null +++ b/docs/scripts/docstring_updater.py @@ -0,0 +1,626 @@ +# -*- coding: utf-8 + +"""On-demand updater for component and connection class docstrings. + +Rewrites the middle sections (image block, Ports, Mandatory Equations, +Parameters) of every registered component docstring from live introspection +of :py:meth:`port_schema`, :py:meth:`get_mandatory_constraints`, and +:py:meth:`get_parameters`. For connection classes only the Parameters section +is regenerated. The first paragraph(s) and the :code:`Example` section are +preserved verbatim. + +Usage +----- + # Update all registered components and connections in-place + python docs/scripts/docstring_updater.py + + # Preview without writing files + python docs/scripts/docstring_updater.py --dry-run + + # Update specific classes only + python docs/scripts/docstring_updater.py Turbine Compressor --dry-run + + # Update connections only + python docs/scripts/docstring_updater.py --connections-only + + # Update components only + python docs/scripts/docstring_updater.py --components-only +""" + +import ast +import inspect +import re +import subprocess +import textwrap + +from tespy.tools.data_containers import ComponentCharacteristicMaps as dc_cm +from tespy.tools.data_containers import ComponentCharacteristics as dc_cc +from tespy.tools.data_containers import ComponentProperties as dc_cp +from tespy.tools.data_containers import FluidComposition as dc_flu +from tespy.tools.data_containers import FluidProperties as dc_prop +from tespy.tools.data_containers import GroupedComponentCharacteristics as dc_gcc +from tespy.tools.data_containers import GroupedComponentProperties as dc_gcp +from tespy.tools.data_containers import ReferencedFluidProperties as dc_ref +from tespy.tools.data_containers import SimpleDataContainer as dc_simple + +# --------------------------------------------------------------------------- +# Base parameters shared by every component +# --------------------------------------------------------------------------- + +_BASE_PARAMETERS = [ + ("label", "str", "The label of the component."), + ("design", "list", "List containing design parameters (stated as String)."), + ("offdesign", "list", "List containing offdesign parameters (stated as String)."), + ("design_path", "str", "Path to the components design case."), + ("local_offdesign", "bool", + "Treat this component in offdesign mode in a design calculation."), + ("local_design", "bool", + "Treat this component in design mode in an offdesign calculation."), + ("char_warnings", "bool", + "Ignore warnings on default characteristics usage for this component."), + ("printout", "bool", "Include this component in the network's results printout."), +] + +# --------------------------------------------------------------------------- +# Base parameters shared by every connection +# --------------------------------------------------------------------------- + +_CONNECTION_BASE_PARAMETERS = [ + ("label", "str", "The label of the connection."), + ("design", "list", "List containing design parameters (stated as String)."), + ("offdesign", "list", "List containing offdesign parameters (stated as String)."), + ("design_path", "str", "Path to the individual design case for this connection."), + ("local_offdesign", "bool", + "Treat this connection in offdesign mode in a design calculation."), + ("local_design", "bool", + "Treat this connection in design mode in an offdesign calculation."), + ("printout", "bool", "Include this connection in the network's results printout."), +] + + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + +def _eq_reference(dc): + """Return a :code:`:py:meth:` cross-reference string for the equation, or :code:`None`.""" + func = getattr(dc, "func", None) + mat = getattr(dc, "structure_matrix", None) + target = func if func is not None else mat + if target is None: + return None + qualname = target.__qualname__ + module = target.__module__ + short = qualname.split(".")[-1] + return f":py:meth:`{short} <{module}.{qualname}>`" + + +def _collect_constraints(instance): + """Return :code:`(unconditional, conditional)` mandatory-constraint dicts. + + Conditional constraints are those that only activate when a power or heat + connector is attached to the component. + """ + for attr in ("power_outl", "power_inl", "heat_outl", "heat_inl"): + setattr(instance, attr, []) + + base = instance.get_mandatory_constraints() + + sentinel = [object()] + for attr in ("power_outl", "power_inl", "heat_outl", "heat_inl"): + setattr(instance, attr, sentinel) + + with_connectors = instance.get_mandatory_constraints() + + for attr in ("power_outl", "power_inl", "heat_outl", "heat_inl"): + setattr(instance, attr, []) + + unconditional = {} + conditional = {} + for key, value in with_connectors.items(): + entry = { + "ref": _eq_reference(value), + "description": getattr(value, "description", None) or key, + } + (unconditional if key in base else conditional)[key] = entry + + return unconditional, conditional + + +def _dc_type(dc): + """Return the NumPy-style type annotation string for a data container.""" + import math + if isinstance(dc, dc_cp): + base = "float, dict" + return base + ', :code:`"var"`' if getattr(dc, "_allows_var", False) else base + if isinstance(dc, dc_cc): + return "tespy.tools.characteristics.CharLine, dict" + if isinstance(dc, dc_cm): + return "tespy.tools.characteristics.CharMap, dict" + if isinstance(dc, (dc_gcp, dc_gcc)): + return type(dc).__name__ + if isinstance(dc, dc_ref): + return "Ref" + if isinstance(dc, dc_prop): + return "float, Ref" + if isinstance(dc, dc_flu): + return "dict" + if isinstance(dc, dc_simple): + dtype = getattr(dc, "dtype", None) + if dtype: + return dtype + val = getattr(dc, "val", None) + if isinstance(val, bool): + return "bool" + if isinstance(val, int): + return "int" + if isinstance(val, float) and not math.isnan(val): + return "int, float" + if isinstance(val, str): + return "str" + return "any" + return "any" + + +# --------------------------------------------------------------------------- +# Section formatters +# --------------------------------------------------------------------------- + +_PORT_LABELS = [ + ("inlets", "Fluid inlets"), + ("outlets", "Fluid outlets"), + ("powerinlets", "Power inlets"), + ("poweroutlets", "Power outlets"), + ("heatinlets", "Heat inlets"), + ("heatoutlets", "Heat outlets"), +] + + +def _ports_section(cls): + schema = cls.port_schema() + lines = [] + for key, label in _PORT_LABELS: + entry = schema.get(key, {}) + kind = entry.get("type") + if kind == "fixed": + ports = entry.get("ports", []) + if ports: + lines.append(f"{label}: {', '.join(ports)}") + elif kind == "variable": + param = entry["parameter"] + pattern = entry["pattern"] + lines.append( + f"{label}: {pattern.replace('{n}', '1')}, " + f"{pattern.replace('{n}', '2')}, ... " + f"(variable, count set by :code:`{param}`)" + ) + if not lines: + return "" + return "Ports\n-----\n\n" + "\n\n".join(lines) + + +def _mandatory_section(instance): + try: + unconditional, conditional = _collect_constraints(instance) + except Exception: + return "" + + if not unconditional and not conditional: + return "Mandatory Equations\n-------------------\n\nNone" + + def _bullet(entry): + ref = entry["ref"] + desc = entry["description"].rstrip(".") + return "- " + desc + (f": {ref}" if ref else "") + + parts = ["Mandatory Equations\n-------------------\n"] + parts.extend(_bullet(e) for e in unconditional.values()) + + if conditional: + parts.append("\nWhen a power or heat connector is attached:\n") + parts.extend(_bullet(e) for e in conditional.values()) + + return "\n".join(parts) + + +def _parameters_section(instance, base_params=None, param_filter=None): + if base_params is None: + base_params = _BASE_PARAMETERS + entries = [] + + for name, ptype, desc in base_params: + entries.append((name, f"\n{name} : {ptype}\n {desc}")) + + try: + params = instance.get_parameters() + except Exception: + params = {} + + for name, dc in params.items(): + if param_filter is not None and not param_filter(name, dc): + continue + ptype = _dc_type(dc) + + raw_desc = getattr(dc, "description", None) or "" + desc = (raw_desc[0].upper() + raw_desc[1:]).rstrip(".") if raw_desc else "" + + meta_parts = [] + if isinstance(dc, dc_cp): + q = getattr(dc, "quantity", None) + if q: + meta_parts.append(f"Quantity: :code:`{q}`.") + if getattr(dc, "_allows_var", False): + meta_parts.append( + 'Can be set as a system variable by passing :code:`"var"` as its value.' + ) + if isinstance(dc, (dc_gcp, dc_gcc)): + elements = getattr(dc, "elements", None) or [] + if elements: + meta_parts.append( + "Elements: " + ", ".join(f":code:`{e}`" for e in elements) + "." + ) + + ref = _eq_reference(dc) + + desc_body = (desc + "." if desc else "") + ( + " " + " ".join(meta_parts) if meta_parts else "" + ) + body_line = textwrap.fill( + desc_body.strip(), width=76, initial_indent=" ", + subsequent_indent=" " + ) + if ref: + eq_line = f" Equation: {ref}." + entries.append((name, f"\n{name} : {ptype}\n{body_line}\n{eq_line}")) + else: + entries.append((name, f"\n{name} : {ptype}\n{body_line}")) + + entries.sort(key=lambda x: x[0].lower()) + + return "\n".join(["Parameters\n----------"] + [e for _, e in entries]) + + +def _image_block(cls): + import os + _images_dir = os.path.join(os.path.dirname(__file__), "..", "api", "_images", "components") + available = { + os.path.splitext(f)[0] + for f in os.listdir(_images_dir) + if f.endswith(".svg") and not f.endswith("_darkmode.svg") + } + + image_name = next( + (c.__name__ for c in cls.__mro__ if c.__name__ in available), + None, + ) + if not image_name: + return "" + + low = cls.__name__.lower() + return ( + f".. image:: /api/_images/components/{image_name}.svg\n" + f" :alt: flowsheet of the {low}\n" + f" :align: center\n" + f" :class: only-light\n\n" + f".. image:: /api/_images/components/{image_name}_darkmode.svg\n" + f" :alt: flowsheet of the {low}\n" + f" :align: center\n" + f" :class: only-dark" + ) + + +# --------------------------------------------------------------------------- +# Existing-docstring splitting +# --------------------------------------------------------------------------- + +# Section markers that signal the start of auto-generated content +_SECTION_START = re.compile( + r"(?:^|\n)(?=\*\*(?:Mandatory|Optional)" + r"|Ports\n[-]" + r"|Mandatory\s+Equations" + r"|Optional\s+Equations" + r"|Inlets/Outlets" + r"|Image\n" + r"|\.\.\ image::" + r"|Parameters\n[-])", + re.MULTILINE, +) +_EXAMPLE_START = re.compile(r"(?:^|\n\n)Examples?\n[-]+", re.MULTILINE) +_PRESERVE_SECTION_START = re.compile( + r"(?:^|\n\n)(?:" + r"(?:Note|Notes|Warning|Warnings|References|See Also)\n[-]+" + r"|\.\.\ (?:note|tip|warning|attention|important|caution)::" + r")", + re.MULTILINE, +) + + +def _split_docstring(cls): + """Return :code:`(intro, suffix, example)` from the current class docstring. + + *suffix* contains any Note / Warning / References sections that follow + the auto-generated block; they are preserved verbatim after Parameters. + """ + doc = inspect.getdoc(cls) or "" + + sm = _SECTION_START.search(doc) + em = _EXAMPLE_START.search(doc) + + # intro ends at the first auto-generated section or the Example section + intro_end = len(doc) + if sm: + intro_end = sm.start() + (1 if doc[sm.start()] == "\n" else 0) + if em: + ex_pos = em.start() + (1 if doc[em.start()] == "\n" else 0) + intro_end = min(intro_end, ex_pos) + + intro = doc[:intro_end].strip() + example = doc[em.start():].strip() if em else "" + if example.startswith("\n"): + example = example[1:] + + auto_end = em.start() if em else len(doc) + auto_block = doc[intro_end:auto_end] + pm = _PRESERVE_SECTION_START.search(auto_block) + suffix = auto_block[pm.start():].lstrip("\n").strip() if pm else "" + + return intro, suffix, example + + +# --------------------------------------------------------------------------- +# Docstring assembly +# --------------------------------------------------------------------------- + +def generate_docstring(cls): + """Return the complete new docstring body (without surrounding quotes).""" + from tespy.components.component import Component + from tespy.tools.schema import _instantiate_component + + intro, suffix, example = _split_docstring(cls) + + instance = _instantiate_component(cls) + if instance is None: + instance = cls.__new__(cls) + Component.__init__(instance, "_docprobe_") + + parts = [] + if intro: + parts.append(intro) + image_block = _image_block(cls) + if image_block: + parts.append(image_block) + ports = _ports_section(cls) + if ports: + parts.append(ports) + mandatory = _mandatory_section(instance) + if mandatory: + parts.append(mandatory) + parts.append(_parameters_section(instance)) + if suffix: + if re.match(r"^\.\.", suffix): + parts.append("Notes\n-----\n\n" + suffix) + else: + parts.append(suffix) + if example: + parts.append(example) + + return "\n\n".join(parts) + + +# --------------------------------------------------------------------------- +# Source-file patching +# --------------------------------------------------------------------------- + +def _char_pos(source, line_1based, col): + """Convert 1-based line + 0-based col to a character offset in *source*.""" + pos = 0 + for _ in range(line_1based - 1): + pos = source.index("\n", pos) + 1 + return pos + col + + +def _patch_file(source, cls_name, new_body): + """Return *source* with the docstring of *cls_name* replaced by *new_body*.""" + tree = ast.parse(source) + + for node in ast.walk(tree): + if not (isinstance(node, ast.ClassDef) and node.name == cls_name): + continue + if not node.body: + break + first = node.body[0] + if not ( + isinstance(first, ast.Expr) + and isinstance(first.value, ast.Constant) + and isinstance(first.value.value, str) + ): + break + + dv = first.value + start = _char_pos(source, dv.lineno, dv.col_offset) + end = _char_pos(source, dv.end_lineno, dv.end_col_offset) + + indent = " " * dv.col_offset + raw_prefix = "r" if source[start] == "r" else "" + + # Indent every line of the body to match the class indentation + indented_lines = [] + for line in new_body.split("\n"): + indented_lines.append(indent + line if line.strip() else "") + body = "\n".join(indented_lines) + + new_doc = f'{raw_prefix}"""\n{body}\n{indent}"""' + return source[:start] + new_doc + source[end:] + + return source + + +# --------------------------------------------------------------------------- +# Git helpers +# --------------------------------------------------------------------------- + +def _has_uncommitted_changes(filepath): + """Return True if *filepath* has uncommitted changes according to git.""" + try: + result = subprocess.run( + ["git", "status", "--porcelain", filepath], + capture_output=True, text=True, check=True, + ) + return bool(result.stdout.strip()) + except (subprocess.CalledProcessError, FileNotFoundError): + return False + + +# --------------------------------------------------------------------------- +# Connection docstring generation +# --------------------------------------------------------------------------- + +def generate_connection_docstring(cls): + """Return the complete new docstring body for a connection class.""" + intro, suffix, example = _split_docstring(cls) + + instance = cls.__new__(cls) + + parts = [] + if intro: + parts.append(intro) + parts.append(_parameters_section( + instance, + base_params=_CONNECTION_BASE_PARAMETERS, + param_filter=lambda name, _: not name.endswith("_ref"), + )) + if suffix: + if re.match(r"^\.\.", suffix): + parts.append("Notes\n-----\n\n" + suffix) + else: + parts.append(suffix) + if example: + parts.append(example) + + return "\n\n".join(parts) + + +def update_connection_docstrings(classes=None, dry_run=False, force=False): + """Update docstrings for *classes* (defaults to all registered connections). + + Parameters + ---------- + classes : list of str, optional + Class names to process. Defaults to every entry in the connection + registry. + dry_run : bool + When :code:`True`, print the generated docstrings to stdout instead of + writing files. + force : bool + When :code:`True`, write files even if they have uncommitted changes. + """ + from tespy.connections.connection import connection_registry + + registry = { + k: v for k, v in connection_registry.items.items() + if classes is None or k in classes + } + + pending = {} + + for cls_name, cls in registry.items(): + try: + new_body = generate_connection_docstring(cls) + except Exception as exc: + print(f"[SKIP] {cls_name}: {exc}") + continue + + if dry_run: + sep = "=" * 72 + print(f"\n{sep}\n=== {cls_name}\n{sep}") + print(new_body) + continue + + filepath = inspect.getfile(cls) + if filepath not in pending: + with open(filepath, encoding="utf-8") as fh: + pending[filepath] = fh.read() + + pending[filepath] = _patch_file(pending[filepath], cls_name, new_body) + print(f"[OK] {cls_name}") + + for filepath, content in pending.items(): + if not force and _has_uncommitted_changes(filepath): + print(f"[SKIP] {filepath}: has uncommitted changes (pass --force to override)") + continue + with open(filepath, "w", encoding="utf-8") as fh: + fh.write(content) + print(f"[WRITE] {filepath}") + + +# --------------------------------------------------------------------------- +# Public entry point +# --------------------------------------------------------------------------- + +def update_component_docstrings(classes=None, dry_run=False, force=False): + """Update docstrings for *classes* (defaults to all registered components). + + Parameters + ---------- + classes : list of str, optional + Class names to process. Defaults to every entry in the component + registry except the base :code:`Component` class. + dry_run : bool + When :code:`True`, print the generated docstrings to stdout instead of + writing files. + force : bool + When :code:`True`, write files even if they have uncommitted changes. + """ + from tespy.components.component import component_registry + + registry = { + k: v for k, v in component_registry.items.items() + if k != "Component" and (classes is None or k in classes) + } + + pending = {} # filepath → current source text + + for cls_name, cls in registry.items(): + try: + new_body = generate_docstring(cls) + except Exception as exc: + print(f"[SKIP] {cls_name}: {exc}") + continue + + if dry_run: + sep = "=" * 72 + print(f"\n{sep}\n=== {cls_name}\n{sep}") + print(new_body) + continue + + filepath = inspect.getfile(cls) + if filepath not in pending: + with open(filepath, encoding="utf-8") as fh: + pending[filepath] = fh.read() + + pending[filepath] = _patch_file(pending[filepath], cls_name, new_body) + print(f"[OK] {cls_name}") + + for filepath, content in pending.items(): + if not force and _has_uncommitted_changes(filepath): + print(f"[SKIP] {filepath}: has uncommitted changes (pass --force to override)") + continue + with open(filepath, "w", encoding="utf-8") as fh: + fh.write(content) + print(f"[WRITE] {filepath}") + + +if __name__ == "__main__": + import sys + + argv = sys.argv[1:] + dry_run = "--dry-run" in argv + force = "--force" in argv + components_only = "--components-only" in argv + connections_only = "--connections-only" in argv + names = [a for a in argv if not a.startswith("--")] or None + + if not connections_only: + update_component_docstrings(classes=names, dry_run=dry_run, force=force) + if not components_only: + update_connection_docstrings(classes=names, dry_run=dry_run, force=force) diff --git a/docs/scripts/generate_tespy_data_module.py b/docs/scripts/generate_tespy_data_module.py index 62c0aa251..e94daffa7 100644 --- a/docs/scripts/generate_tespy_data_module.py +++ b/docs/scripts/generate_tespy_data_module.py @@ -1,15 +1,21 @@ # -*- coding: utf-8 -*- import json +import os from matplotlib import pyplot as plt -from pkg_resources import resource_filename import tespy +DOCS_DIR = os.path.join(os.path.dirname(__file__), "..") +IMAGES_DIR = os.path.join(DOCS_DIR, "api", "_images", "characteristics") +API_DIR = os.path.join(DOCS_DIR, "api") + +os.makedirs(IMAGES_DIR, exist_ok=True) + def get_char_data(filename): - path = resource_filename('tespy.data', filename + '.json') + path = os.path.join(tespy.__datapath__, f'{filename}.json') with open(path) as f: data = json.load(f) @@ -17,50 +23,68 @@ def get_char_data(filename): return data -def plot_line(component, parameter, name, data): +def plot_line(component, parameter, name, data, suffix=""): char = tespy.tools.characteristics.CharLine(x=data['x'], y=data['y']) - title = ('Characteristic line "' + name + '" for parameter "' + - parameter + '".') + title = f'Characteristic line "{name}" for parameter "{parameter}".' xlabel = '$X$' ylabel = r'$f\left(X\right)$' - path = component + '_' + parameter + '_' + name + '.svg' - char.plot(path.replace(' ', '_'), title, xlabel, ylabel) + filename = f'{component}_{parameter}_{name}{suffix}.svg'.replace(' ', '_') + char.plot(os.path.join(IMAGES_DIR, filename), title, xlabel, ylabel) -def plot_map(component, parameter, name, data): +def plot_map(component, parameter, name, data, suffix=""): char = tespy.tools.characteristics.CharMap( x=data['x'], y=data['y'], z=data['z']) - title = ('Characteristic line "' + name + '" for parameter "' + - parameter + '".') + title = f'Characteristic line "{name}" for parameter "{parameter}".' xlabel = '$Y$' ylabel = r'$f\left(X,Y\right)$' - path = component + '_' + parameter + '_' + name + '.svg' - char.plot(path.replace(' ', '_'), title, xlabel, ylabel) + filename = f'{component}_{parameter}_{name}{suffix}.svg'.replace(' ', '_') + char.plot(os.path.join(IMAGES_DIR, filename), title, xlabel, ylabel) def generate_api_doc(component, parameter, name, char_type, ref): - path = '_images/' + component + '_' + parameter + '_' + name + '.svg' - rst = ( - '.. figure:: ' + path.replace(' ', '_') + '\n' - ' :alt: Characteristic ' + char_type + ' "' + name + - '" for parameter "' + parameter + '".\n' - ' :align: center\n\n' - ) - if ref: - rst += ' Reference: :cite:`' + ref + '`.\n\n' - else: - rst += ' Reference: Generic data.\n\n' + base = f'{component}_{parameter}_{name}'.replace(' ', '_') + alt = f'Characteristic {char_type} "{name}" for parameter "{parameter}".' + caption = f' Reference: :cite:`{ref}`.\n\n' if ref else ' Reference: Generic data.\n\n' + + def figure(filename, extra_class): + return ( + f'.. figure:: /api/_images/characteristics/{filename}.svg\n' + f' :alt: {alt}\n' + f' :align: center\n' + f' :figclass: {extra_class}\n\n' + + caption + ) + + return figure(base, 'only-light') + figure(f'{base}_darkmode', 'only-dark') + + +def generate_plots(suffix=""): + for component, params in get_char_data('char_lines').items(): + for param, lines in params.items(): + for line, data in lines.items(): + plot_line(component, param, line, data, suffix) + + for component, params in get_char_data('char_maps').items(): + for param, chars in params.items(): + for char, data in chars.items(): + plot_map(component, param, char, data, suffix) + + +generate_plots() - return rst +with plt.style.context("dark_background"): + generate_plots(suffix="_darkmode") rst = ( + '.. _data_label:\n\n' 'tespy.data module\n' '=================\n\n' ) @@ -82,12 +106,10 @@ def generate_api_doc(component, parameter, name, char_type, ref): ) for component, params in get_char_data('char_lines').items(): - rst += '**' + component + '**\n\n' + rst += f'**{component}**\n\n' for param, lines in params.items(): for line, data in lines.items(): - plot_line(component, param, line, data) - rst += generate_api_doc( - component, param, line, 'line', data['ref']) + rst += generate_api_doc(component, param, line, 'line', data['ref']) rst += ( 'Characteristic maps\n' @@ -95,12 +117,10 @@ def generate_api_doc(component, parameter, name, char_type, ref): ) for component, params in get_char_data('char_maps').items(): - rst += '**' + component + '**\n\n' + rst += f'**{component}**\n\n' for param, chars in params.items(): for char, data in chars.items(): - plot_map(component, param, char, data) rst += generate_api_doc(component, param, char, 'map', data['ref']) -with open('tespy.data.rst', 'w') as f: +with open(os.path.join(API_DIR, 'data.rst'), 'w') as f: f.write(rst) - f.close() diff --git a/docs/whats_new/v0-10-0.rst b/docs/whats_new/v0-10-0.rst index 450d62fa2..f57e3a17c 100644 --- a/docs/whats_new/v0-10-0.rst +++ b/docs/whats_new/v0-10-0.rst @@ -44,6 +44,12 @@ API Changes for that parameter, and setting a numerical value automatically unsets any previously set :code:`Ref`. Both could be set simultaneously before, which raised a :code:`FutureWarning`. +- The :code:`char_map_pr` and :code:`char_map_eta_s` parameters of + :py:class:`~tespy.components.turbomachinery.compressor.Compressor` are + deprecated. Use + :py:class:`~tespy.components.turbomachinery.turbocompressor.TurboCompressor` + instead, which is the dedicated class providing characteristic map offdesign + capability. - The pygmo compatibility interface of :py:class:`~tespy.tools.optimization.OptimizationProblem` has been removed. The :code:`fitness`, :code:`get_nobj`, :code:`get_nic`, :code:`get_bounds`, @@ -152,6 +158,19 @@ Other Changes the parameter (`PR #980 `__). - Fix logging message in connection preprocessing (`PR #988 `__). +- :py:func:`~tespy.tools.schema.generate_component_schema` and + :py:func:`~tespy.tools.schema.generate_connection_schema` export a JSON + description of all registered component and connection parameters - including + container type, physical quantity and description - for use in external + tooling (`PR #938 `__). +- A docstring updater script has been added at + :code:`docs/scripts/docstring_updater.py`. It regenerates the Ports, + Mandatory Equations, and Parameters sections of all registered component and + connection class docstrings from live introspection of + :py:meth:`port_schema`, :py:meth:`get_mandatory_constraints`, and + :py:meth:`get_parameters`, while preserving the introductory paragraph, + :code:`Notes` sections, and :code:`Example` blocks verbatim + (`PR #938 `__). Bug Fixes ######### diff --git a/src/tespy/components/basics/cycle_closer.py b/src/tespy/components/basics/cycle_closer.py index b6985432d..76591ec4d 100644 --- a/src/tespy/components/basics/cycle_closer.py +++ b/src/tespy/components/basics/cycle_closer.py @@ -23,46 +23,64 @@ class CycleCloser(Component): r""" Component for closing cycles. - **Mandatory Equations** + Ports + ----- - - pressure: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - enthalpy: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + Fluid inlets: in1 - Image not available + Fluid outlets: out1 + + Mandatory Equations + ------------------- + + - pressure equality constraint: :py:meth:`variable_equality_structure_matrix ` + - enthalpy equality constraint: :py:meth:`variable_equality_structure_matrix ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + fluid_deviation : float, dict + Norm of absolute deviation of fluid composition between inlet and + outlet. - local_design : boolean + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + mass_deviation : float, dict + Absolute deviation of mass flow between inlet and outlet. Quantity: + :code:`mass_flow`. - printout : boolean + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool Include this component in the network's results printout. - Note - ---- - This component can be used to close a cycle process. The system of - equations describing your plant will overdetermined, if you close a cycle - without this component or a cut the cycle with a sink and a source at - some point of the cycle. This component can be used instead of cutting - the cycle. + Notes + ----- + + .. note:: + + This component can be used to close a cycle process. The system of + equations describing your plant will overdetermined, if you close a cycle + without this component or a cut the cycle with a sink and a source at + some point of the cycle. This component can be used instead of cutting + the cycle. Example ------- diff --git a/src/tespy/components/basics/sink.py b/src/tespy/components/basics/sink.py index a93e12d58..2f450160e 100644 --- a/src/tespy/components/basics/sink.py +++ b/src/tespy/components/basics/sink.py @@ -21,30 +21,41 @@ class Sink(Component): r""" A flow drains in a Sink. + Ports + ----- + + Fluid inlets: in1 + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/basics/source.py b/src/tespy/components/basics/source.py index f05dc50e9..70ada47bc 100644 --- a/src/tespy/components/basics/source.py +++ b/src/tespy/components/basics/source.py @@ -22,30 +22,41 @@ class Source(Component): r""" A flow originates from a Source. + Ports + ----- + + Fluid outlets: out1 + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/basics/subsystem_interface.py b/src/tespy/components/basics/subsystem_interface.py index 27f37d2a2..1f0079352 100644 --- a/src/tespy/components/basics/subsystem_interface.py +++ b/src/tespy/components/basics/subsystem_interface.py @@ -22,63 +22,68 @@ class SubsystemInterface(Component): r""" The subsystem interface does not change fluid properties. - **Mandatory Equations** + .. image:: /api/_images/components/SubsystemInterface.svg + :alt: flowsheet of the subsysteminterface + :align: center + :class: only-light - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - pressure: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - enthalpy: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/SubsystemInterface_darkmode.svg + :alt: flowsheet of the subsysteminterface + :align: center + :class: only-dark - Inlets/Outlets + Ports + ----- - - Specify number of inlets and outlets with :code:`num_inter`, - default value: 1. + Fluid inlets: in1, in2, ... (variable, count set by :code:`num_inter`) - Image + Fluid outlets: out1, out2, ... (variable, count set by :code:`num_inter`) - .. image:: /api/_images/SubsystemInterface.svg - :alt: flowsheet of the subsystem interface - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/SubsystemInterface_darkmode.svg - :alt: flowsheet of the subsystem interface - :align: center - :class: only-dark + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - pressure equality constraint: :py:meth:`variable_equality_structure_matrix ` + - enthalpy equality constraint: :py:meth:`variable_equality_structure_matrix ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + num_inter : int + Number of interfacing connections. - printout : boolean + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool Include this component in the network's results printout. - num_inter : float, dict - Number of interfaces for subsystem. + Notes + ----- + + .. note:: - Note - ---- - This component passes all fluid properties and mass flow from its inlet to - the outlet. + This component passes all fluid properties and mass flow from its inlet to + the outlet. Example ------- @@ -149,10 +154,21 @@ def get_mandatory_constraints(self): def get_parameters(): return { "num_inter": dc_simple( - description="number of interfacing connections" + dtype="int", description="number of interfacing connections" ) } + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "variable", "parameter": "num_inter", "pattern": "in{n}", "min": 1}, + "outlets": {"type": "variable", "parameter": "num_inter", "pattern": "out{n}", "min": 1}, + "powerinlets": {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } + def inlets(self): if self.num_inter.is_set: return ['in' + str(i + 1) for i in range(self.num_inter.val)] diff --git a/src/tespy/components/combustion/base.py b/src/tespy/components/combustion/base.py index 04b7f069b..9a2ad7273 100644 --- a/src/tespy/components/combustion/base.py +++ b/src/tespy/components/combustion/base.py @@ -32,87 +32,92 @@ class CombustionChamber(Component): r""" The class CombustionChamber is parent class of all combustion components. - **Mandatory Equations** + .. image:: /api/_images/components/CombustionChamber.svg + :alt: flowsheet of the combustionchamber + :align: center + :class: only-light - - :py:meth:`tespy.components.combustion.base.CombustionChamber.mass_flow_func` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.combustion_pressure_structure_matrix` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.stoichiometry` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.energy_balance_func` + .. image:: /api/_images/components/CombustionChamber_darkmode.svg + :alt: flowsheet of the combustionchamber + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.combustion.base.CombustionChamber.lambda_func` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.ti_func` + Fluid inlets: in1, in2 - Available fuels + Fluid outlets: out1 - - methane, ethane, propane, butane, hydrogen, carbon monoxide, nDodecane + Mandatory Equations + ------------------- - .. tip:: + - mass flow balance over all inflows and outflows: :py:meth:`mass_flow_func ` + - pressure equality constraints: :py:meth:`combustion_pressure_structure_matrix ` + - constraints for stoichiometry of the reaction: :py:meth:`stoichiometry_func ` + - constraint for energy balance: :py:meth:`energy_balance_func ` - You can add more fluids by importing :code:`COMBUSTION_FLUIDS` from - the :code:`tespy.tools` module and passing the respective information. - See in the example below, how to do that. - - Inlets/Outlets - - - in1, in2 - - out1 - - Image + Parameters + ---------- - .. image:: /api/_images/CombustionChamber.svg - :alt: flowsheet of the combustion chamber - :align: center - :class: only-light + char_warnings : bool + Ignore warnings on default characteristics usage for this component. - .. image:: /api/_images/CombustionChamber_darkmode.svg - :alt: flowsheet of the combustion chamber - :align: center - :class: only-dark + design : list + List containing design parameters (stated as String). - .. note:: + design_path : str + Path to the components design case. - The fuel and the air components can be connected to either of the - inlets. + f_nox : float, dict + Mass-based nitric oxide (NO) generation rate in flue gas in mass of + created NO per mass of fuel and air input. Only active if value is + explicitly set. Quantity: :code:`ratio`. - Parameters - ---------- label : str The label of the component. - design : list - List containing design parameters (stated as String). + lamb : float, dict + Available oxygen to stoichiometric oxygen ratio. Quantity: + :code:`ratio`. + Equation: :py:meth:`lambda_func `. + + local_design : bool + Treat this component in design mode in an offdesign calculation. + + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. offdesign : list List containing offdesign parameters (stated as String). - design_path : str - Path to the components design case. + printout : bool + Include this component in the network's results printout. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + ti : float, dict + Thermal input of fuel: lower heating value multiplied with mass flow. + Quantity: :code:`heat`. + Equation: :py:meth:`ti_func `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + Notes + ----- - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + .. tip:: - printout : boolean - Include this component in the network's results printout. + You can add more fluids by importing :code:`COMBUSTION_FLUIDS` from + the :code:`tespy.tools` module and passing the respective information. + See in the example below, how to do that. To retrieve the fluids + available by default run: - lamb : float, dict - Actual oxygen to stoichiometric oxygen ratio, :math:`\lambda/1`. + .. code-block:: python - ti : float, dict - Thermal input, (:math:`{LHV \cdot \dot{m}_f}`), :math:`ti/\text{W}`. + from tespy.tools.global_vars import COMBUSTION_FLUIDS + COMBUSTION_FLUIDS.fluids.keys() + + .. note:: - Note - ---- - For more information on the usage of the combustion chamber see the - examples section on github or look for the combustion chamber tutorials - at tespy.readthedocs.io. + The fuel and the air components can be connected to either of the + inlets. Example ------- @@ -198,7 +203,7 @@ def get_parameters(self): dependents=self.ti_dependents, num_eq_sets=1, quantity="heat", - description="thermal input of fuel: lower heating value multipled with mass flow", + description="thermal input of fuel: lower heating value multiplied with mass flow", calc=self._calc_ti ), "f_nox": dc_cp( @@ -584,7 +589,7 @@ def stoichiometry(self, fluid): 0 = res + \left( \dot{m}_{H_m} - \dot{m}_{H_{exc,m}} \right) \cdot 0.5 \cdot M_{H_2O} - Equation for carbondioxide + Equation for carbon dioxide .. math:: @@ -683,7 +688,7 @@ def stoichiometry(self, fluid): ) ################################################################### - # equation for carbondioxide + # equation for carbon dioxide if fluid == self.co2: dm = (n_c - n_c_exc) * inl[0].fluid.wrapper[self.co2]._molar_mass @@ -911,12 +916,12 @@ def lambda_dependents(self): def _calc_lambda(self): r""" - Calculate oxygen to stoichimetric oxygen ration + Calculate oxygen to stoichiometric oxygen ratio Returns ------- lambda : float - Oxygent to stoichiometric oxygen ratio. + Oxygen to stoichiometric oxygen ratio. .. math:: @@ -1203,7 +1208,7 @@ def entropy_balance(self): reaction, we need to define the same reference state for the entropy balance of the combustion. The temperature for the reference state is set to 25 °C and reference pressure is 1 bar. As the water in the flue - gas may be liquid but the thermodynmic temperature of heat of + gas may be liquid but the thermodynamic temperature of heat of combustion refers to the lower heating value, the water is forced to gas at the reference point by considering evaporation. diff --git a/src/tespy/components/combustion/diabatic.py b/src/tespy/components/combustion/diabatic.py index 513911b17..095b7e562 100644 --- a/src/tespy/components/combustion/diabatic.py +++ b/src/tespy/components/combustion/diabatic.py @@ -23,108 +23,119 @@ @component_registry class DiabaticCombustionChamber(CombustionChamber): r""" - The class CombustionChamber is parent class of all combustion components. + An extension of the adiabatic combustion chamber with pressure drop and heat loss. - **Mandatory Equations** + .. image:: /api/_images/components/CombustionChamber.svg + :alt: flowsheet of the diabaticcombustionchamber + :align: center + :class: only-light - - :py:meth:`tespy.components.combustion.base.CombustionChamber.mass_flow_func` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.combustion_pressure_structure_matrix` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.stoichiometry` + .. image:: /api/_images/components/CombustionChamber_darkmode.svg + :alt: flowsheet of the diabaticcombustionchamber + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.combustion.base.CombustionChamber.lambda_func` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.ti_func` - - :py:meth:`tespy.components.combustion.diabatic.DiabaticCombustionChamber.energy_balance_func` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` + Fluid inlets: in1, in2 - Available fuels + Fluid outlets: out1 - - methane, ethane, propane, butane, hydrogen, carbon monoxide, nDodecane + Mandatory Equations + ------------------- - .. tip:: + - mass flow balance over all inflows and outflows: :py:meth:`mass_flow_func ` + - constraints for stoichiometry of the reaction: :py:meth:`stoichiometry_func ` - You can add more fluids by importing :code:`COMBUSTION_FLUIDS` from - the :code:`tespy.tools` module and passing the respective information. - See in the example of - :py:class:`tespy.components.combustion.base.CombustionChamber`, how to - do that. - - Inlets/Outlets + Parameters + ---------- - - in1, in2 - - out1 + char_warnings : bool + Ignore warnings on default characteristics usage for this component. - Image + design : list + List containing design parameters (stated as String). - .. image:: /api/_images/CombustionChamber.svg - :alt: flowsheet of the combustion chamber - :align: center - :class: only-light + design_path : str + Path to the components design case. - .. image:: /api/_images/CombustionChamber_darkmode.svg - :alt: flowsheet of the combustion chamber - :align: center - :class: only-dark + dp : float, dict + Inlet 0 to outlet 0 absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - .. note:: + eta : float, dict + Heat dissipation ratio relative to thermal input. Quantity: + :code:`efficiency`. + Equation: :py:meth:`energy_balance_func `. - The fuel and the air components can be connected to either of the - inlets. The pressure of inlet 2 is disconnected from the pressure of - inlet 1. A warning is prompted, if the pressure at inlet 2 is lower than - the pressure at inlet 1. + f_nox : float, dict + Mass-based nitric oxide (NO) generation rate in flue gas in mass of + created NO per mass of fuel and air input. Only active if value is + explicitly set. Quantity: :code:`ratio`. - Parameters - ---------- label : str The label of the component. - design : list - List containing design parameters (stated as String). - - offdesign : list - List containing offdesign parameters (stated as String). + lamb : float, dict + Available oxygen to stoichiometric oxygen ratio. Quantity: + :code:`ratio`. + Equation: :py:meth:`lambda_func `. - design_path : str - Path to the components design case. + local_design : bool + Treat this component in design mode in an offdesign calculation. - local_offdesign : boolean + local_offdesign : bool Treat this component in offdesign mode in a design calculation. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + offdesign : list + List containing offdesign parameters (stated as String). - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + pr : float, dict + Outlet 0 to inlet 0 pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - printout : boolean + printout : bool Include this component in the network's results printout. - lamb : float, dict - Actual oxygen to stoichiometric oxygen ratio, :math:`\lambda/1`. + Qloss : float, dict + Heat dissipation. Quantity: :code:`heat`. ti : float, dict - Thermal input, (:math:`{LHV \cdot \dot{m}_f}`), :math:`ti/\text{W}`. + Thermal input of fuel: lower heating value multiplied with mass flow. + Quantity: :code:`heat`. + Equation: :py:meth:`ti_func `. - eta : float, dict - Combustion thermal efficiency, :math:`\eta`. Heat loss calculation based - on share of thermal input. + Notes + ----- - pr : float, dict - Pressure ratio of outlet 1 to inlet 1, :math:`pr`. + .. tip:: + + You can add more fluids by importing :code:`COMBUSTION_FLUIDS` from + the :code:`tespy.tools` module and passing the respective information. + See in the example of + :py:class:`tespy.components.combustion.base.CombustionChamber`, how to + do that. To retrieve the fluids available by default run: + + .. code-block:: python - Note - ---- - For more information on the usage of the combustion chamber see the - examples section on github or look for the combustion chamber tutorials - at tespy.readthedocs.io. + from tespy.tools.global_vars import COMBUSTION_FLUIDS + COMBUSTION_FLUIDS.fluids.keys() + + .. note:: + + The fuel and the air components can be connected to either of the + inlets. The pressure of inlet 2 is disconnected from the pressure of + inlet 1. A warning is prompted, if the pressure at inlet 2 is lower than + the pressure at inlet 1. Example ------- The combustion chamber calculates energy input due to combustion as well as the flue gas composition based on the type of fuel and the amount of oxygen supplied. In this example a mixture of methane, hydrogen and - carbondioxide is used as fuel. + carbon dioxide is used as fuel. >>> from tespy.components import Sink, Source, DiabaticCombustionChamber >>> from tespy.connections import Connection @@ -170,8 +181,8 @@ class DiabaticCombustionChamber(CombustionChamber): >>> round(comb_fg.p.val, 2) 1.14 - Instead of the pressure ration, we can also specify the outlet pressure. - The pressure ratio is the ratio or pressure at the outlet to the pressure + Instead of the pressure ratio, we can also specify the outlet pressure. + The pressure ratio is the ratio of pressure at the outlet to the pressure at the inlet 1 (ambient air inlet in this example). >>> comb.set_attr(pr=None) @@ -272,7 +283,7 @@ def energy_balance_func(self): The temperature for the reference state is set to 25 °C, thus the water may be liquid. In order to make sure, the state is referring to the lower heating value, the state of the water in the - flue gas is fored to gaseous. + flue gas is forced to gaseous. - Reference temperature: 298.15 K. - Reference pressure: 1 bar. diff --git a/src/tespy/components/combustion/engine.py b/src/tespy/components/combustion/engine.py index 8298e569d..b5038269b 100644 --- a/src/tespy/components/combustion/engine.py +++ b/src/tespy/components/combustion/engine.py @@ -36,162 +36,174 @@ class CombustionEngine(CombustionChamber): chamber. Thermal input and power output, heat output and heat losses are linked with an individual characteristic line for each property. - **Mandatory Equations** + .. image:: /api/_images/components/CombustionEngine.svg + :alt: flowsheet of the combustionengine + :align: center + :class: only-light - - :py:meth:`tespy.components.combustion.base.CombustionChamber.mass_flow_func` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.combustion_pressure_structure_matrix` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.stoichiometry` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.energy_balance_func` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.tiP_char_func` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.Q1_char_func` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.Q2_char_func` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.Qloss_char_func` + .. image:: /api/_images/components/CombustionEngine_darkmode.svg + :alt: flowsheet of the combustionengine + :align: center + :class: only-dark - - for each cooling loop: + Ports + ----- - - mass flow: :py:meth:`tespy.components.combustion.engine.CombustionEngine.variable_equality_structure_matrix` - - fluid: :py:meth:`tespy.components.combustion.engine.CombustionEngine.variable_equality_structure_matrix` + Fluid inlets: in1, in2, in3, in4 - **Optional Equations** + Fluid outlets: out1, out2, out3 - - :py:meth:`tespy.components.combustion.base.CombustionChamber.lambda_func` - - :py:meth:`tespy.components.combustion.base.CombustionChamber.ti_func` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.Q1_func` - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.Q2_func` + Power outlets: power - - for each cooling loop: + Mandatory Equations + ------------------- - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` + - mass flow balance over all inflows and outflows: :py:meth:`mass_flow_func ` + - pressure equality constraints: :py:meth:`combustion_pressure_structure_matrix ` + - constraints for stoichiometry of the reaction: :py:meth:`stoichiometry_func ` + - constraint for energy balance: :py:meth:`energy_balance_func ` + - equation for thermal input to power generation relation: :py:meth:`tiP_char_func ` + - equation for thermal input to heating port 1 heat generation relation: :py:meth:`Q1_char_func ` + - equation for thermal input to heating port 2 heat generation relation: :py:meth:`Q2_char_func ` + - equation for thermal input to heat dissipation relation: :py:meth:`Qloss_char_func ` + - equation for mass flow equality at heating ports: :py:meth:`variable_equality_structure_matrix ` + - equation for fluid composition equality at heating ports: :py:meth:`variable_equality_structure_matrix ` - Available fuels + When a power or heat connector is attached: - - methane, ethane, propane, butane, hydrogen, carbon monoxide, nDodecane + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` - .. tip:: - - You can add more fluids by importing :code:`COMBUSTION_FLUIDS` from - the :code:`tespy.tools` module and passing the respective information. - See in the example of - :py:class:`tespy.components.combustion.base.CombustionChamber`, how to - do that. + Parameters + ---------- - Inlets/Outlets + char_warnings : bool + Ignore warnings on default characteristics usage for this component. - - in1, in2 (cooling water), in3, in4 (air and fuel) - - out1, out2 (cooling water), out3 (flue gas) + design : list + List containing design parameters (stated as String). - Power outlets + design_path : str + Path to the components design case. - - power + dp1 : float, dict + Heating port 1 inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - Image + dp2 : float, dict + Heating port 2 inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - .. image:: /api/_images/CombustionEngine.svg - :alt: flowsheet of the combustion engine - :align: center - :class: only-light + eta_mech : float - .. image:: /api/_images/CombustionEngine_darkmode.svg - :alt: flowsheet of the combustion engine - :align: center - :class: only-dark - .. note:: + f_nox : float, dict + Mass-based nitric oxide (NO) generation rate in flue gas in mass of + created NO per mass of fuel and air input. Only active if value is + explicitly set. Quantity: :code:`ratio`. - The fuel and the air components can be connected to either of the - inlets. - - Parameters - ---------- label : str The label of the component. - design : list - List containing design parameters (stated as String). - - offdesign : list - List containing offdesign parameters (stated as String). + lamb : float, dict + Available oxygen to stoichiometric oxygen ratio. Quantity: + :code:`ratio`. + Equation: :py:meth:`lambda_func `. - design_path : str - Path to the components design case. + local_design : bool + Treat this component in design mode in an offdesign calculation. - local_offdesign : boolean + local_offdesign : bool Treat this component in offdesign mode in a design calculation. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + offdesign : list + List containing offdesign parameters (stated as String). - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + P : float, dict, :code:`"var"` + Mechanical power generated by the engine. Quantity: :code:`power`. Can + be set as a system variable by passing :code:`"var"` as its value. - printout : boolean - Include this component in the network's results printout. + pr1 : float, dict + Heating port 1 outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - lamb : float, dict - Air to stoichiometric air ratio, :math:`\lambda/1`. + pr2 : float, dict + Heating port 2 outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - ti : float, dict - Thermal input, (:math:`{LHV \cdot \dot{m}_f}`), :math:`ti/\text{W}`. - - P : float, dict, :code:`"var"` - Power output, :math:`P/\text{W}`. + printout : bool + Include this component in the network's results printout. Q1 : float, dict - Heat output 1, :math:`\dot Q/\text{W}`. + Heating port 1 heat production. Quantity: :code:`heat`. + Equation: :py:meth:`Q1_func `. + + Q1_char : tespy.tools.characteristics.CharLine, dict + Thermal input to heat production of port 1 lookup table. Q2 : float, dict - Heat output 2, :math:`\dot Q/\text{W}`. + Heating port 2 heat production. Quantity: :code:`heat`. + Equation: :py:meth:`Q2_func `. + + Q2_char : tespy.tools.characteristics.CharLine, dict + Thermal input to heat production of port 2 lookup table. Qloss : float, dict, :code:`"var"` - Heat loss, :math:`\dot Q_{loss}/\text{W}`. + Heat dissipation. Quantity: :code:`heat`. Can be set as a system + variable by passing :code:`"var"` as its value. - pr1 : float, dict, :code:`"var"` - Pressure ratio heat outlet 1, :math:`pr/1`. + Qloss_char : tespy.tools.characteristics.CharLine, dict + Thermal input to heat dissipation lookup table. - pr2 : float, dict, :code:`"var"` - Pressure ratio heat outlet 2, :math:`pr/1`. + T_v_inner : float - zeta1 : float, dict, :code:`"var"` - Geometry independent friction coefficient heating loop 1, - :math:`\zeta_1/\frac{1}{\text{m}^4}`. - zeta2 : float, dict, :code:`"var"` - Geometry independent friction coefficient heating loop 2, - :math:`\zeta_2/\frac{1}{\text{m}^4}`. + ti : float, dict + Thermal input of fuel: lower heating value multiplied with mass flow. + Quantity: :code:`heat`. + Equation: :py:meth:`ti_func `. tiP_char : tespy.tools.characteristics.CharLine, dict - Characteristic line linking fuel input to power output. + Thermal input to power lookup table. - Q1_char : tespy.tools.characteristics.CharLine, dict - Characteristic line linking heat output 1 to power output. + zeta1 : float, dict + Heating port 1 non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - Q2_char : tespy.tools.characteristics.CharLine, dict - Characteristic line linking heat output 2 to power output. + zeta2 : float, dict + Heating port 2 non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - Qloss_char : tespy.tools.characteristics.CharLine, dict - Characteristic line linking heat loss to power output. + Notes + ----- - eta_mech : float - Value of internal efficiency of the combustion engine. This value is - required to determine the (virtual) thermodynamic temperature of heat - inside the combustion engine for the entropy balance calculation. - Default value is 0.85. + .. tip:: - Note - ---- - Parameters available through entropy balance are listed in the respective - method: + You can add more fluids by importing :code:`COMBUSTION_FLUIDS` from + the :code:`tespy.tools` module and passing the respective information. + See in the example of + :py:class:`tespy.components.combustion.base.CombustionChamber`, how to + do that. To retrieve the fluids available by default run: + + .. code-block:: python + + from tespy.tools.global_vars import COMBUSTION_FLUIDS + COMBUSTION_FLUIDS.fluids.keys() - - :py:meth:`tespy.components.combustion.engine.CombustionEngine.entropy_balance` + .. note:: + + The fuel and the air components can be connected to either of the + inlets. Example ------- The combustion chamber calculates energy input due to combustion as well as the flue gas composition based on the type of fuel and the amount of oxygen supplied. In this example a mixture of methane, hydrogen and - carbondioxide is used as fuel. There are two cooling ports, the cooling + carbon dioxide is used as fuel. There are two cooling ports, the cooling water will flow through them in parallel. >>> from tespy.components import (Sink, Source, CombustionEngine, Merge, @@ -263,7 +275,7 @@ def get_parameters(self): params = super().get_parameters() params.update({ 'P': dc_cp( - _val=-1e6, max_val=-1, quantity="power", _potential_var=True, + _val=-1e6, max_val=-1, quantity="power", _allows_var=True, description="mechanical power generated by the engine", calc=self._calc_P ), @@ -286,7 +298,7 @@ def get_parameters(self): calc=self._calc_Q2 ), 'Qloss': dc_cp( - _val=-1e5, max_val=-1, quantity="heat", _potential_var=True, + _val=-1e5, max_val=-1, quantity="heat", _allows_var=True, description="heat dissipation", calc=self._calc_Qloss ), @@ -350,8 +362,8 @@ def get_parameters(self): 'Qloss_char': dc_cc( description="thermal input to heat dissipation lookup table" ), - 'eta_mech': dc_simple(_val=0.85), - 'T_v_inner': dc_simple() + 'eta_mech': dc_simple(_val=0.85, dtype="float"), + 'T_v_inner': dc_simple(dtype="float") }) return params @@ -959,7 +971,7 @@ def entropy_balance(self): reaction, we need to define the same reference state for the entropy balance of the combustion. The temperature for the reference state is set to 25 °C and reference pressure is 1 bar. As the water in the flue - gas may be liquid but the thermodynmic temperature of heat of + gas may be liquid but the thermodynamic temperature of heat of combustion refers to the lower heating value, the water is forced to gas at the reference point by considering evaporation. diff --git a/src/tespy/components/component.py b/src/tespy/components/component.py index c883ce185..d818ec6cf 100644 --- a/src/tespy/components/component.py +++ b/src/tespy/components/component.py @@ -209,13 +209,13 @@ def set_attr(self, **kwargs): def _set_parameter(self, key, value): try: self.parameters[key].accept(value) - except TypeError as e: + except (TypeError, ValueError) as e: msg = ( - f"Bad datatype for keyword argument '{key}' on " + f"Bad value for keyword argument '{key}' on " f"component {self.label}: {e}" ) logger.error(msg) - raise TypeError(msg) from e + raise type(e)(msg) from e def _set_design_list(self, key, value): if not isinstance(value, list): @@ -573,6 +573,50 @@ def get_bypass_constraints(self): logger.exception(msg) raise NotImplementedError(msg) + @classmethod + def port_schema(cls): + """ + Return a description of the component's port topology for UI tooling. + + The default implementation derives fixed-port descriptions from the + ``@staticmethod`` ``inlets``/``outlets``/``powerinlets``/ + ``poweroutlets`` methods. Subclasses with variable or conditional + port counts must override this method. + + Returns + ------- + dict + Keys are ``"inlets"``, ``"outlets"``, ``"powerinlets"``, + ``"poweroutlets"``, ``"heatinlets"``, ``"heatoutlets"``. + Each value is a dict with at least a ``"type"`` key: + + ``{"type": "fixed", "ports": [...]}`` + The port list is static. + + ``{"type": "variable", "parameter": str, "pattern": str, "min": int}`` + Port count is controlled by *parameter*. *pattern* is a + Python format string where ``{n}`` is replaced by the + 1-based port index (e.g. ``"in{n}"``). + """ + import inspect + result = {} + for port_type in ( + "inlets", "outlets", + "powerinlets", "poweroutlets", + "heatinlets", "heatoutlets", + ): + attr = inspect.getattr_static(cls, port_type, None) + if isinstance(attr, staticmethod): + result[port_type] = { + "type": "fixed", + "ports": getattr(cls, port_type)(), + } + else: + # Instance method — subclass should override port_schema() + # but provide a safe fallback so schema generation never crashes. + result[port_type] = {"type": "unknown"} + return result + @staticmethod def inlets(): return [] diff --git a/src/tespy/components/displacementmachinery/base.py b/src/tespy/components/displacementmachinery/base.py index 7ac38299b..7e33e158e 100644 --- a/src/tespy/components/displacementmachinery/base.py +++ b/src/tespy/components/displacementmachinery/base.py @@ -23,57 +23,58 @@ class DisplacementMachine(Component): r""" Parent class for displacement machines - **Mandatory Equations** + Ports + ----- - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + Fluid inlets: in1 - **Optional Equations** + Fluid outlets: out1 - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.displacementmachinery.base.DisplacementMachine.energy_balance_func` + Mandatory Equations + ------------------- - Inlets/Outlets - - - in1 - - out1 + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + offdesign : list + List containing offdesign parameters (stated as String). P : float, dict - Power, :math:`P/\text{W}` + Power input of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + printout : bool + Include this component in the network's results printout. Example ------- diff --git a/src/tespy/components/displacementmachinery/polynomial_compressor.py b/src/tespy/components/displacementmachinery/polynomial_compressor.py index 078c08f8f..5eb8ccc26 100644 --- a/src/tespy/components/displacementmachinery/polynomial_compressor.py +++ b/src/tespy/components/displacementmachinery/polynomial_compressor.py @@ -34,93 +34,140 @@ class PolynomialCompressor(DisplacementMachine): See the example for the intended use of the component. - **Mandatory Equations** + .. image:: /api/_images/components/PolynomialCompressor.svg + :alt: flowsheet of the polynomialcompressor + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/PolynomialCompressor_darkmode.svg + :alt: flowsheet of the polynomialcompressor + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.displacementmachinery.polynomial_compressor.PolynomialCompressor.energy_balance_group_func` - - :py:meth:`tespy.components.displacementmachinery.polynomial_compressor.PolynomialCompressor.eta_s_group_func` - - :py:meth:`tespy.components.displacementmachinery.polynomial_compressor.PolynomialCompressor.eta_vol_group_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power inlets: power - Optional inlets + Mandatory Equations + ------------------- - - power + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` - Image + When a power or heat connector is attached: - .. image:: /api/_images/Compressor.svg - :alt: flowsheet of the compressor - :align: center - :class: only-light - - .. image:: /api/_images/Compressor_darkmode.svg - :alt: flowsheet of the compressor - :align: center - :class: only-dark + - energy balance between for power connector and the power consumption of the compressor: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. - - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dissipation_ratio : float, dict + Heat dissipation ratio relative to power consumption. Quantity: + :code:`ratio`. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - printout : boolean - Include this component in the network's results printout. + energy_balance_group : GroupedComponentProperties + Energy balance equation for fixed power and dissipation ratio. Elements: + :code:`P`, :code:`dissipation_ratio`. + Equation: :py:meth:`energy_balance_group_func `. - P : float, dict - Compressor power, :math:`P/\text{W}` + eta_s : float, dict + Isentropic efficiency. Quantity: :code:`efficiency`. - dissipation_ratio : float, dict - Relative heat loss of compressor, :math:`Q_\text{diss,rel}/1` + eta_s_group : GroupedComponentProperties + Isentropic efficiency equation with fixed efficiency. Elements: + :code:`eta_s`, :code:`dissipation_ratio`. + Equation: :py:meth:`eta_s_group_func `. - eta_s : float, dict - Isentropic efficiency, :math:`\eta_\text{s}/1` + eta_s_poly : list + Polynomial coefficients for isentropic efficiency. - eta_s_poly : array, dict - Polynomial coefficients for isentropic efficiency + eta_s_poly_group : GroupedComponentProperties + Isentropic efficiency equation based on polynomial coefficients. + Elements: :code:`eta_s_poly`, :code:`dissipation_ratio`. + Equation: :py:meth:`eta_s_poly_group_func `. eta_vol : float, dict - Volumetric efficiency, :math:`\eta_\text{vol}/1` + Volumetric efficiency. Quantity: :code:`efficiency`. + + eta_vol_group : GroupedComponentProperties + Elements: :code:`reference_state`, :code:`eta_vol`, :code:`frequency`. + Equation: :py:meth:`eta_vol_frequency_group_func `. + + eta_vol_group_rpm : GroupedComponentProperties + Displacement equation based on fixed volumetric efficiency. Elements: + :code:`reference_state`, :code:`eta_vol`, :code:`rpm`. + Equation: :py:meth:`eta_vol_group_func `. + + eta_vol_poly : list + Polynomial coefficients for volumetric efficiency. - eta_vol_poly : array, dict - Polynomial coefficients for volumetric efficiency + eta_vol_poly_group : GroupedComponentProperties + Displacement equation based on polynomial coefficients for volumetric + efficiency. Elements: :code:`reference_state`, :code:`eta_vol_poly`, + :code:`frequency`. + Equation: :py:meth:`eta_vol_poly_frequency_group_func `. - reference_state: dict - Reference state for the polynomial and displacement. + eta_vol_poly_group_rpm : GroupedComponentProperties + Displacement equation based on polynomial coefficients for volumetric + efficiency. Elements: :code:`reference_state`, :code:`eta_vol_poly`, + :code:`rpm`. + Equation: :py:meth:`eta_vol_poly_group_func `. + + frequency : float, dict, :code:`"var"` + Compressor frequency. Quantity: :code:`frequency`. Can be set as a + system variable by passing :code:`"var"` as its value. + + label : str + The label of the component. + + local_design : bool + Treat this component in design mode in an offdesign calculation. + + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). + + P : float, dict + Power consumption. Quantity: :code:`power`. pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + printout : bool + Include this component in the network's results printout. + + Q_diss : float, dict + Heat dissipation. Quantity: :code:`heat`. + + reference_state : dict + Reference state definition for the scaling of displacement with + compressor rpm. + + rpm : float, dict, :code:`"var"` + Compressor frequency. Can be set as a system variable by passing + :code:`"var"` as its value. Example ------- @@ -365,6 +412,7 @@ def get_mandatory_constraints(self): constraints["energy_connector_balance"] = dc_cmc(**{ "func": self.energy_connector_balance_func, "dependents": self.energy_connector_dependents, + "description": "energy balance between for power connector and the power consumption of the compressor.", "num_eq_sets": 1 }) @@ -398,21 +446,24 @@ def get_parameters(self): description="heat dissipation ratio relative to power consumption" ), "frequency": dc_cp( - min_val=0, max_val=10000, is_result=True, _potential_var=True, + min_val=0, max_val=10000, is_result=True, _allows_var=True, quantity="frequency", description="compressor frequency" ), "rpm": dc_cp( - min_val=0, is_result=True, _potential_var=True, + min_val=0, is_result=True, _allows_var=True, description="compressor frequency" ), "reference_state": dc_simple( + dtype="dict", description="reference state definition for the scaling of displacement with compressor rpm" ), "eta_s_poly": dc_simple( + dtype="list", description="polynomial coefficients for isentropic efficiency" ), "eta_vol_poly": dc_simple( + dtype="list", description="polynomial coefficients for volumetric efficiency" ), "eta_vol_poly_group_rpm": dc_gcp( @@ -506,6 +557,20 @@ def _calc_eta_vol(self): # this is a bit different that in other cases, because the power cannot # directly be deduced from the change in enthalpy def energy_connector_balance_func(self): + r"""Equation for equality of power connector power with component drawn + power. + + .. math:: + + 0 = \dot m \cdot + \frac{ h_\text{out} - h_\text{in}}{1 - \dot Q_\text{diss,rel}} + - \dot E + + Returns + ------- + float + residual + """ return self._calc_P() - self.power_inl[0].E.val_SI def energy_connector_dependents(self): diff --git a/src/tespy/components/displacementmachinery/polynomial_compressor_with_cooling.py b/src/tespy/components/displacementmachinery/polynomial_compressor_with_cooling.py index 6ea8ae514..3f15161ce 100644 --- a/src/tespy/components/displacementmachinery/polynomial_compressor_with_cooling.py +++ b/src/tespy/components/displacementmachinery/polynomial_compressor_with_cooling.py @@ -27,108 +27,158 @@ class PolynomialCompressorWithCooling(PolynomialCompressor): See the example for the intended use of the component. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - cooling energy balance: :py:meth:`tespy.components.displacementmachinery.polynomial_compressor_with_cooling.PolynomialCompressorWithCooling.cooling_energy_balance_func` + .. image:: /api/_images/components/PolynomialCompressorWithCooling.svg + :alt: flowsheet of the polynomialcompressorwithcooling + :align: center + :class: only-light - **Optional Equations** + .. image:: /api/_images/components/PolynomialCompressorWithCooling_darkmode.svg + :alt: flowsheet of the polynomialcompressorwithcooling + :align: center + :class: only-dark - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.displacementmachinery.polynomial_compressor.PolynomialCompressor.energy_balance_group_func` - - :py:meth:`tespy.components.displacementmachinery.polynomial_compressor.PolynomialCompressor.eta_s_group_func` - - :py:meth:`tespy.components.displacementmachinery.polynomial_compressor.PolynomialCompressor.eta_vol_group_func` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` for cooling - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` for cooling + Ports + ----- - Inlets/Outlets + Fluid inlets: in1, in2 - - in1, in2 (cooling) - - out1, out2 (cooling) + Fluid outlets: out1, out2 - Optional inlets + Power inlets: power - - power + Mandatory Equations + ------------------- - Image + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - energy balance for the cooling ports: :py:meth:`cooling_energy_balance_func ` - .. image:: /api/_images/PolynomialCompressorWithCooling.svg - :alt: flowsheet of the compressor - :align: center - :class: only-light + When a power or heat connector is attached: - .. image:: /api/_images/PolynomialCompressorWithCooling_darkmode.svg - :alt: flowsheet of the compressor - :align: center - :class: only-dark + - energy balance between for power connector and the power consumption of the compressor: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. - - local_design : boolean - Treat this component in design mode in an offdesign calculation. - - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + dissipation_ratio : float, dict + Heat dissipation ratio relative to power consumption. Quantity: + :code:`ratio`. - printout : boolean - Include this component in the network's results printout. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - P : float, dict - Compressor power, :math:`P/\text{W}` + dp_cooling : float, dict + Cooling port inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - dissipation_ratio : float, dict - Relative heat loss of compressor, :math:`Q_\text{diss,rel}/1` + energy_balance_group : GroupedComponentProperties + Energy balance equation for fixed power and dissipation ratio. Elements: + :code:`P`, :code:`dissipation_ratio`. + Equation: :py:meth:`energy_balance_group_func `. eta_recovery : float, dict - Share of heat recovered in the cooling fluid of the heat loss of - compressor, :math:`Q_\text{diss,rel}/1` + Share of dissipated heat usable in cooling port. Quantity: + :code:`efficiency`. eta_s : float, dict - Isentropic efficiency, :math:`\eta_\text{s}/1` + Isentropic efficiency. Quantity: :code:`efficiency`. - eta_s_poly : array, dict - Polynomial coefficients for isentropic efficiency + eta_s_group : GroupedComponentProperties + Isentropic efficiency equation with fixed efficiency. Elements: + :code:`eta_s`, :code:`dissipation_ratio`. + Equation: :py:meth:`eta_s_group_func `. + + eta_s_poly : list + Polynomial coefficients for isentropic efficiency. + + eta_s_poly_group : GroupedComponentProperties + Isentropic efficiency equation based on polynomial coefficients. + Elements: :code:`eta_s_poly`, :code:`dissipation_ratio`. + Equation: :py:meth:`eta_s_poly_group_func `. eta_vol : float, dict - Volumetric efficiency, :math:`\eta_\text{vol}/1` + Volumetric efficiency. Quantity: :code:`efficiency`. - eta_vol_poly : array, dict - Polynomial coefficients for volumetric efficiency + eta_vol_group : GroupedComponentProperties + Elements: :code:`reference_state`, :code:`eta_vol`, :code:`frequency`. + Equation: :py:meth:`eta_vol_frequency_group_func `. - reference_state: dict - Reference state for the polynomial and displacement. + eta_vol_group_rpm : GroupedComponentProperties + Displacement equation based on fixed volumetric efficiency. Elements: + :code:`reference_state`, :code:`eta_vol`, :code:`rpm`. + Equation: :py:meth:`eta_vol_group_func `. - pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + eta_vol_poly : list + Polynomial coefficients for volumetric efficiency. - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + eta_vol_poly_group : GroupedComponentProperties + Displacement equation based on polynomial coefficients for volumetric + efficiency. Elements: :code:`reference_state`, :code:`eta_vol_poly`, + :code:`frequency`. + Equation: :py:meth:`eta_vol_poly_frequency_group_func `. + + eta_vol_poly_group_rpm : GroupedComponentProperties + Displacement equation based on polynomial coefficients for volumetric + efficiency. Elements: :code:`reference_state`, :code:`eta_vol_poly`, + :code:`rpm`. + Equation: :py:meth:`eta_vol_poly_group_func `. + + frequency : float, dict, :code:`"var"` + Compressor frequency. Quantity: :code:`frequency`. Can be set as a + system variable by passing :code:`"var"` as its value. + + label : str + The label of the component. + + local_design : bool + Treat this component in design mode in an offdesign calculation. + + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). + + P : float, dict + Power consumption. Quantity: :code:`power`. + + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. pr_cooling : float, dict - Outlet to inlet pressure ratio for cooling, :math:`pr/1` + Cooling port outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp_cooling : float, dict - Inlet to outlet pressure difference for cooling, - :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + printout : bool + Include this component in the network's results printout. + + Q_diss : float, dict + Heat dissipation. Quantity: :code:`heat`. + + reference_state : dict + Reference state definition for the scaling of displacement with + compressor rpm. + + rpm : float, dict, :code:`"var"` + Compressor frequency. Can be set as a system variable by passing + :code:`"var"` as its value. + + td_minimal : float, dict + Theoretical minimal temperature difference between working and cooling + fluid. Quantity: :code:`temperature_difference`. Example ------- diff --git a/src/tespy/components/energy/_bus.py b/src/tespy/components/energy/_bus.py index 30779b658..ddbbdd30f 100644 --- a/src/tespy/components/energy/_bus.py +++ b/src/tespy/components/energy/_bus.py @@ -25,6 +25,18 @@ class _EnergyBus(Component): _energy_port: str = None + @classmethod + def port_schema(cls): + is_power = cls._energy_port == "power" + return { + "inlets": {"type": "fixed", "ports": []}, + "outlets": {"type": "fixed", "ports": []}, + "powerinlets": {"type": "variable", "parameter": "num_in", "pattern": "power_in{n}", "min": 1} if is_power else {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "variable", "parameter": "num_out", "pattern": "power_out{n}", "min": 1} if is_power else {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": []} if is_power else {"type": "variable", "parameter": "num_in", "pattern": "heat_in{n}", "min": 1}, + "heatoutlets": {"type": "fixed", "ports": []} if is_power else {"type": "variable", "parameter": "num_out", "pattern": "heat_out{n}", "min": 1}, + } + def powerinlets(self): if self._energy_port == "power": return [f"power_in{i + 1}" for i in range(self.num_in.val)] @@ -55,8 +67,8 @@ def _energy_outl(self): def get_parameters(self): return { - "num_in": dc_simple(val=0, description="number of inlets"), - "num_out": dc_simple(val=0, description="number of outlets"), + "num_in": dc_simple(val=0, dtype="int", description="number of inlets"), + "num_out": dc_simple(val=0, dtype="int", description="number of outlets"), } def get_mandatory_constraints(self): diff --git a/src/tespy/components/energy/_sink.py b/src/tespy/components/energy/_sink.py index a44aa29b7..bf7f5a08a 100644 --- a/src/tespy/components/energy/_sink.py +++ b/src/tespy/components/energy/_sink.py @@ -21,6 +21,18 @@ class _EnergySink(Component): _energy_port: str = None + @classmethod + def port_schema(cls): + is_power = cls._energy_port == "power" + return { + "inlets": {"type": "fixed", "ports": []}, + "outlets": {"type": "fixed", "ports": []}, + "powerinlets": {"type": "fixed", "ports": ["power"] if is_power else []}, + "poweroutlets": {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": [] if is_power else ["heat"]}, + "heatoutlets": {"type": "fixed", "ports": []}, + } + def powerinlets(self): return ["power"] if self._energy_port == "power" else [] diff --git a/src/tespy/components/energy/_source.py b/src/tespy/components/energy/_source.py index 5fe2e2d04..bf8dc5265 100644 --- a/src/tespy/components/energy/_source.py +++ b/src/tespy/components/energy/_source.py @@ -21,6 +21,18 @@ class _EnergySource(Component): _energy_port: str = None + @classmethod + def port_schema(cls): + is_power = cls._energy_port == "power" + return { + "inlets": {"type": "fixed", "ports": []}, + "outlets": {"type": "fixed", "ports": []}, + "powerinlets": {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "fixed", "ports": ["power"] if is_power else []}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": [] if is_power else ["heat"]}, + } + def poweroutlets(self): return ["power"] if self._energy_port == "power" else [] diff --git a/src/tespy/components/heat/bus.py b/src/tespy/components/heat/bus.py index b35ee4324..72d26bf72 100644 --- a/src/tespy/components/heat/bus.py +++ b/src/tespy/components/heat/bus.py @@ -25,47 +25,51 @@ class HeatBus(_EnergyBus): :class:`~tespy.components.PowerSource` / :class:`~tespy.components.PowerSink` with :class:`~tespy.components.HeatSource` / :class:`~tespy.components.HeatSink`. - **Mandatory Equations** + Ports + ----- - - :py:meth:`tespy.components.energy._bus._EnergyBus.energy_balance_func` + Heat inlets: heat_in1, heat_in2, ... (variable, count set by :code:`num_in`) - HeatConnection inlets/outlets + Heat outlets: heat_out1, heat_out2, ... (variable, count set by :code:`num_out`) - - specify number of inlets with :code:`num_in`: 'heat_in1', ... - - specify number of outlets with :code:`num_out`: 'heat_out1', ... + Mandatory Equations + ------------------- + + - energy balance over all inflows and outflows: :py:meth:`energy_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. - - printout : boolean - Include this component in the network's results printout. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - num_in : float + num_in : int Number of inlets. - num_out : float + num_out : int Number of outlets. + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool + Include this component in the network's results printout. + Example ------- A HeatBus collects heat from two sources and distributes it to one sink. diff --git a/src/tespy/components/heat/sink.py b/src/tespy/components/heat/sink.py index c17d3c3b8..8cc0e8b20 100644 --- a/src/tespy/components/heat/sink.py +++ b/src/tespy/components/heat/sink.py @@ -19,30 +19,41 @@ class HeatSink(_EnergySink): r""" A heat flow drains in a HeatSink. + Ports + ----- + + Heat inlets: heat + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/heat/source.py b/src/tespy/components/heat/source.py index cc293bcc6..98eb6a120 100644 --- a/src/tespy/components/heat/source.py +++ b/src/tespy/components/heat/source.py @@ -19,30 +19,41 @@ class HeatSource(_EnergySource): r""" A heat flow emerges from a HeatSource. + Ports + ----- + + Heat outlets: heat + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/heat_exchangers/base.py b/src/tespy/components/heat_exchangers/base.py index 8d925912f..f6a7e96f3 100644 --- a/src/tespy/components/heat_exchangers/base.py +++ b/src/tespy/components/heat_exchangers/base.py @@ -40,138 +40,148 @@ class HeatExchanger(Component): - :py:class:`tespy.components.heat_exchangers.desuperheater.Desuperheater` - :py:class:`tespy.components.heat_exchangers.movingboundary.MovingBoundaryHeatExchanger` - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_func` - - **Optional Equations** - - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_char_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_u_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_l_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_min_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_cold_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_max_func` - - For hot and cold side individually: + .. image:: /api/_images/components/HeatExchanger.svg + :alt: flowsheet of the heatexchanger + :align: center + :class: only-light - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` + .. image:: /api/_images/components/HeatExchanger_darkmode.svg + :alt: flowsheet of the heatexchanger + :align: center + :class: only-dark - Inlets/Outlets + Ports + ----- - - in1, in2 (index 1: hot side, index 2: cold side) - - out1, out2 (index 1: hot side, index 2: cold side) + Fluid inlets: in1, in2 - Image + Fluid outlets: out1, out2 - .. image:: /api/_images/HeatExchanger.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/HeatExchanger_darkmode.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-dark + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - hot side to cold side heat transfer equation: :py:meth:`energy_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp1 : float, dict + Hot side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp2 : float, dict + Cold side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eff_cold : float, dict + Heat exchanger effectiveness for cold side. Quantity: + :code:`efficiency`. + Equation: :py:meth:`eff_cold_func `. - printout : boolean - Include this component in the network's results printout. + eff_hot : float, dict + Heat exchanger effectiveness for hot side. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_hot_func `. - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. + eff_max : float, dict + Maximum heat exchanger effectiveness. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_max_func `. - pr1 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at hot side, :math:`pr/1`. + kA : float, dict + Heat transfer coefficient considering terminal temperature differences. + Quantity: :code:`heat_transfer_coefficient`. + Equation: :py:meth:`kA_func `. - pr2 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at cold side, :math:`pr/1`. + kA_char : GroupedComponentCharacteristics + Equation for heat transfer based on kA and modification factor. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`kA_char_func `. - dp1 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at hot side, unit is the network's - pressure unit!. + kA_char1 : tespy.tools.characteristics.CharLine, dict + Hot side kA modification lookup table for offdesign. - dp2 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at cold side, unit is the network's - pressure unit!. + kA_char2 : tespy.tools.characteristics.CharLine, dict + Cold side kA modification lookup table for offdesign. - zeta1 : float, dict, :code:`"var"` - Geometry independent friction coefficient at hot side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + label : str + The label of the component. - zeta2 : float, dict, :code:`"var"` - Geometry independent friction coefficient at cold side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + local_design : bool + Treat this component in design mode in an offdesign calculation. - ttd_l : float, dict - Lower terminal temperature difference :math:`ttd_\text{l}/\text{K}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - ttd_u : float, dict - Upper terminal temperature difference :math:`ttd_\text{u}/\text{K}`. + offdesign : list + List containing offdesign parameters (stated as String). - ttd_min : float, dict - Minimum terminal temperature difference :math:`ttd_\text{min}/\text{K}`. + pr1 : float, dict + Hot side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_cold : float, dict - Cold side heat exchanger effectiveness :math:`eff_\text{cold}/\text{1}`. + pr2 : float, dict + Cold side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_hot : float, dict - Hot side heat exchanger effectiveness :math:`eff_\text{hot}/\text{1}`. + printout : bool + Include this component in the network's results printout. - eff_max : float, dict - Max value of hot and cold side heat exchanger effectiveness values - :math:`eff_\text{max}/\text{1}`. + Q : float, dict + Heat transfer from hot side. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_hot_func `. - kA : float, dict - Area independent heat transfer coefficient, - :math:`kA/\frac{\text{W}}{\text{K}}`. + td_log : float, dict + Logarithmic temperature difference. Quantity: + :code:`temperature_difference`. - kA_char : dict - Area independent heat transfer coefficient characteristic. + ttd_l : float, dict + Terminal temperature difference at hot side outlet to cold side inlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_l_func `. - kA_char1 : tespy.tools.characteristics.CharLine, dict - Characteristic line for hot side heat transfer coefficient. + ttd_min : float, dict + Minimum terminal temperature difference. Quantity: + :code:`temperature_difference`. + Equation: :py:meth:`ttd_min_func `. - kA_char2 : tespy.tools.characteristics.CharLine, dict - Characteristic line for cold side heat transfer coefficient. - - Note - ---- - The HeatExchanger and subclasses ( - :py:class:`tespy.components.heat_exchangers.condenser.Condenser`, - :py:class:`tespy.components.heat_exchangers.desuperheater.Desuperheater`) - are countercurrent heat exchangers. Equations (:code:`kA`, :code:`ttd_u`, - :code:`ttd_l`) do not work for directcurrent and crosscurrent or - combinations of different types. + ttd_u : float, dict + Terminal temperature difference at hot side inlet to cold side outlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_u_func `. + + zeta1 : float, dict + Hot side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. + + zeta2 : float, dict + Cold side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. + + Notes + ----- + + .. note:: + + The HeatExchanger and subclasses ( + :py:class:`tespy.components.heat_exchangers.condenser.Condenser`, + :py:class:`tespy.components.heat_exchangers.desuperheater.Desuperheater`) + are countercurrent heat exchangers. Equations (:code:`kA`, :code:`ttd_u`, + :code:`ttd_l`) do not work for directcurrent and crosscurrent or + combinations of different types. Example ------- diff --git a/src/tespy/components/heat_exchangers/condenser.py b/src/tespy/components/heat_exchangers/condenser.py index 7b9084456..1ecd8eaf6 100644 --- a/src/tespy/components/heat_exchangers/condenser.py +++ b/src/tespy/components/heat_exchangers/condenser.py @@ -28,151 +28,155 @@ class Condenser(HeatExchanger): The condensing fluid is cooled by the cold side fluid. The fluid on the hot side of the condenser must be pure. Subcooling is available. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_func` - - condensate outlet state, function can be disabled by specifying - :code:`set_attr(subcooling=True)` - :py:meth:`tespy.components.heat_exchangers.condenser.Condenser.subcooling_func` - - **Optional Equations** - - The :code:`Condenser` class uses an individual definition for the - calculation of the logarithmic temperature difference - - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_char_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_u_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_l_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_min_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_cold_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_max_func` - - For hot and cold side individually: - - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - Inlets/Outlets - - - in1, in2 (index 1: hot side, index 2: cold side) - - out1, out2 (index 1: hot side, index 2: cold side) - - Image - - .. image:: /api/_images/Condenser.svg + .. image:: /api/_images/components/Condenser.svg :alt: flowsheet of the condenser :align: center :class: only-light - .. image:: /api/_images/Condenser_darkmode.svg + .. image:: /api/_images/components/Condenser_darkmode.svg :alt: flowsheet of the condenser :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1, in2 + + Fluid outlets: out1, out2 + + Mandatory Equations + ------------------- + + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - hot side to cold side heat transfer equation: :py:meth:`energy_balance_func ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp1 : float, dict + Hot side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp2 : float, dict + Cold side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eff_cold : float, dict + Heat exchanger effectiveness for cold side. Quantity: + :code:`efficiency`. + Equation: :py:meth:`eff_cold_func `. - printout : boolean - Include this component in the network's results printout. + eff_hot : float, dict + Heat exchanger effectiveness for hot side. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_hot_func `. - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. + eff_max : float, dict + Maximum heat exchanger effectiveness. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_max_func `. - pr1 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at hot side, :math:`pr/1`. + kA : float, dict + Heat transfer coefficient considering terminal temperature differences. + Quantity: :code:`heat_transfer_coefficient`. + Equation: :py:meth:`kA_func `. - pr2 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at cold side, :math:`pr/1`. + kA_char : GroupedComponentCharacteristics + Equation for heat transfer based on kA and modification factor. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`kA_char_func `. - dp1 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at hot side, unit is the network's - pressure unit!. + kA_char1 : tespy.tools.characteristics.CharLine, dict + Hot side kA modification lookup table for offdesign. - dp2 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at cold side, unit is the network's - pressure unit!. + kA_char2 : tespy.tools.characteristics.CharLine, dict + Cold side kA modification lookup table for offdesign. - zeta1 : float, dict, :code:`"var"` - Geometry independent friction coefficient at hot side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + label : str + The label of the component. - zeta2 : float, dict, :code:`"var"` - Geometry independent friction coefficient at cold side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + local_design : bool + Treat this component in design mode in an offdesign calculation. - ttd_l : float, dict - Lower terminal temperature difference :math:`ttd_\text{l}/\text{K}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - ttd_u : float, dict - Upper terminal temperature difference (referring to saturation - temperature of condensing fluid) :math:`ttd_\text{u}/\text{K}`. + offdesign : list + List containing offdesign parameters (stated as String). - ttd_min : float, dict - Minimum terminal temperature difference :math:`ttd_\text{min}/\text{K}`. + pr1 : float, dict + Hot side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_cold : float, dict - Cold side heat exchanger effectiveness :math:`eff_\text{cold}/\text{1}`. + pr2 : float, dict + Cold side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_hot : float, dict - Hot side heat exchanger effectiveness :math:`eff_\text{hot}/\text{1}`. + printout : bool + Include this component in the network's results printout. - eff_max : float, dict - Max value of hot and cold side heat exchanger effectiveness values - :math:`eff_\text{max}/\text{1}`. + Q : float, dict + Heat transfer from hot side. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_hot_func `. - kA : float, dict - Area independent heat transfer coefficient, - :math:`kA/\frac{\text{W}}{\text{K}}`. + subcooling : bool + Allow subcooling in the condenser. + Equation: :py:meth:`subcooling_func `. - kA_char : tespy.tools.data_containers.SimpleDataContainer - Area independent heat transfer coefficient characteristic. + td_log : float, dict + Logarithmic temperature difference. Quantity: + :code:`temperature_difference`. - kA_char1 : tespy.tools.characteristics.CharLine, dict - Characteristic line for hot side heat transfer coefficient. + ttd_l : float, dict + Terminal temperature difference at hot side outlet to cold side inlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_l_func `. - kA_char2 : tespy.tools.characteristics.CharLine, dict - Characteristic line for cold side heat transfer coefficient. + ttd_min : float, dict + Minimum terminal temperature difference. Quantity: + :code:`temperature_difference`. + Equation: :py:meth:`ttd_min_func `. + + ttd_u : float, dict + Terminal temperature difference at hot side inlet to cold side outlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_u_func `. + + zeta1 : float, dict + Hot side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. + + zeta2 : float, dict + Cold side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. + + Notes + ----- - subcooling : boolean - Enable/disable subcooling, default value: disabled. + .. note:: - Note - ---- - The condenser has an additional equation for enthalpy at hot side outlet: - The fluid leaves the component in saturated liquid state. If subcooling - is activated, it possible to specify the enthalpy at the outgoing - connection manually. + The condenser has an additional equation for enthalpy at hot side outlet: + The fluid leaves the component in saturated liquid state. If subcooling + is activated, it is possible to specify the enthalpy at the outgoing + connection manually. - It has different calculation method for given heat transfer coefficient and - upper terminal temperature dierence: These parameters refer to the - **condensing** temperature, even if the fluid on the hot side enters the - component in superheated state. + It has a different calculation method for given heat transfer coefficient and + upper terminal temperature difference: These parameters refer to the + **condensing** temperature, even if the fluid on the hot side enters the + component in superheated state. Example ------- @@ -240,7 +244,7 @@ def get_parameters(self): params = super().get_parameters() params.update({ 'subcooling': dc_simple( - _val=False, num_eq_sets=1, + _val=False, dtype="bool", num_eq_sets=1, func=self.subcooling_func, dependents=self.subcooling_dependents, description="allow subcooling in the condenser" diff --git a/src/tespy/components/heat_exchangers/desuperheater.py b/src/tespy/components/heat_exchangers/desuperheater.py index de2dc7ba4..b37798393 100644 --- a/src/tespy/components/heat_exchangers/desuperheater.py +++ b/src/tespy/components/heat_exchangers/desuperheater.py @@ -24,115 +24,149 @@ class Desuperheater(HeatExchanger): r""" The Desuperheater cools a fluid to the saturated gas state. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_func` - - :py:meth:`tespy.components.heat_exchangers.desuperheater.Desuperheater.saturated_gas_func` - - **Optional Equations** - - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_char_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_u_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_l_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_min_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_cold_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_max_func` - - For hot and cold side individually: - - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - Inlets/Outlets - - - in1, in2 (index 1: hot side, index 2: cold side) - - out1, out2 (index 1: hot side, index 2: cold side) - - Image - - .. image:: /api/_images/HeatExchanger.svg + .. image:: /api/_images/components/HeatExchanger.svg :alt: flowsheet of the desuperheater :align: center :class: only-light - .. image:: /api/_images/HeatExchanger_darkmode.svg + .. image:: /api/_images/components/HeatExchanger_darkmode.svg :alt: flowsheet of the desuperheater :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1, in2 + + Fluid outlets: out1, out2 + + Mandatory Equations + ------------------- + + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - hot side to cold side heat transfer equation: :py:meth:`energy_balance_func ` + - equation for saturated gas at hot side outlet: :py:meth:`saturated_gas_func ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp1 : float, dict + Hot side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. + + dp2 : float, dict + Cold side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. + + eff_cold : float, dict + Heat exchanger effectiveness for cold side. Quantity: + :code:`efficiency`. + Equation: :py:meth:`eff_cold_func `. + + eff_hot : float, dict + Heat exchanger effectiveness for hot side. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_hot_func `. - local_design : boolean + eff_max : float, dict + Maximum heat exchanger effectiveness. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_max_func `. + + kA : float, dict + Heat transfer coefficient considering terminal temperature differences. + Quantity: :code:`heat_transfer_coefficient`. + Equation: :py:meth:`kA_func `. + + kA_char : GroupedComponentCharacteristics + Equation for heat transfer based on kA and modification factor. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`kA_char_func `. + + kA_char1 : tespy.tools.characteristics.CharLine, dict + Hot side kA modification lookup table for offdesign. + + kA_char2 : tespy.tools.characteristics.CharLine, dict + Cold side kA modification lookup table for offdesign. + + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + offdesign : list + List containing offdesign parameters (stated as String). - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. + pr1 : float, dict + Hot side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - pr1 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at hot side, :math:`pr/1`. + pr2 : float, dict + Cold side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - pr2 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at cold side, :math:`pr/1`. + printout : bool + Include this component in the network's results printout. - zeta1 : float, dict, :code:`"var"` - Geometry independent friction coefficient at hot side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + Q : float, dict + Heat transfer from hot side. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_hot_func `. - zeta2 : float, dict, :code:`"var"` - Geometry independent friction coefficient at cold side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + td_log : float, dict + Logarithmic temperature difference. Quantity: + :code:`temperature_difference`. ttd_l : float, dict - Lower terminal temperature difference :math:`ttd_\text{l}/\text{K}`. + Terminal temperature difference at hot side outlet to cold side inlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_l_func `. + + ttd_min : float, dict + Minimum terminal temperature difference. Quantity: + :code:`temperature_difference`. + Equation: :py:meth:`ttd_min_func `. ttd_u : float, dict - Upper terminal temperature difference :math:`ttd_\text{u}/\text{K}`. + Terminal temperature difference at hot side inlet to cold side outlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_u_func `. - kA : float, dict - Area independent heat transfer coefficient, - :math:`kA/\frac{\text{W}}{\text{K}}`. + zeta1 : float, dict + Hot side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - kA_char1 : tespy.tools.characteristics.CharLine, dict - Characteristic line for hot side heat transfer coefficient. + zeta2 : float, dict + Cold side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - kA_char2 : tespy.tools.characteristics.CharLine, dict - Characteristic line for cold side heat transfer coefficient. + Notes + ----- + + .. note:: - Note - ---- - The desuperheater has an additional equation for enthalpy at hot side - outlet: The fluid leaves the component in saturated gas state. + The desuperheater has an additional equation for enthalpy at hot side + outlet: The fluid leaves the component in saturated gas state. Example ------- - Overheated enthanol is cooled with water in a heat exchanger until it + Overheated ethanol is cooled with water in a heat exchanger until it reaches the state of saturated gas. >>> from tespy.components import Sink, Source, Desuperheater diff --git a/src/tespy/components/heat_exchangers/movingboundary.py b/src/tespy/components/heat_exchangers/movingboundary.py index 93bd3508e..01828e5d3 100644 --- a/src/tespy/components/heat_exchangers/movingboundary.py +++ b/src/tespy/components/heat_exchangers/movingboundary.py @@ -27,150 +27,181 @@ class MovingBoundaryHeatExchanger(SectionedHeatExchanger): identification is done iteratively. In principle the implementations follows :cite:`bell2015`. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_func` + .. image:: /api/_images/components/HeatExchanger.svg + :alt: flowsheet of the movingboundaryheatexchanger + :align: center + :class: only-light - **Optional Equations** + .. image:: /api/_images/components/HeatExchanger_darkmode.svg + :alt: flowsheet of the movingboundaryheatexchanger + :align: center + :class: only-dark - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_hot_func` - - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.UA_func` - - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.td_pinch_func` - - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.UA_cecchinato_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_u_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_l_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_min_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_cold_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_max_func` + Ports + ----- - For hot and cold side individually: + Fluid inlets: in1, in2 - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` + Fluid outlets: out1, out2 - Inlets/Outlets + Mandatory Equations + ------------------- - - in1, in2 (index 1: hot side, index 2: cold side) - - out1, out2 (index 1: hot side, index 2: cold side) + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - hot side to cold side heat transfer equation: :py:meth:`energy_balance_func ` - Image + Parameters + ---------- - .. image:: /api/_images/HeatExchanger.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-light + alpha_ratio : float, dict + Secondary to refrigerant side convective heat transfer coefficient + ratio. Quantity: :code:`ratio`. - .. image:: /api/_images/HeatExchanger_darkmode.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-dark + area_ratio : float, dict + Secondary to refrigerant side heat transfer area ratio. Quantity: + :code:`ratio`. - Parameters - ---------- - label : str - The label of the component. + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp1 : float, dict + Hot side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp2 : float, dict + Cold side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eff_cold : float, dict + Heat exchanger effectiveness for cold side. Quantity: + :code:`efficiency`. + Equation: :py:meth:`eff_cold_func `. - printout : boolean - Include this component in the network's results printout. + eff_hot : float, dict + Heat exchanger effectiveness for hot side. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_hot_func `. - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. + eff_max : float, dict + Maximum heat exchanger effectiveness. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_max_func `. - pr1 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at hot side, :math:`pr/1`. + kA : float, dict + Heat transfer coefficient considering terminal temperature differences. + Quantity: :code:`heat_transfer_coefficient`. + Equation: :py:meth:`kA_func `. - pr2 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at cold side, :math:`pr/1`. + kA_char : GroupedComponentCharacteristics + Equation for heat transfer based on kA and modification factor. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`kA_char_func `. - dp1 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at hot side, unit is the network's - pressure unit!. + kA_char1 : tespy.tools.characteristics.CharLine, dict + Hot side kA modification lookup table for offdesign. - dp2 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at cold side, unit is the network's - pressure unit!. + kA_char2 : tespy.tools.characteristics.CharLine, dict + Cold side kA modification lookup table for offdesign. - zeta1 : float, dict, :code:`"var"` - Geometry independent friction coefficient at hot side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + label : str + The label of the component. - zeta2 : float, dict, :code:`"var"` - Geometry independent friction coefficient at cold side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + local_design : bool + Treat this component in design mode in an offdesign calculation. - ttd_l : float, dict - Lower terminal temperature difference :math:`ttd_\text{l}/\text{K}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - ttd_u : float, dict - Upper terminal temperature difference :math:`ttd_\text{u}/\text{K}`. + offdesign : list + List containing offdesign parameters (stated as String). - ttd_min : float, dict - Minimum terminal temperature difference :math:`ttd_\text{min}/\text{K}`. + pr1 : float, dict + Hot side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_cold : float, dict - Cold side heat exchanger effectiveness :math:`eff_\text{cold}/\text{1}`. + pr2 : float, dict + Cold side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_hot : float, dict - Hot side heat exchanger effectiveness :math:`eff_\text{hot}/\text{1}`. + printout : bool + Include this component in the network's results printout. - eff_max : float, dict - Max value of hot and cold side heat exchanger effectiveness values - :math:`eff_\text{max}/\text{1}`. + Q : float, dict + Heat transfer from hot side. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_hot_func `. - UA : float, dict - Sum of UA in all sections of the heat exchanger. + re_exp_r : float, dict + Reynolds exponent for UA modification based on refrigerant side mass + flow. + + re_exp_sf : float, dict + Reynolds exponent for UA modification based on secondary fluid side mass + flow. + + refrigerant_index : int + Side on which the refrigerant is flowing (0: hot, 1:cold). + + td_log : float, dict + Logarithmic temperature difference. Quantity: + :code:`temperature_difference`. td_pinch : float, dict - Value of the lowest delta T between hot side and cold side at the - different sections. + Equation for minimum pinch. Quantity: :code:`temperature_difference`. + Equation: :py:meth:`td_pinch_func `. + + ttd_l : float, dict + Terminal temperature difference at hot side outlet to cold side inlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_l_func `. + + ttd_min : float, dict + Minimum terminal temperature difference. Quantity: + :code:`temperature_difference`. + Equation: :py:meth:`ttd_min_func `. + + ttd_u : float, dict + Terminal temperature difference at hot side inlet to cold side outlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_u_func `. + + UA : float, dict + Sum of UA values of all sections of heat exchanger. Quantity: + :code:`heat_transfer_coefficient`. + Equation: :py:meth:`UA_func `. - UA_cecchinato : dict - Group specification for partload UA modification according to - :cite:`cecchinato2010`, for usage see details in the - :py:meth:`tespy.components.heat_exchangers.movingboundary.MovingBoundaryHeatExchanger.UA_cecchinato_func`. - This method can only be used in offdesign simulations! + UA_cecchinato : GroupedComponentProperties + Equation for UA modification in offdesign. Elements: :code:`re_exp_r`, + :code:`re_exp_sf`, :code:`alpha_ratio`, :code:`area_ratio`. + Equation: :py:meth:`UA_cecchinato_func `. - alpha_ration: float - Secondary fluid to refrigerant heat transfer coefficient ratio. + UA_char : GroupedComponentCharacteristics + Equation for sectioned UA modification based on characteristic lines. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`UA_char_func `. - area_ration: float - Secondary fluid to refrigerant heat transfer area ratio. + zeta1 : float, dict + Hot side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - re_exp_r: float - Reynolds exponent for refrigerant side. + zeta2 : float, dict + Cold side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - re_exp_sf: float - Reynolds exponent for secondary fluid side. + Notes + ----- - refrigerant_index: int - Connection index for the refrigerant side, 0 if refrigerant is on hot - side, 1 if refrigerant is on cold side. + .. note:: - Note - ---- - The equations only apply to counter-current heat exchangers. + The equations only apply to counter-current heat exchangers. Example ------- diff --git a/src/tespy/components/heat_exchangers/parabolic_trough.py b/src/tespy/components/heat_exchangers/parabolic_trough.py index faf29f8c7..b6122352a 100644 --- a/src/tespy/components/heat_exchangers/parabolic_trough.py +++ b/src/tespy/components/heat_exchangers/parabolic_trough.py @@ -22,133 +22,157 @@ class ParabolicTrough(SimpleHeatExchanger): r""" The ParabolicTrough calculates heat output from irradiance. - **Mandatory Equations** + .. image:: /api/_images/components/ParabolicTrough.svg + :alt: flowsheet of the parabolictrough + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/ParabolicTrough_darkmode.svg + :alt: flowsheet of the parabolictrough + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.energy_balance_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.darcy_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.hazen_williams_func` - - :py:meth:`tespy.components.heat_exchangers.parabolic_trough.ParabolicTrough.energy_group_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power inlets: heat - Image + Power outlets: heat - .. image:: /api/_images/ParabolicTrough.svg - :alt: flowsheet of the parabolic trough - :align: center - :class: only-light + Heat inlets: heat - .. image:: /api/_images/ParabolicTrough_darkmode.svg - :alt: flowsheet of the parabolic trough - :align: center - :class: only-dark + Heat outlets: heat + + Mandatory Equations + ------------------- + + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + + When a power or heat connector is attached: + + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + A : float, dict, :code:`"var"` + Area of the parabolic trough. Quantity: :code:`area`. Can be set as a + system variable by passing :code:`"var"` as its value. + + aoi : float, dict + Angle of incidence. Quantity: :code:`angle`. + + c_1 : float, dict + Thermal loss coefficient 1. + + c_2 : float, dict + Thermal loss coefficient 2. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + D : float, dict, :code:`"var"` + Diameter of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. + + darcy_group : GroupedComponentProperties + Darcy-Weißbach equation for pressure loss. Elements: :code:`L`, + :code:`ks`, :code:`D`. + Equation: :py:meth:`darcy_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dissipative : bool - local_design : boolean - Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + doc : float, dict + Degree of cleanliness. Quantity: :code:`ratio`. - printout : boolean - Include this component in the network's results printout. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - Q : float, dict, :code:`"var"` - Heat transfer, :math:`Q/\text{W}`. + E : float, dict, :code:`"var"` + Solar irradiation to the parabolic trough. Quantity: :code:`heat`. Can + be set as a system variable by passing :code:`"var"` as its value. - pr : float, dict, :code:`"var"` - Outlet to inlet pressure ratio, :math:`pr/1`. + energy_group : GroupedComponentProperties + Energy balance equation of the parabolic trough. Elements: :code:`E`, + :code:`eta_opt`, :code:`aoi`, :code:`doc`, :code:`c_1`, :code:`c_2`, + :code:`iam_1`, :code:`iam_2`, :code:`A`, :code:`Tamb`. + Equation: :py:meth:`energy_group_func `. - zeta : float, dict, :code:`"var"` - Geometry independent friction coefficient, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + eta_opt : float, dict + Optical efficiency. Quantity: :code:`efficiency`. - D : float, dict, :code:`"var"` - Diameter of the absorber tube, :math:`D/\text{m}`. + hw_group : GroupedComponentProperties + Hazen-Williams equation for pressure loss. Elements: :code:`L`, + :code:`ks_HW`, :code:`D`. + Equation: :py:meth:`hazen_williams_func `. - L : float, dict, :code:`"var"` - Length of the absorber tube, :math:`L/\text{m}`. + iam_1 : float, dict + Incidence angle modifier 1. - ks : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{m}`. + iam_2 : float, dict + Incidence angle modifier 2. - darcy_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using darcy weissbach equation. + ks : float, dict, :code:`"var"` + Roughness of wall material. Quantity: :code:`length`. Can be set as a + system variable by passing :code:`"var"` as its value. ks_HW : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{1}`. + Hazen-Williams roughness. Can be set as a system variable by passing + :code:`"var"` as its value. - hw_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using hazen williams equation. + L : float, dict, :code:`"var"` + Length of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. - E : float, dict, :code:`"var"` - Direct irradiance to tilted collector, - :math:`E/\frac{\text{W}}{\text{m}^2}`. + label : str + The label of the component. - aoi : float, dict, :code:`"var"` - Angle of incidience, :math:`aoi/^\circ`. + local_design : bool + Treat this component in design mode in an offdesign calculation. - doc : float, dict, :code:`"var"` - Degree of cleanliness (1: full absorption, 0: no absorption), - :math:`X`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - eta_opt : float, dict, :code:`"var"` - (constant) optical losses due to surface reflection, - :math:`\eta_{opt}`. + offdesign : list + List containing offdesign parameters (stated as String). - c_1 : float, dict, :code:`"var"` - Linear thermal loss key figure, - :math:`c_1/\frac{\text{W}}{\text{K} \cdot \text{m}^2}`. + power_connector_location : str - c_2 : float, dict, :code:`"var"` - Quadratic thermal loss key figure, - :math:`c_2/\frac{\text{W}}{\text{K}^2 \cdot \text{m}^2}`. - iam_1 : float, dict, :code:`"var"` - Linear incidence angle modifier, - :math:`iam_1/\frac{1}{^\circ}`. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - iam_2 : float, dict, :code:`"var"` - Quadratic incidence angle modifier, - :math:`iam_2/\left(\frac{1}{^\circ}\right)^2`. + printout : bool + Include this component in the network's results printout. - A : float, dict, :code:`"var"` - Collector aperture surface area :math:`A/\text{m}^2`. + Q : float, dict + Heat transfer. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_func `. + + Q_loss : float, dict + Heat dissipation. Quantity: :code:`heat`. Tamb : float, dict - Ambient temperature, provide parameter in network's temperature unit. + Ambient temperature. Quantity: :code:`temperature`. - energy_group : str, dict - Parametergroup for energy balance of solarthermal collector. + zeta : float, dict + Non-dimensional friction coefficient for pressure loss calculation. + Equation: :py:meth:`zeta_func `. Example ------- @@ -228,11 +252,11 @@ def get_parameters(self): data.update({ 'E': dc_cp( - min_val=0, quantity="heat", _potential_var=True, + min_val=0, quantity="heat", _allows_var=True, description="solar irradiation to the parabolic trough" ), 'A': dc_cp( - min_val=0, quantity="area", _potential_var=True, + min_val=0, quantity="area", _allows_var=True, description="area of the parabolic trough" ), 'eta_opt': dc_cp( diff --git a/src/tespy/components/heat_exchangers/parallel.py b/src/tespy/components/heat_exchangers/parallel.py index 4d886a51c..194a0664f 100644 --- a/src/tespy/components/heat_exchangers/parallel.py +++ b/src/tespy/components/heat_exchangers/parallel.py @@ -20,122 +20,129 @@ class ParallelFlowHeatExchanger(HeatExchanger): r""" Class for parallel flow heat exchanger. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_func` - - **Optional Equations** - - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.kA_char_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_u_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_l_func` - - For hot and cold side individually: + .. image:: /api/_images/components/HeatExchanger.svg + :alt: flowsheet of the parallelflowheatexchanger + :align: center + :class: only-light - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` + .. image:: /api/_images/components/HeatExchanger_darkmode.svg + :alt: flowsheet of the parallelflowheatexchanger + :align: center + :class: only-dark - Inlets/Outlets + Ports + ----- - - in1, in2 (index 1: hot side, index 2: cold side) - - out1, out2 (index 1: hot side, index 2: cold side) + Fluid inlets: in1, in2 - Image + Fluid outlets: out1, out2 - .. image:: /api/_images/HeatExchanger.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/HeatExchanger_darkmode.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-dark + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - hot side to cold side heat transfer equation: :py:meth:`energy_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp1 : float, dict + Hot side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp2 : float, dict + Cold side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + kA : float, dict + Heat transfer coefficient considering terminal temperature differences. + Quantity: :code:`heat_transfer_coefficient`. + Equation: :py:meth:`kA_func `. - printout : boolean - Include this component in the network's results printout. + kA_char : GroupedComponentCharacteristics + Equation for heat transfer based on kA and modification factor. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`kA_char_func `. - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. + kA_char1 : tespy.tools.characteristics.CharLine, dict + Hot side kA modification lookup table for offdesign. + + kA_char2 : tespy.tools.characteristics.CharLine, dict + Cold side kA modification lookup table for offdesign. + + label : str + The label of the component. + + local_design : bool + Treat this component in design mode in an offdesign calculation. + + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). pr1 : float, dict - Outlet to inlet pressure ratio at hot side, :math:`pr/1`. + Hot side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. pr2 : float, dict - Outlet to inlet pressure ratio at cold side, :math:`pr/1`. + Cold side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp1 : float, dict, - Inlet to outlet pressure delta at hot side, :math:`dp/\text{Pa}` - - dp2 : float, dict - Inlet to outlet pressure delta at cold side, :math:`dp\text{Pa}`. + printout : bool + Include this component in the network's results printout. - zeta1 : float, dict - Geometry independent friction coefficient at hot side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + Q : float, dict + Heat transfer from hot side. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_hot_func `. - zeta2 : float, dict - Geometry independent friction coefficient at cold side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + td_log : float, dict + Logarithmic temperature difference. Quantity: + :code:`temperature_difference`. ttd_l : float, dict - Initial terminal temperature difference, referring to the temperature - difference between the two inlets of the heat exchanger, - :math:`ttd_\text{l}/\text{K}`. + Terminal temperature difference at hot side outlet to cold side inlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_l_func `. ttd_u : float, dict - Final terminal temperature difference, referring to the temperature - difference between the two outlets of the heat exchanger, - :math:`ttd_\text{u}/\text{K}`. + Terminal temperature difference at hot side inlet to cold side outlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_u_func `. - kA : float, dict - Area independent heat transfer coefficient, - :math:`kA/\frac{\text{W}}{\text{K}}`. + zeta1 : float, dict + Hot side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - kA_char : dict - Area independent heat transfer coefficient characteristic. + zeta2 : float, dict + Cold side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - kA_char1 : tespy.tools.characteristics.CharLine, dict - Characteristic line for hot side heat transfer coefficient. + Notes + ----- - kA_char2 : tespy.tools.characteristics.CharLine, dict - Characteristic line for cold side heat transfer coefficient. - - Note - ---- - The :code:`ParallelFlowHeatExchanger` implements parallel flow of both - streams, meaning the streams enter with a high temperature difference and - then gradually reduce their temperature difference to each other. The - initial temperature difference is the maximum temperature difference, the - final temperature difference is the minimum temperature difference. + .. note:: + + The :code:`ParallelFlowHeatExchanger` implements parallel flow of both + streams, meaning the streams enter with a high temperature difference and + then gradually reduce their temperature difference to each other. The + initial temperature difference is the maximum temperature difference, the + final temperature difference is the minimum temperature difference. Example ------- diff --git a/src/tespy/components/heat_exchangers/sectioned.py b/src/tespy/components/heat_exchangers/sectioned.py index 1a56f826a..2251dc65a 100644 --- a/src/tespy/components/heat_exchangers/sectioned.py +++ b/src/tespy/components/heat_exchangers/sectioned.py @@ -36,158 +36,189 @@ class SectionedHeatExchanger(HeatExchanger): transfer. The number of section can be adjusted by the user. It is based on the model implemented by :cite:`Quoilin2020`. - **Mandatory Equations** + .. image:: /api/_images/components/HeatExchanger.svg + :alt: flowsheet of the sectionedheatexchanger + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_func` + .. image:: /api/_images/components/HeatExchanger_darkmode.svg + :alt: flowsheet of the sectionedheatexchanger + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.energy_balance_hot_func` - - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.UA_func` - - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.td_pinch_func` - - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.UA_cecchinato_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_u_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_l_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.ttd_min_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_cold_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_hot_func` - - :py:meth:`tespy.components.heat_exchangers.base.HeatExchanger.eff_max_func` + Fluid inlets: in1, in2 - For hot and cold side individually: + Fluid outlets: out1, out2 - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` + Mandatory Equations + ------------------- - Inlets/Outlets + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - hot side to cold side heat transfer equation: :py:meth:`energy_balance_func ` - - in1, in2 (index 1: hot side, index 2: cold side) - - out1, out2 (index 1: hot side, index 2: cold side) + Parameters + ---------- - Image + alpha_ratio : float, dict + Secondary to refrigerant side convective heat transfer coefficient + ratio. Quantity: :code:`ratio`. - .. image:: /api/_images/HeatExchanger.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-light + area_ratio : float, dict + Secondary to refrigerant side heat transfer area ratio. Quantity: + :code:`ratio`. - .. image:: /api/_images/HeatExchanger_darkmode.svg - :alt: flowsheet of the heat exchanger - :align: center - :class: only-dark - - Parameters - ---------- - label : str - The label of the component. + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp1 : float, dict + Hot side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp2 : float, dict + Cold side inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eff_cold : float, dict + Heat exchanger effectiveness for cold side. Quantity: + :code:`efficiency`. + Equation: :py:meth:`eff_cold_func `. - printout : boolean - Include this component in the network's results printout. + eff_hot : float, dict + Heat exchanger effectiveness for hot side. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_hot_func `. - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. + eff_max : float, dict + Maximum heat exchanger effectiveness. Quantity: :code:`efficiency`. + Equation: :py:meth:`eff_max_func `. + + kA : float, dict + Heat transfer coefficient considering terminal temperature differences. + Quantity: :code:`heat_transfer_coefficient`. + Equation: :py:meth:`kA_func `. + + kA_char : GroupedComponentCharacteristics + Equation for heat transfer based on kA and modification factor. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`kA_char_func `. - pr1 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at hot side, :math:`pr/1`. + kA_char1 : tespy.tools.characteristics.CharLine, dict + Hot side kA modification lookup table for offdesign. - pr2 : float, dict, :code:`"var"` - Outlet to inlet pressure ratio at cold side, :math:`pr/1`. + kA_char2 : tespy.tools.characteristics.CharLine, dict + Cold side kA modification lookup table for offdesign. - dp1 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at hot side, unit is the network's - pressure unit!. + label : str + The label of the component. - dp2 : float, dict, :code:`"var"` - Inlet to outlet pressure delta at cold side, unit is the network's - pressure unit!. + local_design : bool + Treat this component in design mode in an offdesign calculation. - zeta1 : float, dict, :code:`"var"` - Geometry independent friction coefficient at hot side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - zeta2 : float, dict, :code:`"var"` - Geometry independent friction coefficient at cold side, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + num_sections : int + Number of sections of the heat exchanger. - ttd_l : float, dict - Lower terminal temperature difference :math:`ttd_\text{l}/\text{K}`. + offdesign : list + List containing offdesign parameters (stated as String). - ttd_u : float, dict - Upper terminal temperature difference :math:`ttd_\text{u}/\text{K}`. + pr1 : float, dict + Hot side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - ttd_min : float, dict - Minimum terminal temperature difference :math:`ttd_\text{min}/\text{K}`. + pr2 : float, dict + Cold side outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eff_cold : float, dict - Cold side heat exchanger effectiveness :math:`eff_\text{cold}/\text{1}`. + printout : bool + Include this component in the network's results printout. - eff_hot : float, dict - Hot side heat exchanger effectiveness :math:`eff_\text{hot}/\text{1}`. + Q : float, dict + Heat transfer from hot side. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_hot_func `. - eff_max : float, dict - Max value of hot and cold side heat exchanger effectiveness values - :math:`eff_\text{max}/\text{1}`. + re_exp_r : float, dict + Reynolds exponent for UA modification based on refrigerant side mass + flow. - UA : float, dict - Sum of UA in all sections of the heat exchanger. + re_exp_sf : float, dict + Reynolds exponent for UA modification based on secondary fluid side mass + flow. + + refrigerant_index : int + Side on which the refrigerant is flowing (0: hot, 1:cold). + + td_log : float, dict + Logarithmic temperature difference. Quantity: + :code:`temperature_difference`. td_pinch : float, dict - Value of the lowest delta T between hot side and cold side at the - different sections. + Equation for minimum pinch. Quantity: :code:`temperature_difference`. + Equation: :py:meth:`td_pinch_func `. - num_sections : int - Number of sections. + ttd_l : float, dict + Terminal temperature difference at hot side outlet to cold side inlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_l_func `. + + ttd_min : float, dict + Minimum terminal temperature difference. Quantity: + :code:`temperature_difference`. + Equation: :py:meth:`ttd_min_func `. - UA_cecchinato : dict - Group specification for partload UA modification according to - :cite:`cecchinato2010`, for usage see details in the - :py:meth:`tespy.components.heat_exchangers.sectioned.SectionedHeatExchanger.UA_cecchinato_func`. - This method can only be used in offdesign simulations! + ttd_u : float, dict + Terminal temperature difference at hot side inlet to cold side outlet. + Quantity: :code:`temperature_difference`. + Equation: :py:meth:`ttd_u_func `. + + UA : float, dict + Sum of UA values of all sections of heat exchanger. Quantity: + :code:`heat_transfer_coefficient`. + Equation: :py:meth:`UA_func `. + + UA_cecchinato : GroupedComponentProperties + Equation for UA modification in offdesign. Elements: :code:`re_exp_r`, + :code:`re_exp_sf`, :code:`alpha_ratio`, :code:`area_ratio`. + Equation: :py:meth:`UA_cecchinato_func `. - alpha_ration: float - Secondary fluid to refrigerant heat transfer coefficient ratio. + UA_char : GroupedComponentCharacteristics + Equation for sectioned UA modification based on characteristic lines. + Elements: :code:`kA_char1`, :code:`kA_char2`. + Equation: :py:meth:`UA_char_func `. - area_ration: float - Secondary fluid to refrigerant heat transfer area ratio. + zeta1 : float, dict + Hot side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - re_exp_r: float - Reynolds exponent for refrigerant side. + zeta2 : float, dict + Cold side non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - re_exp_sf: float - Reynolds exponent for secondary fluid side. + Notes + ----- - refrigerant_index: int - Connection index for the refrigerant side, 0 if refrigerant is on hot - side, 1 if refrigerant is on cold side. + .. note:: - Note - ---- - The equations only apply to counter-current heat exchangers. + The equations only apply to counter-current heat exchangers. Example ------- Water vapor should be cooled down, condensed and then further subcooled. - For his air is heated up from 15 °C to 25 °C. + For this, air is heated up from 15 °C to 25 °C. >>> from tespy.components import Source, Sink, SectionedHeatExchanger >>> from tespy.connections import Connection @@ -318,12 +349,12 @@ class SectionedHeatExchanger(HeatExchanger): >>> round(cd.td_pinch.val, 2) 4.3 - Example - ------- - A transcritical gas cooler designed to cool CO2 from 160°C to approximately 50°C - while water is heated from 10°C to 60°C. The heat exchanger uses characteristic - lines (`kA_char1` and `kA_char2`) to scale the heat transfer coefficient in - offdesign operation as mass flow varies. + **Second Example** + + A transcritical gas cooler designed to cool CO2 from 160°C to approximately + 50°C while water is heated from 10°C to 60°C. The heat exchanger uses + characteristic lines (`kA_char1` and `kA_char2`) to scale the heat transfer + coefficient in offdesign operation as mass flow varies. This two-stage approach improves convergence: @@ -474,7 +505,7 @@ def get_parameters(self): params = super().get_parameters() params.update({ 'num_sections': dc_simple( - val=50, + val=50, dtype="int", description="number of sections of the heat exchanger" ), 'UA': dc_cp( @@ -492,7 +523,7 @@ def get_parameters(self): description="equation for sectioned UA modification based on characteristic lines" ), 'refrigerant_index': dc_simple( - val=0, + val=0, dtype="int", description="side on which the refrigerant is flowing (0: hot, 1:cold)" ), 're_exp_r': dc_cp( diff --git a/src/tespy/components/heat_exchangers/simple.py b/src/tespy/components/heat_exchangers/simple.py index 928bdd42d..4c30a58ef 100644 --- a/src/tespy/components/heat_exchangers/simple.py +++ b/src/tespy/components/heat_exchangers/simple.py @@ -42,108 +42,127 @@ class SimpleHeatExchanger(Component): - :py:class:`tespy.components.heat_exchangers.parabolic_trough.ParabolicTrough` - :py:class:`tespy.components.piping.pipe.Pipe` - **Mandatory Equations** + Ports + ----- - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + Fluid inlets: in1 - **Optional Equations** + Fluid outlets: out1 - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.energy_balance_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.darcy_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.hazen_williams_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.kA_group_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.kA_char_group_func` + Power inlets: heat - Inlets/Outlets + Power outlets: heat - - in1 - - out1 + Heat inlets: heat - Image + Heat outlets: heat - .. image:: /api/_images/Pipe.svg - :alt: flowsheet of the simple heat exchanger - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/Pipe_darkmode.svg - :alt: flowsheet of the simple heat exchanger - :align: center - :class: only-dark + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + + When a power or heat connector is attached: + + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + D : float, dict, :code:`"var"` + Diameter of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. + + darcy_group : GroupedComponentProperties + Darcy-Weißbach equation for pressure loss. Elements: :code:`L`, + :code:`ks`, :code:`D`. + Equation: :py:meth:`darcy_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dissipative : bool - local_design : boolean - Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - printout : boolean - Include this component in the network's results printout. + hw_group : GroupedComponentProperties + Hazen-Williams equation for pressure loss. Elements: :code:`L`, + :code:`ks_HW`, :code:`D`. + Equation: :py:meth:`hazen_williams_func `. - Q : float, dict, :code:`"var"` - Heat transfer, :math:`Q/\text{W}`. + kA : float, dict, :code:`"var"` + Heat transfer coefficient considering ambient temperature. Quantity: + :code:`heat_transfer_coefficient`. Can be set as a system variable by + passing :code:`"var"` as its value. - pr : float, dict, :code:`"var"` - Outlet to inlet pressure ratio, :math:`pr/1`. + kA_char : tespy.tools.characteristics.CharLine, dict + Heat transfer coefficient lookup table for offdesign. - zeta : float, dict, :code:`"var"` - Geometry independent friction coefficient, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + kA_char_group : GroupedComponentProperties + Heat transfer from design heat transfer coefficient, modifier lookup + table and ambient temperature. Elements: :code:`kA_char`, :code:`Tamb`. + Equation: :py:meth:`kA_char_group_func `. - D : float, dict, :code:`"var"` - Diameter of the pipes, :math:`D/\text{m}`. + kA_group : GroupedComponentProperties + Equation for heat transfer based on ambient temperature and heat + transfer coefficient. Elements: :code:`kA`, :code:`Tamb`. + Equation: :py:meth:`kA_group_func `. + + ks : float, dict, :code:`"var"` + Roughness of wall material. Quantity: :code:`length`. Can be set as a + system variable by passing :code:`"var"` as its value. + + ks_HW : float, dict, :code:`"var"` + Hazen-Williams roughness. Can be set as a system variable by passing + :code:`"var"` as its value. L : float, dict, :code:`"var"` - Length of the pipes, :math:`L/\text{m}`. + Length of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. - ks : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{m}`. + label : str + The label of the component. - darcy_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using darcy weissbach equation. + local_design : bool + Treat this component in design mode in an offdesign calculation. - ks_HW : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{1}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - hw_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using hazen williams equation. + offdesign : list + List containing offdesign parameters (stated as String). - kA : float, dict, :code:`"var"` - Area independent heat transfer coefficient, - :math:`kA/\frac{\text{W}}{\text{K}}`. + power_connector_location : str - kA_char : tespy.tools.characteristics.CharLine, dict - Characteristic line for heat transfer coefficient. + + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. + + printout : bool + Include this component in the network's results printout. + + Q : float, dict + Heat transfer. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_func `. Tamb : float, dict - Ambient temperature, provide parameter in network's temperature unit. + Ambient temperature. Quantity: :code:`temperature`. - kA_group : str, dict - Parametergroup for heat transfer calculation from ambient temperature - and area independent heat transfer coefficient kA. + zeta : float, dict + Non-dimensional friction coefficient for pressure loss calculation. + Equation: :py:meth:`zeta_func `. Example ------- @@ -258,7 +277,7 @@ def _calc_kA(self): def get_parameters(self): return { - 'power_connector_location': dc_simple(), + 'power_connector_location': dc_simple(dtype="str"), 'Q': dc_cp( num_eq_sets=1, func=self.energy_balance_func, @@ -294,27 +313,27 @@ def get_parameters(self): 'D': dc_cp( min_val=1e-2, max_val=2, d=1e-5, quantity="length", description="diameter of channel", - _potential_var=True + _allows_var=True ), 'L': dc_cp( min_val=1e-1, quantity="length", description="length of channel", - _potential_var=True + _allows_var=True ), 'ks': dc_cp( _val=1e-4, min_val=1e-7, max_val=1e-3, quantity="length", description="roughness of wall material", - _potential_var=True + _allows_var=True ), 'ks_HW': dc_cp( _val=10, min_val=1e-1, max_val=1e3, description="Hazen-Williams roughness", - _potential_var=True + _allows_var=True ), 'kA': dc_cp( min_val=0, quantity="heat_transfer_coefficient", description="heat transfer coefficient considering ambient temperature", - _potential_var=True, + _allows_var=True, calc=self._calc_kA, calc_deps=['Q'] ), 'kA_char': dc_cc( @@ -325,7 +344,7 @@ def get_parameters(self): quantity="temperature", description="ambient temperature" ), - 'dissipative': dc_simple(_val=None), + 'dissipative': dc_simple(_val=None, dtype="bool"), 'darcy_group': dc_gcp( elements=['L', 'ks', 'D'], num_eq_sets=1, func=self.darcy_func, diff --git a/src/tespy/components/heat_exchangers/solar_collector.py b/src/tespy/components/heat_exchangers/solar_collector.py index ebeedfa03..57f4b46a9 100644 --- a/src/tespy/components/heat_exchangers/solar_collector.py +++ b/src/tespy/components/heat_exchangers/solar_collector.py @@ -22,118 +22,145 @@ class SolarCollector(SimpleHeatExchanger): r""" The solar collector calculates heat output from irradiance. - **Mandatory Equations** + .. image:: /api/_images/components/SolarCollector.svg + :alt: flowsheet of the solarcollector + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/SolarCollector_darkmode.svg + :alt: flowsheet of the solarcollector + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.energy_balance_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.darcy_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.hazen_williams_func` - - :py:meth:`tespy.components.heat_exchangers.solar_collector.SolarCollector.energy_group_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power inlets: heat - Image + Power outlets: heat - .. image:: /api/_images/SolarCollector.svg - :alt: flowsheet of the solar collector - :align: center - :class: only-light + Heat inlets: heat - .. image:: /api/_images/SolarCollector_darkmode.svg - :alt: flowsheet of the solar collector - :align: center - :class: only-dark + Heat outlets: heat + + Mandatory Equations + ------------------- + + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + + When a power or heat connector is attached: + + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + A : float, dict, :code:`"var"` + Area of the solar collector. Quantity: :code:`area`. Can be set as a + system variable by passing :code:`"var"` as its value. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + D : float, dict, :code:`"var"` + Diameter of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. + + darcy_group : GroupedComponentProperties + Darcy-Weißbach equation for pressure loss. Elements: :code:`L`, + :code:`ks`, :code:`D`. + Equation: :py:meth:`darcy_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dissipative : bool - local_design : boolean - Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - printout : boolean - Include this component in the network's results printout. + E : float, dict, :code:`"var"` + Solar irradiation to the solar collector. Quantity: :code:`heat`. Can be + set as a system variable by passing :code:`"var"` as its value. - Q : float, dict, :code:`"var"` - Heat transfer, :math:`Q/\text{W}`. + energy_group : GroupedComponentProperties + Energy balance equation of the solar collector. Elements: :code:`E`, + :code:`eta_opt`, :code:`lkf_lin`, :code:`lkf_quad`, :code:`A`, + :code:`Tamb`. + Equation: :py:meth:`energy_group_func `. - pr : float, dict, :code:`"var"` - Outlet to inlet pressure ratio, :math:`pr/1`. + eta_opt : float, dict + Optical efficiency. Quantity: :code:`efficiency`. - zeta : float, dict, :code:`"var"` - Geometry independent friction coefficient, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + hw_group : GroupedComponentProperties + Hazen-Williams equation for pressure loss. Elements: :code:`L`, + :code:`ks_HW`, :code:`D`. + Equation: :py:meth:`hazen_williams_func `. - D : float, dict, :code:`"var"` - Diameter of the pipes, :math:`D/\text{m}`. + ks : float, dict, :code:`"var"` + Roughness of wall material. Quantity: :code:`length`. Can be set as a + system variable by passing :code:`"var"` as its value. + + ks_HW : float, dict, :code:`"var"` + Hazen-Williams roughness. Can be set as a system variable by passing + :code:`"var"` as its value. L : float, dict, :code:`"var"` - Length of the pipes, :math:`L/\text{m}`. + Length of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. - ks : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{m}`. + label : str + The label of the component. - darcy_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using darcy weissbach equation. + lkf_lin : float, dict + Linear heat loss factor. - ks_HW : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{1}`. + lkf_quad : float, dict + Quadratic heat loss factor. - hw_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using hazen williams equation. + local_design : bool + Treat this component in design mode in an offdesign calculation. - E : float, dict, :code:`"var"` - irradiance at tilted collector surface area, - :math:`E/\frac{\text{W}}{\text{m}^2}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - eta_opt : float, dict, :code:`"var"` - optical loss at surface cover, - :math:`\eta_{opt}`. + offdesign : list + List containing offdesign parameters (stated as String). - lkf_lin : float, dict, :code:`"var"` - Linear thermal loss key figure, - :math:`\alpha_1/\frac{\text{W}}{\text{K} \cdot \text{m}^2}`. + power_connector_location : str - lkf_quad : float, dict, :code:`"var"` - Quadratic thermal loss key figure, - :math:`\alpha_2/\frac{\text{W}}{\text{K}^2 \cdot \text{m}^2}`. - A : float, dict, :code:`"var"` - Collector surface area :math:`A/\text{m}^2`. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. + + printout : bool + Include this component in the network's results printout. + + Q : float, dict + Heat transfer. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_func `. + + Q_loss : float, dict + Heat dissipation. Quantity: :code:`heat`. Tamb : float, dict - Ambient temperature, provide parameter in network's temperature unit. + Ambient air temperature. Quantity: :code:`temperature`. - energy_group : str, dict - Parametergroup for energy balance of solarthermal collector. + zeta : float, dict + Non-dimensional friction coefficient for pressure loss calculation. + Equation: :py:meth:`zeta_func `. Example ------- @@ -188,11 +215,11 @@ def get_parameters(self): data.update({ 'E': dc_cp( - min_val=0, quantity="heat", _potential_var=True, + min_val=0, quantity="heat", _allows_var=True, description="solar irradiation to the solar collector" ), 'A': dc_cp( - min_val=0, quantity="area", _potential_var=True, + min_val=0, quantity="area", _allows_var=True, description="area of the solar collector" ), 'eta_opt': dc_cp( diff --git a/src/tespy/components/nodes/base.py b/src/tespy/components/nodes/base.py index 264cfcb8c..0d8430f2b 100644 --- a/src/tespy/components/nodes/base.py +++ b/src/tespy/components/nodes/base.py @@ -16,7 +16,42 @@ @component_registry class NodeBase(Component): - """Class NodeBase is parent class for all components of submodule nodes.""" + """ + Class NodeBase is parent class for all components of submodule nodes. + + Mandatory Equations + ------------------- + + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + + Parameters + ---------- + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + design : list + List containing design parameters (stated as String). + + design_path : str + Path to the components design case. + + label : str + The label of the component. + + local_design : bool + Treat this component in design mode in an offdesign calculation. + + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool + Include this component in the network's results printout. + """ @staticmethod def get_bypass_constraints(): diff --git a/src/tespy/components/nodes/droplet_separator.py b/src/tespy/components/nodes/droplet_separator.py index 9aed82804..3efec237e 100644 --- a/src/tespy/components/nodes/droplet_separator.py +++ b/src/tespy/components/nodes/droplet_separator.py @@ -26,56 +26,58 @@ class DropletSeparator(NodeBase): This component is the parent component of the Drum. - **Mandatory Equations** + .. image:: /api/_images/components/DropletSeparator.svg + :alt: flowsheet of the dropletseparator + :align: center + :class: only-light - - :py:meth:`tespy.components.nodes.base.NodeBase.mass_flow_func` - - :py:meth:`tespy.components.nodes.base.NodeBase.pressure_structure_matrix` - - :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.fluid_structure_matrix` - - :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.energy_balance_func` - - saturated liquid: :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.saturated_outlet_func` - - saturated gas: :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.saturated_outlet_func` + .. image:: /api/_images/components/DropletSeparator_darkmode.svg + :alt: flowsheet of the dropletseparator + :align: center + :class: only-dark - Inlets/Outlets + Ports + ----- - - in1 - - out1, out2 (index 1: saturated liquid, index 2: saturated gas) + Fluid inlets: in1 - Image + Fluid outlets: out1, out2 - .. image:: /api/_images/DropletSeparator.svg - :alt: flowsheet of the droplet separator - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/DropletSeparator_darkmode.svg - :alt: flowsheet of the droplet separator - :align: center - :class: only-dark + - mass balance constraint: :py:meth:`mass_flow_func ` + - energy balance constraint: :py:meth:`energy_balance_func ` + - pressure equality constraints: :py:meth:`pressure_structure_matrix ` + - outlet 0 is saturated liquid constraint: :py:meth:`saturated_outlet_func ` + - outlet 1 is saturated gas constraint: :py:meth:`saturated_outlet_func ` + - fluid equality constraints: :py:meth:`fluid_structure_matrix ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/nodes/drum.py b/src/tespy/components/nodes/drum.py index ba8305320..cc44dd57c 100644 --- a/src/tespy/components/nodes/drum.py +++ b/src/tespy/components/nodes/drum.py @@ -23,67 +23,72 @@ class Drum(DropletSeparator): r""" A drum separates saturated gas from saturated liquid. - **Mandatory Equations** - - - :py:meth:`tespy.components.nodes.base.NodeBase.mass_flow_func` - - :py:meth:`tespy.components.nodes.base.NodeBase.pressure_structure_matrix` - - :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.fluid_structure_matrix` - - :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.energy_balance_func` - - saturated liquid: :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.saturated_outlet_func` - - saturated gas: :py:meth:`tespy.components.nodes.droplet_separator.DropletSeparator.saturated_outlet_func` - - Inlets/Outlets - - - in1, in2 (index 1: from economiser, index 2: from evaporator) - - out1, out2 (index 1: saturated liquid, index 2: saturated gas) - - Image - - .. image:: /api/_images/Drum.svg + .. image:: /api/_images/components/Drum.svg :alt: flowsheet of the drum :align: center :class: only-light - .. image:: /api/_images/Drum_darkmode.svg + .. image:: /api/_images/components/Drum_darkmode.svg :alt: flowsheet of the drum :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1, in2 + + Fluid outlets: out1, out2 + + Mandatory Equations + ------------------- + + - mass balance constraint: :py:meth:`mass_flow_func ` + - energy balance constraint: :py:meth:`energy_balance_func ` + - pressure equality constraints: :py:meth:`pressure_structure_matrix ` + - outlet 0 is saturated liquid constraint: :py:meth:`saturated_outlet_func ` + - outlet 1 is saturated gas constraint: :py:meth:`saturated_outlet_func ` + - fluid equality constraints: :py:meth:`fluid_structure_matrix ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. - Note - ---- - If you are using a drum in a network with multiple fluids, it is likely - the fluid propagation causes trouble. If this is the case, try to - specify the fluid composition at another connection of your network. + Notes + ----- + + .. note:: + + If you are using a drum in a network with multiple fluids, it is likely + the fluid propagation causes trouble. If this is the case, try to + specify the fluid composition at another connection of your network. - This component assumes, that the fluid composition between outlet 1 and - inlet 2 does not change, thus there is no equation for the fluid mass - fraction at the inlet 2! + This component assumes, that the fluid composition between outlet 1 and + inlet 2 does not change, thus there is no equation for the fluid mass + fraction at the inlet 2! Example ------- @@ -111,7 +116,7 @@ class Drum(DropletSeparator): >>> s = Sink('steam') >>> dr = Drum('drum') >>> ev = HeatExchanger('evaporator') - >>> erp = Pump('evaporator reciculation pump') + >>> erp = Pump('evaporator recirculation pump') >>> f_dr = Connection(fa, 'out1', dr, 'in1') >>> dr_erp = Connection(dr, 'out1', erp, 'in1') >>> erp_ev = Connection(erp, 'out1', ev, 'in2') diff --git a/src/tespy/components/nodes/merge.py b/src/tespy/components/nodes/merge.py index e82a7ac92..ebb35e18d 100644 --- a/src/tespy/components/nodes/merge.py +++ b/src/tespy/components/nodes/merge.py @@ -24,58 +24,60 @@ class Merge(NodeBase): r""" Class for merge points with multiple inflows and one outflow. - **Mandatory Equations** - - - :py:meth:`tespy.components.nodes.base.NodeBase.mass_flow_func` - - :py:meth:`tespy.components.nodes.base.NodeBase.pressure_structure_matrix` - - :py:meth:`tespy.components.nodes.merge.Merge.fluid_func` - - :py:meth:`tespy.components.nodes.merge.Merge.energy_balance_func` - - Inlets/Outlets - - - specify number of inlets with :code:`num_in` (default value: 2) - - out1 - - Image - - .. image:: /api/_images/Merge.svg + .. image:: /api/_images/components/Merge.svg :alt: flowsheet of the merge :align: center :class: only-light - .. image:: /api/_images/Merge_darkmode.svg + .. image:: /api/_images/components/Merge_darkmode.svg :alt: flowsheet of the merge :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1, in2, ... (variable, count set by :code:`num_in`) + + Fluid outlets: out1 + + Mandatory Equations + ------------------- + + - mass balance constraint: :py:meth:`mass_flow_func ` + - fluid mass fraction balance constraints: :py:meth:`fluid_func ` + - energy balance constraint: :py:meth:`energy_balance_func ` + - pressure equality constraints: :py:meth:`pressure_structure_matrix ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + num_in : int + Number of inlets. - num_in : float, dict - Number of inlets for this component, default value: 2. + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool + Include this component in the network's results printout. Example ------- @@ -166,7 +168,18 @@ class Merge(NodeBase): @staticmethod def get_parameters(): - return {'num_in': dc_simple(description="number of inlets")} + return {'num_in': dc_simple(dtype="int", description="number of inlets")} + + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "variable", "parameter": "num_in", "pattern": "in{n}", "min": 2}, + "outlets": {"type": "fixed", "ports": ["out1"]}, + "powerinlets": {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } def _update_num_eq(self): self.variable_fluids = set( diff --git a/src/tespy/components/nodes/node.py b/src/tespy/components/nodes/node.py index b39044cfa..c34ba0e1c 100644 --- a/src/tespy/components/nodes/node.py +++ b/src/tespy/components/nodes/node.py @@ -23,63 +23,65 @@ class Node(Splitter, Merge): Class for combined merge and splitting points with multiple inflows and outflows. - **Mandatory Equations** - - - :py:meth:`tespy.components.nodes.base.NodeBase.mass_flow_func` - - :py:meth:`tespy.components.nodes.base.NodeBase.pressure_structure_matrix` - - :py:meth:`tespy.components.nodes.node.Node.enthalpy_structure_matrix` - - :py:meth:`tespy.components.nodes.node.Node.fluid_structure_matrix` - - :py:meth:`tespy.components.nodes.merge.Merge.fluid_func` - - :py:meth:`tespy.components.nodes.merge.Merge.energy_balance_func` - - Inlets/Outlets - - - specify number of inlets with :code:`num_in` (default value: 2) - - specify number of outlets with :code:`num_in` (default value: 2) - - Image - - .. image:: /api/_images/Node.svg + .. image:: /api/_images/components/Node.svg :alt: flowsheet of the node :align: center :class: only-light - .. image:: /api/_images/Node_darkmode.svg + .. image:: /api/_images/components/Node_darkmode.svg :alt: flowsheet of the node :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1, in2, ... (variable, count set by :code:`num_in`) + + Fluid outlets: out1, out2, ... (variable, count set by :code:`num_out`) + + Mandatory Equations + ------------------- + + - mass balance constraint: :py:meth:`mass_flow_func ` + - pressure equality constraints: :py:meth:`pressure_structure_matrix ` + - equal enthalpy at all outlets constraint(s): :py:meth:`enthalpy_structure_matrix ` + - equal fluid at all outlets constraint(s): :py:meth:`fluid_structure_matrix ` + - fluid mass fraction constraints: :py:meth:`fluid_func ` + - energy balance constraint: :py:meth:`energy_balance_func ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + num_in : int + Number of inlets. - num_in : float - Number of inlets for this component, default value: 2. + num_out : int + Number of outlets. - num_out : float - Number of outlets for this component, default value: 2. + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool + Include this component in the network's results printout. Example ------- @@ -131,8 +133,19 @@ class Node(Splitter, Merge): @staticmethod def get_parameters(): return { - 'num_out': dc_simple(description="number of outlets"), - 'num_in': dc_simple(description="number of inlets") + 'num_out': dc_simple(dtype="int", description="number of outlets"), + 'num_in': dc_simple(dtype="int", description="number of inlets") + } + + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "variable", "parameter": "num_in", "pattern": "in{n}", "min": 2}, + "outlets": {"type": "variable", "parameter": "num_out", "pattern": "out{n}", "min": 2}, + "powerinlets": {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, } def get_mandatory_constraints(self): diff --git a/src/tespy/components/nodes/separator.py b/src/tespy/components/nodes/separator.py index 6a91873dd..04082d8fe 100644 --- a/src/tespy/components/nodes/separator.py +++ b/src/tespy/components/nodes/separator.py @@ -23,63 +23,58 @@ class Separator(NodeBase): r""" A separator separates fluid components from a mass flow. - **Mandatory Equations** + Ports + ----- - - :py:meth:`tespy.components.nodes.base.NodeBase.mass_flow_func` - - :py:meth:`tespy.components.nodes.base.NodeBase.pressure_structure_matrix` - - :py:meth:`tespy.components.nodes.separator.Separator.fluid_func` - - :py:meth:`tespy.components.nodes.separator.Separator.energy_balance_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1, out2, ... (variable, count set by :code:`num_out`) - - in1 - - specify number of outlets with :code:`num_out` (default value: 2) + Mandatory Equations + ------------------- - Image - - .. image:: /api/_images/Splitter.svg - :alt: flowsheet of the splitter - :align: center - :class: only-light - - .. image:: /api/_images/Splitter_darkmode.svg - :alt: flowsheet of the splitter - :align: center - :class: only-dark - - Note - ---- - Fluid separation requires power and cooling, equations have not been - implemented, yet! + - mass balance constraint: :py:meth:`mass_flow_func ` + - fluid mass fraction balance constraints: :py:meth:`fluid_func ` + - equal temperature at all outlets constraints: :py:meth:`energy_balance_func ` + - pressure equality constraints: :py:meth:`pressure_structure_matrix ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + num_out : int + Number of outlets. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. - num_out : float, dict - Number of outlets for this component, default value: 2. + Notes + ----- + + .. note:: + + Fluid separation requires power and cooling, equations have not been + implemented, yet! Example ------- @@ -134,7 +129,18 @@ class Separator(NodeBase): @staticmethod def get_parameters(): - return {'num_out': dc_simple(description="number of outlets")} + return {'num_out': dc_simple(dtype="int", description="number of outlets")} + + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "fixed", "ports": ["in1"]}, + "outlets": {"type": "variable", "parameter": "num_out", "pattern": "out{n}", "min": 2}, + "powerinlets": {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } def _update_num_eq(self): self.variable_fluids = set( diff --git a/src/tespy/components/nodes/splitter.py b/src/tespy/components/nodes/splitter.py index b1d5e7dfd..07c8a2e24 100644 --- a/src/tespy/components/nodes/splitter.py +++ b/src/tespy/components/nodes/splitter.py @@ -21,58 +21,60 @@ class Splitter(NodeBase): r""" Split up a mass flow in parts of identical enthalpy and fluid composition. - **Mandatory Equations** - - - :py:meth:`tespy.components.nodes.base.NodeBase.mass_flow_func` - - :py:meth:`tespy.components.nodes.base.NodeBase.pressure_structure_matrix` - - :py:meth:`tespy.components.nodes.splitter.Splitter.enthalpy_structure_matrix` - - :py:meth:`tespy.components.nodes.splitter.Splitter.fluid_structure_matrix` - - Inlets/Outlets - - - in1 - - specify number of outlets with :code:`num_out` (default value: 2) - - Image - - .. image:: /api/_images/Splitter.svg + .. image:: /api/_images/components/Splitter.svg :alt: flowsheet of the splitter :align: center :class: only-light - .. image:: /api/_images/Splitter_darkmode.svg + .. image:: /api/_images/components/Splitter_darkmode.svg :alt: flowsheet of the splitter :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1 + + Fluid outlets: out1, out2, ... (variable, count set by :code:`num_out`) + + Mandatory Equations + ------------------- + + - mass balance constraint: :py:meth:`mass_flow_func ` + - equal enthalpy at all outlets constraint: :py:meth:`enthalpy_structure_matrix ` + - pressure equality constraints: :py:meth:`pressure_structure_matrix ` + - fluid equality constraints: :py:meth:`fluid_structure_matrix ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + num_out : int + Number of outlets. - num_out : float, dict - Number of outlets for this component, default value: 2. + offdesign : list + List containing offdesign parameters (stated as String). + + printout : bool + Include this component in the network's results printout. Example ------- @@ -118,7 +120,18 @@ class Splitter(NodeBase): @staticmethod def get_parameters(): - return {'num_out': dc_simple(description="number of outlets")} + return {'num_out': dc_simple(dtype="int", description="number of outlets")} + + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "fixed", "ports": ["in1"]}, + "outlets": {"type": "variable", "parameter": "num_out", "pattern": "out{n}", "min": 2}, + "powerinlets": {"type": "fixed", "ports": []}, + "poweroutlets": {"type": "fixed", "ports": []}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } def get_mandatory_constraints(self): return { diff --git a/src/tespy/components/piping/pipe.py b/src/tespy/components/piping/pipe.py index 7cf5d6c33..f5f2bf74a 100644 --- a/src/tespy/components/piping/pipe.py +++ b/src/tespy/components/piping/pipe.py @@ -30,144 +30,181 @@ class Pipe(SimpleHeatExchanger): a subsurface buried pipe. The implementation is based on :cite:`gnielinski1975` (surface) and :cite:`wallenten1991` (subsurface). - **Mandatory Equations** + .. image:: /api/_images/components/Pipe.svg + :alt: flowsheet of the pipe + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/Pipe_darkmode.svg + :alt: flowsheet of the pipe + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.energy_balance_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.darcy_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.hazen_williams_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.kA_group_func` - - :py:meth:`tespy.components.heat_exchangers.simple.SimpleHeatExchanger.kA_char_group_func` - - :py:meth:`tespy.components.piping.pipe.Pipe.ohc_surface_group_func` - - :py:meth:`tespy.components.piping.pipe.Pipe.ohc_subsurface_group_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power inlets: heat - Optional inlets/outlets + Power outlets: heat - - heat + Heat inlets: heat - Image + Heat outlets: heat - .. image:: /api/_images/Pipe.svg - :alt: flowsheet of the pipe - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/Pipe_darkmode.svg - :alt: flowsheet of the pipe - :align: center - :class: only-dark + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + + When a power or heat connector is attached: + + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + D : float, dict, :code:`"var"` + Diameter of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. + + darcy_group : GroupedComponentProperties + Darcy-Weißbach equation for pressure loss. Elements: :code:`L`, + :code:`ks`, :code:`D`. + Equation: :py:meth:`darcy_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dissipative : bool - local_design : boolean - Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - printout : boolean - Include this component in the network's results printout. + environment_media : str - Q : float, dict - Heat transfer, :math:`Q/\text{W}`. - pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1`. + flow_speed : float, dict + Flow speed at inlet of pipe. Quantity: :code:`speed`. - zeta : float, dict - Geometry independent friction coefficient, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + flow_speed_group : GroupedComponentProperties + Equation connecting volumetric flow, flow speed and diameter of pipe. + Elements: :code:`D`, :code:`flow_speed`. + Equation: :py:meth:`flow_speed_func `. - flow_speed : float, dict - Flow speed at the inlet of the pumpe, :math:`c/\text{m/s}` + hw_group : GroupedComponentProperties + Hazen-Williams equation for pressure loss. Elements: :code:`L`, + :code:`ks_HW`, :code:`D`. + Equation: :py:meth:`hazen_williams_func `. - D : float, dict, :code:`"var"` - Diameter of the pipes, :math:`D/\text{m}`. + insulation_tc : float, dict + Thermal conductivity of insulation. Quantity: + :code:`thermal_conductivity`. - L : float, dict, :code:`"var"` - Length of the pipes, :math:`L/\text{m}`. + insulation_thickness : float, dict + Thickness of pipe insulation. Quantity: :code:`length`. - ks : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{m}`. + kA : float, dict, :code:`"var"` + Heat transfer coefficient considering ambient temperature. Quantity: + :code:`heat_transfer_coefficient`. Can be set as a system variable by + passing :code:`"var"` as its value. + + kA_char : tespy.tools.characteristics.CharLine, dict + Heat transfer coefficient lookup table for offdesign. - darcy_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using darcy weissbach equation. + kA_char_group : GroupedComponentProperties + Heat transfer from design heat transfer coefficient, modifier lookup + table and ambient temperature. Elements: :code:`kA_char`, :code:`Tamb`. + Equation: :py:meth:`kA_char_group_func `. + + kA_group : GroupedComponentProperties + Equation for heat transfer based on ambient temperature and heat + transfer coefficient. Elements: :code:`kA`, :code:`Tamb`. + Equation: :py:meth:`kA_group_func `. + + ks : float, dict, :code:`"var"` + Roughness of wall material. Quantity: :code:`length`. Can be set as a + system variable by passing :code:`"var"` as its value. ks_HW : float, dict, :code:`"var"` - Pipe's roughness, :math:`ks/\text{1}`. + Hazen-Williams roughness. Can be set as a system variable by passing + :code:`"var"` as its value. - hw_group : str, dict - Parametergroup for pressure drop calculation based on pipes dimensions - using hazen williams equation. + L : float, dict, :code:`"var"` + Length of channel. Quantity: :code:`length`. Can be set as a system + variable by passing :code:`"var"` as its value. - kA : float, dict, :code:`"var"` - Area independent heat transfer coefficient, - :math:`kA/\frac{\text{W}}{\text{K}}`. + label : str + The label of the component. - kA_char : tespy.tools.characteristics.CharLine, dict - Characteristic line for heat transfer coefficient. + local_design : bool + Treat this component in design mode in an offdesign calculation. - Tamb : float, dict - Ambient temperature, provide parameter in network's temperature - unit, :math:`Tamb/\text{K}`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + material : str - kA_group : str, dict - Parametergroup for heat transfer calculation from ambient temperature - and area independent heat transfer coefficient kA. - insulation_thickness: float - thickness of insulation, :math:`insulation_thickness/\text{m}`. + offdesign : list + List containing offdesign parameters (stated as String). - insulation_tc: float - thermal conductivity insulation, - :math:`insulation_tc/\frac{\text{W}}{\text{m}\text{K}}`. + pipe_depth : float, dict + Depth of buried pipe. Quantity: :code:`length`. - material: str, float - material of pipe: "Steel", "Carbon Steel", "Cast Iron", - "Stainless Steel", "PVC", "CommercialCopper" or user-specified heat - conductivity of material: float + pipe_thickness : float, dict + Wall thickness of pipe. Quantity: :code:`length`. - pipe_thickness: float - thickness of pipe, :math:`pipe_thickness/\text{m}`. + power_connector_location : str - environment_media: str - environment media around the pipe: "air", "gravel", "stones", - "dry soil", "moist soil". - wind_velocity: float - Mean velocity of the wind. Needs to be greater than zero, - :math:`wind_velocity/\frac{\text{m}}{\text{s}}`. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - pipe_depth: float - pipe depth in the ground, :math:`pipe_depth/\text{m}` + printout : bool + Include this component in the network's results printout. + + Q : float, dict + Heat transfer. Quantity: :code:`heat`. + Equation: :py:meth:`energy_balance_func `. + + Q_ohc_group_subsurface : GroupedComponentProperties + Equation for heat loss of buried pipes. Elements: + :code:`insulation_thickness`, :code:`insulation_tc`, :code:`Tamb`, + :code:`material`, :code:`pipe_thickness`, :code:`environment_media`, + :code:`pipe_depth`. + Equation: :py:meth:`ohc_subsurface_group_func `. + + Q_ohc_group_surface : GroupedComponentProperties + Equation for heat loss of surface pipes. Elements: + :code:`insulation_thickness`, :code:`insulation_tc`, :code:`Tamb`, + :code:`material`, :code:`pipe_thickness`, :code:`environment_media`, + :code:`wind_velocity`. + Equation: :py:meth:`ohc_surface_group_func `. + + Tamb : float, dict + Ambient temperature. Quantity: :code:`temperature`. + + wind_velocity : float, dict + Velocity of wind at insulation surface. Quantity: :code:`speed`. + + zeta : float, dict + Non-dimensional friction coefficient for pressure loss calculation. + Equation: :py:meth:`zeta_func `. Example ------- @@ -286,12 +323,12 @@ def get_parameters(self): min_val=1e-3, max_val=1e2, quantity="thermal_conductivity", description="thermal conductivity of insulation" ) - parameters["material"]=dc_simple(val="Steel") + parameters["material"]=dc_simple(val="Steel", dtype="str") parameters["pipe_thickness"]=dc_cp( min_val=0, max_val=1, quantity="length", description="wall thickness of pipe" ) - parameters["environment_media"]=dc_simple(val="soil") + parameters["environment_media"]=dc_simple(val="soil", dtype="str") parameters["wind_velocity"]=dc_cp( min_val=1e-6, max_val=20, quantity="speed", description="velocity of wind at insulation surface" diff --git a/src/tespy/components/piping/valve.py b/src/tespy/components/piping/valve.py index b399f0673..97a3bd09f 100644 --- a/src/tespy/components/piping/valve.py +++ b/src/tespy/components/piping/valve.py @@ -28,70 +28,98 @@ class Valve(Component): r""" The Valve throttles a fluid without changing enthalpy. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - **Optional Equations** - - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` - - :py:meth:`tespy.components.piping.valve.Valve.dp_char_func` - - Inlets/Outlets - - - in1 - - out1 - - Image - - .. image:: /api/_images/Valve.svg + .. image:: /api/_images/components/Valve.svg :alt: flowsheet of the valve :align: center :class: only-light - .. image:: /api/_images/Valve_darkmode.svg + .. image:: /api/_images/components/Valve_darkmode.svg :alt: flowsheet of the valve :align: center :class: only-dark + Ports + ----- + + Fluid inlets: in1 + + Fluid outlets: out1 + + Mandatory Equations + ------------------- + + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - equation for enthalpy equality: :py:meth:`variable_equality_structure_matrix ` + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. + + dp_char : tespy.tools.characteristics.CharLine, dict + Inlet to outlet absolute pressure change as function of mass flow lookup + table. + Equation: :py:meth:`dp_char_func `. + + Kv : float, dict + Flow coefficient in m3/h. + Equation: :py:meth:`Kv_func `. + + Kv_analytical : dict + Fitting parameters and method for the analytical Kv evaluation provided + in a dictionary with keys 'method' (callable) and 'params' (list). - local_design : boolean + Kv_char : tespy.tools.characteristics.CharLine, dict + Lookup-table data for flow coefficient as function of opening. + + Kv_char_analytical_group : GroupedComponentProperties + Elements: :code:`Kv_analytical`, :code:`opening`. + Equation: :py:meth:`Kv_char_analytical_func `. + + Kv_char_group : GroupedComponentProperties + Equation for flow coefficient over opening. Elements: :code:`Kv_char`, + :code:`opening`. + Equation: :py:meth:`Kv_char_func `. + + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + offdesign : list + List containing offdesign parameters (stated as String). - pr : float, dict, :code:`"var"` - Outlet to inlet pressure ratio, :math:`pr/1` + opening : float, dict, :code:`"var"` + Opening ratio of the valve. Quantity: :code:`ratio`. Can be set as a + system variable by passing :code:`"var"` as its value. - zeta : float, dict, :code:`"var"` - Geometry independent friction coefficient, - :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp_char : tespy.tools.characteristics.CharLine, dict - Characteristic line for difference pressure to mass flow. + printout : bool + Include this component in the network's results printout. + + zeta : float, dict + Non-dimensional friction coefficient for pressure loss calculation. + Equation: :py:meth:`zeta_func `. Example ------- @@ -240,7 +268,7 @@ def get_parameters(self): 'opening': dc_cp( # opening can be more than 100 % sometimes min_val=0, max_val=1.1, - _potential_var=True, + _allows_var=True, description="opening ratio of the valve", quantity="ratio" ), @@ -252,6 +280,7 @@ def get_parameters(self): description="equation for flow coefficient over opening" ), 'Kv_analytical': dc_simple( + dtype="dict", description=( "fitting parameters and method for the analytical Kv " "evaluation provided in a dictionary with keys 'method' " diff --git a/src/tespy/components/power/bus.py b/src/tespy/components/power/bus.py index 3bde79c32..db0cde4e1 100644 --- a/src/tespy/components/power/bus.py +++ b/src/tespy/components/power/bus.py @@ -22,62 +22,60 @@ class PowerBus(_EnergyBus): For example, it can be used to model single shaft gas turbine systems or to calculate the net power generation of a rankine cycle plant - **Mandatory Equations** - - - :py:meth:`tespy.components.power.bus.PowerBus.energy_balance_func` - - Inlets/Outlets + .. image:: /api/_images/components/PowerBus.svg + :alt: flowsheet of the powerbus + :align: center + :class: only-light - - None + .. image:: /api/_images/components/PowerBus_darkmode.svg + :alt: flowsheet of the powerbus + :align: center + :class: only-dark - PowerConnection inlets/outlets + Ports + ----- - - specify number of inlets with :code:`num_in`: 'power_in1', ... - - specify number of outlets with :code:`num_out` 'power_out1', ... + Power inlets: power_in1, power_in2, ... (variable, count set by :code:`num_in`) - Image + Power outlets: power_out1, power_out2, ... (variable, count set by :code:`num_out`) - .. image:: /api/_images/PowerBus.svg - :alt: flowsheet of the power bus - :align: center - :class: only-light + Mandatory Equations + ------------------- - .. image:: /api/_images/PowerBus_darkmode.svg - :alt: flowsheet of the power bus - :align: center - :class: only-dark + - energy balance over all inflows and outflows: :py:meth:`energy_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + num_in : int + Number of inlets. + + num_out : int + Number of outlets. - num_in : float - Number of inlets + offdesign : list + List containing offdesign parameters (stated as String). - num_out : float - Number of outlets + printout : bool + Include this component in the network's results printout. Example ------- @@ -119,5 +117,15 @@ class PowerBus(_EnergyBus): >>> round(e1.E.val_SI) == 60000 True """ + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "fixed", "ports": []}, + "outlets": {"type": "fixed", "ports": []}, + "powerinlets": {"type": "variable", "parameter": "num_in", "pattern": "power_in{n}", "min": 1}, + "poweroutlets": {"type": "variable", "parameter": "num_out", "pattern": "power_out{n}", "min": 1}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } _energy_port = "power" diff --git a/src/tespy/components/power/generator.py b/src/tespy/components/power/generator.py index 54827ad1f..f6aa65a28 100644 --- a/src/tespy/components/power/generator.py +++ b/src/tespy/components/power/generator.py @@ -19,72 +19,66 @@ class Generator(_EnergyConverter): r""" A generator converts mechanical energy into electrical energy. - **Mandatory Equations** - - - None - - **Optional Equations** - - - :py:meth:`tespy.components.power.generator.Generator.eta_func` - - :py:meth:`tespy.components.power.generator.Generator.delta_power_func` - - :py:meth:`tespy.components.power.generator.Generator.eta_char_func` - - Inlets/Outlets - - - None - - Optional inlets/outlets - - - power_in - - power_out - - Image - - .. image:: /api/_images/Generator.svg + .. image:: /api/_images/components/Generator.svg :alt: flowsheet of the generator :align: center :class: only-light - .. image:: /api/_images/Generator_darkmode.svg + .. image:: /api/_images/components/Generator_darkmode.svg :alt: flowsheet of the generator :align: center :class: only-dark + Ports + ----- + + Power inlets: power_in + + Power outlets: power_out + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + delta_power : float, dict + Inlet to outlet power difference. Quantity: :code:`power`. + Equation: :py:meth:`delta_power_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + eta : float, dict + Efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_func `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + eta_char : tespy.tools.characteristics.CharLine, dict + Efficiency lookup table for offdesign. + Equation: :py:meth:`eta_char_func `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + label : str + The label of the component. - printout : boolean - Include this component in the network's results printout. + local_design : bool + Treat this component in design mode in an offdesign calculation. - eta : float, dict - Outlet to inlet efficiency, :math:`\eta/1` + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - delta_power : float, dict - Fixed power offset, :math:`\text{delta_power}/\text{W}` + offdesign : list + List containing offdesign parameters (stated as String). - eta_char : tespy.tools.characteristics.CharLine, dict - Characteristic line for efficiency to power as function of design - efficiency. + printout : bool + Include this component in the network's results printout. Example ------- @@ -160,3 +154,13 @@ class Generator(_EnergyConverter): >>> round(generator.eta.val, 3) 0.952 """ + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "fixed", "ports": []}, + "outlets": {"type": "fixed", "ports": []}, + "powerinlets": {"type": "fixed", "ports": ["power_in"]}, + "poweroutlets": {"type": "fixed", "ports": ["power_out"]}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } diff --git a/src/tespy/components/power/motor.py b/src/tespy/components/power/motor.py index b467be7f6..99bc25c16 100644 --- a/src/tespy/components/power/motor.py +++ b/src/tespy/components/power/motor.py @@ -19,72 +19,66 @@ class Motor(_EnergyConverter): r""" A motor converts electrical energy into mechanical energy. - **Mandatory Equations** - - - None - - **Optional Equations** - - - :py:meth:`tespy.components.power.motor.Motor.eta_func` - - :py:meth:`tespy.components.power.motor.Motor.delta_power_func` - - :py:meth:`tespy.components.power.motor.Motor.eta_char_func` - - Inlets/Outlets - - - None - - Optional inlets/outlets - - - power_in - - power_out - - Image - - .. image:: /api/_images/Motor.svg + .. image:: /api/_images/components/Motor.svg :alt: flowsheet of the motor :align: center :class: only-light - .. image:: /api/_images/Motor_darkmode.svg + .. image:: /api/_images/components/Motor_darkmode.svg :alt: flowsheet of the motor :align: center :class: only-dark + Ports + ----- + + Power inlets: power_in + + Power outlets: power_out + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + delta_power : float, dict + Inlet to outlet power difference. Quantity: :code:`power`. + Equation: :py:meth:`delta_power_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + eta : float, dict + Efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_func `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + eta_char : tespy.tools.characteristics.CharLine, dict + Efficiency lookup table for offdesign. + Equation: :py:meth:`eta_char_func `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + label : str + The label of the component. - printout : boolean - Include this component in the network's results printout. + local_design : bool + Treat this component in design mode in an offdesign calculation. - eta : float, dict - Outlet to inlet efficiency, :math:`\eta/1` + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - delta_power : float, dict - Fixed power offset, :math:`\text{delta_power}/\text{W}` + offdesign : list + List containing offdesign parameters (stated as String). - eta_char : tespy.tools.characteristics.CharLine, dict - Characteristic line for efficiency to power as function of design - efficiency. + printout : bool + Include this component in the network's results printout. Example ------- @@ -160,3 +154,13 @@ class Motor(_EnergyConverter): >>> round(motor.eta.val, 3) 0.95 """ + @classmethod + def port_schema(cls): + return { + "inlets": {"type": "fixed", "ports": []}, + "outlets": {"type": "fixed", "ports": []}, + "powerinlets": {"type": "fixed", "ports": ["power_in"]}, + "poweroutlets": {"type": "fixed", "ports": ["power_out"]}, + "heatinlets": {"type": "fixed", "ports": []}, + "heatoutlets": {"type": "fixed", "ports": []}, + } diff --git a/src/tespy/components/power/sink.py b/src/tespy/components/power/sink.py index 9b615bfbd..cec3cdcbe 100644 --- a/src/tespy/components/power/sink.py +++ b/src/tespy/components/power/sink.py @@ -19,30 +19,41 @@ class PowerSink(_EnergySink): r""" A power flow drains in a PowerSink. + Ports + ----- + + Power inlets: power + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/power/source.py b/src/tespy/components/power/source.py index 756427241..c04b81720 100644 --- a/src/tespy/components/power/source.py +++ b/src/tespy/components/power/source.py @@ -19,30 +19,41 @@ class PowerSource(_EnergySource): r""" A power flow emerges from a PowerSource. + Ports + ----- + + Power outlets: power + + Mandatory Equations + ------------------- + + None + Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + label : str + The label of the component. - local_design : boolean + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. + + offdesign : list + List containing offdesign parameters (stated as String). - printout : boolean + printout : bool Include this component in the network's results printout. Example diff --git a/src/tespy/components/reactors/fuel_cell.py b/src/tespy/components/reactors/fuel_cell.py index b35e6ee55..db7c72241 100644 --- a/src/tespy/components/reactors/fuel_cell.py +++ b/src/tespy/components/reactors/fuel_cell.py @@ -24,93 +24,106 @@ class FuelCell(Component): r""" The fuel cell produces power by oxidation of hydrogen. - **Mandatory Equations** + .. image:: /api/_images/components/FuelCell.svg + :alt: flowsheet of the fuelcell + :align: center + :class: only-light - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.cooling_fluid_structure_matrix` - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.cooling_mass_flow_structure_matrix` - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.reactor_mass_flow_func` - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.reactor_pressure_structure_matrix` - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.energy_balance_func` + .. image:: /api/_images/components/FuelCell_darkmode.svg + :alt: flowsheet of the fuelcell + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - cooling loop: + Fluid inlets: in1, in2, in3 - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.zeta_func` + Fluid outlets: out1, out2 - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.eta_func` - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.heat_func` - - :py:meth:`tespy.components.reactors.fuel_cell.FuelCell.specific_energy_func` + Power outlets: power - Inlets/Outlets + Mandatory Equations + ------------------- - - in1 (cooling inlet), in2 (oxygen inlet), in3 (hydrogen inlet) - - out1 (cooling outlet), out2 (water outlet) + - equations for oxygen and hydrogen mass flow relation: :py:meth:`reactor_mass_flow_func ` + - cooling fluid mass flow equality equation: :py:meth:`cooling_mass_flow_structure_matrix ` + - cooling fluid composition equality equation: :py:meth:`cooling_fluid_structure_matrix ` + - energy balance equation of the reactor: :py:meth:`energy_balance_func ` + - reactor pressure equality equations: :py:meth:`reactor_pressure_structure_matrix ` - Image + When a power or heat connector is attached: - .. image:: _images/FuelCell.svg - :alt: alternative text - :align: center + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Cooling inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. + + e : float, dict, :code:`"var"` + Equation for specified specific energy consumption of the fuel cell. + Quantity: :code:`specific_energy`. Can be set as a system variable by + passing :code:`"var"` as its value. + Equation: :py:meth:`specific_energy_func `. + + eta : float, dict + Efficiency of the fuel cell. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_func `. - local_design : boolean + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + offdesign : list + List containing offdesign parameters (stated as String). P : float, dict, :code:`"var"` - Power input, :math:`P/\text{W}`. + Power output of the fuel cell. Quantity: :code:`power`. Can be set as a + system variable by passing :code:`"var"` as its value. - Q : float, dict - Heat output of cooling, :math:`Q/\text{W}` + pr : float, dict + Cooling port outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - e : float, dict, :code:`"var"` - Electrolysis specific energy consumption, - :math:`e/(\text{J}/\text{m}^3)`. + printout : bool + Include this component in the network's results printout. - eta : float, dict - Electrolysis efficiency, :math:`\eta/1`. + Q : float, dict + Heat output of the cooling port. Quantity: :code:`heat`. + Equation: :py:meth:`heat_func `. - pr : float, dict - Cooling loop pressure ratio, :math:`pr/1`. + zeta : float, dict + Cooling port non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. - dp : float, dict - Inlet to outlet pressure difference of cooling loop, - :math:`dp/\text{p}_\text{unit}` Is specified in the Network's pressure unit + Notes + ----- - zeta : float, dict, :code:`"var"` - Geometry independent friction coefficient for cooling loop pressure - drop, :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + .. note:: - Note - ---- - Other than usual components, the fuel cell has the fluid composition - built into its equations for the feed hydrogen and oxygen inlets as well - as the water outlet. Thus, the user must not specify the fluid composition - at these connections! + Other than usual components, the fuel cell has the fluid composition + built into its equations for the feed hydrogen and oxygen inlets as well + as the water outlet. Thus, the user must not specify the fluid composition + at these connections! Example ------- @@ -173,7 +186,7 @@ def _calc_eta(self): def get_parameters(self): return { 'P': dc_cp( - max_val=0, quantity="power", _potential_var=True, + max_val=0, quantity="power", _allows_var=True, description="power output of the fuel cell" ), 'Q': dc_cp( @@ -215,7 +228,7 @@ def get_parameters(self): func=self.specific_energy_func, dependents=self.specific_energy_dependents, quantity="specific_energy", - _potential_var=True, + _allows_var=True, description="equation for specified specific energy consumption of the fuel cell", calc=self._calc_e ), diff --git a/src/tespy/components/reactors/water_electrolyzer.py b/src/tespy/components/reactors/water_electrolyzer.py index fc3fd5a71..559dcfaf5 100644 --- a/src/tespy/components/reactors/water_electrolyzer.py +++ b/src/tespy/components/reactors/water_electrolyzer.py @@ -26,105 +26,111 @@ class WaterElectrolyzer(Component): r""" The water electrolyzer produces hydrogen and oxygen from water and power. - **Mandatory Equations** + .. image:: /api/_images/components/WaterElectrolyzer.svg + :alt: flowsheet of the waterelectrolyzer + :align: center + :class: only-light - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.cooling_fluid_structure_matrix` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.cooling_mass_flow_structure_matrix` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.reactor_mass_flow_func` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.reactor_pressure_structure_matrix` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.energy_balance_func` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.gas_temperature_func` + .. image:: /api/_images/components/WaterElectrolyzer_darkmode.svg + :alt: flowsheet of the waterelectrolyzer + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - cooling loop: + Fluid inlets: in1, in2 - - :py:meth:`tespy.components.component.Component.zeta_func` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` + Fluid outlets: out1, out2, out3 - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.eta_func` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.eta_char_func` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.heat_func` - - :py:meth:`tespy.components.reactors.water_electrolyzer.WaterElectrolyzer.specific_energy_func` + Power inlets: power - Inlets/Outlets + Mandatory Equations + ------------------- - - in1 (cooling inlet), in2 (feed water inlet) - - out1 (cooling outlet), out2 (oxygen outlet), out3 (hydrogen outlet) + - equations for oxygen and hydrogen mass flow relation: :py:meth:`reactor_mass_flow_func ` + - cooling fluid mass flow equality equation: :py:meth:`cooling_mass_flow_structure_matrix ` + - cooling fluid composition equality equation: :py:meth:`cooling_fluid_structure_matrix ` + - energy balance equation of the reactor: :py:meth:`energy_balance_func ` + - reactor pressure equality equations: :py:meth:`reactor_pressure_structure_matrix ` + - equation for same temperature of product gases: :py:meth:`gas_temperature_func ` - Image + When a power or heat connector is attached: - .. image:: /api/_images/WaterElectrolyzer.svg - :alt: flowsheet of the water electrolyzer - :align: center - :class: only-light - - .. image:: /api/_images/WaterElectrolyzer_darkmode.svg - :alt: flowsheet of the water electrolyzer - :align: center - :class: only-dark + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Cooling inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + e : float, dict, :code:`"var"` + Equation for specified specific energy consumption of the electrolyzer. + Quantity: :code:`specific_energy`. Can be set as a system variable by + passing :code:`"var"` as its value. + Equation: :py:meth:`specific_energy_func `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eta : float, dict + Efficiency of the electrolyzer. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_func `. - printout : boolean - Include this component in the network's results printout. + eta_char : tespy.tools.characteristics.CharLine, dict + Efficiency lookup table for offdesign. + Equation: :py:meth:`eta_char_func `. - P : float, dict, :code:`"var"` - Power input, :math:`P/\text{W}`. + label : str + The label of the component. - Q : float, dict - Heat output of cooling, :math:`Q/\text{W}` + local_design : bool + Treat this component in design mode in an offdesign calculation. - e : float, dict, :code:`"var"` - Electrolysis specific energy consumption, - :math:`e/(\text{J}/\text{m}^3)`. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - eta : float, dict - Electrolysis efficiency (referring to H2 higher heating value), - :math:`\eta/1`. + offdesign : list + List containing offdesign parameters (stated as String). - eta_char : tespy.tools.characteristics.CharLine, dict - Electrolysis efficiency characteristic line. + P : float, dict, :code:`"var"` + Power consumption of the electrolyzer. Quantity: :code:`power`. Can be + set as a system variable by passing :code:`"var"` as its value. pr : float, dict - Cooling loop pressure ratio, :math:`pr/1`. + Cooling port outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp : float, dict - Inlet to outlet pressure difference of cooling loop, - :math:`dp/\text{p}_\text{unit}` Is specified in the Network's pressure unit + printout : bool + Include this component in the network's results printout. + + Q : float, dict + Heat output of the cooling port. Quantity: :code:`heat`. + Equation: :py:meth:`heat_func `. zeta : float, dict - Geometry independent friction coefficient for cooling loop pressure - drop, :math:`\frac{\zeta}{D^4}/\frac{1}{\text{m}^4}`. + Cooling port non-dimensional friction coefficient for pressure loss + calculation. + Equation: :py:meth:`zeta_func `. + + Notes + ----- + + .. note:: - Note - ---- - Other than usual components, the water electrolyzer has the fluid - composition built into its equations for the feed water inlet and the - hydrogen and oxygen outlet. Thus, the user must not specify the fluid - composition at these connections! + Other than usual components, the water electrolyzer has the fluid + composition built into its equations for the feed water inlet and the + hydrogen and oxygen outlet. Thus, the user must not specify the fluid + composition at these connections! Example ------- @@ -201,7 +207,7 @@ def _calc_eta(self): def get_parameters(self): return { 'P': dc_cp( - min_val=0, quantity="power", _potential_var=True, + min_val=0, quantity="power", _allows_var=True, description="power consumption of the electrolyzer" ), 'Q': dc_cp( @@ -243,7 +249,7 @@ def get_parameters(self): func=self.specific_energy_func, dependents=self.specific_energy_dependents, quantity="specific_energy", - _potential_var=True, + _allows_var=True, description="equation for specified specific energy consumption of the electrolyzer", calc=self._calc_e ), @@ -252,7 +258,7 @@ def get_parameters(self): func=self.eta_func, dependents=self.eta_dependents, quantity="efficiency", - description="efficiency of the fuel cell", + description="efficiency of the electrolyzer", calc=self._calc_eta, calc_deps=['e'] ), 'eta_char': dc_cc( diff --git a/src/tespy/components/turbomachinery/base.py b/src/tespy/components/turbomachinery/base.py index ae0b77123..a3842d4f9 100644 --- a/src/tespy/components/turbomachinery/base.py +++ b/src/tespy/components/turbomachinery/base.py @@ -23,57 +23,58 @@ class Turbomachine(Component): r""" Parent class for compressor, pump and turbine. - **Mandatory Equations** + Ports + ----- - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + Fluid inlets: in1 - **Optional Equations** + Fluid outlets: out1 - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.turbomachinery.base.Turbomachine.energy_balance_func` + Mandatory Equations + ------------------- - Inlets/Outlets - - - in1 - - out1 + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + offdesign : list + List containing offdesign parameters (stated as String). P : float, dict - Power, :math:`P/\text{W}` + Power input/output of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + printout : bool + Include this component in the network's results printout. Example ------- diff --git a/src/tespy/components/turbomachinery/compressor.py b/src/tespy/components/turbomachinery/compressor.py index db6f4b1d3..e821ace28 100644 --- a/src/tespy/components/turbomachinery/compressor.py +++ b/src/tespy/components/turbomachinery/compressor.py @@ -35,82 +35,86 @@ class Compressor(Turbomachine): r""" Class for a basic compressor. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/Compressor.svg + :alt: flowsheet of the compressor + :align: center + :class: only-light - **Optional Equations** + .. image:: /api/_images/components/Compressor_darkmode.svg + :alt: flowsheet of the compressor + :align: center + :class: only-dark - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.turbomachinery.base.Turbomachine.energy_balance_func` - - :py:meth:`tespy.components.turbomachinery.compressor.Compressor.eta_s_func` - - :py:meth:`tespy.components.turbomachinery.compressor.Compressor.eta_s_char_func` + Ports + ----- - Inlets/Outlets + Fluid inlets: in1 - - in1 - - out1 + Fluid outlets: out1 - Optional inlets + Power inlets: power - - power + Mandatory Equations + ------------------- - Image + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` - .. image:: /api/_images/Compressor.svg - :alt: flowsheet of the compressor - :align: center - :class: only-light + When a power or heat connector is attached: - .. image:: /api/_images/Compressor_darkmode.svg - :alt: flowsheet of the compressor - :align: center - :class: only-dark + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. + + eta_s : float, dict + Isentropic efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_s_func `. - local_design : boolean + eta_s_char : tespy.tools.characteristics.CharLine, dict + Isentropic efficiency lookup table for offdesign. + Equation: :py:meth:`eta_s_char_func `. + + igva : float, dict, :code:`"var"` + Inlet guide vane angle. Quantity: :code:`angle`. Can be set as a system + variable by passing :code:`"var"` as its value. + + label : str + The label of the component. + + local_design : bool Treat this component in design mode in an offdesign calculation. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - printout : boolean - Include this component in the network's results printout. + offdesign : list + List containing offdesign parameters (stated as String). P : float, dict - Power, :math:`P/\text{W}` - - eta_s : float, dict - Isentropic efficiency, :math:`\eta_s/1` + Power input/output of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` - - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - eta_s_char : tespy.tools.characteristics.CharLine, dict - Characteristic curve for isentropic efficiency, provide CharLine as - function :code:`func`. + printout : bool + Include this component in the network's results printout. Example ------- @@ -149,21 +153,6 @@ class Compressor(Turbomachine): >>> round(comp.eta_s.val, 2) 0.79 """ - - def _preprocess(self, row_idx): - if self.char_map_pr.is_set or self.char_map_eta_s.is_set or self.igva.is_set: - msg = ( - "The scope of the component 'Compressor' will change in the " - "next major release. The availability of the compressor maps " - "in context of offdesign simulations has moved to the new " - "component 'TurboCompressor'. If you want to make use of " - "these parameters, please use that component class instead." - ) - logger.warning(msg) - warnings.warn(msg, FutureWarning) - - return super()._preprocess(row_idx) - @staticmethod def powerinlets(): return ["power"] @@ -202,27 +191,8 @@ def get_parameters(self): ), 'igva': dc_cp( min_val=-90, max_val=90, val=0, quantity="angle", - description="inlet guide vane angle", _potential_var=True - ), - 'char_map_eta_s': dc_cm( - description="2D lookup table for efficiency over non-dimensional mass flow and speed line" - ), - 'char_map_eta_s_group': dc_gcp( - elements=['char_map_eta_s', 'igva'], num_eq_sets=1, - func=self.char_map_eta_s_func, - dependents=self.char_map_dependents, - description="map for isentropic efficiency over speedlines and non-dimensional mass flow" + description="inlet guide vane angle", _allows_var=True ), - 'char_map_pr': dc_cm( - description="2D lookup table for pressure ratio over non-dimensional mass flow and speed line" - ), - 'char_map_pr_group': dc_gcp( - elements=['char_map_pr', 'igva'], - num_eq_sets=1, - func=self.char_map_pr_func, - dependents=self.char_map_dependents, - description="map for pressure ratio over speedlines and non-dimensional mass flow" - ) }) return parameters @@ -363,110 +333,6 @@ def eta_s_char_dependents(self): self.outl[0].h, ] - def char_map_pr_func(self): - - r""" - Calculate pressure ratio from characteristic map. - - Returns - ------- - residual : float - Residual value of equations. - - Note - ---- - - X: speedline index (rotational speed is constant) - - Y: nondimensional mass flow - - igva: variable inlet guide vane angle for value manipulation - according to :cite:`GasTurb2018`. - - .. math:: - - X = \sqrt{\frac{T_\text{in,design}}{T_\text{in}}}\\ - Y = \frac{\dot{m}_\text{in} \cdot p_\text{in,design}} - {\dot{m}_\text{in,design} \cdot p_\text{in} \cdot X}\\ - \vec{Y} = f\left(X,Y\right)\cdot\left(1-\frac{igva}{100}\right)\\ - \vec{Z} = f\left(X,Y\right)\cdot\left(1-\frac{igva}{100}\right)\\ - 0 = \frac{p_{out} \cdot p_{in,design}} - {p_\text{in} \cdot p_\text{out,design}}- - f\left(Y,\vec{Y},\vec{Z}\right) - """ - i = self.inl[0] - o = self.outl[0] - - beta = np.sqrt(self._conn_design(i, 'T') / i.calc_T()) - y = (i.m.val_SI * self._conn_design(i, 'p')) / (self._conn_design(i, 'm') * i.p.val_SI * beta) - - yarr, zarr = self.char_map_pr.char_func.evaluate_x(beta) - # value manipulation with igva - yarr *= (1 - self.igva.val_SI / 100) - zarr *= (1 - self.igva.val_SI / 100) - pr = self.char_map_pr.char_func.evaluate_y(y, yarr, zarr) - - return (o.p.val_SI / i.p.val_SI) - pr * self.pr.design - - def char_map_eta_s_func(self): - r""" - Calculate isentropic efficiency from characteristic map. - - Returns - ------- - residual : float - Residual value of equation. - - Note - ---- - - X: speedline index (rotational speed is constant) - - Y: nondimensional mass flow - - igva: variable inlet guide vane angle for value manipulation - according to :cite:`GasTurb2018`. - - .. math:: - - X = \sqrt{\frac{T_\text{in,design}}{T_\text{in}}}\\ - Y = \frac{\dot{m}_\text{in} \cdot p_\text{in,design}} - {\dot{m}_\text{in,design} \cdot p_\text{in} \cdot X}\\ - \vec{Y} = f\left(X,Y\right)\cdot\left(1-\frac{igva}{100}\right)\\ - \vec{Z}=f\left(X,Y\right)\cdot\left(1-\frac{igva^2}{10000}\right)\\ - 0 = \frac{\eta_\text{s}}{\eta_\text{s,design}} - - f\left(Y,\vec{Y},\vec{Z}\right) - """ - i = self.inl[0] - o = self.outl[0] - - x = np.sqrt(self._conn_design(i, 'T') / i.calc_T()) - y = (i.m.val_SI * self._conn_design(i, 'p')) / (self._conn_design(i, 'm') * i.p.val_SI * x) - - yarr, zarr = self.char_map_eta_s.char_func.evaluate_x(x) - # value manipulation with igva - yarr *= (1 - self.igva.val_SI / 100) - zarr *= (1 - self.igva.val_SI ** 2 / 10000) - eta = self.char_map_eta_s.char_func.evaluate_y(y, yarr, zarr) - - return ( - ( - isentropic( - i.p.val_SI, - i.h.val_SI, - o.p.val_SI, - i.fluid_data, - i.mixing_rule, - T0=i.T.val_SI, - T0_out=o.T.val_SI - ) - i.h.val_SI) - / (o.h.val_SI - i.h.val_SI) - eta * self.eta_s.design - ) - - def char_map_dependents(self): - return [ - self.inl[0].m, - self.inl[0].p, - self.inl[0].h, - self.outl[0].p, - self.outl[0].h, - self.igva - ] - def convergence_check(self): r""" Perform a convergence check. @@ -576,18 +442,3 @@ def _calc_eta_s(self): T0=i.T.val_SI, T0_out=o.T.val_SI ) - i.h.val_SI ) / (o.h.val_SI - i.h.val_SI) - - def check_parameter_bounds(self): - r"""Check parameter value limits.""" - _no_limit_violations = super().check_parameter_bounds() - - for data in [self.char_map_pr, self.char_map_eta_s]: - if data.is_set: - x = np.sqrt(self._conn_design(self.inl[0], 'T') / self.inl[0].T.val_SI) - y = (self.inl[0].m.val_SI * self._conn_design(self.inl[0], 'p')) / ( - self._conn_design(self.inl[0], 'm') * self.inl[0].p.val_SI * x) - yarr = data.char_func.get_domain_errors_x(x, self.label) - yarr *= (1 - self.igva.val_SI / 100) - data.char_func.get_domain_errors_y(y, yarr, self.label) - - return _no_limit_violations diff --git a/src/tespy/components/turbomachinery/pump.py b/src/tespy/components/turbomachinery/pump.py index d8a6dd781..5d440d472 100644 --- a/src/tespy/components/turbomachinery/pump.py +++ b/src/tespy/components/turbomachinery/pump.py @@ -33,102 +33,115 @@ class Pump(Turbomachine): r""" Class for axial or radial pumps. - **Mandatory Equations** + .. image:: /api/_images/components/Pump.svg + :alt: flowsheet of the pump + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/Pump_darkmode.svg + :alt: flowsheet of the pump + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.turbomachinery.base.Turbomachine.energy_balance_func` - - :py:meth:`tespy.components.turbomachinery.pump.Pump.eta_s_func` - - :py:meth:`tespy.components.turbomachinery.pump.Pump.eta_s_char_func` - - :py:meth:`tespy.components.turbomachinery.pump.Pump.flow_char_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power inlets: power - Optional inlets + Mandatory Equations + ------------------- - - power + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` - Image + When a power or heat connector is attached: - .. image:: /api/_images/Pump.svg - :alt: flowsheet of the pump - :align: center - :class: only-light - - .. image:: /api/_images/Pump_darkmode.svg - :alt: flowsheet of the pump - :align: center - :class: only-dark + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. - - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eta : float, dict + Efficiency defined as specific incompressible flow work over increase of + enthalpy. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_func `. - printout : boolean - Include this component in the network's results printout. + eta_flow_group : GroupedComponentProperties + Map function for efficiency over volumetric flow and frequency. + Elements: :code:`eta_flow_map`, :code:`frequency`. + Equation: :py:meth:`eta_flow_frequency_group_func `. - P : float, dict - Power, :math:`P/\text{W}` + eta_flow_map : tespy.tools.characteristics.CharMap, dict + 2D lookup table for pump efficiency over volumetric flow and frequency. eta_s : float, dict - Isentropic efficiency, :math:`\eta_s/1` + Isentropic efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_s_func `. - eta : float, dict - Efficiency based on flow work :math:`v\cdot dp`, :math:`\eta/1` + eta_s_char : tespy.tools.characteristics.CharLine, dict + Isentropic efficiency lookup table for offdesign. + Equation: :py:meth:`eta_s_char_func `. - frequency : float, dict - Frequency of the pump, :math:`\omega/(1/)` + flow_char : tespy.tools.characteristics.CharLine, dict + Pressure rise over volumetric flow lookup table. + Equation: :py:meth:`flow_char_func `. - eta_flow_map : tespy.tools.characteristics.CharMap, dict - Characteristic map for efficiency vs. volumetric flow and frequency + frequency : float, dict, :code:`"var"` + Frequency of the pump. Quantity: :code:`frequency`. Can be set as a + system variable by passing :code:`"var"` as its value. + + head : float, dict + Hydraulic head of the pump. Quantity: :code:`length`. + Equation: :py:meth:`hydraulic_head_func `. head_flow_map : tespy.tools.characteristics.CharMap, dict - Characteristic map for hydraulic head vs. volumetric flow and frequency + 2D lookup table for hydraulic head over volumetric flow and frequency. - pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + head_flow_map_group : GroupedComponentProperties + Map function for efficiency over volumetric flow and frequency. + Elements: :code:`head_flow_map`, :code:`frequency`. + Equation: :py:meth:`head_flow_frequency_group_func `. - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + label : str + The label of the component. - head : float, dict - Hydraulic head, :math:`H/m` + local_design : bool + Treat this component in design mode in an offdesign calculation. - eta_s_char : tespy.tools.characteristics.CharLine, dict - Characteristic curve for isentropic efficiency, provide CharLine as - function :code:`func` + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - flow_char : tespy.tools.characteristics.CharLine, dict - Characteristic curve for pressure rise as function of volumetric flow - :math:`x/\frac{\text{m}^3}{\text{s}} \, y/\text{Pa}` + offdesign : list + List containing offdesign parameters (stated as String). + + P : float, dict + Power input/output of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. + + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. + + printout : bool + Include this component in the network's results printout. Example ------- @@ -405,7 +418,7 @@ def get_parameters(self): ), "frequency": dc_cp( min_val=0, max_val=10000, - _potential_var=True, + _allows_var=True, quantity="frequency", description="frequency of the pump" ), diff --git a/src/tespy/components/turbomachinery/steam_turbine.py b/src/tespy/components/turbomachinery/steam_turbine.py index 18566a65f..4927ec756 100644 --- a/src/tespy/components/turbomachinery/steam_turbine.py +++ b/src/tespy/components/turbomachinery/steam_turbine.py @@ -29,93 +29,98 @@ class SteamTurbine(Turbine): r""" Class for steam turbines with wet expansion. - **Mandatory Equations** + .. image:: /api/_images/components/Turbine.svg + :alt: flowsheet of the steamturbine + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/Turbine_darkmode.svg + :alt: flowsheet of the steamturbine + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.turbomachinery.base.Turbomachine.energy_balance_func` - - :py:meth:`tespy.components.turbomachinery.steam_turbine.SteamTurbine.eta_s_wet_func` - - :py:meth:`tespy.components.turbomachinery.turbine.Turbine.eta_s_func` - - :py:meth:`tespy.components.turbomachinery.turbine.Turbine.eta_s_char_func` - - :py:meth:`tespy.components.turbomachinery.turbine.Turbine.cone_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power outlets: power - Optional outlets + Mandatory Equations + ------------------- - - power + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` - Image + When a power or heat connector is attached: - .. image:: /api/_images/Turbine.svg - :alt: flowsheet of the turbine - :align: center - :class: only-light - - .. image:: /api/_images/Turbine_darkmode.svg - :alt: flowsheet of the turbine - :align: center - :class: only-dark + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + alpha : float, dict + Influence factor for wetness efficiency modifier. Quantity: + :code:`ratio`. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + cone : bool + Cone law equation for offdesign. + Equation: :py:meth:`cone_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + eta_s : float, dict + Isentropic efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_s_func `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eta_s_char : tespy.tools.characteristics.CharLine, dict + Isentropic efficiency lookup table for offdesign. + Equation: :py:meth:`eta_s_char_func `. - printout : boolean - Include this component in the network's results printout. + eta_s_dry : float, dict + Isentropic efficiency of dry expansion. Quantity: :code:`efficiency`. - P : float, dict - Power, :math:`P/\text{W}` + eta_s_dry_group : GroupedComponentProperties + Method to apply Baumann rule. Elements: :code:`alpha`, + :code:`eta_s_dry`. + Equation: :py:meth:`eta_s_wet_func `. - eta_s : float, dict - Isentropic efficiency, :math:`\eta_s/1` + label : str + The label of the component. - eta_s_dry : float, dict - Dry isentropic efficiency, :math:`\eta_s/1` + local_design : bool + Treat this component in design mode in an offdesign calculation. - alpha: float, dict - Influence factor on wetness efficiency modifier, :math:`\alpha/1` + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + offdesign : list + List containing offdesign parameters (stated as String). - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + P : float, dict + Power input/output of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. - eta_s_char : tespy.tools.characteristics.CharLine, dict - Characteristic curve for isentropic efficiency, provide CharLine as - function :code:`func`. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - cone : dict - Apply Stodola's cone law (works in offdesign only). + printout : bool + Include this component in the network's results printout. Example ------- diff --git a/src/tespy/components/turbomachinery/turbine.py b/src/tespy/components/turbomachinery/turbine.py index 277ae9fff..547f7a031 100644 --- a/src/tespy/components/turbomachinery/turbine.py +++ b/src/tespy/components/turbomachinery/turbine.py @@ -31,86 +31,86 @@ class Turbine(Turbomachine): r""" Class for gas or steam turbines. - **Mandatory Equations** + .. image:: /api/_images/components/Turbine.svg + :alt: flowsheet of the turbine + :align: center + :class: only-light - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/Turbine_darkmode.svg + :alt: flowsheet of the turbine + :align: center + :class: only-dark - **Optional Equations** + Ports + ----- - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.turbomachinery.base.Turbomachine.energy_balance_func` - - :py:meth:`tespy.components.turbomachinery.turbine.Turbine.eta_s_func` - - :py:meth:`tespy.components.turbomachinery.turbine.Turbine.eta_s_char_func` - - :py:meth:`tespy.components.turbomachinery.turbine.Turbine.cone_func` + Fluid inlets: in1 - Inlets/Outlets + Fluid outlets: out1 - - in1 - - out1 + Power outlets: power - Optional outlets + Mandatory Equations + ------------------- - - power + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` - Image + When a power or heat connector is attached: - .. image:: /api/_images/Turbine.svg - :alt: flowsheet of the turbine - :align: center - :class: only-light - - .. image:: /api/_images/Turbine_darkmode.svg - :alt: flowsheet of the turbine - :align: center - :class: only-dark + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. + + cone : bool + Cone law equation for offdesign. + Equation: :py:meth:`cone_func `. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - local_design : boolean - Treat this component in design mode in an offdesign calculation. + eta_s : float, dict + Isentropic efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_s_func `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eta_s_char : tespy.tools.characteristics.CharLine, dict + Isentropic efficiency lookup table for offdesign. + Equation: :py:meth:`eta_s_char_func `. - printout : boolean - Include this component in the network's results printout. + label : str + The label of the component. - P : float, dict - Power, :math:`P/\text{W}` + local_design : bool + Treat this component in design mode in an offdesign calculation. - eta_s : float, dict - Isentropic efficiency, :math:`\eta_s/1` + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + offdesign : list + List containing offdesign parameters (stated as String). - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + P : float, dict + Power input/output of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. - eta_s_char : tespy.tools.characteristics.CharLine, dict - Characteristic curve for isentropic efficiency, provide CharLine as - function :code:`func`. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - cone : dict - Apply Stodola's cone law (works in offdesign only). + printout : bool + Include this component in the network's results printout. Example ------- @@ -216,7 +216,7 @@ def get_parameters(self): description="isentropic efficiency lookup table for offdesign" ), "cone": dc_simple( - num_eq_sets=1, + dtype="bool", num_eq_sets=1, func=self.cone_func, dependents=self.cone_dependents, description="cone law equation for offdesign" diff --git a/src/tespy/components/turbomachinery/turbocompressor.py b/src/tespy/components/turbomachinery/turbocompressor.py index 5533a7014..935e7a515 100644 --- a/src/tespy/components/turbomachinery/turbocompressor.py +++ b/src/tespy/components/turbomachinery/turbocompressor.py @@ -26,89 +26,100 @@ class TurboCompressor(Compressor): r""" Class for a turbocompressor. - **Mandatory Equations** - - - fluid: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` - - mass flow: :py:meth:`tespy.components.component.Component.variable_equality_structure_matrix` + .. image:: /api/_images/components/Compressor.svg + :alt: flowsheet of the turbocompressor + :align: center + :class: only-light - **Optional Equations** + .. image:: /api/_images/components/Compressor_darkmode.svg + :alt: flowsheet of the turbocompressor + :align: center + :class: only-dark - - :py:meth:`tespy.components.component.Component.dp_structure_matrix` - - :py:meth:`tespy.components.component.Component.pr_structure_matrix` - - :py:meth:`tespy.components.turbomachinery.base.Turbomachine.energy_balance_func` - - :py:meth:`tespy.components.turbomachinery.compressor.Compressor.eta_s_func` - - :py:meth:`tespy.components.turbomachinery.turbocompressor.TurboCompressor.char_map_eta_s_func` - - :py:meth:`tespy.components.turbomachinery.turbocompressor.TurboCompressor.char_map_pr_func` + Ports + ----- - Inlets/Outlets + Fluid inlets: in1 - - in1 - - out1 + Fluid outlets: out1 - Optional inlets + Power inlets: power - - power + Mandatory Equations + ------------------- - Image + - mass flow equality constraint(s): :py:meth:`variable_equality_structure_matrix ` + - fluid composition equality constraint(s): :py:meth:`variable_equality_structure_matrix ` - .. image:: /api/_images/Compressor.svg - :alt: flowsheet of the compressor - :align: center - :class: only-light + When a power or heat connector is attached: - .. image:: /api/_images/Compressor_darkmode.svg - :alt: flowsheet of the compressor - :align: center - :class: only-dark + - energy_connector_balance: :py:meth:`energy_connector_balance_func ` Parameters ---------- - label : str - The label of the component. + + char_map_eta_s : tespy.tools.characteristics.CharMap, dict + 2D lookup table for efficiency over non-dimensional mass flow and speed + line. + + char_map_eta_s_group : GroupedComponentProperties + Map for isentropic efficiency over speedlines and non-dimensional mass + flow. Elements: :code:`char_map_eta_s`, :code:`igva`. + Equation: :py:meth:`char_map_eta_s_func `. + + char_map_pr : tespy.tools.characteristics.CharMap, dict + 2D lookup table for pressure ratio over non-dimensional mass flow and + speed line. + + char_map_pr_group : GroupedComponentProperties + Map for pressure ratio over speedlines and non-dimensional mass flow. + Elements: :code:`char_map_pr`, :code:`igva`. + Equation: :py:meth:`char_map_pr_func `. + + char_warnings : bool + Ignore warnings on default characteristics usage for this component. design : list List containing design parameters (stated as String). - offdesign : list - List containing offdesign parameters (stated as String). - design_path : str Path to the components design case. - local_offdesign : boolean - Treat this component in offdesign mode in a design calculation. - - local_design : boolean - Treat this component in design mode in an offdesign calculation. + dp : float, dict + Inlet to outlet absolute pressure change. Quantity: + :code:`pressure_difference`. + Equation: :py:meth:`dp_structure_matrix `. - char_warnings : boolean - Ignore warnings on default characteristics usage for this component. + eta_s : float, dict + Isentropic efficiency. Quantity: :code:`efficiency`. + Equation: :py:meth:`eta_s_func `. - printout : boolean - Include this component in the network's results printout. + igva : float, dict, :code:`"var"` + Inlet guide vane angle. Quantity: :code:`angle`. Can be set as a system + variable by passing :code:`"var"` as its value. - P : float, dict - Power, :math:`P/\text{W}` + label : str + The label of the component. - eta_s : float, dict - Isentropic efficiency, :math:`\eta_s/1` + local_design : bool + Treat this component in design mode in an offdesign calculation. - pr : float, dict - Outlet to inlet pressure ratio, :math:`pr/1` + local_offdesign : bool + Treat this component in offdesign mode in a design calculation. - dp : float, dict - Inlet to outlet pressure difference, :math:`dp/\text{p}_\text{unit}` - Is specified in the Network's pressure unit + offdesign : list + List containing offdesign parameters (stated as String). - char_map_pr : tespy.tools.characteristics.CharMap, dict - Characteristic map for pressure ratio vs. nondimensional mass flow. + P : float, dict + Power input/output of the component. Quantity: :code:`power`. + Equation: :py:meth:`energy_balance_func `. - char_map_eta_s : tespy.tools.characteristics.CharMap, dict - Characteristic map for isentropic efficiency vs. nondimensional mass - flow. + pr : float, dict + Outlet to inlet pressure ratio. Quantity: :code:`ratio`. + Equation: :py:meth:`pr_structure_matrix `. - igva : float, dict, :code:`"var"` - Inlet guide vane angle, :math:`igva/^\circ`. + printout : bool + Include this component in the network's results printout. Example ------- @@ -178,7 +189,7 @@ def get_parameters(self): parameters.update({ 'igva': dc_cp( min_val=-90, max_val=90, val=0, quantity="angle", - description="inlet guide vane angle", _potential_var=True + description="inlet guide vane angle", _allows_var=True ), 'char_map_eta_s': dc_cm( description="2D lookup table for efficiency over non-dimensional mass flow and speed line" diff --git a/src/tespy/connections/connection.py b/src/tespy/connections/connection.py index 0b990cc7d..e684f3adb 100644 --- a/src/tespy/connections/connection.py +++ b/src/tespy/connections/connection.py @@ -442,67 +442,77 @@ class Connection(ConnectionBase): Parameters ---------- - m : float, tespy.connections.connection.Ref - Mass flow specification. - m0 : float - Starting value specification for mass flow. + design : list + List containing design parameters (stated as String). - p : float, tespy.connections.connection.Ref - Pressure specification. + design_path : str + Path to the individual design case for this connection. - p0 : float - Starting value specification for pressure. + fluid : dict + Mass fractions of the fluid composition (system variable). - h : float, tespy.connections.connection.Ref - Enthalpy specification. + fluid_balance : bool + Apply an equation which closes the fluid balance with at least two + unknown fluid mass fractions. + Equation: :py:meth:`fluid_balance_func `. - h0 : float - Starting value specification for enthalpy. + h : float, Ref + Mass specific enthalpy of the fluid (system variable). - fluid : dict - Fluid compostition specification. + label : str + The label of the connection. + + local_design : bool + Treat this connection in design mode in an offdesign calculation. + + local_offdesign : bool + Treat this connection in offdesign mode in a design calculation. - fluid0 : dict - Starting value specification for fluid compostition. + m : float, Ref + Mass flow of the fluid (system variable). - fluid_balance : boolean - Fluid balance equation specification. + offdesign : list + List containing offdesign parameters (stated as String). - x : float - Gas phase mass fraction specification. + p : float, Ref + Absolute pressure of the fluid (system variable). - T : float, tespy.connections.connection.Ref - Temperature specification. + printout : bool + Include this connection in the network's results printout. - v : float - Volumetric flow specification. + s : float, Ref + Specific entropy of the fluid (output only). - state : str - State of the pure fluid on this connection: liquid ('l') or gaseous - ('g'). + T : float, Ref + Temperature of the fluid. + Equation: :py:meth:`T_func `. - design : list - List containing design parameters (stated as string). + T_bubble : float, Ref + Determine pressure based on the provided bubble temperature of the + fluid. - offdesign : list - List containing offdesign parameters (stated as string). + T_dew : float, Ref + Determine pressure based on the provided dew temperature of the fluid. - design_path : str - Path to individual design case for this connection. + td_bubble : float, Ref + Subcooling temperature difference to bubble line temperature. + Equation: :py:meth:`td_bubble_func `. - local_offdesign : boolean - Treat this connection in offdesign mode in a design calculation. + td_dew : float, Ref + Superheating temperature difference to dew line temperature. + Equation: :py:meth:`td_dew_func `. - local_design : boolean - Treat this connection in design mode in an offdesign calculation. + v : float, Ref + Volumetric flow of the fluid. + Equation: :py:meth:`v_func `. - printout : boolean - Include this connection in the network's results printout. + vol : float, Ref + Specific volume of the fluid (output only). - label : str - Label of the connection. The default value is: - :code:`'source:source_id_target:target_id'`. + x : float, Ref + Vapor mass fraction/quality of the two-phase fluid. + Equation: :py:meth:`x_func `. Note ---- @@ -646,8 +656,8 @@ def __init__(self, source, outlet_id, target, inlet_id, self._check_connector_id(source, outlet_id, source.outlets()) self._check_connector_id(target, inlet_id, target.inlets()) - self.state = dc_simple() - self.phase = dc_simple() + self.state = dc_simple(dtype="str") + self.phase = dc_simple(dtype="str") self.mixing_rule = None self._fluid_data = None self._init_common(source, outlet_id, target, inlet_id, label, **kwargs) @@ -1280,6 +1290,7 @@ def get_parameters(self): d=1e-5, description="mass fractions of the fluid composition (system variable)" ), "fluid_balance": dc_simple( + dtype="bool", func=self.fluid_balance_func, deriv=self.fluid_balance_deriv, _val=False, num_eq_sets=1, diff --git a/src/tespy/connections/humidairconnection.py b/src/tespy/connections/humidairconnection.py index 6537bbea1..170c78791 100644 --- a/src/tespy/connections/humidairconnection.py +++ b/src/tespy/connections/humidairconnection.py @@ -87,6 +87,7 @@ def get_parameters(self): description="relative humidity" ), "fluid_balance": dc_simple( + dtype="bool", func=self.fluid_balance_func, deriv=self.fluid_balance_deriv, _val=False, num_eq_sets=1, diff --git a/src/tespy/connections/powerconnection.py b/src/tespy/connections/powerconnection.py index 2857d4921..9d7e59379 100644 --- a/src/tespy/connections/powerconnection.py +++ b/src/tespy/connections/powerconnection.py @@ -95,4 +95,3 @@ def _get_result_cols(cls, all_fluids): def collect_results(self, all_fluids): return [self.E.val, self.E.unit] - diff --git a/src/tespy/data/char_maps.json b/src/tespy/data/char_maps.json index 550034b80..289ab2737 100644 --- a/src/tespy/data/char_maps.json +++ b/src/tespy/data/char_maps.json @@ -1,74 +1,4 @@ { - "Compressor": { - "char_map_pr": { - "DEFAULT": { - "x": [0.810, 0.870, 0.946, 0.971, 1, 1.029, 1.062], - "y": [[0.460, 0.481, 0.502, 0.523, 0.543, - 0.562,0.583, 0.598, 0.606, 0.612], - [0.590, 0.605, 0.620, 0.640, 0.660, - 0.685, 0.703, 0.710, 0.711, 0.713], - [0.767, 0.805, 0.838, 0.859, 0.87, - 0.876, 0.878, 0.878, 0.879, 0.88], - [0.874, 0.908, 0.93, 0.943, 0.953, - 0.961, 0.962, 0.963, 0.963, 0.964], - [0.948, 0.974, 0.987, 0.995, 1.0, - 1.002, 1.005, 1.005, 1.006, 1.006], - [1.014, 1.017, 1.02, 1.023, 1.026, - 1.028, 1.03, 1.032, 1.034, 1.036], - [1.045, 1.047, 1.049, 1.051, 1.052, - 1.053, 1.054, 1.054, 1.055, 1.056]], - "z": [[0.502, 0.493, 0.485, 0.467, 0.442, - 0.411, 0.378, 0.344, 0.31, 0.276], - [0.65, 0.637, 0.617, 0.589, 0.556, - 0.519, 0.482, 0.445, 0.407, 0.37], - [0.931, 0.917, 0.893, 0.859, 0.82, - 0.779, 0.738, 0.698, 0.657, 0.616], - [1.05, 1.02, 0.982, 0.939, 0.895, - 0.851, 0.806, 0.762, 0.717, 0.672], - [1.195, 1.151, 1.102, 1.052, 1.0, - 0.951, 0.9, 0.85, 0.799, 0.748], - [1.34, 1.276, 1.213, 1.149, 1.085, - 1.022, 0.958, 0.894, 0.831, 0.767], - [1.441, 1.37, 1.3, 1.229, 1.158, - 1.088, 1.017, 0.946, 0.876, 0.805]], - "ref": "Plis2016" - } - }, - "char_map_eta_s": { - "DEFAULT": { - "x": [0.810, 0.870, 0.946, 0.971, 1, 1.029, 1.062], - "y": [[0.460, 0.481, 0.502, 0.523, 0.543, - 0.562,0.583, 0.598, 0.606, 0.612], - [0.590, 0.605, 0.620, 0.640, 0.660, - 0.685, 0.703, 0.710, 0.711, 0.713], - [0.767, 0.805, 0.838, 0.859, 0.87, - 0.876, 0.878, 0.878, 0.879, 0.88], - [0.874, 0.908, 0.93, 0.943, 0.953, - 0.961, 0.962, 0.963, 0.963, 0.964], - [0.948, 0.974, 0.987, 0.995, 1.0, - 1.002, 1.005, 1.005, 1.006, 1.006], - [1.014, 1.017, 1.02, 1.023, 1.026, - 1.028, 1.03, 1.032, 1.034, 1.036], - [1.045, 1.047, 1.049, 1.051, 1.052, - 1.053, 1.054, 1.054, 1.055, 1.056]], - "z": [[0.872, 0.885, 0.898, 0.911, 0.925, - 0.94, 0.945, 0.926, 0.903, 0.879], - [0.887, 0.909, 0.93, 0.947, 0.963, - 0.971, 0.965, 0.939, 0.913, 0.887], - [0.891, 0.918, 0.946, 0.973, 1.001, - 1.014, 1.015, 0.986, 0.955, 0.925], - [0.977, 0.977, 0.981, 0.995, 1.007, - 1.002, 0.981, 0.961, 0.94, 0.92], - [0.956, 0.959, 0.969, 0.984, 1.0, - 0.985, 0.967, 0.95, 0.932, 0.914], - [0.948, 0.959, 0.962, 0.949, 0.935, - 0.922, 0.908, 0.895, 0.881, 0.868], - [0.879, 0.888, 0.898, 0.907, 0.916, - 0.924, 0.915, 0.906, 0.896, 0.887]], - "ref": "Plis2016" - } - } - }, "TurboCompressor": { "char_map_pr": { "DEFAULT": { diff --git a/src/tespy/models/template.py b/src/tespy/models/template.py index 7758b3736..6fa51aecf 100644 --- a/src/tespy/models/template.py +++ b/src/tespy/models/template.py @@ -450,7 +450,7 @@ def run_exergy(model): results["_idx"] = order return results.sort_values(by="_idx").drop(columns="_idx").reset_index(drop=True) - # Method for checking the parameter lenghts + # Method for checking the parameter lengths def _check_parameter_lengths(self, param_dict=None): lengths = [len(v) for v in param_dict.values()] if len(set(lengths)) != 1: diff --git a/src/tespy/tools/data_containers.py b/src/tespy/tools/data_containers.py index 07359f3a9..134580f79 100644 --- a/src/tespy/tools/data_containers.py +++ b/src/tespy/tools/data_containers.py @@ -748,12 +748,22 @@ def set_unit(self, value): class ComponentProperties(FluidProperties): + @staticmethod + def attr(): + attrs = FluidProperties.attr() + attrs["_allows_var"] = False + return attrs + def _serialize(self): keys = ["val", "val_SI", "is_set", "unit", "is_var"] return {k: getattr(self, k) for k in keys} def accept(self, value): if value == "var": + if not self._allows_var: + raise ValueError( + "This parameter cannot be made a system variable." + ) self.is_set = True self.is_var = True else: @@ -1089,7 +1099,8 @@ def attr(): "structure_matrix": None, "_solved": False, 'dependents': None, - "description": None + "description": None, + "dtype": None, } def _serialize(self): diff --git a/src/tespy/tools/schema.py b/src/tespy/tools/schema.py new file mode 100644 index 000000000..b0ecb30d5 --- /dev/null +++ b/src/tespy/tools/schema.py @@ -0,0 +1,244 @@ +# -*- coding: utf-8 + +"""Utility for generating a JSON schema description of TESPy components +and connections, listing each parameter with its data-container type, +physical quantity and description. +""" + +import json +import warnings + +from tespy.tools.data_containers import ComponentCharacteristicMaps +from tespy.tools.data_containers import ComponentCharacteristics +from tespy.tools.data_containers import ComponentMandatoryConstraints +from tespy.tools.data_containers import ComponentProperties +from tespy.tools.data_containers import FluidComposition +from tespy.tools.data_containers import FluidProperties +from tespy.tools.data_containers import GroupedComponentCharacteristics +from tespy.tools.data_containers import GroupedComponentProperties +from tespy.tools.data_containers import ReferencedFluidProperties +from tespy.tools.data_containers import SimpleDataContainer + +# Human-readable names for each data-container class +_DC_TYPE_NAMES = { + ComponentProperties: "ComponentProperty", + ComponentCharacteristics: "ComponentCharacteristic", + ComponentCharacteristicMaps: "ComponentCharacteristicMap", + GroupedComponentProperties: "GroupedComponentProperties", + GroupedComponentCharacteristics: "GroupedComponentCharacteristics", + ComponentMandatoryConstraints: "ComponentMandatoryConstraint", + FluidProperties: "FluidProperties", + FluidComposition: "FluidComposition", + ReferencedFluidProperties: "ReferencedFluidProperties", + SimpleDataContainer: "SimpleDataContainer", +} + + +def _dc_type_name(dc_instance): + """Return the human-readable data-container type name.""" + for cls, name in _DC_TYPE_NAMES.items(): + if type(dc_instance) is cls: + return name + # Fallback: use the class name directly + return type(dc_instance).__name__ + + +def _serialize_parameter(name, dc_instance): + """Build a dict describing one parameter from its data-container.""" + entry = { + "name": name, + "container_type": _dc_type_name(dc_instance), + "description": getattr(dc_instance, "description", None), + } + + # Physical quantity (present on ComponentProperties / FluidProperties + # and subclasses, absent on SimpleDataContainer etc.) + quantity = getattr(dc_instance, "quantity", None) + if quantity is not None: + entry["quantity"] = quantity + + # For grouped containers, list the member parameter names + if isinstance(dc_instance, (GroupedComponentProperties, GroupedComponentCharacteristics)): + entry["elements"] = list(getattr(dc_instance, "elements", [])) + + return entry + + +def _instantiate_component(cls): + """ + Return a minimally initialised instance of a component class. + + Node-like classes declare get_parameters() as a @staticmethod and do not + need an instance. For all other classes we run the base Component.__init__ + with a harmless dummy label, which is the safest path because some + get_parameters() overrides inspect self.inl / self.outl counts. + """ + import inspect + if isinstance(inspect.getattr_static(cls, "get_parameters"), staticmethod): + return None # no instance needed + + from tespy.components.component import Component + instance = cls.__new__(cls) + Component.__init__(instance, "_schema_probe_") + return instance + + +def _get_parameters_for_class(cls, instance=None): + """Return the get_parameters() dict for *cls*, reusing *instance* if given.""" + import inspect + if isinstance(inspect.getattr_static(cls, "get_parameters"), staticmethod): + return cls.get_parameters() + if instance is None: + instance = _instantiate_component(cls) + return instance.get_parameters() + + + +def generate_component_schema( + exclude_base_classes=("Component",), + as_json=True, + indent=2, +): + """ + Return a serialized description of all registered TESPy component classes. + + For every class in the component registry (except those listed in + *exclude_base_classes*) the function collects every parameter returned by + ``get_parameters()`` and records: + + * the parameter name + * the data-container type (e.g. ``ComponentProperty``, ``ComponentCharacteristic``) + * the physical quantity (e.g. ``"pressure"``, ``"efficiency"``) when available + * the human-readable description + + Parameters + ---------- + exclude_base_classes : tuple[str], optional + Names of registry entries to skip. Defaults to ``("Component",)``. + as_json : bool, optional + When *True* (default) return a JSON string; when *False* return the + raw nested dict. + indent : int, optional + JSON indentation level (only used when *as_json* is True). + + Returns + ------- + str | dict + JSON string or dict depending on *as_json*. + """ + warnings.warn( + "tespy.tools.schema is not yet stable and may change without notice in future releases.", + FutureWarning, + stacklevel=2, + ) + from tespy.components.component import component_registry + + schema = {} + + for class_name, cls in component_registry.items.items(): + if class_name in exclude_base_classes: + continue + + try: + instance = _instantiate_component(cls) + parameters = _get_parameters_for_class(cls, instance) + except Exception as exc: + schema[class_name] = {"error": str(exc)} + continue + + params_list = [ + _serialize_parameter(param_name, dc) + for param_name, dc in parameters.items() + ] + + # e.g. "tespy.components.turbomachinery.turbine" → "turbomachinery" + module_parts = cls.__module__.split(".") + submodule = module_parts[2] if len(module_parts) > 2 else cls.__module__ + + ports = cls.port_schema() + + schema[class_name] = { + "module": cls.__module__, + "submodule": submodule, + "inlets": ports["inlets"], + "outlets": ports["outlets"], + "powerinlets": ports["powerinlets"], + "poweroutlets": ports["poweroutlets"], + "heatinlets": ports["heatinlets"], + "heatoutlets": ports["heatoutlets"], + "parameters": params_list, + } + + if as_json: + return json.dumps(schema, indent=indent) + return schema + + +def generate_connection_schema( + exclude_base_classes=(), + as_json=True, + indent=2, +): + """ + Return a serialized description of all registered TESPy connection classes. + + Parameters + ---------- + exclude_base_classes : tuple[str], optional + Names of registry entries to skip. Defaults to + ``("Connection", "PowerConnection")``. + as_json : bool, optional + When *True* (default) return a JSON string; when *False* return the + raw nested dict. + indent : int, optional + JSON indentation level (only used when *as_json* is True). + + Returns + ------- + str | dict + JSON string or dict depending on *as_json*. + """ + warnings.warn( + "tespy.tools.schema is not yet stable and may change without notice in future releases.", + FutureWarning, + stacklevel=2, + ) + from tespy.connections.connection import connection_registry + + schema = {} + + for class_name, cls in connection_registry.items.items(): + if class_name in exclude_base_classes: + continue + + # Connection classes need two component arguments; use a lightweight + # approach: call get_parameters() on a bare (uninitialized) instance + # via a staticmethod check, or fall back to calling the unbound method + # with a sentinel self. + try: + import inspect as _inspect + static_gp = _inspect.getattr_static(cls, "get_parameters", None) + if isinstance(static_gp, staticmethod): + parameters = cls.get_parameters() + else: + # Connection.get_parameters() only accesses self for method + # lookup; create a hollow proxy to avoid full __init__ + instance = cls.__new__(cls) + parameters = cls.get_parameters(instance) + except Exception as exc: + schema[class_name] = {"error": str(exc)} + continue + + params_list = [ + _serialize_parameter(param_name, dc) + for param_name, dc in parameters.items() + ] + + schema[class_name] = { + "module": cls.__module__, + "parameters": params_list, + } + + if as_json: + return json.dumps(schema, indent=indent) + return schema diff --git a/tests/test_tools/test_schema.py b/tests/test_tools/test_schema.py new file mode 100644 index 000000000..3464ec3cf --- /dev/null +++ b/tests/test_tools/test_schema.py @@ -0,0 +1,364 @@ +# -*- coding: utf-8 + +"""Tests for tespy.tools.schema - component and connection schema generation. + +This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted +by the contributors recorded in the version control history of the file, +available from its original location tests/test_tools/test_schema.py + +SPDX-License-Identifier: MIT +""" +import json + +import pytest + +from tespy.components.component import component_registry +from tespy.connections.connection import connection_registry +from tespy.tools.schema import _dc_type_name +from tespy.tools.schema import _serialize_parameter +from tespy.tools.schema import generate_component_schema +from tespy.tools.schema import generate_connection_schema + +# --------------------------------------------------------------------------- +# Fixtures - generate schemas once per session for speed +# --------------------------------------------------------------------------- + +@pytest.fixture(scope="session") +def component_schema(): + return generate_component_schema(as_json=False) + + +@pytest.fixture(scope="session") +def connection_schema(): + return generate_connection_schema(as_json=False) + + +# --------------------------------------------------------------------------- +# Return-type tests +# --------------------------------------------------------------------------- + +class TestReturnTypes: + def test_component_schema_returns_json_string_by_default(self): + result = generate_component_schema() + assert isinstance(result, str) + parsed = json.loads(result) + assert isinstance(parsed, dict) + + def test_component_schema_returns_dict_when_requested(self, component_schema): + assert isinstance(component_schema, dict) + + def test_connection_schema_returns_json_string_by_default(self): + result = generate_connection_schema() + assert isinstance(result, str) + parsed = json.loads(result) + assert isinstance(parsed, dict) + + def test_connection_schema_returns_dict_when_requested(self, connection_schema): + assert isinstance(connection_schema, dict) + + +# --------------------------------------------------------------------------- +# Component schema - presence and structure +# --------------------------------------------------------------------------- + +class TestComponentSchemaStructure: + def test_base_component_excluded_by_default(self, component_schema): + assert "Component" not in component_schema + + def test_known_components_present(self, component_schema): + expected = set(component_registry.items.keys()) - {"Component"} + for name in expected: + assert name in component_schema, f"{name} missing from component schema" + + def test_no_component_has_error(self, component_schema): + errors = {k: v for k, v in component_schema.items() if "error" in v} + assert errors == {}, f"Schema generation errors: {errors}" + + def test_component_entry_has_required_keys(self, component_schema): + required = { + "module", "submodule", "inlets", "outlets", + "powerinlets", "poweroutlets", + "heatinlets", "heatoutlets", + "parameters" + } + for name, entry in component_schema.items(): + assert required <= entry.keys(), ( + f"{name} is missing keys: {required - entry.keys()}" + ) + + def test_parameters_is_a_list(self, component_schema): + for name, entry in component_schema.items(): + assert isinstance(entry["parameters"], list), ( + f"{name}.parameters is not a list" + ) + + def test_each_parameter_has_required_keys(self, component_schema): + required = {"name", "container_type", "description"} + for comp_name, entry in component_schema.items(): + for param in entry["parameters"]: + assert required <= param.keys(), ( + f"{comp_name}.{param.get('name')} missing keys: " + f"{required - param.keys()}" + ) + + def test_submodule_extracted_correctly(self, component_schema): + assert component_schema["Turbine"]["submodule"] == "turbomachinery" + assert component_schema["HeatExchanger"]["submodule"] == "heat_exchangers" + assert component_schema["Source"]["submodule"] == "basics" + assert component_schema["Merge"]["submodule"] == "nodes" + assert component_schema["Motor"]["submodule"] == "power" + + def test_exclusion_respected(self): + schema = generate_component_schema( + exclude_base_classes=("Turbine", "Compressor"), as_json=False + ) + assert "Turbine" not in schema + assert "Compressor" not in schema + assert "Pump" in schema + + +# --------------------------------------------------------------------------- +# Component schema - specific parameter details +# --------------------------------------------------------------------------- + +class TestComponentParameters: + def _get_param(self, component_schema, component, param_name): + params = {p["name"]: p for p in component_schema[component]["parameters"]} + assert param_name in params, ( + f"Parameter '{param_name}' not found in {component}. " + f"Available: {list(params)}" + ) + return params[param_name] + + def test_turbine_eta_s_is_component_property(self, component_schema): + p = self._get_param(component_schema, "Turbine", "eta_s") + assert p["container_type"] == "ComponentProperty" + assert p["quantity"] == "efficiency" + + def test_polynomial_compressor_has_grouped_properties(self, component_schema): + p = self._get_param(component_schema, "PolynomialCompressor", "eta_s_group") + assert p["container_type"] == "GroupedComponentProperties" + assert "elements" in p + assert isinstance(p["elements"], list) + assert len(p["elements"]) > 0 + + def test_turbine_pr_is_component_property(self, component_schema): + p = self._get_param(component_schema, "Turbine", "pr") + assert p["container_type"] == "ComponentProperty" + + def test_motor_eta_is_efficiency(self, component_schema): + p = self._get_param(component_schema, "Motor", "eta") + assert p["container_type"] == "ComponentProperty" + assert p["quantity"] == "efficiency" + + def test_motor_eta_char_is_characteristic(self, component_schema): + p = self._get_param(component_schema, "Motor", "eta_char") + assert p["container_type"] == "ComponentCharacteristic" + + def test_subsystem_interface_num_inter_is_simple(self, component_schema): + p = self._get_param(component_schema, "SubsystemInterface", "num_inter") + assert p["container_type"] == "SimpleDataContainer" + + +# --------------------------------------------------------------------------- +# Port schema +# --------------------------------------------------------------------------- + +class TestPortSchema: + def test_fixed_ports_have_ports_list(self, component_schema): + inlets = component_schema["CycleCloser"]["inlets"] + assert inlets["type"] == "fixed" + assert "ports" in inlets + assert inlets["ports"] == ["in1"] + + def test_variable_ports_have_parameter_and_pattern(self, component_schema): + inlets = component_schema["Merge"]["inlets"] + assert inlets["type"] == "variable" + assert inlets["parameter"] == "num_in" + assert "pattern" in inlets + assert "min" in inlets + + def test_subsystem_interface_variable_in_and_out(self, component_schema): + entry = component_schema["SubsystemInterface"] + assert entry["inlets"]["type"] == "variable" + assert entry["outlets"]["type"] == "variable" + assert entry["inlets"]["parameter"] == "num_inter" + assert entry["outlets"]["parameter"] == "num_inter" + + def test_splitter_has_variable_outlets(self, component_schema): + outlets = component_schema["Splitter"]["outlets"] + assert outlets["type"] == "variable" + assert outlets["parameter"] == "num_out" + + def test_motor_has_power_ports_only(self, component_schema): + entry = component_schema["Motor"] + assert entry["inlets"]["ports"] == [] + assert entry["outlets"]["ports"] == [] + assert entry["powerinlets"]["type"] == "fixed" + assert entry["powerinlets"]["ports"] == ["power_in"] + assert entry["poweroutlets"]["type"] == "fixed" + assert entry["poweroutlets"]["ports"] == ["power_out"] + assert entry["heatinlets"]["ports"] == [] + assert entry["heatoutlets"]["ports"] == [] + + def test_source_has_no_inlets(self, component_schema): + inlets = component_schema["Source"]["inlets"] + assert inlets["type"] == "fixed" + assert inlets["ports"] == [] + + def test_sink_has_no_outlets(self, component_schema): + outlets = component_schema["Sink"]["outlets"] + assert outlets["type"] == "fixed" + assert outlets["ports"] == [] + + def test_simple_heat_exchanger_heat_and_power_ports(self, component_schema): + entry = component_schema["SimpleHeatExchanger"] + assert entry["powerinlets"]["ports"] == ["heat"] + assert entry["poweroutlets"]["ports"] == ["heat"] + assert entry["heatinlets"]["ports"] == ["heat"] + assert entry["heatoutlets"]["ports"] == ["heat"] + + def test_heat_sink_has_heat_inlet(self, component_schema): + entry = component_schema["HeatSink"] + assert entry["heatinlets"]["type"] == "fixed" + assert entry["heatinlets"]["ports"] == ["heat"] + assert entry["powerinlets"]["ports"] == [] + + def test_heat_source_has_heat_outlet(self, component_schema): + entry = component_schema["HeatSource"] + assert entry["heatoutlets"]["type"] == "fixed" + assert entry["heatoutlets"]["ports"] == ["heat"] + assert entry["poweroutlets"]["ports"] == [] + + def test_power_sink_has_power_inlet(self, component_schema): + entry = component_schema["PowerSink"] + assert entry["powerinlets"]["ports"] == ["power"] + assert entry["heatinlets"]["ports"] == [] + + def test_power_source_has_power_outlet(self, component_schema): + entry = component_schema["PowerSource"] + assert entry["poweroutlets"]["ports"] == ["power"] + assert entry["heatoutlets"]["ports"] == [] + + def test_heat_bus_has_variable_heat_ports(self, component_schema): + entry = component_schema["HeatBus"] + assert entry["heatinlets"]["type"] == "variable" + assert entry["heatinlets"]["pattern"] == "heat_in{n}" + assert entry["heatoutlets"]["type"] == "variable" + assert entry["heatoutlets"]["pattern"] == "heat_out{n}" + assert entry["powerinlets"]["ports"] == [] + assert entry["poweroutlets"]["ports"] == [] + + def test_turbine_has_no_power_ports_by_default(self, component_schema): + entry = component_schema["Turbine"] + assert entry["powerinlets"]["type"] == "fixed" + assert entry["powerinlets"]["ports"] == [] + assert entry["poweroutlets"]["type"] == "fixed" + + +# --------------------------------------------------------------------------- +# Connection schema +# --------------------------------------------------------------------------- + +class TestConnectionSchema: + def test_connection_types_present(self, connection_schema): + expected = set(connection_registry.items.keys()) + for name in expected: + assert name in connection_schema, f"{name} missing from component schema" + + def test_connection_entry_has_required_keys(self, connection_schema): + for name, entry in connection_schema.items(): + assert "module" in entry + assert "parameters" in entry + + def test_no_connection_has_error(self, connection_schema): + errors = {k: v for k, v in connection_schema.items() if "error" in v} + assert errors == {}, f"Schema generation errors: {errors}" + + def test_connection_has_fluid_parameters(self, connection_schema): + params = {p["name"] for p in connection_schema["Connection"]["parameters"]} + assert {"m", "p", "h", "T", "x", "fluid"} <= params + + def test_power_connection_has_E_parameter(self, connection_schema): + params = {p["name"]: p for p in connection_schema["PowerConnection"]["parameters"]} + assert "E" in params + assert params["E"]["container_type"] == "FluidProperties" + + def test_fluid_composition_container_type(self, connection_schema): + params = {p["name"]: p for p in connection_schema["Connection"]["parameters"]} + assert params["fluid"]["container_type"] == "FluidComposition" + + def test_specific_connection_excluded(self): + exclude = "Connection" + expected = set(connection_registry.items.keys()) - {exclude} + schema = generate_connection_schema( + exclude_base_classes=(exclude,), as_json=False + ) + for name in expected: + assert name in schema, f"{name} missing from component schema" + assert exclude not in schema + + +# --------------------------------------------------------------------------- +# Internal helpers +# --------------------------------------------------------------------------- + +class TestDcTypeName: + def test_known_container_types(self): + from tespy.tools.data_containers import ComponentCharacteristicMaps + from tespy.tools.data_containers import ComponentCharacteristics + from tespy.tools.data_containers import ComponentProperties + from tespy.tools.data_containers import FluidComposition + from tespy.tools.data_containers import FluidProperties + from tespy.tools.data_containers import GroupedComponentCharacteristics + from tespy.tools.data_containers import GroupedComponentProperties + from tespy.tools.data_containers import SimpleDataContainer + + cases = [ + # TODO: Name of container?! + (ComponentProperties(), "ComponentProperty"), + (ComponentCharacteristics(), "ComponentCharacteristic"), + (ComponentCharacteristicMaps(), "ComponentCharacteristicMap"), + (GroupedComponentProperties(), "GroupedComponentProperties"), + (GroupedComponentCharacteristics(), "GroupedComponentCharacteristics"), + (FluidProperties(), "FluidProperties"), + (FluidComposition(), "FluidComposition"), + (SimpleDataContainer(), "SimpleDataContainer"), + ] + for instance, expected in cases: + assert _dc_type_name(instance) == expected, ( + f"Expected {expected} for {type(instance).__name__}" + ) + + def test_unknown_type_falls_back_to_class_name(self): + class MyContainer: + pass + assert _dc_type_name(MyContainer()) == "MyContainer" + + +class TestSerializeParameter: + def test_quantity_included_when_present(self): + from tespy.tools.data_containers import ComponentProperties as dc_cp + dc = dc_cp(quantity="pressure") + result = _serialize_parameter("pr", dc) + assert result["quantity"] == "pressure" + assert result["name"] == "pr" + assert result["container_type"] == "ComponentProperty" + + def test_quantity_omitted_when_absent(self): + from tespy.tools.data_containers import SimpleDataContainer as dc_simple + dc = dc_simple() + result = _serialize_parameter("flag", dc) + assert "quantity" not in result + + def test_grouped_includes_elements(self): + from tespy.tools.data_containers import GroupedComponentProperties as dc_gcp + dc = dc_gcp(elements=["a", "b", "c"]) + result = _serialize_parameter("group", dc) + assert result["elements"] == ["a", "b", "c"] + + def test_non_grouped_has_no_elements(self): + from tespy.tools.data_containers import ComponentProperties as dc_cp + dc = dc_cp() + result = _serialize_parameter("pr", dc) + assert "elements" not in result