I build a Modelica model, but when checking the model (Here is the model download link), it shows a local singularity like in the following screenshot.
so I delete the code showed in the error message.
h[3]=(hout+hl)/2
but although the model checks fine, there is a strong nonlinearity issue which causes the initialization failure.
So I try to delete the following code line:
h[1]=(hin+hv)/2
and the model not only checks but also there is no initialization issue.
My questions are:
- When debugging the model singularity, the error message showed by Dymola might be not the singularity source of the model? Is there a general method to find the source of the singularity problem? Or I have to analyze the equations in the model manually?
How to minimize the nonlinearity of the Modelica model and ensure convergence? I found this problem exists in many fields, especially in the thermo-hydraulic models, I found that one way to deal with this problem is the way used in Thermao Power Library from Modelon and ThermoSysPro for EDF, these two libraries divide the models or connector into two types: flow and volume. To ensure convergence, it requires to use a staggered grid scheme like in the following screenshot.
So is there another method to deal with the nonlinearity problem in thermo-hydraulic models? is there a common view on how to deal with the nonlinearity problem in thermo-hydraulic models?