Opened 5 years ago

Last modified 3 years ago

#5800 assigned defect

OMEdit fails to simulate example model from OpenHPL

Reported by: Dietmar Winkler Owned by: Per Östlund
Priority: high Milestone:
Component: Backend Version: v1.16.0-dev
Keywords: Cc:

Description

When testing some of the examples of https://github.com/simulatino/OpenHPL I got the following error message which I don't really know how to tackle.
This happens when running OpenHPL.Examples.HPSimple:
:

[3] 14:08:06 Translation Error
Internal error IndexReduction.pantelidesIndexReduction failed! System is structurally singulare and cannot handled because number of unassigned equations is larger than number of states. Use -d=bltdump to get more information.

So I did set the flag and got:

[2] 14:08:06 Symbolic Error
[OpenHPL.Waterway.SurgeTank: 119:3-119:16]: Model is structurally singular, error found sorting equations
  36: surgeTank.Mdot = surgeTank.mdot * surgeTank.v
  34: surgeTank.M = surgeTank.m * surgeTank.v
  39: surgeTank.F_g = surgeTank.m * data.g * surgeTank.cos_theta
  38: surgeTank.F_p = (surgeTank.p_n - data.p_a) * surgeTank.A
  30: der(surgeTank.M) = surgeTank.Mdot + surgeTank.F
  22: der(tail.m) = 0.0
  18: tail.A = tail.H * (tail.w + 2.0 * tail.H * tan(0.0174532925199433 * tail.alpha))
  20: tail.F_f = 0.0
  19: tail.m = data.rho * tail.A * tail.L
  14: discharge.v = discharge.Vdot / discharge.A_
  13: discharge.Vdot = turbine.mdot / data.rho
  21: 0.0 = tail.A * (data.p_a - discharge.p_o) + data.g * data.rho * tail.A * tail.H - tail.F_f
  15: discharge.M = data.rho * discharge.L * discharge.Vdot
  16: discharge.F_f = OpenHPL.Functions.DarcyFriction.Friction(discharge.v, discharge.D_, discharge.L, data.rho, data.mu, discharge.p_eps)
  7: turbine.look_up_table.u[1] = control.offset + (if time < control.startTime then 0.0 else if time < control.startTime + control.duration then (time - control.startTime) * control.height / control.duration else control.height)
  42: turbine.Vdot = if turbine.WaterCompress then turbine.mdot / (data.rho * (1.0 + data.beta * (turbine.p_i_tr - data.p_a))) else turbine.mdot / data.rho
  17: der(discharge.M) = data.rho * discharge.Vdot ^ 2.0 * (1.0 / discharge.A_i + (-1.0) / discharge.A_o) + turbine.p_o_tr * discharge.A_i + discharge.m * data.g * discharge.cos_theta + (-discharge.F_f) - discharge.p_o * discharge.A_o
  43: turbine.dp = turbine.Vdot ^ 2.0 * data.p_a / (turbine.C_v_ * turbine.look_up_table.u[1]) ^ 2.0
  5: der(reservoir.m) = 0.0
  1: reservoir.A = reservoir.H * (reservoir.w + 2.0 * reservoir.H * tan(0.0174532925199433 * reservoir.alpha))
  3: reservoir.F_f = 0.0
  2: reservoir.m = data.rho * reservoir.A * reservoir.L
  9: intake.v = intake.Vdot / intake.A_
  4: 0.0 = reservoir.A * (data.p_a - intake.p_i) + data.g * data.rho * reservoir.A * reservoir.H - reservoir.F_f
  10: intake.M = data.rho * intake.L * intake.Vdot
  11: intake.F_f = OpenHPL.Functions.DarcyFriction.Friction(intake.v, intake.D_, intake.L, data.rho, data.mu, intake.p_eps)
  25: penstock.v = penstock.Vdot / penstock.A_
  44: turbine.dp = turbine.p_i_tr - turbine.p_o_tr
  12: der(intake.M) = data.rho * intake.Vdot ^ 2.0 * (1.0 / intake.A_i + (-1.0) / intake.A_o) + intake.p_i * intake.A_i + intake.m * data.g * intake.cos_theta + (-intake.F_f) - surgeTank.p_n * intake.A_o
  27: penstock.F_f = OpenHPL.Functions.DarcyFriction.Friction(penstock.v, penstock.D_, penstock.L, data.rho, data.mu, penstock.p_eps)
  28: der(penstock.M) = data.rho * penstock.Vdot ^ 2.0 * (1.0 / penstock.A_i + (-1.0) / penstock.A_o) + surgeTank.p_n * penstock.A_i + penstock.m * data.g * penstock.cos_theta + (-penstock.F_f) - turbine.p_i_tr * penstock.A_o
  26: penstock.M = data.rho * penstock.L * penstock.Vdot
  6: intake.Vdot = data.rho
  24: penstock.Vdot = turbine.mdot / data.rho
  8: intake.Vdot = intake.mdot / data.rho
  40: surgeTank.mdot = intake.mdot - turbine.mdot
  33: surgeTank.mdot = data.rho * surgeTank.Vdot
  37: surgeTank.F = surgeTank.F_p + (-surgeTank.F_f) - surgeTank.F_g
  35: surgeTank.v = surgeTank.Vdot / surgeTank.A
  29: der(surgeTank.m) = surgeTank.mdot
  32: surgeTank.F_f = OpenHPL.Functions.DarcyFriction.Friction(surgeTank.v, surgeTank.D, surgeTank.l, data.rho, data.mu, surgeTank.p_eps)
  31: surgeTank.m = data.rho * surgeTank.A * surgeTank.l
for variables
  20: surgeTank.Mdot:VARIABLE(unit = "N" )  "Difference in influent and effulent momentum"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  21: surgeTank.M:STATE(1)(unit = "kg.m/s" )  "Water momuntum"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  14: surgeTank.F_g:VARIABLE(unit = "N" )  "Gravity force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  16: surgeTank.F_p:VARIABLE(unit = "N" )  "Pressure force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  19: surgeTank.F:VARIABLE(unit = "N" )  "Total force acting in the surge tank"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  31: tail.m:STATE(1)(min = 0.0 unit = "kg" )  "water mass"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  28: tail.H:VARIABLE(min = 0.0 unit = "m" )  "water height"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  29: tail.F_f:VARIABLE(unit = "N" )  "friction force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  32: tail.A:VARIABLE(unit = "m2" )  "vertiacal cross section"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  38: discharge.v:VARIABLE(unit = "m/s" )  "Water velocity"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  33: discharge.Vdot:VARIABLE(start = discharge.Vdot_0 unit = "m3/s" )  "Flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  35: discharge.p_o:VARIABLE(unit = "Pa" )  "Outlet pressure"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  36: discharge.M:STATE(1)(unit = "kg.m/s" )  "Water momentum"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  37: discharge.F_f:VARIABLE(unit = "N" )  "Friction force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  2: turbine.look_up_table.u[1]:VARIABLE(flow=false )  "Connector of Real input signals"OpenHPL.Examples.HPSimple, OpenHPL.ElectroMech.Turbines.Turbine, Modelica.Blocks.Tables.CombiTable1D type: Real [1]
  5: turbine.Vdot:VARIABLE(unit = "m3/s" )  "Flow rate"OpenHPL.Examples.HPSimple, OpenHPL.ElectroMech.Turbines.Turbine type: Real
  7: turbine.p_o_tr:VARIABLE(unit = "Pa" )  "Outlet pressure"OpenHPL.Examples.HPSimple, OpenHPL.ElectroMech.Turbines.Turbine type: Real
  8: turbine.dp:VARIABLE(unit = "Pa" )  "Turbine pressure drop"OpenHPL.Examples.HPSimple, OpenHPL.ElectroMech.Turbines.Turbine type: Real
  49: reservoir.m:STATE(1)(min = 0.0 unit = "kg" )  "water mass"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  46: reservoir.H:VARIABLE(min = 0.0 unit = "m" )  "water height"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  47: reservoir.F_f:VARIABLE(unit = "N" )  "friction force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  50: reservoir.A:VARIABLE(unit = "m2" )  "vertiacal cross section"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real
  45: intake.v:VARIABLE(unit = "m/s" )  "Water velocity"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  42: intake.p_i:VARIABLE(unit = "Pa" )  "Inlet pressure"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  43: intake.M:STATE(1)(unit = "kg.m/s" )  "Water momentum"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  44: intake.F_f:VARIABLE(unit = "N" )  "Friction force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  27: penstock.v:VARIABLE(unit = "m/s" )  "Water velocity"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  9: turbine.p_i_tr:VARIABLE(unit = "Pa" )  "Inlet pressure"OpenHPL.Examples.HPSimple, OpenHPL.ElectroMech.Turbines.Turbine type: Real
  11: surgeTank.p_n:VARIABLE(unit = "Pa" )  "Node pressure"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  26: penstock.F_f:VARIABLE(unit = "N" )  "Friction force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  25: penstock.M:STATE(1)(unit = "kg.m/s" )  "Water momentum"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  23: penstock.Vdot:VARIABLE(start = penstock.Vdot_0 unit = "m3/s" )  "Flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  40: intake.Vdot:VARIABLE(start = intake.Vdot_0 unit = "m3/s" )  "Flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  3: turbine.mdot:VARIABLE(unit = "kg/s" )  "Mass flow rate"OpenHPL.Examples.HPSimple, OpenHPL.ElectroMech.Turbines.Turbine type: Real
  39: intake.mdot:VARIABLE(unit = "kg/s" )  "Mass flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Pipe type: Real
  10: surgeTank.mdot:VARIABLE(unit = "kg/s" )  "Mass flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  12: surgeTank.Vdot:VARIABLE(start = surgeTank.Vdot_0 unit = "m3/s" fixed = true )  "Water flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  15: surgeTank.F_f:VARIABLE(unit = "N" )  "Friction force"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  17: surgeTank.v:VARIABLE(unit = "m/s" )  "Water velocity"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  22: surgeTank.m:STATE(1,surgeTank.mdot)(min = 0.0 unit = "kg" )  "Water mass"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  18: surgeTank.l:VARIABLE(unit = "m" )  "Length of water in the surge tank"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.SurgeTank type: Real
  48: reservoir.Vdot_i:VARIABLE(unit = "m3/s" )  "inlet flow rate"OpenHPL.Examples.HPSimple, OpenHPL.Waterway.Reservoir type: Real

[3] 14:08:06 Translation Error
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!

I'm not really sure what is missing here especially since the component that OM is complaining about OpenHPL.Waterway.SurgeTank is also used in OpenHPL.Examples.HPSimple_Francis which works perfectly fine. Needless to say that I did test in Dymola before reporting and there no problem occurs what so ever.

Change History (6)

comment:1 by Francesco Casella, 5 years ago

Component: OMEditBackend
Owner: changed from Adeel Asghar to Karim Adbdelhak
Status: newassigned

comment:2 by Dietmar Winkler, 5 years ago

Switching to the old front-end and removing the Data component will work. So something with the lookup of outer and inner is seriously broken.

Just to summarize:

  • Old Frontend:
    • inner Data present on top level: fails
    • inner Data removed from top level: runs
  • New Frontend:
    • fails independent if inner Data is present or not.

comment:3 by Francesco Casella, 5 years ago

Owner: changed from Karim Adbdelhak to Per Östlund

Thanks @dietmarw for the analysis.

@perost, would you mind having a look?

comment:4 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:6 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.