From 55154083b2fb162e7dff0dea9f512de4fc63503d Mon Sep 17 00:00:00 2001 From: softwareengineerprogrammer <4056124+softwareengineerprogrammer@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:52:56 -0700 Subject: [PATCH] Output carbon emissions as just 'tonnes' instead of 'metric tonnes' (fixes result unit parsing) --- src/geophires_x/Outputs.py | 4 ++-- tests/example1_addons.csv | 2 +- tests/examples/example1_addons.out | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geophires_x/Outputs.py b/src/geophires_x/Outputs.py index 6912ccd1..23e869cd 100644 --- a/src/geophires_x/Outputs.py +++ b/src/geophires_x/Outputs.py @@ -864,7 +864,7 @@ def PrintOutputs(self, model: Model): if model.economics.DoCarbonCalculations.value: summary.append(OutputTableItem('Total Avoided Carbon Emissions', '{0:10.2f}'.format( - model.economics.CarbonThatWouldHaveBeenProducedTotal.value * 0.000453592), 'metric tonnes')) + model.economics.CarbonThatWouldHaveBeenProducedTotal.value * 0.000453592), 'tonnes')) if model.economics.econmodel.value == EconomicModel.FCR: economic_parameters.append(OutputTableItem('Economic Model', model.economics.econmodel.value.value)) @@ -1605,7 +1605,7 @@ def PrintOutputs(self, model: Model): f.write(f' Segment {str(i):s} Thickness: {model.reserv.layerthickness.value[i-1]:10.0f} ' + model.reserv.layerthickness.CurrentUnits.value + NL) f.write(f' Segment {str(i+1):s} Geothermal gradient: {model.reserv.gradient.value[i]:10.4g} ' + model.reserv.gradient.CurrentUnits.value + NL) if model.economics.DoCarbonCalculations.value: - f.write(f' Total Avoided Carbon Emissions: {model.economics.CarbonThatWouldHaveBeenProducedTotal.value*0.000453592:10.2f} metric tonnes' + NL) + f.write(f' Total Avoided Carbon Emissions: {model.economics.CarbonThatWouldHaveBeenProducedTotal.value*0.000453592:10.2f} tonnes' + NL) f.write(NL) f.write(NL) diff --git a/tests/example1_addons.csv b/tests/example1_addons.csv index fe067704..1158ef2b 100644 --- a/tests/example1_addons.csv +++ b/tests/example1_addons.csv @@ -7,7 +7,7 @@ SUMMARY OF RESULTS,Number of injection wells,,2,count SUMMARY OF RESULTS,Flowrate per production well,,55.0,kg/sec SUMMARY OF RESULTS,"Well depth (or total length\, if not vertical)",,3.0,kilometer SUMMARY OF RESULTS,Geothermal gradient,,50,degC/km -SUMMARY OF RESULTS,Total Avoided Carbon Emissions,,472017.81, +SUMMARY OF RESULTS,Total Avoided Carbon Emissions,,472017.81,tonnes ECONOMIC PARAMETERS,Economic Model,,Fixed Charge Rate (FCR), ECONOMIC PARAMETERS,Accrued financing during construction,,0.0, ECONOMIC PARAMETERS,Project lifetime,,30,yr diff --git a/tests/examples/example1_addons.out b/tests/examples/example1_addons.out index 7af1d09f..a5da5570 100644 --- a/tests/examples/example1_addons.out +++ b/tests/examples/example1_addons.out @@ -19,7 +19,7 @@ Simulation Metadata Flowrate per production well: 55.0 kg/sec Well depth (or total length, if not vertical): 3.0 kilometer Geothermal gradient: 50 degC/km - Total Avoided Carbon Emissions: 472017.81 metric tonnes + Total Avoided Carbon Emissions: 472017.81 tonnes ***ECONOMIC PARAMETERS***