PMEAL / OpenPNM

A Python package for performing pore network modeling of porous media
http://openpnm.org
MIT License
446 stars 174 forks source link

Model collection for importing snow networks #2602

Open jgostick opened 2 years ago

jgostick commented 2 years ago

OpenPNM wants 'pore.diameter' but snow returns 'pore.inscribed/equivalent/inscribed_diameter'. Same is true for several other properties ('throat.length'). I think it would be helpful to offer a collection of geometry models which maps the snow outputs to the openpnm inputs that openpnm expects. It should be done in such as way that you can then add a normal geometry model collection for computing other stuff like volumes and surface areas.

Actually, as I type this it occurs to me that it should work as follows:

mods1 = op.models.collections.geometry.spheres_and_cylinders
mods2 = op.models.collections.geometry.snow_to_openpnm_mapping  # or whatever name works
mods1.update(mods2) 
pn.add_model_collection(mods1)

The second-last line is the key since it will overwrite any models that are present on spheres_and_cylinders that we don't want, like 'pore.diameter'.

PengzhuLin commented 1 year ago

Hi, i found that module 'openpnm.models.collections.geometry' has no attribute 'snow_to_openpnm_mapping' for the current version(3.1.2). Would you mind sharing how to conduct model collection for importing snow networks? Thank you!

PengzhuLin commented 1 year ago

From Snow, we can get equivalent_diameter, then can we get pore.diameter and throat.diameter by this? Then add other needed properties for further simulations?

pn.add_model(propname='pore.diameter',
             model=op.models.geometry.pore_size.equivalent_diameter)
pn.add_model(propname='throat.diameter',
             model=op.models.geometry.throat_size.equivalent_diameter)
pn.regenerate_models()
jgostick commented 1 year ago

This is not implemented yet, it's just a proposal/suggestion/idea/todo.