-
Notifications
You must be signed in to change notification settings - Fork 0
/
compounds.py
48 lines (39 loc) · 1.23 KB
/
compounds.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
import biosteam as bst
def define_chemical_phase(chemical, phase, **constants):
c = bst.Chemical(chemical)
c.at_state(phase=phase)
return c
# %% Define common chemicals
# PET = "PubChem=8441"
# PP = "PubChem=76958"
# PE = "CAS=9002-88-4"
# Carbon = "PubChem=5462310"
# Aluminum = "PubChem=5359268"
# Heptene = "PubChem=11610"
customChemicals = {
"PET":"C10H10O4",
"PP" : "C22H42O3",
"PE" : "C2H4",
"Carbon" : "C",
"Al" : "Al",
"Ash": "PubChem=24261"
}
# Gases
(CH4, CO2, O2) = [ define_chemical_phase(c, 'g')
for c in ["CH4", 'CO2', 'O2']]
# Fluids
(Heptane, Benzene, Heptene, H2O) = [ c
for c in bst.Chemicals(['Heptane', 'Benzene', "C7H14", "Water"])]
# Solids
(PET, PP, PE, Char, Al, Ash) = [define_chemical_phase(c, 's')
for c in customChemicals.values()]
# Use the PE model for the PP saturation pressure model
# [PP.Psat.add_model(p) for p in PE.Psat]
chemicals = bst.Chemicals([CH4, H2O, CO2, O2, PET, PP, PE, Char, Al, Ash, Benzene, Heptane, Heptene], cache=True)
for chemical in chemicals:
chemical.default()
chemicals.compile()
for (k,v) in customChemicals.items():
chemicals.set_synonym(v, k)
chemicals.set_synonym("C7H14", "Heptene")
bst.settings.set_thermo(chemicals, cache=True)