-
Notifications
You must be signed in to change notification settings - Fork 0
Add hydraulic structures #7
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new HydraulicStructures package to the ChannelFlow library, providing models for various hydraulic structures including weirs, orifices, and pumping stations with their associated components.
Key changes:
- Added new
HydraulicStructurespackage with subpackages for Weir, Orifice, and PumpingStation - Introduced new reservoir types (
Reservoir_multi_io) and homotopic models (HomotopicVolume,HomotopicPower) - Implemented models for hydraulic components including Pump, Resistance, and discharge-controlled structures
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/package.order | Added HydraulicStructures to the package hierarchy |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/SimpleRouting/Reservoir/package.order | Added Reservoir_multi_io to reservoir variants |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/HydraulicStructures/package.mo | Created HydraulicStructures package definition |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/HydraulicStructures/Weir/Weir.mo | Implemented Weir model with discharge coefficient |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/HydraulicStructures/PumpingStation/Resistance.mo | Implemented quadratic resistance model for head loss |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/HydraulicStructures/PumpingStation/PumpingStation.mo | Created PumpingStation model with pump switching capabilities |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/HydraulicStructures/PumpingStation/Pump.mo | Implemented partial Pump model with QHP relationships and working area constraints |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/HydraulicStructures/Orifice/Orifice.mo | Created Orifice model for unidirectional flow control |
| src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/Hydraulic/Reservoir/package.order | Added homotopic reservoir models to hydraulic package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parameter SI.Length width "Width of the weir"; | ||
| parameter SI.VolumeFlowRate q_min "Minimum flow of the weir; has to be positive"; | ||
| parameter SI.VolumeFlowRate q_max "Maximum flow of the weir. Should be as low as possible."; | ||
| parameter SI.Length hw_min "Minimum height of the weir"; | ||
| parameter SI.Length hw_max "Maximum height of the weir"; | ||
| parameter Real weir_coef=0.61 "Weir discharge coefficient"; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple parameters (width, q_min, q_max, hw_min, hw_max, weir_coef) are declared but never used in the model equations. This indicates incomplete implementation of the weir hydraulic relationships, which should relate flow Q to head difference and weir geometry.
| model Resistance "Quadratic resistance of form dH=C*Q^2" | ||
| extends Deltares.ChannelFlow.Internal.HQTwoPort; | ||
|
|
||
| parameter Real C = 0.0; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter C is declared but never used in any equations. Since this model represents 'Quadratic resistance of form dH=C*Q^2', the equation should implement this relationship, but C is not referenced in the equation section.
| // Increasing row number is increasing H power (staring at 0th power). | ||
| // Increasing column number is increasing Q power (staring at 0th power). |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'staring' to 'starting'.
| // Increasing row number is increasing H power (staring at 0th power). | |
| // Increasing column number is increasing Q power (staring at 0th power). | |
| // Increasing row number is increasing H power (starting at 0th power). | |
| // Increasing column number is increasing Q power (starting at 0th power). |
| extends Deltares.ChannelFlow.Hydraulic.Structures.Pump; | ||
|
|
||
| // Increasing row number is increasing H power (staring at 0th power). | ||
| // Increasing column number is increasing Q power (staring at 0th power). |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'staring' to 'starting'.
| // Increasing column number is increasing Q power (staring at 0th power). | |
| // Increasing column number is increasing Q power (starting at 0th power). |
| parameter Real power_coefficients[:, :, :]; | ||
| parameter Real speed_coefficients[:, :] = {{0.0}}; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple parameters (power_coefficients, speed_coefficients, working_area, working_area_direction) are declared but never used in the model equations. These parameters appear to define pump characteristics but are not incorporated into any hydraulic or performance calculations.
| // coefficients of each polynomial are like the power coefficients, in that | ||
| // increasing row (second index) is increasing power of H, and increasing | ||
| // column (third index) is increasing power of Q. | ||
| parameter Real working_area[:, :, :]; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple parameters (power_coefficients, speed_coefficients, working_area, working_area_direction) are declared but never used in the model equations. These parameters appear to define pump characteristics but are not incorporated into any hydraulic or performance calculations.
| // NOTE: May become unnecessary to specify this in the future, if we can | ||
| // figure out a way to determine this automatically based on the working | ||
| // area. | ||
| parameter Real working_area_direction[:]; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple parameters (power_coefficients, speed_coefficients, working_area, working_area_direction) are declared but never used in the model equations. These parameters appear to define pump characteristics but are not incorporated into any hydraulic or performance calculations.
| parameter Modelica.Units.SI.Duration minimum_on = 0.0; | ||
| parameter Modelica.Units.SI.Duration minimum_off = 0.0; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters minimum_on and minimum_off are declared but never used in any equations or constraints. These timing constraints are not enforced in the model.
| parameter Modelica.Units.SI.Energy start_up_energy = 0.0; | ||
| parameter Real start_up_cost = 0.0; | ||
|
|
||
| parameter Modelica.Units.SI.Energy shut_down_energy = 0.0; | ||
| parameter Real shut_down_cost = 0.0; |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters for start-up and shut-down energy and costs are declared but never used in any equations. These operational costs are not incorporated into the model.
No description provided.