Giter VIP home page Giter VIP logo

Comments (5)

pauliacomi avatar pauliacomi commented on June 24, 2024

Hi there,

Yes, the meniscus geometry, or the shape of the fluid-gas interface as shown in the photo below from Adsorption by powders and porous solids by Rouquerol et al, is generally regarded as different based on where the process starts, adsorption (pores empty) or desorption (pores full).

image

If we imagine an infinite cylindrical pore open at both sides, during adsorption the adsorbed phase forms a layer on the walls of the cylinder. The interface is then essentially just a smaller cylinder with a radius of pore_radius - 2 * layer thickness, like in the upper part of the figure.

However, during desorption, what happens is that the pore is filled, and the the interface is essentially just the "edges" of the filled pore, which take a (more or less) hemispherical shape, like in the lower part of the figure.

Now I do not know why ASIQWin would choose the same meniscus geometry for both adsorption and desorption, as it would seem to me as that would give wrong results. This is actually one of the reasons why I hope pyGAPS would be useful, you can look in the code and find out exactly what the calculation does! The negative values are a bit odd, I will look into that but I think it's just deviation from ideality.

As for your question, you can actually use any meniscus geometry if you get one of the lower level functions from psd_meso.py. You'll need manual values for some of the parameters. For example for the pygaps-DH model:

import pygaps as pg
from pygaps.characterisation.models_kelvin import get_kelvin_model
from pygaps.characterisation.models_thickness import get_thickness_model
from pygaps.characterisation.psd_meso import psd_pygapsdh

### Change these as you see fit
isotherm = pg.PointIsotherm() # Your isotherm here
branch = "ads"
thickness_model = "Harkins/Jura"
kelvin_model = "Kelvin"
pore_geometry = "cylinder"
meniscus_geometry = "cylindrical"
###

molar_mass = isotherm.adsorbate.molar_mass()
liquid_density = isotherm.adsorbate.liquid_density(isotherm.temperature)
surface_tension = isotherm.adsorbate.surface_tension(isotherm.temperature)
loading = isotherm.loading(branch=branch,loading_basis='molar',loading_unit='mmol')
pressure = isotherm.pressure(branch=branch, pressure_mode='relative')
if branch == 'des':
    loading = loading[::-1]
    pressure = pressure[::-1]

volume_adsorbed = loading * molar_mass / liquid_density / 1000
t_model = get_thickness_model(thickness_model)
k_model_args = {
    "meniscus_geometry": meniscus_geometry,
    "temperature": isotherm.temperature,
    "liquid_density": liquid_density,
    "adsorbate_molar_mass": molar_mass,
    "adsorbate_surface_tension": surface_tension
}
k_model = get_kelvin_model(kelvin_model, **k_model_args)

# Here is where you get the results
pore_widths, pore_dist, pore_vol_cum = psd_pygapsdh(
    volume_adsorbed, pressure, pore_geometry, t_model, k_model
)

Let me know if this helps.

from pygaps.

Loturest avatar Loturest commented on June 24, 2024

Very appreciated!

As to the negative values, I have checked the code and found that at some time, "the volume desorbed from thinning" (thickness_factor in the code ) will be larger than ads/des volume, resulting negative value.

def psd_pygapsdh()
# Calculate the volume desorbed from thinning of all pores previously emptied
thickness_factor = -d_thickness[i] * sum_area_factor
# Equation for pore volume, then add to the array
pore_volume = (d_volume[i] + thickness_factor) * ratio_factor

I also checked Micromeritics codes (https://github.com/RJC0514/micromeritics), it seems in such case, the pore_volume will be considered as 0.

from pygaps.

pauliacomi avatar pauliacomi commented on June 24, 2024

Hi again,

I've taken some time to get back to you on this, as I wanted to be fully sure. In short yes, the volume desorbed from thinning can be larger than the ads/des volume, though in my opinion this should not be solved by setting it to zero.

I've done some simulations to compare the idealized model output with a standard material, and it seems that the main source of the behaviour is that initial assumptions are wrong: either the function that is used to describe the thickness of the adsorbate inside the pores or the selected geometry simply do not accurately describe the process.

What then happens is that the pore size distribution calculation overshoots and generates negative values. Here is the difference between setting the meniscus geometry either to be cylindrical (cylinder pores)

image

or to hemispherical (one-end open cylinder pores)

image

So to me, negative values would signify bad model initial settings and that a user should think again about what parameters describes their system. To help highlight this I have added a warning that is thrown when this happens, see commit 3f9a635

I have also added a new option to allow for manual selection of the meniscus geometry without having to use one of the base functions. You should now be able to do something like:

import pygaps.characterisation as pgc
pgc.psd_mesoporous(
    iso,
    "DH",
    branch="ads",
    pore_geometry="cylinder",
    meniscus_geometry="hemispherical",
    thickness_model="Harkins/Jura",
    verbose=True,
)

Finally, in the pygaps GUI, I added a graph like the one above, to highlight the match between the PSD model uptake and the actual isotherm, also hopefully to point out that there are some wrong assumptions.

Do you think this is appropriate? If so I will close this issue and make the changes part of a new release.

from pygaps.

Loturest avatar Loturest commented on June 24, 2024

Great. It is a better solution than just setting the value to 0.

from pygaps.

pauliacomi avatar pauliacomi commented on June 24, 2024

Great, thanks again for bringing this to my attention, it was interesting to think about.

from pygaps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.