﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6203	Some parameters seem to be never assigned in Buildings models	Francesco Casella	Per Östlund	"Please check [https://libraries.openmodelica.org/branches/master/Buildings_7.0.0/files/Buildings_7.0.0_Buildings.Fluid.Actuators.Valves.Examples.ThreeWayValves.sim Buildings.Fluid.Actuators.Valves.Examples.ThreeWayValves]. The simulation fails at runtime with
{{{
Jacobian determinant is NaN.
nonlinear system 56 fails: at t=0
}}}
I tried to investigate the issue using the debugger, I found the following chain of equations and assignments
Equation 56 has one equation in the unknown {{{valTab.res3.m_flow}}}
{{{
(residual) valTab.res3.dp - homotopy(Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow(valTab.res3.m_flow, valTab.res3.k, valTab.res3.m_flow_turbulent), valTab.res3.dp_nominal_pos * valTab.res3.m_flow / valTab.res3.m_flow_nominal_pos) = 0

valTab.res3.dp_nominal_pos := abs(valTab.res3.dp_nominal)

valTab.res3.dp_nominal := valTab.res3.dpValve_nominal
}}}
A similar issue pops up with {{{valTab.res3.m_flow_nominal_pos}}}:
{{{
(assign) valTab.res3.m_flow_nominal_pos := abs(valTab.res3.m_flow_nominal)
}}}
but then {{{valTab.res3.m_flow_nominal}}} is apparently not assigned in any equation. 

This of course explains the NaN in the Jacobian, that would be obtained by computing the 0/0 ratio

Unfortunately, the debugger does not report how {{{valTab.res3.dpValve_nominal}}} is computed. I don't know if this is a problem with the debugger, or if it turns out that this parameter is incorrectly skipped and eventually assumed to be zero.

This issue affects many models in the Buildings library, and is possibly the root cause of #6190

"	defect	closed	blocker	1.18.0	New Instantiation		fixed		Adrian Pop
