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

Updates and Improvements to REFLO System Costing #136

Merged
merged 72 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
fd0d4f1
updates to reflo costing
MuktaHardikar Oct 22, 2024
a969c21
black
kurbansitterley Oct 22, 2024
2753c75
add frac_elec_from_grid
MuktaHardikar Oct 24, 2024
cddf797
add ability to load custom case study definition via yaml
kurbansitterley Oct 24, 2024
c43a825
Merge branch 'reflo-costing-updates' of https://github.com/muktahardi…
kurbansitterley Oct 24, 2024
9dd2542
replace _cs_def
kurbansitterley Oct 25, 2024
7f2aa6f
black
kurbansitterley Oct 25, 2024
fafb2a7
fix lt-med costing
kurbansitterley Oct 27, 2024
82474b9
fix MED VAGMD semibatch class costing test
kurbansitterley Oct 27, 2024
c96b0b7
fix VAGMD batch flowsheet multiperiod test
kurbansitterley Oct 27, 2024
604bf6b
fix trough surrogate test costing
kurbansitterley Oct 27, 2024
00e1856
fix flat plate physical test
kurbansitterley Oct 27, 2024
952c772
fix ltmed surrogate costing test
kurbansitterley Oct 27, 2024
5e87303
fix med-tvc costing test
kurbansitterley Oct 27, 2024
bcbd72e
fix VAGMD surrogate test
kurbansitterley Oct 27, 2024
cdd94eb
fix air stripping test
kurbansitterley Oct 27, 2024
768e928
fix chem softening costing test
kurbansitterley Oct 27, 2024
48feb7c
fix cryst eff test costing
kurbansitterley Oct 27, 2024
1bfd943
fix DWI costing test
kurbansitterley Oct 27, 2024
c15762e
fix mec costing tests
kurbansitterley Oct 27, 2024
7e1bdcd
black
kurbansitterley Oct 27, 2024
975a26b
updating grid_frac equation for more stability. updated expressions t…
MuktaHardikar Nov 7, 2024
b43a357
updating electricity grid fraction
MuktaHardikar Nov 7, 2024
68ff1d1
updated grid_frac_elec equation to check for PV
MuktaHardikar Nov 8, 2024
51b8d2d
run black and updated __init__
MuktaHardikar Nov 11, 2024
5f9ef79
trigger tests
kurbansitterley Nov 11, 2024
0adc7db
black trigger tests
kurbansitterley Nov 11, 2024
f5e2b05
move electricity/heat balances to build_integrated_costs
kurbansitterley Nov 12, 2024
34f7e21
add check for electricity and heat in used_flows to system costing; h…
kurbansitterley Nov 12, 2024
b9188ac
checkpoint
kurbansitterley Nov 12, 2024
840bed2
includes costs when only treatment unit has heat
MuktaHardikar Nov 12, 2024
0a491c3
remove duplicate constraint; correct frac_heat_from_grid constr
kurbansitterley Nov 12, 2024
1cecd0d
system costing has _registered_unit_costing for aggregation of costin…
kurbansitterley Nov 12, 2024
32a5477
remove buy/sell vars from defined_flows
kurbansitterley Nov 12, 2024
94a4a89
revert frac_heat_from_grid constr
kurbansitterley Nov 12, 2024
b1606f6
add dummy testing units
kurbansitterley Nov 12, 2024
3c58b48
add dummy flowsheet
kurbansitterley Nov 12, 2024
8b73515
aggregate_flow_heat at system is aggregate_flow_heat for treatment if…
kurbansitterley Nov 12, 2024
b261065
scale dummy units
kurbansitterley Nov 12, 2024
9e946c1
raise error or Treatment/EnergyCosting blocks aren't found
kurbansitterley Nov 13, 2024
aecb937
implement new approach to handle frac_elec_from_grid
kurbansitterley Nov 13, 2024
6066d93
check param equivalence for all costing blocks
kurbansitterley Nov 13, 2024
20161a3
update to always calc aggregate_flow_heat
MuktaHardikar Nov 13, 2024
ec4209d
add elec gen flag to costing
kurbansitterley Nov 13, 2024
7c80926
remove __main__ func
kurbansitterley Nov 13, 2024
dc4ecdf
initial update to costing test
kurbansitterley Nov 13, 2024
2c6706f
update initial values; add initialize_build routine
kurbansitterley Nov 13, 2024
76ff804
add no heat dummy treatment unit; black
kurbansitterley Nov 13, 2024
646414d
add scaling factors
kurbansitterley Nov 13, 2024
b007a7d
wrong costing method for no heat
kurbansitterley Nov 13, 2024
a6c9eca
capex only positive
kurbansitterley Nov 13, 2024
b790a12
electricity gen tests complete
kurbansitterley Nov 13, 2024
ac5f92a
heat gen only test
kurbansitterley Nov 13, 2024
d24c645
add elec and heat generation tests
kurbansitterley Nov 13, 2024
63d097f
add LCOE
kurbansitterley Nov 14, 2024
0d31f82
add_object_reference to LCOE on REFLOSystemCosting
kurbansitterley Nov 14, 2024
67636bf
add SEEC, STEC, LCOH; scaling
kurbansitterley Nov 14, 2024
1f18dcd
add LCOT, LCOW to REFLOSystemCosting; can't add LCOW to EnergyCosting
kurbansitterley Nov 14, 2024
b400a40
add metric tests
kurbansitterley Nov 14, 2024
b042c6a
use TreatmentCosting so can add LCOW for test
kurbansitterley Nov 14, 2024
5e72b25
Merge branch 'main' into reflo-costing-updates
kurbansitterley Nov 14, 2024
f203134
corrected currency year
zacharybinger Nov 15, 2024
e1d46a2
fix unit inconsistency issue
kurbansitterley Nov 15, 2024
698af60
fix unit inconsistency issue
kurbansitterley Nov 15, 2024
f4ff080
add initialize for LCOT, LCOH, LCOE
kurbansitterley Nov 15, 2024
e4023bb
add assert_units_consistent test; heat/energy metric testing; aggrega…
kurbansitterley Nov 15, 2024
8bcd94c
fix currency unit conversions
kurbansitterley Nov 15, 2024
855ab5e
fix failing tests
kurbansitterley Nov 15, 2024
92812df
fix unit
kurbansitterley Nov 15, 2024
b0d59ba
remove return from test
kurbansitterley Nov 15, 2024
15724cd
fix test
kurbansitterley Nov 15, 2024
d989a0d
fix test
kurbansitterley Nov 15, 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
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .components import *
from .KBHDP_SOA import *
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ def add_costing_packages(self):
"""
self.costing = TreatmentCosting()
self.costing.base_currency = pyunits.USD_2020
# set heat and electricity costs to be non-zero
self.costing.heat_cost.set_value(0.01)
self.costing.electricity_cost.fix(0.07)

# The costing model is built upon the last time step
blk = self.mp.get_active_process_blocks()[-1].fs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ def test_costing(self, MED_VAGMD_semibatch_frame):
68657.789, rel=1e-3
)
assert cost_performance["Annual heat cost ($)"] == pytest.approx(
150540.917, rel=1e-3
128236.19, rel=1e-3
)
assert cost_performance["Annual electricity cost ($)"] == pytest.approx(
4064.964, rel=1e-3
)
assert cost_performance["Overall LCOW ($/m3)"] == pytest.approx(
1.76369, rel=1e-3
1.70261, rel=1e-3
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from watertap.core.solvers import get_solver

from watertap_contrib.reflo.costing import REFLOCosting
from watertap_contrib.reflo.costing import TreatmentCosting
from watertap_contrib.reflo.analysis.multiperiod.vagmd_batch.VAGMD_batch_multiperiod_unit_model import (
VAGMDbatchSurrogate,
)
Expand Down Expand Up @@ -248,7 +248,10 @@ def test_costing(self, VAGMD_batch_frame_AS7C15L_Closed):
# The costing model is built upon the last time step
vagmd = m.fs.VAGMD.mp.get_active_process_blocks()[-1].fs.vagmd

m.fs.costing = REFLOCosting()
m.fs.costing = TreatmentCosting()
# set heat and electricity costs to be non-zero
m.fs.costing.heat_cost.set_value(0.01)
m.fs.costing.electricity_cost.fix(0.07)
m.fs.costing.base_currency = pyunits.USD_2020

m.fs.VAGMD.add_costing_module(m.fs.costing)
Expand Down Expand Up @@ -277,7 +280,7 @@ def test_costing(self, VAGMD_batch_frame_AS7C15L_Closed):
assert pytest.approx(151892.658, rel=1e-3) == value(
vagmd.costing.fixed_operating_cost
)
assert pytest.approx(2.777, rel=1e-3) == value(m.fs.costing.LCOW)
assert pytest.approx(2.500, rel=1e-3) == value(m.fs.costing.LCOW)


class TestVAGMDbatchAS7C15L_HighSalinityClosed:
Expand Down
1 change: 1 addition & 0 deletions src/watertap_contrib/reflo/costing/solar/photovoltaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def build_photovoltaic_cost_param_block(blk):
)
def cost_pv(blk):

blk.costing_package.has_electricity_generation = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment on PV costs: it would be totally fair to cost PV out on a $/kW_dc basis. I remember using numbers on the order of $1000 - $2000/kWdc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is how we do it already?

global_params = blk.costing_package
pv_params = blk.costing_package.photovoltaic
pv = blk.unit_model
Expand Down
Loading