From 491b33bef3f877d76690d452234880069e531866 Mon Sep 17 00:00:00 2001 From: jmorris-uk Date: Tue, 21 Jan 2025 12:38:09 +0000 Subject: [PATCH 1/2] Modified output in power.py for issue 1431 --- process/power.py | 51 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/process/power.py b/process/power.py index e09bf5246d..4451465b4b 100644 --- a/process/power.py +++ b/process/power.py @@ -989,23 +989,40 @@ def power2(self, output: bool): "(tcoolin)", tfcoil_variables.tcoolin, ) - # TODO: Both of these efficiencies are printed when it should be either 13% (ITER) or 40% (Strawbrige) - subset of TODO on line 1118 - po.ovarre( - self.outfile, - "Efficiency (figure of merit) of cryogenic plant is 13% of ideal Carnot value:", - "", - (tfcoil_variables.eff_tf_cryo * tfcoil_variables.tmpcry) - / (293.0e0 - tfcoil_variables.tmpcry), - "OP ", - ) - po.ovarre( - self.outfile, - "Efficiency (figure of merit) of cryogenic aluminium plant is 40% of ideal Carnot value:", - "", - (tfcoil_variables.eff_tf_cryo * tfcoil_variables.tcoolin) - / (293.0e0 - tfcoil_variables.tcoolin), - "OP ", - ) + + # Cryo-plants efficiencies + if abs(tfcoil_variables.eff_tf_cryo + 1) < 1e-6: + # The ITER cyoplant efficiency is used for SC + if tfcoil_variables.i_tf_sup == 1: + po.ovarre( + self.outfile, + "Efficiency (figure of merit) of cryogenic plant is 13% of ideal Carnot value:", + "", + (tfcoil_variables.eff_tf_cryo * tfcoil_variables.tmpcry) + / (293.0e0 - tfcoil_variables.tmpcry), + "OP ", + ) + # Strawbrige plot extrapolation is used for Cryo-Al + elif tfcoil_variables.i_tf_sup == 2: + po.ovarre( + self.outfile, + "Efficiency (figure of merit) of cryogenic aluminium plant is 40% of ideal Carnot value:", + "", + (tfcoil_variables.eff_tf_cryo * tfcoil_variables.tcoolin) + / (293.0e0 - tfcoil_variables.tcoolin), + "OP ", + ) + else: + efficiency = tfcoil_variables.eff_tf_cryo*100.0 + po.ovarre( + self.outfile, + f"Efficiency (figure of merit) of cryogenic plant is {efficiency}% of ideal Carnot value (user input):", + "", + (tfcoil_variables.eff_tf_cryo * tfcoil_variables.tcoolin) + / (293.0e0 - tfcoil_variables.tcoolin), + "OP ", + ) + po.ovarre( self.outfile, "Electric power for cryogenic plant (MW)", From 32465d1551125c3c72414d007ce05e0f50f69a9f Mon Sep 17 00:00:00 2001 From: jmorris-uk Date: Tue, 21 Jan 2025 12:40:47 +0000 Subject: [PATCH 2/2] Minor ruff change --- process/power.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/power.py b/process/power.py index 4451465b4b..a2e44122f3 100644 --- a/process/power.py +++ b/process/power.py @@ -1013,7 +1013,7 @@ def power2(self, output: bool): "OP ", ) else: - efficiency = tfcoil_variables.eff_tf_cryo*100.0 + efficiency = tfcoil_variables.eff_tf_cryo * 100.0 po.ovarre( self.outfile, f"Efficiency (figure of merit) of cryogenic plant is {efficiency}% of ideal Carnot value (user input):",