Giter VIP home page Giter VIP logo

Comments (7)

sblanky avatar sblanky commented on September 26, 2024

I have included a rough fix that works for my data (see above commit on my fork). the loadings read in are already in cm3/g stp, so I don't know if this will work on other units/bases. If you look over this and think it makes sense, then let me know and I'll formally submit a pull request etc.

If not, and I just don't understand how this code is meant to work then ignore me!

from pygaps.

pauliacomi avatar pauliacomi commented on September 26, 2024

Interesting difference. A couple of questions to clarify

  • What are the definitions of limiting micropore capacity and limiting micropore volume? Is this total uptake in cm3[gas at stp]/g and cm3[liquid in pores]/g?
  • Where is the magic number coming from? Does this essentially convert from the two? If so, can it be confirmed through CoolProp/RefProp?

If the above are correct, the changes made should not have any impact on the final number, so there may be something else at play...

from pygaps.

pauliacomi avatar pauliacomi commented on September 26, 2024

PS: I don't remember why I did the calcs in base 10, it just makes it more complicated.

from pygaps.

sblanky avatar sblanky commented on September 26, 2024

Your definitions are correct.
And yes, this magic number is just the ratio between gas density/liquid density. Unfortunately, CoolProp doesn't have density of nitrogen at 298 K. On running;

adsorbate.gas_density(298)

The following error is produced;

Thermodynamic backend failed with error Temperature to QT_flash [298 K] must be in range [63.051 K, 126.192 K]. Attempting to read parameters dictionary...

The aif file that the isotherm is imported from has relative pressure units and loading units of 'cm3/g stp' - don't know if that reveals anything?

from pygaps.

pauliacomi avatar pauliacomi commented on September 26, 2024

CoolProp won't work on supercritical gases, true. If it's STP, density should be in 22.4 cm3/mmol / 28k mmol/g (N2 molar mass).

So definitions are right. Note that the volume_gas loading option will give you the isotherm volume of gas at isotherm temperature, so at 77K. In the changes

microp_volume = microp_capacity * gas_density / liquid_density

In terms of units and concepts

[cm3/g, gas at 77k] * [cm3/g, gas at 303k] / [cm3/g, liquid at 77K]

So it's not apples to apples.

from pygaps.

sblanky avatar sblanky commented on September 26, 2024

Grand, so I tested this on a file, and it turns out that I'd just been creating the point isotherm, and then the resultant aif file incorrectly.

Essentially;

file = pd.read_csv('isotherm.csv', names=['pressure', 'loading], header=0)
 isotherm = pg.PointIsotherm(
        pressure=file['pressure'],
        loading=file['loading'],
        material='example',
        adsorbate='N2',
        temperature=77,
        temperature_unit='K',
        pressure_unit='bar',
        pressure_mode='relative',
        loading_basis='volume_gas',
        loading_unit='cm3',
        material_basis='mass',
        material_unit='g',
    )
isotherm.to_aif('isotherm.aif')

So the preamble in the resulting aif file looks like;

...
_pygaps_pressure_mode 'relative'
_pygaps_pressure_unit 'None'
_pygaps_material_basis 'mass'
_pygaps_material_unit 'g'
_pygaps_loading_basis 'volume_gas'
_pygaps_loading_unit 'cm3'
_pygaps_temperature_unit 'K'

Changing to

...
_pygaps_loading_basis 'molar'
_pygaps_loading_unit 'cm3(STP)'
...

Fixes this, and running verbose gives much more reasonable pore volume;

isotherm = pgp.isotherm_from_aif('isotherm.aif')
pgc.dr_da_plots.da_plot(isotherm, p_limits=[0,0.1], verbose=True)

Returns

Exponent is: 3
Micropore volume is: 0.773 cm3/g
Effective adsorption potential is 6.35 kJ/mol

I wonder if it's worth warning when the user attempts to create an isotherm with the specific units and bases I have shown here? To me it was the most intuitive way to do so.

Anywho, closing this issue!

from pygaps.

pauliacomi avatar pauliacomi commented on September 26, 2024

Good stuff!
If it was up to me, I would remove cm3[stp] completely...

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.