Skip to content

Commit

Permalink
Remove p_LLA and p_LLT from operational model
Browse files Browse the repository at this point in the history
  • Loading branch information
tarnold17 committed Sep 25, 2024
1 parent 8a14c2e commit 7b7108c
Showing 1 changed file with 20 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,6 @@ def create_model(df_sets, df_parameters, default={}):
# Build parameters #
build_common_params(model)

model.p_LLT = Param(
model.s_L,
model.s_L,
default=0,
initialize=df_parameters["LLT"],
doc="Valid trucking arcs [-]",
)

model.p_LLA = Param(
model.s_L,
model.s_L,
default=0,
initialize=df_parameters["LLA"],
doc="Valid pipeline arcs [-]",
)

if model.config.production_tanks == ProdTank.individual:
model.p_PAL = Param(
model.s_P,
Expand Down Expand Up @@ -572,12 +556,16 @@ def TreatmentBalanceRule(model, r, t):
return (
model.p_epsilon_Treatment[r, "TDS"]
* (
sum(model.v_F_Piped[l, r, t] for l in model.s_L if model.p_LLA[l, r])
sum(
model.v_F_Piped[l, r, t] for l in model.s_L if (l, r) in model.s_LLA
)
+ sum(
model.v_F_Trucked[l, r, t] for l in model.s_L if model.p_LLT[l, r]
model.v_F_Trucked[l, r, t]
for l in model.s_L
if (l, r) in model.s_LLT
)
)
== sum(model.v_F_Piped[r, l, t] for l in model.s_L if model.p_LLA[l, r])
== sum(model.v_F_Piped[r, l, t] for l in model.s_L if (l, r) in model.s_LLA)
+ model.v_F_UnusedTreatedWater[r, t]
)

Expand All @@ -590,8 +578,10 @@ def TreatmentBalanceRule(model, r, t):

def BeneficialReuseCapacityRule(model, o, t):
return (
sum(model.v_F_Piped[l, o, t] for l in model.s_L if model.p_LLA[l, o])
+ sum(model.v_F_Trucked[l, o, t] for l in model.s_L if model.p_LLT[l, o])
sum(model.v_F_Piped[l, o, t] for l in model.s_L if (l, o) in model.s_LLA)
+ sum(
model.v_F_Trucked[l, o, t] for l in model.s_L if (l, o) in model.s_LLT
)
<= model.p_sigma_Reuse[o] + model.v_S_BeneficialReuseCapacity[o]
)

Expand All @@ -608,9 +598,13 @@ def TreatmentCostRule(model, r, t):
return (
model.v_C_Treatment[r, t]
== (
sum(model.v_F_Piped[l, r, t] for l in model.s_L if model.p_LLA[l, r])
sum(
model.v_F_Piped[l, r, t] for l in model.s_L if (l, r) in model.s_LLA
)
+ sum(
model.v_F_Trucked[l, r, t] for l in model.s_L if model.p_LLT[l, r]
model.v_F_Trucked[l, r, t]
for l in model.s_L
if (l, r) in model.s_LLT
)
)
* model.p_pi_Treatment[r]
Expand Down Expand Up @@ -644,8 +638,8 @@ def TotalPadStorageCostRule(model):

def TreatmentDestinationDeliveriesRule(model, r, t):
return model.v_F_TreatmentDestination[r, t] == sum(
model.v_F_Piped[l, r, t] for l in model.s_L if model.p_LLA[l, r]
) + sum(model.v_F_Trucked[l, r, t] for l in model.s_L if model.p_LLT[l, r])
model.v_F_Piped[l, r, t] for l in model.s_L if (l, r) in model.s_LLA
) + sum(model.v_F_Trucked[l, r, t] for l in model.s_L if (l, r) in model.s_LLT)

model.TreatmentDestinationDeliveries = Constraint(
model.s_R,
Expand All @@ -666,7 +660,7 @@ def TreatmentDestinationDeliveriesRule(model, r, t):
return model


def water_quality(model, df_sets, df_parameters):
def water_quality(model):
# Introduce parameter nu for water quality at each pad
model.p_nu = Param(
model.s_P,
Expand Down

0 comments on commit 7b7108c

Please sign in to comment.