Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/python/OMChem/Flowsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ def safe_streams(stms):

# --- Define compounds ---
for c in self.compounds:
c_title = c.title()
self.data.append(f"parameter Simulator.Files.Chemsep_Database.{c_title} {c_title};\n")
norm = _normalize_compound_name(c)
self.data.append(f"parameter Simulator.Files.Chemsep_Database.{norm} {norm};\n")

self.data.append(unitop.OM_Flowsheet_Initialize())

Expand Down
11 changes: 4 additions & 7 deletions src/main/python/utils/UnitOperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
parentPath = os.path.dirname(parent)
sys.path.append(parentPath)

from python.OMChem.Flowsheet import Flowsheet
from python.OMChem.Flowsheet import Flowsheet, _normalize_compound_name
from python.OMChem.EngStm import EngStm
from python.utils.ComponentSelector import *
from python.utils.Container import *
Expand Down Expand Up @@ -138,8 +138,7 @@ def OM_Flowsheet_Initialize(self):

self.OM_data_init += self.for_naming[i] + str(self.counter) + ' ' + self.for_naming + '(Nc = ' + str(len(self.compounds))

C = str(self.compounds).strip('[').strip(']')
C = C.replace("'", "")
C = ', '.join(_normalize_compound_name(c) for c in self.compounds)
self.OM_data_init += ',C = {' + C + '}'

for k in self.parameters:
Expand All @@ -153,8 +152,7 @@ def OM_Flowsheet_Initialize(self):

else:
self.OM_data_init += 'Simulator.UnitOperations.' + self.type + ' ' + self.name + '(Nc = ' + str(len(self.compounds))
C = str(self.compounds).strip('[').strip(']')
C = C.replace("'", "")
C = ', '.join(_normalize_compound_name(c) for c in self.compounds)
self.OM_data_init += ',C = {' + C + '}'

for k in self.parameters:
Expand Down Expand Up @@ -518,8 +516,7 @@ def OM_Flowsheet_Initialize(self):
self.OM_data_init = self.OM_data_init + (
"Simulator.UnitOperations.CompoundSeparator " + self.name + "(Nc = " + str(comp_count))
self.OM_data_init = self.OM_data_init + (", C = {")
comp = str(self.compounds).strip('[').strip(']')
comp = comp.replace("'", "")
comp = ', '.join(_normalize_compound_name(c) for c in self.compounds)
self.OM_data_init = self.OM_data_init + comp + ("},")
self.OM_data_init = self.OM_data_init + ("SepFact_c = " + SepFact + ",SepStrm = " + SepStrm + ");\n")

Expand Down