frank1010111 / pywaterflood

Capacitance resistance models for waterflood connectivity
BSD 2-Clause "Simplified" License
45 stars 19 forks source link

Is the constraint on \sum_{j}^{Nprod} fij<=1$ implemented? #87

Open castroavila opened 8 months ago

castroavila commented 8 months ago

Is your feature request related to a problem? Please describe. I have tested the library, and I noticed that $$\sum^{N{prod}}{j=1} fij\leq1$$ for a fixed injector $i$ is not fulfilled. This is the constrain given by Eq. 19 in Holanda et al. 2018. I have tried every option for constraints in CRM(constraints=..) and the issue remains. Not sure if I have missed/did something wrong and the constraint is already implemented.

Describe the solution you'd like It would very helpful to have such constraint implemented. Make the solution more realistic, since in the real oil field, injection losses occur.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

frank1010111 commented 8 months ago

Thank you for your suggested improvement. You are right, this is not currently implemented:

https://github.com/frank1010111/pywaterflood/blob/6460d6275bdd81923db94a2ff17b8080eaa543ea/python/pywaterflood/crm.py#L633-L635

The python constrained optimization options provided by scipy.optimize tend to be very slow when handling a large number of dimensions. I will check on the state of the art for any faster optimizers.

castroavila commented 7 months ago

Thanks for the reply. Any hint how to implement this constraint (even so the implementation be slow)?

frank1010111 commented 7 months ago

Oh yes, I have done it before in this branch: https://github.com/frank1010111/pywaterflood/tree/jax which is a few years stale. I would have to think about how to refresh the branch given how much the code has changed in the interim.