Skip to content

Conversation

@k-horvath-deltares
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a 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 HydraulicStructures package 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.

Comment on lines +11 to +16
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";
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
model Resistance "Quadratic resistance of form dH=C*Q^2"
extends Deltares.ChannelFlow.Internal.HQTwoPort;

parameter Real C = 0.0;
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +7
// Increasing row number is increasing H power (staring at 0th power).
// Increasing column number is increasing Q power (staring at 0th power).
Copy link

Copilot AI Oct 28, 2025

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'.

Suggested change
// 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).

Copilot uses AI. Check for mistakes.
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).
Copy link

Copilot AI Oct 28, 2025

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'.

Suggested change
// Increasing column number is increasing Q power (staring at 0th power).
// Increasing column number is increasing Q power (starting at 0th power).

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
parameter Real power_coefficients[:, :, :];
parameter Real speed_coefficients[:, :] = {{0.0}};
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
// 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[:, :, :];
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
// 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[:];
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +28
parameter Modelica.Units.SI.Duration minimum_on = 0.0;
parameter Modelica.Units.SI.Duration minimum_off = 0.0;
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +42
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;
Copy link

Copilot AI Oct 28, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants