diff options
author | pravindalve | 2020-07-08 16:39:05 +0530 |
---|---|---|
committer | pravindalve | 2020-07-08 16:39:05 +0530 |
commit | dafe790599284515c1db8bbf58946aae531bb551 (patch) | |
tree | fddf979be0d7459140ebb5583565f13f0b60e56a | |
parent | a69bc3eb0486d949c024bb5b373b14c0618d2220 (diff) | |
download | Chemical-Simulator-GUI-dafe790599284515c1db8bbf58946aae531bb551.tar.gz Chemical-Simulator-GUI-dafe790599284515c1db8bbf58946aae531bb551.tar.bz2 Chemical-Simulator-GUI-dafe790599284515c1db8bbf58946aae531bb551.zip |
Flash bugs fixed
-rw-r--r-- | DockWidgets/DockWidgetFlash.py | 2 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidget.cpython-37.pyc | bin | 6107 -> 6125 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc | bin | 3169 -> 3187 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc | bin | 4186 -> 4204 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc | bin | 2895 -> 2914 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc | bin | 8739 -> 8757 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc | bin | 2226 -> 2244 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc | bin | 3364 -> 3382 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc | bin | 2733 -> 2751 bytes | |||
-rw-r--r-- | Undo.dat | bin | 64907 -> 64377 bytes | |||
-rw-r--r-- | UnitOperations.py | 33 |
11 files changed, 29 insertions, 6 deletions
diff --git a/DockWidgets/DockWidgetFlash.py b/DockWidgets/DockWidgetFlash.py index 6098b27..1634169 100644 --- a/DockWidgets/DockWidgetFlash.py +++ b/DockWidgets/DockWidgetFlash.py @@ -29,7 +29,7 @@ class DockWidgetFlash(QDockWidget,ui_dialog): try: print("input_params_list ", self.input_dict) - self.l1.setText(self.obj.variables['thermoPackage']['name']+":") + self.l1.setText(self.obj.variables['thermo_package']['name']+":") self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] for j in self.lines: self.cb1.addItem(str(j)) diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex f1fa8b5..0733a15 100644 --- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc Binary files differindex ecad97b..a017f6c 100644 --- a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc Binary files differindex e5f9002..9edcc3b 100644 --- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc Binary files differindex c706582..7a0568c 100644 --- a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differindex e42b5d7..ad1e8f3 100644 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc Binary files differindex ab2fad7..6bfb174 100644 --- a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc Binary files differindex 1c34a04..7e4a733 100644 --- a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc Binary files differBinary files differindex bcd36dc..045ca3d 100644 --- a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc diff --git a/UnitOperations.py b/UnitOperations.py index 5a67b2f..faf54de 100644 --- a/UnitOperations.py +++ b/UnitOperations.py @@ -38,7 +38,7 @@ class UnitOperation(): self.for_naming = [] self.multidict = [] self.thermo_pack_req = False - self.thermo_package = None + self.thermo_package = 'RaoultsLaw' def param_getter(self,mode=None): params = {} @@ -116,11 +116,18 @@ class UnitOperation(): C = str(self.compounds).strip('[').strip(']') C = C.replace("'", "") self.OM_data_init += ',C = {' + C + '}' - - for k,v in self.parameters.items(): + + # if len(self.parameters) > 0: + # for k,v in self.parameters.items(): + # self.OM_data_init += ', ' + # self.OM_data_init += k + ' = ' + str(v) + + for k in self.parameters: self.OM_data_init += ', ' - self.OM_data_init += k + ' = ' + str(v) - self.OM_data_init += ');\n' + self.OM_data_init += k + ' = ' + (json.dumps(self.variables[k]['value']) if json.dumps(self.variables[k]['value']).replace('"', '').replace('_', '').isalpha() + else json.dumps(self.variables[k]['value']).replace('[', '{').replace(']', '}').replace('"', '')) + + self.OM_data_init += ');\n' else: self.OM_data_init += 'Simulator.UnitOperations.' + self.type + ' ' + self.name + '(Nc = ' + str(len(self.compounds)) @@ -349,11 +356,15 @@ class Flash(UnitOperation): UnitOperation.__init__(self) self.name = name + str(Flash.counter) self.type = 'Flash' + self.extra = ['Flash'] + self.for_naming = ['Flash'] self.no_of_inputs = 1 self.no_of_outputs = 2 self.input_stms = [] self.output_stms = [] self.count = Flash.counter + self.thermo_pack_req = True + self.parameters = ['BTdef', 'Tdef', 'BPdef', 'Pdef'] type(self).counter += 1 self.variables = { @@ -372,6 +383,18 @@ class Flash(UnitOperation): self.variables['Pdef']['value'] = params[4] print(self.variables) + def OM_Flowsheet_Equation(self): + self.OM_data_eqn = '' + + self.OM_data_eqn += ('connect(' + self.name + '.In,' + self.input_stms[0].name + '.Out);\n') + + strcount = 1 + for strm in self.output_stms: + self.OM_data_eqn += ('connect(' + strm.name + '.In,' + self.name + '.Out' + str(strcount) + ');\n') + strcount += 1 + + return self.OM_data_eqn + class Pump(UnitOperation): def __init__(self,name='Pump'): UnitOperation.__init__(self) |