Skip to content

Commit a41dbe9

Browse files
Merge pull request #18 from Deltares/fix-partial-homotopic-bottom-level
Fix the declaration of the water levels in partial homotopic
2 parents 6e9f630 + 45974ee commit a41dbe9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/rtctools_channel_flow/modelica/Deltares/ChannelFlow/Hydraulic/Branches/Internal/PartialHomotopic.mo

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ partial model PartialHomotopic
2020
input SI.Stress wind_stress_v(nominal = 1e-1) = 0.0; // Wind stress in y (v, northing) direction (= 0.5*pi radians, 90 degrees)
2121
// Flow
2222
SI.VolumeFlowRate[n_level_nodes + 1] Q(each nominal = abs(Q_nominal));
23-
//Assumption: the minimum water level in the channel is at least the maximum bottom level at any part of the channel,
24-
// thus for steep channels this assumption might be a bit restrictive, but operatinally still reasonable.
25-
SI.Position[n_level_nodes] H(each min=max(H_b[1],H_b[n_level_nodes]));
23+
// Water level
24+
SI.Position[n_level_nodes] H(min = cat(1, max(H_b[1], H_b[2]), max(H_b[1:n_level_nodes - 2], max(H_b[2:n_level_nodes - 1], H_b[3:n_level_nodes])), max(H_b[n_level_nodes - 1], H_b[n_level_nodes])));
2625
// Array of Bottom Levels
2726
parameter SI.Position[n_level_nodes] H_b;
2827
// Length
@@ -57,14 +56,14 @@ partial model PartialHomotopic
5756
// Zero by default, which means that a fully implicit discretization is used.
5857
input SI.Duration semi_implicit_step_size = 0.0;
5958
// Substance flow rates
60-
SI.VolumeFlowRate M[n_level_nodes + 1, medium.n_substances](each nominal = 10);
59+
SI.VolumeFlowRate M[n_level_nodes + 1, HQUp.medium.n_substances](each nominal = 10);
6160
// Substance concentrations
62-
SI.Density C[n_level_nodes, medium.n_substances](each min = 0, each nominal = 1);
61+
SI.Density C[n_level_nodes, HQUp.medium.n_substances](each min = 0, each nominal = 1);
6362
// Nominal substance concentrations used in linearization
64-
parameter Real C_nominal[medium.n_substances] = fill(1e-3, medium.n_substances);
63+
parameter Real C_nominal[HQUp.medium.n_substances] = fill(1e-3, HQUp.medium.n_substances);
6564
protected
6665
SI.Stress _wind_stress;
67-
Real[n_level_nodes] _dQ_sq_div_Adx(each unit = "m3/s2");
66+
Real[n_level_nodes] _dQ_sq_div_Adx(each unit = "m^3/s^2");
6867
parameter SI.Angle rotation_rad = Deltares.Constants.D2R * rotation_deg; // Conversion to rotation in radians
6968
parameter SI.Distance dx = length / (n_level_nodes - 1);
7069
SI.Area[n_level_nodes] _friction;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
BottomFrictionCoefficient
22
PartialHomotopic
3-
PartialIDZ
3+
PartialIDZ

0 commit comments

Comments
 (0)