I’m trying to establish an exemplatory process model of the BiSMA-Binding. Unfortunately the simulation does not end. If I try to debug Cadet Core in VS using the h5 file I run into the error below. I attached the h5 file below, could you let me know if this is an issue of the parameter set or the BiSMA implementation in Cadet Core?
Debug Error in Visual Studio using the current Cadet Core master-branch without changes:
Assertion failed: scalingFactors[i] != 0.0, file D:\data\source\repos\CADET\src\libcadet\linalg\DenseMatrix.cpp, line 303
I could also reproduce the error, the factorization in the consistent initialization failed. You only specified the initial values for the salt liquid phase as non-zero, all the other (liquid and solid) phases were specified as zero. These initial values are inconsistent with the equations and we thus need consistent initialization, which CADET generally supports.
We found that the ordering of the binding parameters was not correct: it should be in state-major, i.e. first come the values for the first bound state of all components, then for the second bound states.
The specification of some binding parameters as zero (which was meant for the salt but was applied for a non-salt component) created a singular (sub)matrix in the Jacobian, i.e. a zero row, which is why the factorization within the consistent initialization failed.
Furthermore, in order to debug your simulations, we recommend setting CONNECTIONS_INCLUDE_DYNAMIC_FLOW = false, otherwise the preprocessing takes rather long in debug mode.
We also found, that setting the consistent_init_mode = 5 is required if the different bound states have different parameters. E.g.
This will always work,
So if you find, that your BiSMA simulations aren’t terminating, especially if they get stuck at a section switch time, try setting consistent_init_mode = 5. This will perform a full “consistent initialization” at the start of the simulation and “lean” initializations at subsequent section switches
Note that this will only use the constant term of the flow rates. Since this is mostly for debugging, no further checks are performed. So if you implemented gradients using flow rates, this will not work.