Skip to content

Commit

Permalink
MED cost model update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoran29 committed Jan 10, 2022
1 parent 71ca50f commit 663115d
Show file tree
Hide file tree
Showing 9 changed files with 13,348 additions and 29 deletions.
4 changes: 2 additions & 2 deletions DesalinationModels/ABS_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,

self.operation_hour = 24 #* (1-downtime) # Average daily operation hour (h/day)
self.f_HEX = f_HEX
self.HEX_area = HEX_area
self.HEX_area = HEX_area*Capacity
self.Capacity = Capacity
self.STEC = STEC
self.coe = coe
Expand All @@ -66,7 +66,7 @@ def __init__(self,

def lcow(self):

self.cost_sys = 6291 * self.Capacity**(-0.135) * (1- self.f_HEX + self.f_HEX * (self.HEX_area/(self.Capacity/24/3.6)/302.01)**0.8)
self.cost_sys = 6291 * self.Capacity**(-0.135) * (1- self.f_HEX + self.f_HEX * (self.HEX_area/8841)**0.8)

if self.P_req < 400:
self.cost_AHP = (226.85 - 0.332 * self.P_req) * 1.2 # $/kW
Expand Down
7 changes: 2 additions & 5 deletions DesalinationModels/LTMED_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,

self.operation_hour = 24 #* (1-downtime) # Average daily operation hour (h/day)
self.f_HEX = f_HEX
self.HEX_area = HEX_area
self.HEX_area = HEX_area*Capacity
self.Capacity = Capacity
self.STEC = STEC
self.coe = coe
Expand All @@ -65,12 +65,9 @@ def __init__(self,

def lcow(self):

self.cost_sys = 6291 * self.Capacity**(-0.135) * (1- self.f_HEX + self.f_HEX * (self.HEX_area * 24 * 3.6/302.01)**0.8)
self.cost_sys = 6291 * self.Capacity**(-0.135) * (1- self.f_HEX + self.f_HEX * (self.HEX_area / 8841)**0.8)
self.CAPEX = ((self.cost_sys*self.Capacity+ self.cost_storage * self.storage_cap)*self.int_rate*(1+self.int_rate)**self.yrs) / ((1+self.int_rate)**self.yrs-1) / self.Prod

print(self.int_rate*(1+self.int_rate)**self.yrs / ((1+self.int_rate)**self.yrs-1))


self.OPEX = self.STEC * (self.fuel_usage * self.coh + (1-self.fuel_usage) * self.sam_coh) \
+ self.coe * self.SEEC + self.Chemicals + self.Labor + self.Maintenance/100*self.CAPEX \
+ self.Miscellaneous + self.Discharge + self.Insurance/100*self.CAPEX
Expand Down
14 changes: 8 additions & 6 deletions DesalinationModels/LT_MED_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def effects_calculation(self):
self.BPE[0] = self.A[0] * self.Xb_w[0] + self.B[0] * self.Xb_w[0]**2 + self.C[0] * self.Xb_w[0]**3
self.Tv[0] = self.Tb[0] - self.BPE[0] - self.DELTAT_loss
self.Uef[0] = 1.9695 + (1.2057e-2 * self.Tb[0]) - (8.5989e-5 * self.Tb[0]**2) + (2.5651e-7 * self.Tb[0]**3)

print(self.Mv)
for i in range(1, self.Nef):
self.DTb[i] *= self.Aef[i] / self.Am
self.Tb[i] = self.Tb[i-1] -self.DTb[i]
Expand All @@ -253,6 +253,8 @@ def effects_calculation(self):
self.Tdb[i] = self.Tv[i] - self.NEA[i]
self.DA[i] = abs(self.Aef[i-1] - self.Aef[i])

print(self.count)
print(self.Mv)
self.count += 1
self.max_DA = max(self.DA)

Expand Down Expand Up @@ -317,11 +319,11 @@ def model_execution(self):

#%% MODEL EXECUTION

# default_case = lt_med_calculation(Nef=16,Ts=80)
# default_case.preheater_calculations()
# default_case.effects_calculation()
# default_case.condenser_calculations()
# default_case.distilllates_calculations()
default_case = lt_med_calculation(Nef=14,Ts=80)
default_case.preheater_calculations()
default_case.effects_calculation()
default_case.condenser_calculations()
default_case.distilllates_calculations()



12 changes: 7 additions & 5 deletions DesalinationModels/MEDTVC_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def __init__(self,
solar_coh = '',
sam_coh = 0.02, # Unit cost of heat from SAM ($/kWh)
cost_storage = 26 , # Cost of thermal storage ($/kWh)
storage_cap = 13422 # Capacity of thermal storage (kWh)

storage_cap = 13422, # Capacity of thermal storage (kWh)
Nef = 8
):

self.operation_hour = 24 #* (1-downtime) # Average daily operation hour (h/day)
self.f_HEX = f_HEX
self.HEX_area = HEX_area
self.HEX_area = HEX_area*Capacity
self.Capacity = Capacity
self.STEC = STEC
self.coe = coe
Expand All @@ -62,10 +62,11 @@ def __init__(self,
self.int_rate = int_rate
self.cost_storage = cost_storage
self.storage_cap = storage_cap

self.Nef = Nef
def lcow(self):

self.cost_sys = 6291 * self.Capacity**(-0.135) * (1- self.f_HEX + self.f_HEX * (self.HEX_area*24*3.6/302.01)**0.8)
self.cost_sys = 6291 * self.Capacity**(-0.135) * (1- self.f_HEX + self.f_HEX * (self.HEX_area/8841)**0.8)

self.CAPEX = ((self.cost_sys*self.Capacity+ self.cost_storage * self.storage_cap)*self.int_rate*(1+self.int_rate)**self.yrs) / ((1+self.int_rate)**self.yrs-1) / self.Prod


Expand All @@ -74,6 +75,7 @@ def lcow(self):

self.LCOW = self.CAPEX + self.OPEX


cost_output = []
cost_output.append({'Name':'Desal CAPEX','Value':self.CAPEX,'Unit':'$/m3'})
cost_output.append({'Name':'Desal OPEX','Value':self.OPEX,'Unit':'$/m3'})
Expand Down
10 changes: 5 additions & 5 deletions SAM_flatJSON/SamBaseClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def desal_simulation(self, desal):
Ctest1= self.desal_values_json['Ctest1'],SR1= self.desal_values_json['SR1'],Rt1= self.desal_values_json['Rt1'],Pdropmax= self.desal_values_json['Pdropmax'],
Pfp= self.desal_values_json['Pfp'],maxQf= self.desal_values_json['maxQf'])
self.design_output = self.RO_FO.design()
if self.cspModel=='pvsamv1':
if self.cspModel=='pvsamv1' or self.cspModel=='pvwattsv7':
self.simu_output = self.RO_FO.simulation(elec_gen = self.elec_gen, thermal_gen = [0], solar_type = 'pv', storage = 0)
elif self.cspModel == 'linear_fresnel_dsg_iph' or self.cspModel == 'trough_physical_process_heat' or self.cspModel == 'SC_FPC' or self.cspModel == 'SC_ETC':
self.simu_output = self.RO_FO.simulation(elec_gen = [0], thermal_gen = self.heat_gen, solar_type = 'thermal', storage = 0)
Expand All @@ -643,7 +643,7 @@ def desal_simulation(self, desal):
j = self.desal_values_json['j'], TCoolIn = self.desal_values_json['TCoolIn'],
Ttank = self.desal_values_json['Ttank'], dt = self.desal_values_json['dt'])
self.design_output = self.RO_MDB.design()
if self.cspModel=='pvsamv1':
if self.cspModel=='pvsamv1' or self.cspModel=='pvwattsv7':
self.simu_output = self.RO_MDB.simulation(elec_gen = self.elec_gen, thermal_gen = [0], solar_type = 'pv', storage = 0)
elif self.cspModel == 'linear_fresnel_dsg_iph' or self.cspModel == 'trough_physical_process_heat' or self.cspModel == 'SC_FPC' or self.cspModel == 'SC_ETC':
self.simu_output = self.RO_MDB.simulation(elec_gen = [0], thermal_gen = self.heat_gen, solar_type = 'thermal', storage = 0)
Expand Down Expand Up @@ -828,7 +828,7 @@ def cost(self, desal):
elif desal == 'ABS':
from DesalinationModels.ABS_cost import ABS_cost
self.LCOW = ABS_cost(f_HEX = self.cost_values_json['f_HEX'], P_req = self.P_req, downtime = self.cost_values_json['downtime'],
# HEX_area = self.LTMED.system.sum_A,
HEX_area = self.ABS.sA,
Capacity = self.desal_values_json['Capacity'], Prod = self.simu_output[4]['Value'], fuel_usage = self.simu_output[7]['Value'], SEEC = self.cost_values_json['SEEC'], STEC = self.ABS.STEC,
Chemicals = self.cost_values_json['Chemicals'], Labor = self.cost_values_json['Labor'], Discharge = self.cost_values_json['Discharge'], Maintenance = self.cost_values_json['Maintenance'], Miscellaneous = self.cost_values_json['Miscellaneous'],
yrs = self.cost_values_json['yrs'], int_rate = self.cost_values_json['int_rate'], coe = self.cost_values_json['coe'], solar_coh = self.cost_values_json['solar_coh'], coh = self.cost_values_json['coh'], sam_coh = self.lcoh, cost_storage = self.cost_values_json['cost_storage'], storage_cap = self.ABS.storage_cap)
Expand Down Expand Up @@ -881,7 +881,7 @@ def cost(self, desal):

elif desal == 'RO_FO':
from DesalinationModels.RO_FO_cost import RO_FO_cost
if self.cspModel=='pvsamv1':
if self.cspModel=='pvsamv1' or self.cspModel=='pvwattsv7':
self.sam_lcoe = self.lcoe
self.sam_lcoh = 0

Expand All @@ -906,7 +906,7 @@ def cost(self, desal):

elif desal == 'RO_MDB':
from DesalinationModels.RO_MDB_cost import RO_MDB_cost
if self.cspModel=='pvsamv1':
if self.cspModel=='pvsamv1' or self.cspModel=='pvwattsv7':
self.sam_lcoe = self.lcoe
self.sam_lcoh = 0

Expand Down
2 changes: 1 addition & 1 deletion app/app-data.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"solar": "SC_FPC", "desal": "RO_FO", "finance": "iph_to_lcoefcr", "parametric": true, "project_name": "Project_1", "timestamp": "2021-12-30_23-18-00", "solar_outfile": "SC_FPC2021-12-30_23-18-00_inputs.json", "desal_outfile": "RO_FO2021-12-30_23-18-00_inputs.json", "finance_outfile": "lcoh_calculator2021-12-30_23-18-00_inputs.json"}
{"solar": "SC_FPC", "desal": "MEDTVC", "finance": "iph_to_lcoefcr", "parametric": true, "project_name": "Project_1", "timestamp": "2022-01-10_14-11-47", "solar_outfile": "SC_FPC2022-01-10_14-11-47_inputs.json", "desal_outfile": "MEDTVC2022-01-10_14-11-47_inputs.json", "finance_outfile": "lcoh_calculator2022-01-10_14-11-47_inputs.json"}
4 changes: 2 additions & 2 deletions app/apps/model_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def run_model(csp, desal, finance, json_file, desal_file, finance_file, timestam

powertower_alert = html.Div([
dbc.Alert([html.Strong("For Power Tower Molten Salt system"),
html.P("System capacity should be larger than 20 MW, and the desalination plant should be sized accordingly. Be aware that power tower models take longer than other models.")],
html.P("System capacity should be larger than 20 MW, and the desalination plant should be sized accordingly to avoid high energy curtailment. ")],
className="alert alert-dismissible alert-light",
dismissable=True,
id='powertower-alert',
Expand All @@ -305,7 +305,7 @@ def run_model(csp, desal, finance, json_file, desal_file, finance_file, timestam

powertower2_alert = html.Div([
dbc.Alert([html.Strong("For Power Tower Direct Steam system"),
html.P("System capacity should be larger than 30 MW, and the desalination plant should be sized accordingly. Be aware that power tower models take longer than other models.")],
html.P("System capacity should be larger than 30 MW, and the desalination plant should be sized accordingly to avoid high energy curtailment.")],
className="alert alert-dismissible alert-light",
dismissable=True,
id='powertower2-alert',
Expand Down
6 changes: 3 additions & 3 deletions app/apps/model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
),

dbc.FormGroup([
dbc.Label("Solar Thermal System", width=2, size='lg',color='warning',style={'text-align':'center'}),
dbc.Label("Solar Energy Generation", width=2, size='lg',color='warning',style={'text-align':'center'}),
dbc.Col(
dbc.RadioItems(
id='select-solar',
Expand Down Expand Up @@ -72,15 +72,15 @@
],row=True),
dbc.FormGroup([
#dbc.Label("Desalination System", width=2, size='lg',color='success',style={'text-align':'center'}),
dbc.Label("Desalination System",width=2, size='lg',color='info',style={'text-align':'center'}),
dbc.Label("Desalination",width=2, size='lg',color='info',style={'text-align':'center'}),
dbc.Col(
dbc.RadioItems(
id='select-desal',
),width=10,
),
],row=True,),
dbc.FormGroup([
dbc.Label("Financial Model",width=2, size='lg',color='success',style={'text-align':'center'}),
dbc.Label("Financial",width=2, size='lg',color='success',style={'text-align':'center'}),
dbc.Col(
dbc.RadioItems(
id='select-finance',
Expand Down
Loading

0 comments on commit 663115d

Please sign in to comment.