numat / RASPA2

NO LONGER UPDATED. Use the official repository.
https://github.com/iraspa/RASPA2
Other
73 stars 72 forks source link

how to run example given in git? #51

Open dzy-tju opened 4 years ago

dzy-tju commented 4 years ago

hello guys, I want to learn running RASPA using python, but I fail with the example given in the git(as follow). actually, I can't figure out the ''run'' function defined in raspa2.py "def run(structure, molecule_name, temperature=273.15, pressure=101325, helium_void_fraction=1.0, unit_cells=(1, 1, 1), framework_name="streamed", simulation_type="MonteCarlo", cycles=2000, init_cycles="auto", forcefield="CrystalGenerator", input_file_type="cif")" which one should be the input parameter "structure" in function run. If I just want to test one material ''Cu-BTC.cif'', how should I make it with "run" function.

thanks!

import RASPA2

Set up

gas = "CO2" pressures = [1e4 * 10*(0.1 i) for i in range(21)]

Run

results = [RASPA2.run(my_structure, gas, temperature=298, pressure=pressure) for pressure in pressures]

Parse

uptakes = [r["Number of molecules"][gas] ["Average loading absolute [cm^3 (STP)/cm^3 framework]"][0] for r in results]

Plot

plot(pressures, uptakes)