OpenCCM is a CFD-based compartment modelling software package. It is primarily intended for convection dominated reactive flows which feature a weak or one-way coupling between the reactive species and the carrier fluid, i.e. the reaction does not substantially influence the fluid flow over the course of the simulation.
Previously the initial flow optimization in tweak_compartment_flows required each compartment have no net outflow and that the net inflow was capped to the user specified $atol{opt}$. However, it was not enforcing $atol{opt}$ through the optimization routine, it was only checking against it after the fact. I.e. the constraint was $$\epsilon \le flow{in} - flow{out}$$
This PR changes the optimization problem to include that maximum, $atol{opt}$, as a constraint on each compartment. I.e. each compartment has the following constraints: $$\epsilon \le flow{in} - flow{out} \le atol{opt}$$
It also removes $rtol_{opt}$ since the value being compared against is $0$, thus a relative tolerance isn't needed.
Previously the initial flow optimization in
tweak_compartment_flows
required each compartment have no net outflow and that the net inflow was capped to the user specified $atol{opt}$. However, it was not enforcing $atol{opt}$ through the optimization routine, it was only checking against it after the fact. I.e. the constraint was $$\epsilon \le flow{in} - flow{out}$$This PR changes the optimization problem to include that maximum, $atol{opt}$, as a constraint on each compartment. I.e. each compartment has the following constraints: $$\epsilon \le flow{in} - flow{out} \le atol{opt}$$
It also removes $rtol_{opt}$ since the value being compared against is $0$, thus a relative tolerance isn't needed.