modelFiniteEscapeTime
Extends from NonlinearSolverFailures.InitialFailure (Initial nonlinear system of equations has no solutions).
Information
This model describes a simple hydraulic system with a pump, followed by a valve, which fills a reservoir.
As the reservoir level increase, the flow rate w_pump approaches zero. When it does, the energy balance equation causes the specific enthalpy h1, and thus the temperature T1, to approach infinity. The temperature T1 is the input of a first-order linear system, representing the temperature sensor dynamics. If a variable step-size solver with error control is used, it will try to compute the state trajectory, which also approaches infinity, so the solver eventually gets stuck around time t = 666.
The debugger should identify the state variable (Ts, in this case) whose error estimate is causing the step size to be reduced, then suggest the user to look at how its derivative der(Ts) is computed. It will be shown that it depends on T1, which diverges towards infinity. T1 in turn depends on h1, which also diverges to infinity. Finally, h1 depends on the energy balance equation, which depends on w_pump - at that point it will become apparent that as the flow rate w_pump goes to zero, the model wil become ill-posed, because of a division by zero.
The solution in this case is to change the pump model, by adding to the energy balance some dynamic energy storage and/or some heat transfer to the ambient, and by introducing a check-valve behaviour in the flow-head relationship to avoid flow reversal.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Pressure | patm (from InitialFailure) | 101325 | Atmospheric pressure |
| Real | Kv (from InitialFailure) | 1e-2 | Valve coefficient |
| Real | dp_small (from InitialFailure) | 1 | Small dp for valve equation |
| Real | dp0 (from InitialFailure) | 3e5 | Pump dp @ zero flow |
| Real | a1 (from InitialFailure) | 1e6 | Pump coefficient |
| Real | a2 (from InitialFailure) | 3e2 | Pump coefficient |
| Real | a3 (from InitialFailure) | 3e2 | Pump coefficient |
| SI.Temperature | T0 (from InitialFailure) | 20 + 273.15 | Temperature of incoming fluid |
| SI.Density | rho (from InitialFailure) | 995 | Density of fluid |
| SI.Area | A (from InitialFailure) | 0.01 | Storage tank cross section |
| SI.MassFlowRate | w_extra (from InitialFailure) | 0 | Extra mass flow rate into reservoir |
| SI.Acceleration | g (from InitialFailure) | Modelica.Constants.g_n | Acceleration of gravity |
| SI.Temperature | Tref (from InitialFailure) | 273.16 | Reference temperature for specific enthalpy computation |
| SI.SpecificHeatCapacity | cp (from InitialFailure) | 4186 | Cp of the fluid |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| SI.MassFlowRate | w_pump (from InitialFailure) | Mass flow rate from the pump | |
| SI.Pressure | p1 (from InitialFailure) | Pump discharge pressure | |
| SI.Pressure | p2 (from InitialFailure) | Storage tank inlet pressure | |
| SI.Pressure | dp_pump (from InitialFailure) | Pump dp | |
| SI.Pressure | dp_valve (from InitialFailure) | Valve dp | |
| Real | sqrt_dp (from InitialFailure) | Regularized sqrt(dp) | |
| SI.SpecificEnthalpy | h0 (from InitialFailure) | Pump inlet specific enthalpy | |
| SI.SpecificEnthalpy | h1 (from InitialFailure) | Pump discharge specific enthalpy | |
| SI.Power | W (from InitialFailure) | ||
| SI.Length | y (from InitialFailure) | Reservoir level | |
| Real | eta (from InitialFailure) | (p1 - patm)*w_pump/rho/W | Pump efficiency |
| SI.Temperature | T1 (from InitialFailure) | Pump discharge temperature | |
| SI.Time | tau (from InitialFailure) | 1 | Time constant of temperature sensor |
| SI.Temperature | Ts | Output of pump discharge temperature sensor |