Skip to content

Commit

Permalink
Add IE39 with hydro nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
JosepFanals committed Jan 8, 2024
1 parent 6ae0c4d commit 4c080d8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 31 deletions.
13 changes: 6 additions & 7 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions src/GridCalEngine/Core/Devices/Fluid/fluid_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,28 +105,28 @@ def copy(self):
:return: Copy of this object
"""

# make a new instance (separated object in memory)
fluid_node = FluidNode()
# make a new instance (separated object in memory)
fluid_node = FluidNode()

fluid_node.min_level = self.min_level # hm3
fluid_node.max_level = self.max_level # hm3
fluid_node.initial_level = self.current_level # hm3
fluid_node.spillage_cost = self.spillage_cost # m3/h
fluid_node.inflow = self.inflow # m3/h
fluid_node._bus: Bus = self.bus
fluid_node.build_status = self.build_status
fluid_node.min_level = self.min_level # hm3
fluid_node.max_level = self.max_level # hm3
fluid_node.initial_level = self.current_level # hm3
fluid_node.spillage_cost = self.spillage_cost # m3/h
fluid_node.inflow = self.inflow # m3/h
fluid_node._bus: Bus = self.bus
fluid_node.build_status = self.build_status

fluid_node.inflow_prof = self.inflow_prof # m3/h
fluid_node.spillage_cost_prof = self.spillage_cost_prof # €/(m3/h)
fluid_node.inflow_prof = self.inflow_prof # m3/h
fluid_node.spillage_cost_prof = self.spillage_cost_prof # €/(m3/h)

# list of turbines
fluid_node.turbines = self.turbines
# list of turbines
fluid_node.turbines = self.turbines

# list of pumps
fluid_node.pumps = self.pumps
# list of pumps
fluid_node.pumps = self.pumps

# list of power to gas devices
fluid_node.p2xs = self.p2xs
# list of power to gas devices
fluid_node.p2xs = self.p2xs

@property
def bus(self) -> Bus:
Expand Down
10 changes: 3 additions & 7 deletions src/GridCalEngine/Simulations/OPF/linear_opf_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,10 +1327,6 @@ def add_hydro_formulation(t: Union[int, None],
ub=path_data.max_flow[m],
name=join("hflow_", [t, m], "_"))

# add flow variables for turbines and pumps to be recovered later on
# for m in range(turbine_data.nelm):
# inj_vars.flow[t, m] = prob.add_var()

# Constraints
for m in range(path_data.nelm):
# inflow: fluid flow entering the target node in m3/h
Expand Down Expand Up @@ -1358,7 +1354,7 @@ def add_hydro_formulation(t: Union[int, None],
logger.add_error(msg='Turbine generator pmin < 0 is not possible',
value=generator_data.pmin[gen_idx])

f_obj += turbine_flow
# f_obj += turbine_flow

for m in range(pump_data.nelm):
gen_idx = pump_data.generator_idx[m]
Expand All @@ -1380,7 +1376,7 @@ def add_hydro_formulation(t: Union[int, None],
logger.add_error(msg='Pump generator pmax > 0 is not possible',
value=generator_data.pmax[gen_idx])

f_obj -= pump_flow
# f_obj -= pump_flow

for m in range(p2x_data.nelm):
gen_idx = p2x_data.generator_idx[m]
Expand All @@ -1399,7 +1395,7 @@ def add_hydro_formulation(t: Union[int, None],
logger.add_error(msg='P2X generator pmax > 0 is not possible',
value=generator_data.pmax[gen_idx])

f_obj -= p2x_flow
# f_obj -= p2x_flow

if t is not None:
# constraints for the node level
Expand Down

0 comments on commit 4c080d8

Please sign in to comment.