-
Notifications
You must be signed in to change notification settings - Fork 0
/
AEM_API_wACCC_ACCCSolvents+nonACCCSalt.py
82 lines (70 loc) · 3.56 KB
/
AEM_API_wACCC_ACCCSolvents+nonACCCSalt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# ============================================================================
""" Advanced Electrolyte Model (AEM) API Demo """
""" © 2024 Ridgetop Group, Inc. and Adarsh Dave (CMU), All Rights Reserved """
# ============================================================================
## Import Libraries and AEM API Classes
import os
import sys
from AEM_API import ElectrolyteComposition, ACCCElectrolyteComposition, AEM_API
## AEM Directories
homedir = os.path.expanduser("~")
AEM_HOME_PATH = rf'{homedir}\Documents\AEM\CLI' # Path to AEM/CLI/ (Update path if different!)
AEM_PROGRAM_NAME = "aem-2242m-d-accc.exe"
## Define Non-ACCC Electrolyte Composition - Solvents and Salts
solvents = {}
salts = {'LiPF6': 1}
electrolyte = ElectrolyteComposition.by_mass_fraction_and_molality(solvents=solvents, salts=salts)
## Define ACCC Electrolyte Composition - Solvents and Salts
accc_solvents = {'EC_EMC': (70, 30)}
accc_salts = {}
accc_electrolyte = ACCCElectrolyteComposition(solvents=accc_solvents, salts=accc_salts)
## Define Input Parameters
output_dir = 'AEM-API-Output\\Demos' # Output Directory for AEM API Runs
run_name = 'w_ACCC_ACCCSolvents+NonACCCSalt' # Run Name
solventcomp = 1 # Solvent Composition: 1 (Single Fixed Composition) or 2 (Larger Matrix)
solventcomppropbasis = 2 # Solvent Composition Proportionality Basis: 1 (Volume) or 2 (Mass)
saltcomp = 1 # Salt Composition [Salts > 1]: 1 (Single Fixed Composition) or 2 (Several Proportions)
totalsaltconc = 1 # Max. Total Salt Concentration of Interest
tmin = 10 # Minimum Temperature: -30deg to 60 deg (Do not exceed 100deg)
tmax = 60 # Maximum Temperature: -30deg to 60 deg (Do not exceed 100deg)
stepsize = 10 # Temperature Stepsize: 5deg or 10deg
tis = 1 # Triple-Ion Stability Method: 1 (default) or 2 (inequalities are automatically determined)
contactangle = 90 # Contact Angle: 0deg to 90deg
porelength = 50 # Pore Length: 0.1um to 50um
saltconc = 0.1 # Input Salt Concentration of Interest: 0.1 to Max. Salt Conc.
scaep = 0 # Surface-Charge Attenuated Electrolyte Permittivity (SCAEP) Calculations: 0 (No) or 1 (Yes)
dl = 0 # Double Layer (DL) Calculations: 0 (No) or 1 (Yes)
## Initialize the AEM-API Object
aem = AEM_API(electrolyte=electrolyte,
accc_electrolyte=accc_electrolyte,
solventcomp=solventcomp,
solventcomppropbasis=solventcomppropbasis,
saltcomp=saltcomp,
totalsaltconc=totalsaltconc,
tmin=tmin,
tmax=tmax,
stepsize=stepsize,
tis=tis,
contactangle=contactangle,
porelength=porelength,
saltconc=saltconc,
scaep=scaep,
dl=dl,
output_dir=output_dir,
run_name=run_name,
AEMHomePath=AEM_HOME_PATH,
AEMProgramName=AEM_PROGRAM_NAME)
## Generate Cues for AEM CLI
aem.generate_cues()
## Run AEM
aem.runAEM(quiet=False)
## Visualize the AEM_PARSER Parsed Data
report_no = "Report02" # Report01-20
x = "c2" # x-axis: Any column from chosen report
y = "gamma" # y-axis: Any column from chosen report
aem.plot_parsed_data(x=x, y=y, report_number=report_no)
## Process the Output Data & Save
aem.process()
all_data = aem.save_processed_data()
## Plot the Output Data
aem.plot_processed_data(all_data)