PMEAL / OpenPNM

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

`Air` object has no attribute `get_comp_vals` #2713

Closed JorgeESantos closed 1 year ago

JorgeESantos commented 1 year ago

Greetings.

I'm trying to set up an Air phase in order to perform Fickian Diffusion simulation, to calculate Network tortuosity. The code I'm trying to run is:

air = pnm.phase.Air(network=Net, name='air')
air['pore. Temperature'] = 293.15
air['throat. Temperature'] = 293.15 #24ºC = 297.15K
# set T = 20ºC
air.add_model(propname='throat.diffusive_size_factors',
              model=pnm.models.geometry.diffusive_size_factors.spheres_and_cylinders)
# air.add_model(propname='pore.diffusivity',
#               model=pnm.models.phase.diffusivity.gas_mixture_ce(phase=air, MWs=air.params['molecular_weight']))
# air.add_model(propname='throat.diffusivity',
#               model=pnm.models.phase.diffusivity.gas_mixture_ce(phase=air, MWs=air.params['molecular_weight']))
# tryed this way and nothing

air.add_model(propname='pore.diffusivity',
              model=pnm.models.phase.diffusivity.gas_mixture_ce(phase=air))
air.add_model(propname='throat.diffusivity',
              model=pnm.models.phase.diffusivity.gas_mixture_ce(phase=air))
air.add_model(propname='throat.diffusive_conductance',
              model=pnm.models.physics.diffusive_conductance.generic_diffusive)

The error raised is the following: image

It seems I'm unable to define diffusity and that "gas_misture_ce" has not been able to fetch or reach air.params of Molecular Weight? With gas_mixture_fesg(), the result is the same.

Whats going on? Am I missing something? @ma-sadeghi

Regards

ma-sadeghi commented 1 year ago

Hi. There are a couple of issues with your code:

Have you looked at this example? It explains how to compute tortuosity of a network.

JorgeESantos commented 1 year ago

Hey there. Thanks for the quick answer. Its solved. I added the diffusive size factors to the Network and then, I deleted diffusivity models and it does the trick. The temperature was a typo when I wrote it on Github. Now the code is:

air = pnm.phase.Air(network=Net, name='air')
air.add_model_collection(pnm.models.collections.physics.basic)
air['pore.temperature'] = 293.15
air['throat.temperature'] = 293.15 #24ºC = 297.15K
# set T = 20ºC
air.add_model(propname='throat.diffusive_conductance',
              model=pnm.models.physics.diffusive_conductance.generic_diffusive)
print('Phase and physics set')

Thanks for the help. Should I delete the thread?