OpenPNM
OpenPNM copied to clipboard
Pore-scale model factory
The idea is to write a method that serves as a factory for pore-scale models. For instance, let's say you want to use a peculiar rate equation as source term, but don't want to bother writing an actual OpenPNM-compatible pore-scale model. Here's the API that I had in mind:
def my_peculiar_rate_eqn(c_A, c_B, T):
return (c_A + c_B)**2 * np.exp(T/500)
from openpnm.models.misc import model_builder
custom_rate_model = model_builder(func=my_peculiar_rate_eqn,
c_A="pore.c_A",
c_B="pore.c_B",
T="pore.temperature")
phys.add_model(propname="pore.rxn", model=custom_rate_model)
This is sort of related to issue #653. Although it only seems like a wrapper, I think it makes it easier for writing custom pore-scale models, especially for those less experienced in OpenPNM.
Another convenience that could come with this model factory is doing proper mapping based on which object on which the model is added, which is usually something that most beginners.
I think I see some value here. I'm going to reopen it and add it to future enhancements.
Given that our new philosophy is the keep things simple and stop adding frills just for the thrills, I think we should forget about this. There is ample instruction on how to create a pore-scale model in the docs now.