Complicated constraintsolver
After a review of the MiscibleMultiPhaseComposition
constraint solver, Katharina and I postulate that it is far too complicated. Maybe this also applies to other constraint solvers. In two complicated routines a matrix and a right hand side are constructed and solved. However this can also be done in 2*numComponent lines of code (e.g. for two components):
double x^w_g = p^w,sat / p_g; // p^w,sat is known, p_g is a primary or secondary variable
double x^k_l = p^w,sat / H; // the Henry coefficient is well known
double x^k_g = 1.0 - x^w_g; // our standard constraints
double x^w_l = 1.0 - x^k_l; // our standard constraints