Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revenue & Cashflow Profile #16

Merged
merged 32 commits into from
Mar 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
71b45f2
Fixed typo in Economics.py for Parallel CHP production LCOH calculation.
malcolm-dsider Feb 14, 2024
7897f47
Update HIP-RA-X functions to include pressure in all calculations.
malcolm-dsider Feb 20, 2024
2ed5773
Update HIP-RA-X functions to include pressure in all calculations.
malcolm-dsider Feb 20, 2024
cb1adf8
Update HIP-RA-X functions to include pressure in all calculations. Up…
malcolm-dsider Feb 21, 2024
49ff3a1
WIP 2024-03-01
malcolm-dsider Mar 1, 2024
7882e59
Updates all example outputs to contain new output, like cashflow tabl…
malcolm-dsider Mar 3, 2024
c7e8994
Updates to allow testing framework to work. Also contains Rich libray…
malcolm-dsider Mar 3, 2024
e91a3c0
updated test for higher temperature limit for UtilEff. Was 373.xxx, n…
malcolm-dsider Mar 3, 2024
c0c98ee
updates that allow testing famework to work with sys.argv containing …
malcolm-dsider Mar 3, 2024
af3a6f8
fixed python 3.8 syntax error
malcolm-dsider Mar 3, 2024
468998f
Update example11_AC IRR output format
softwareengineerprogrammer Mar 4, 2024
fc03c4d
Undo backwards-incompatible '(LCOE)' suffix to 'Electricity breakeven…
softwareengineerprogrammer Mar 4, 2024
c2d00ce
Remove obsolete FIXME in MC
softwareengineerprogrammer Mar 4, 2024
ec6edb1
Revert erroneous rollback of output file arg centralization
softwareengineerprogrammer Mar 4, 2024
57ace7d
WIP - extract revenue & cashflow profile
softwareengineerprogrammer Mar 4, 2024
f771923
FIXME re: transforming CCUS profile from revenue & cashflow
softwareengineerprogrammer Mar 4, 2024
e5d4bd7
REVENUE & CASHFLOW PROFILE extraction/integration
softwareengineerprogrammer Mar 4, 2024
11c70a7
Update examples with revenue & cashflow profiles
softwareengineerprogrammer Mar 4, 2024
43110be
Revert probably-unnecessary addition of blank lines to MC output file…
softwareengineerprogrammer Mar 4, 2024
5e37490
Move Border_EGS_150C_Electricity_Input.txt to Examples
softwareengineerprogrammer Mar 4, 2024
8a95526
Correct utils static pressure methoddoc
softwareengineerprogrammer Mar 4, 2024
17d3b08
Economics - remove redundant value declarations on new fields
softwareengineerprogrammer Mar 4, 2024
a142470
Delete stray HIP.html
softwareengineerprogrammer Mar 4, 2024
3073642
Tweak utils docs
softwareengineerprogrammer Mar 4, 2024
2d5af8f
Document commented WIP implementation for https://github.com/NREL/GEO…
softwareengineerprogrammer Mar 4, 2024
8a9a89c
Align LCOE output spaces
softwareengineerprogrammer Mar 4, 2024
4d98df7
Account for LCOH-suffixed direct-use heat property name change
softwareengineerprogrammer Mar 4, 2024
490d3fe
Re-add erroneously removed type in method doc
softwareengineerprogrammer Mar 4, 2024
469b298
Render projects with no payback period as N/A instead of 0.00 yr
softwareengineerprogrammer Mar 4, 2024
2d635a6
Add payback period & chp cost allocation fields to client result
softwareengineerprogrammer Mar 4, 2024
3acd94b
Update schema-generated geophires-request.json
softwareengineerprogrammer Mar 4, 2024
09390a8
Mark backwards-compatible CCUS profile transform as FIXME TODO instea…
softwareengineerprogrammer Mar 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/geophires_x/AGSOutputs.py
Original file line number Diff line number Diff line change
@@ -75,8 +75,6 @@ def PrintOutputs(self, model: Model):
if not model.economics.econmodel.value == EconomicModel.CLGS:
super().PrintOutputs(model)
else:
if len(sys.argv) > 2:
self.output_file = sys.argv[2]
with open(self.output_file, 'w', encoding='UTF-8') as f:
f.write(' *****************\n')
f.write(' ***CASE REPORT***\n')
27 changes: 18 additions & 9 deletions src/geophires_x/Model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from pathlib import Path
import logging
import time
@@ -44,17 +45,17 @@ class Model(object):
Model is the container class of the application, giving access to everything else, including the logger
"""

def __init__(self, enable_geophires_logging_config=True):
def __init__(self, enable_geophires_logging_config=True, input_file=None):
"""
The __init__ function is called automatically every time the class is being used to create a new object.
:return: Nothing
"""

# get logging started
self.logger = logging.getLogger('root')
self.logger = logging.getLogger('root') # TODO should be getting __name__ logger instead of root

if enable_geophires_logging_config:
logging.config.fileConfig(Path(Path(__file__).parent,'logging.conf'))
logging.config.fileConfig(Path(Path(__file__).parent, 'logging.conf'))
self.logger.setLevel(logging.INFO)

self.logger.info(f'Init {__class__}: {__name__}')
@@ -68,7 +69,10 @@ def __init__(self, enable_geophires_logging_config=True):
# we do this as soon as possible because what we instantiate may depend on settings in this file
self.InputParameters = {}

read_input_file(self.InputParameters, logger=self.logger)
if input_file is None and len(sys.argv) > 1:
input_file = sys.argv[1]

read_input_file(self.InputParameters, logger=self.logger, input_file_name=input_file)

self.sdacgtoutputs = None
self.sdacgteconomics = None
@@ -102,15 +106,20 @@ def __init__(self, enable_geophires_logging_config=True):
self.wellbores: WellBores = WellBores(self)
self.surfaceplant: SurfacePlant = SurfacePlant(self)
self.economics: Economics = Economics(self)
self.outputs: Outputs = Outputs(self)

output_file = 'HDR.out'
if len(sys.argv) > 2:
output_file = sys.argv[2]

self.outputs = Outputs(self, output_file=output_file)

if 'Reservoir Model' in self.InputParameters:
if self.InputParameters['Reservoir Model'].sValue == '7':
# if we use SUTRA output for simulating reservoir thermal energy storage, we use a special wellbore object that can handle SUTRA data
self.wellbores: WellBores = SUTRAWellBores(self)
self.surfaceplant: SurfacePlantSUTRA = SurfacePlantSUTRA(self)
self.economics: SUTRAEconomics = SUTRAEconomics(self)
self.outputs: SUTRAOutputs = SUTRAOutputs(self)
self.outputs: SUTRAOutputs = SUTRAOutputs(self, output_file=output_file)

if 'Is AGS' in self.InputParameters:
if self.InputParameters['Is AGS'].sValue in ['True', 'true', 'TRUE', 'T', '1']:
@@ -123,21 +132,21 @@ def __init__(self, enable_geophires_logging_config=True):
self.wellbores: WellBores = AGSWellBores(self)
self.surfaceplant: SurfacePlantAGS = SurfacePlantAGS(self)
self.economics: AGSEconomics = AGSEconomics(self)
self.outputs: AGSOutputs = AGSOutputs(self)
self.outputs: AGSOutputs = AGSOutputs(self, output_file=output_file)
self.wellbores.IsAGS.value = True

# if we find out we have an add-ons, we need to instantiate it, then read for the parameters
if 'AddOn Nickname 1' in self.InputParameters:
self.logger.info("Initiate the Add-on elements")
self.addeconomics: EconomicsAddOns = EconomicsAddOns(self)
self.addoutputs: OutputsAddOns = OutputsAddOns(self)
self.addoutputs: OutputsAddOns = OutputsAddOns(self, output_file=output_file)

# if we find out we have an S-DAC-GT calculation, we need to instantiate it
if 'Do S-DAC-GT Calculations' in self.InputParameters:
if self.InputParameters['Do S-DAC-GT Calculations'].sValue in ['On', 'on', 'ON', 'True', 'true', 'TRUE', 'T', 't', '1']:
self.logger.info("Initiate the S-DAC-GT elements")
self.sdacgteconomics: EconomicsS_DAC_GT = EconomicsS_DAC_GT(self)
self.sdacgtoutputs: OutputsS_DAC_GT = OutputsS_DAC_GT(self)
self.sdacgtoutputs: OutputsS_DAC_GT = OutputsS_DAC_GT(self, output_file=output_file)

self.logger.info(f'Complete {__class__}: {__name__}')

2 changes: 0 additions & 2 deletions src/geophires_x/Outputs.py
Original file line number Diff line number Diff line change
@@ -102,8 +102,6 @@ def PrintOutputs(self, model: Model):
# write results to output file and screen

try:
if len(sys.argv) > 2:
self.output_file = sys.argv[2]
with open(self.output_file, 'w', encoding='UTF-8') as f:
f.write(' *****************\n')
f.write(' ***CASE REPORT***\n')
2 changes: 0 additions & 2 deletions src/geophires_x/OutputsAddOns.py
Original file line number Diff line number Diff line change
@@ -22,8 +22,6 @@ def PrintOutputs(self, model):
# now do AddOn output, which will append to the original output
# write results to output file and screen
try:
if len(sys.argv) > 2:
self.output_file = sys.argv[2]
with open(self.output_file, 'a', encoding='UTF-8') as f:
f.write(NL)
f.write(NL)
2 changes: 0 additions & 2 deletions src/geophires_x/OutputsCCUS.py
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@ def PrintOutputs(self, model):
# now do CCUS output, which will append to the original output
# write results to output file and screen
try:
if len(sys.argv) > 2:
self.output_file = sys.argv[2]
with open(self.output_file, 'a', encoding='UTF-8') as f:
f.write(NL)
f.write(NL)
2 changes: 0 additions & 2 deletions src/geophires_x/OutputsS_DAC_GT.py
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@ def PrintOutputs(self, model):
# now do S_DAC_GT output, which will append to the original output
# write results to output file and screen
try:
if len(sys.argv) > 2:
self.output_file = sys.argv[2]
with open(self.output_file, 'a', encoding='UTF-8') as f:
f.write(NL)
f.write(NL)
2 changes: 0 additions & 2 deletions src/geophires_x/SUTRAOutputs.py
Original file line number Diff line number Diff line change
@@ -109,8 +109,6 @@ def PrintOutputs(self, model: Model):
# write results to output file and screen

try:
if len(sys.argv) > 2:
self.output_file = sys.argv[2]
with open(self.output_file,'w', encoding='UTF-8') as f:
f.write(' *****************\n')
f.write(' ***CASE REPORT***\n')