Opened 10 years ago

Closed 7 years ago

#4316 closed defect (fixed)

Simulation of Modelica.Fluid.Examples.Pumpingsystem and HeatingSystem fail

Reported by: anonymous Owned by: Francesco Casella
Priority: blocker Milestone: 2.0.0
Component: *unknown* Version: v1.12.0
Keywords: examples heatingsystem pumpingsystem Cc:

Description

Modelica Library 3.2.1 Build3
Openmodelica 1.12.0~dev-513-gc9b9653
Ubuntu 16.04

The examples PumpingSystem and HeatingSystem both fail to simulate. The process for simulating PumpingSystem ends with:

stdout | OMEditInfo | <p>/tmp/OpenModelica_briant/OMEdit/Modelica.Fluid.Examples.PumpingSystem -port=42081 -logFormat=xmltcp -override=startTime=0,stopTime=2000,stepSize=0.4,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=Modelica.Fluid.Examples.PumpingSystem_res.mat -w -lv=LOG_STATS</p>
LOG_NLS | warning | <p>Matrix singular!</p>
LOG_NLS | warning | <p>under-determined linear system not solvable!</p>
LOG_NLS | warning | <p>Matrix singular!</p>
LOG_NLS | warning | <p>under-determined linear system not solvable!</p>
LOG_NLS | warning | <p>Matrix singular!</p>
LOG_NLS | warning | <p>under-determined linear system not solvable!</p>
LOG_NLS_V | warning | <p>Warning: maximal number of iteration reached but no root found</p>
stdout | warning | <p>While solving non-linear system an assertion failed during initialization.</p>
LOG_NLS_V | warning | <p>Warning: maximal number of iteration reached but no root found</p>
stdout | warning | <p>While solving non-linear system an assertion failed during initialization.</p>
stdout | warning | <p>While solving non-linear system an assertion failed during initialization.</p>
LOG_NLS | warning | <p>nonlinear system 118 fails: at t=0</p>
assert | debug | <p>Solving non-linear system 118 failed at time=0.<br>
For more information please use -lv LOG_NLS.</p>
assert | info | <p>simulation terminated by an assertion at initialization</p>
stdout | error | <p>Simulation process failed. Exited with code 255.</p>

HeatingSystem does not compile:

[1] 22:35:06 Translation Warning
Iteration variables with default zero start attribute in torn nonlinear equation system:
         $DER.pump.dp_pump:DUMMY_DER(fixed = false )  "Pressure increase" type: Real 
         $DER.pump.medium.h:DUMMY_DER(fixed = false )  "Specific enthalpy of medium" type: Real 


[2] 22:35:06 Symbolic Error
[Modelica.Fluid.Pipes: 1116:13-1116:140]: Model is structurally singular, error found sorting equations 
 18: heater.flowModel.Fs_p[1] = heater.crossAreas[1] * (heater.mediums[1].p - pump.p_b_nominal) * heater.flowModel.nParallel;
17: $cse17 = Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(heater.mediums[1].p, heater.mediums[1].h, heater.statesFM[2].phase, 0);
19: heater.statesFM[2].phase = if heater.mediums[1].h < Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(heater.mediums[1].p, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.boilingcurve_p(heater.mediums[1].p)) or heater.mediums[1].h > Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(heater.mediums[1].p, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dewcurve_p(heater.mediums[1].p)) or heater.mediums[1].p > 22064000.0 then 1 else 2;
15: heater.heatTransfer.Ts[1] = Modelica.Media.Water.IF97_Utilities.T_props_ph(heater.mediums[1].p, heater.mediums[1].h, $cse17);
33: pump.heatTransfer.states[1].phase = if pump.medium.h < Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(pump.p_b_nominal, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.boilingcurve_p(pump.p_b_nominal)) or pump.medium.h > Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(pump.p_b_nominal, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dewcurve_p(pump.p_b_nominal)) or pump.p_b_nominal > 22064000.0 then 1 else 2;
31: $cse6 = Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(pump.p_b_nominal, pump.medium.h, pump.heatTransfer.states[1].phase, 0);
10: pump.Hb_flow = m_flow * (smooth(0, tank.medium.h) - smooth(0, pump.medium.h));
8: -pump.Hb_flow = pump.W_single * /*Real*/(pump.nParallel);
5: pump.eta = Modelica.Fluid.Machines.ControlledPump$pump.efficiencyCharacteristic(pump.V_flow_single * pump.N_nominal / pump.N, 0.8);
3: pump.dp_pump = pump.p_b_nominal - tank.ports[2].p;
38: $STATESET1.J[3] = pump.W_single - pump.dp_pump * pump.V_flow_single / pump.eta;
29: pump.rho = Modelica.Media.Water.IF97_Utilities.rho_props_ph(pump.p_b_nominal, pump.medium.h, $cse6);
7: pump.V_flow_single = pump.V_flow / /*Real*/(pump.nParallel);
9: pump.V_flow = m_flow / pump.rho;
16: heater.flowModel.dps_fg[1] = -2.0 * heater.flowModel.Fs_p[1] / (heater.flowModel.nParallel * 2.0 * heater.crossAreas[1]);
14: heater.statesFM[2].d = Modelica.Media.Water.IF97_Utilities.rho_props_ph(heater.mediums[1].p, heater.mediums[1].h, $cse17);
13: heater.flowModel.mus[2] = Modelica.Media.Water.IF97_Utilities.dynamicViscosity(heater.statesFM[2].d, heater.heatTransfer.Ts[1], heater.mediums[1].p, heater.statesFM[2].phase);
11: m_flow = $cse43 * heater.flowModel.nParallel;
25: heater.statesFM[1].d = Modelica.Media.Water.IF97_Utilities.rho_props_ph(pump.p_b_nominal, pump.medium.h, $cse27);
12: $cse43 = Modelica.Fluid.Pipes.DynamicPipe$heater.FlowModel$heater$flowModel.WallFriction.massFlowRate_dp_staticHead(heater.flowModel.dps_fg[1], heater.statesFM[1].d, heater.statesFM[2].d, heater.flowModel.mus[1], heater.flowModel.mus[2], heater.pathLengths[1], heater.dimensions[1], 0.0, heater.crossAreas[1], heater.roughnesses[1], 0.5 * heater.flowModel.dp_small, heater.flowModel.Re_turbulent);
21: heater.flowModel.mus[1] = Modelica.Media.Water.IF97_Utilities.dynamicViscosity(heater.statesFM[1].d, heater.statesFM[1].T, pump.p_b_nominal, 0);
23: heater.statesFM[1].T = Modelica.Media.Water.IF97_Utilities.T_props_ph(pump.p_b_nominal, pump.medium.h, $cse27);
35: $cse27 = Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(pump.p_b_nominal, pump.medium.h, 0, 0);
 for variables 
 heater.flowModel.mus[1](77), $cse17.vt(86), $cse17.vp(81), $cse17.h(91), $cse17.T(83), heater.flowModel.Fs_p[1](80), $cse17.p(88), $cse17.cp(89), tank.portInDensities[2](78), $cse17.cv(92), heater.statesFM[2].phase(79), $cse17.region(84), $cse17.pt(85), $cse17.R(93), $cse17.pd(94), heater.statesFM[2].d(99), pump.dp_pump(110), $cse17.phase(82), pump.V_flow_single(106), $cse1.h(30), $cse6.region(51), $cse6.cv(41), $cse6.pd(49), $cse6.rho(44), $cse6.x(42), $cse6.phase(45), $cse6.R(38), $cse6.h(50), $cse6.p(52), $cse6.s(39), $cse6.dpT(46), $cse6.T(47), $cse6.vp(48), $cse6.cp(43), $cse6.pt(40), $cse6.vt(37), $cse8(107), heater.heatTransfer.Ts[1](98), heater.flowModel.dps_fg[1](97), $cse17.rho(96), pump.rho(54), tank.heatTransfer.states[1].d(53), pump.W_single(105), $cse43(101), pump.V_flow(104), pump.eta(108), $cse17.s(95), heater.statesFM[1].d(58), heater.flowModel.mus[2](100), $cse17.x(87), heater.statesFM[1].T(60), $cse27.rho(3), $cse27.T(4), $cse27.dpT(5), $cse27.vp(6), pump.N(113), $cse27.vt(8), $cse27.p(7), $cse27.cv(10), $cse27.R(9), $cse27.s(11), $cse27.h(13), $cse27.region(14), $cse27.pd(15), $cse27.cp(16), $cse1.pt(23), $cse1.dpT(31), pump.Hb_flow(103)

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

[4] 22:35:06 Translation Error
[/build/openmodelica-Mf9OLm/openmodelica-1.12.0~dev-513-gc9b9653/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 4170:9-4170:59]: Internal error function createStateSetsSets failed.

[5] 22:35:06 Translation Error
[/build/openmodelica-Mf9OLm/openmodelica-1.12.0~dev-513-gc9b9653/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 592:5-592:146]: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]

Change History (8)

comment:1 by Francesco Casella, 9 years ago

Milestone: Future → 2.0.0
Priority: high → blocker

These models from MSL should definitely work in 2.0.0

comment:2 by Henning Kiel, 9 years ago

PumpingSystem fails when doing ExpressionSolve.mo:913 f1 := Expression.expandFactors(e1) with e1=

pumps.V_flow_single / 0.0 * (-100.0 + Modelica.Fluid.Machines.PrescribedPump$pumps.flowCharacteristic(0.0, {0.0, 0.25, 0.5}, {100.0, 60.0, 0.0})) / pumps.N_nominal * pumps.N

comment:3 by Vitalij Ruge, 9 years ago

Owner: changed from somebody to Vitalij Ruge
Status: new → assigned

comment:4 by Vitalij Ruge, 9 years ago

Resolution: → fixed
Status: assigned → closed

fixed with ​PR2312

comment:5 by Christoph Buchner <buchner@…>, 8 years ago

Resolution: fixed
Status: closed → reopened

I just encountered someone having a ​very bad first user experience trying these two examples, both of them failing. I hoped to reassure the user that these examples have been fixed in current OM, but unfortunately, both of them fail to simulate with current master (​PumpingSystem and ​HeatingSystem).

Truncated logs (all above notification level):

Error: post-optimization module replaceHomotopyWithSimplified (initialization) failed.
Error: No system for the symbolic initialization was generated

and

Warning: The model contains alias variables with conflicting start and/or nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.
Warning: Iteration variables with default zero start attribute in torn nonlinear equation system:
         $DER.tank.ports[2].p:DUMMY_DER(flow=false fixed = false )  "Thermodynamic pressure in the connection point" type: Real  [2]
         $DER.pump.medium.h:DUMMY_DER(fixed = false )  "Specific enthalpy of medium" type: Real
[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo:3822:9-3822:59:writable] Error: Internal error function createStateSetsSets failed.
[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo:637:5-637:146:writable] Error: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]

I think there must have been a regression since this was fixed, so can somebody more knowledgeable check this?

comment:6 by Vitalij Ruge, 8 years ago

Owner: changed from Vitalij Ruge to somebody
Status: reopened → assigned

comment:7 by Francesco Casella, 8 years ago

Owner: changed from somebody to Francesco Casella

I'll look into this.

comment:8 by Francesco Casella, 7 years ago

Resolution: → fixed
Status: assigned → closed

PumpingSystem now ​works fine, while the issue with HeatingSystem is described in #5459.

Note: See TracTickets for help on using tickets.