OpenPNM icon indicating copy to clipboard operation
OpenPNM copied to clipboard

How to implement multicomponent transport

Open JiayanJI opened this issue 2 years ago • 2 comments

How to implement multicomponent transport in the current version.

JiayanJI avatar Feb 12 '23 10:02 JiayanJI

This has been on our todo list since OpenPNM v1! (see our wish list for v2). Anyway, here's how I think it should be done for let's say a 3 component mixture:

  1. Define your mixture (mixtures are natively supported in v3)
  2. If I remember correctly, you should be able to calculate the diffusion coefficent for each component using the Mixture class and built-in models. Take a look at this tutorial.
  3. Create 2 transport algorithms, one for each component (for now, you can use FickianDiffusion) except the last one, which you can solve using mass balance.
  4. Set your boundary conditions, etc.
  5. In a while loop, solve these 2 transport algorithms in serial; the transport properties should be automatically updated, but double check. If not, you need to manually update the properties.
  6. Define a stopping criterion, e.g., change in $C_1$ and $C_2$ in consecutive iterations must be smaller than 1e-5, or something to this effect.

This should get you started. Of course, since I haven't done this myself yet, you'll likely run into problems. You can start prototyping what I just described in an IPython notebook, make a PR, and I'll guide you along the way. Once completed, we can add it to the contrib folder of OpenPNM, and later we (or hopefully you can do it) can refactor it as a standalone transport algorithm.

ma-sadeghi avatar Feb 12 '23 20:02 ma-sadeghi

OK, Thanks for your help, I will have a try for this work.

JiayanJI avatar Feb 13 '23 09:02 JiayanJI