Skip to content

Commit

Permalink
Update raspa.py
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyxl authored Sep 11, 2023
1 parent 611b466 commit d40a1a4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions mofa/simulation/raspa.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def prep_raspa_single(
report_frequency: How often to report structures
Returns:
raspa_path: a directory with the raspa simulation input files
return_code: cif2lammps running status, 0 means success (directory raspa_path will be kept),
return_code: cif2lammps running status, 0 means success (directory raspa_path will be kept),
-1 means failure (directory raspa_path will be destroyed)
"""
cif_name = os.path.split(cif_path)[-1]
Expand Down Expand Up @@ -770,15 +770,16 @@ def prep_raspa_single(
# cwd=os.path.abspath(sim_dir),
# stdout=subprocess.PIPE,
# stderr=subprocess.STDOUT)

# read void fraction:
outdir = os.path.join(sim_dir, "Output")
outdir = os.path.join(outdir, os.listdir(outdir)[0])
outfile = os.path.join(outdir, [x for x in os.listdir(outdir) if "2.2.2" in x][0])
outstr = None
with io.open(outfile, "r", newline="\n") as rf:
outstr = rf.read()
He_Void_Faction = float(outstr.split("[helium] Average Widom Rosenbluth-weight:")[1].split("+/-")[0])
#He_Void_Faction = 0.0
# outdir = os.path.join(sim_dir, "Output")
# outdir = os.path.join(outdir, os.listdir(outdir)[0])
# outfile = os.path.join(outdir, [x for x in os.listdir(outdir) if "2.2.2" in x][0])
# outstr = None
# with io.open(outfile, "r", newline="\n") as rf:
# outstr = rf.read()
# He_Void_Faction = float(outstr.split("[helium] Average Widom Rosenbluth-weight:")[1].split("+/-")[0])
He_Void_Faction = 0.0

# GCMC rigid!!!
sim_dir = os.path.join(raspa_path, "co2_adsorption_rigid")
Expand Down

0 comments on commit d40a1a4

Please sign in to comment.