Dear Davood,
The geochemistry module that comes as a third-party module in MRST release contains tools for solving equilibrium water-based chemical system. The water-salt system with two chemical reactions (H2O <-> H+ + OH- and NaCl <-> Na+ + Cl-) is a typical example of that and is demonstrated in several examples. The module provides also tools for coupling with transport but only in a single water phase, in this version. You can have a look at `examples/transport/injectorProducerArray.m` for an example also NaCl.
Adding black-oil capability will require to rewrite the function:
`function [eqs, names, types] = equationsTransportComponents(model, state0, state, dt, drivingForces, varargin)`
which is located in `geochemistry/utils/` and include the blackoil part, with the two oil and gas phases and components. The equations for the blackoil part
`function [problem, state] = equationsBlackOil(state0, state, model, dt, drivingForces, varargin)`
can be found in `mrst-autodiff/ad-blackoil/utils/equationsBlackOil.m`
Depending on your familiarity with MRST these modifications may more or less easy. By doing that, you can obtain a first prototype.
The solver will nonetheless not cope with the absence/disparition of species (for example absence of NaCl). This case requires support for switching equations (we miss an equilibrium equation) which is not supported in this version.
I hope it helps!
Best Regards,
Xavier.