Skip to content

Commit

Permalink
Output carbon emissions as just 'tonnes' instead of 'metric tonnes' (…
Browse files Browse the repository at this point in the history
…fixes result unit parsing)
  • Loading branch information
softwareengineerprogrammer committed Jun 26, 2024
1 parent 520ae72 commit 5515408
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/geophires_x/Outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/example1_addons.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/example1_addons.out
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand Down

0 comments on commit 5515408

Please sign in to comment.