diff options
author | pravindalve | 2020-12-23 18:26:03 +0530 |
---|---|---|
committer | pravindalve | 2020-12-23 18:26:03 +0530 |
commit | 60d80b1c9f32d9e742f1622eb2ec458fe79ba765 (patch) | |
tree | 97e1a97add543b00d721503a5def0efdaad5174f | |
parent | 227d047492feea589f5f9f7d5ecf6cc3d610f84d (diff) | |
download | Chemical-Simulator-GUI-60d80b1c9f32d9e742f1622eb2ec458fe79ba765.tar.gz Chemical-Simulator-GUI-60d80b1c9f32d9e742f1622eb2ec458fe79ba765.tar.bz2 Chemical-Simulator-GUI-60d80b1c9f32d9e742f1622eb2ec458fe79ba765.zip |
All modes added to distillation column
-rw-r--r-- | DockWidgets/DockWidget.py | 2 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidget.cpython-37.pyc | bin | 4329 -> 4338 bytes | |||
-rw-r--r-- | UnitOperations.py | 34 |
3 files changed, 32 insertions, 4 deletions
diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index b3997f3..7e8a221 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -59,7 +59,7 @@ class DockWidget(QDockWidget,ui_dialog): print(i) if i == None: continue - l = QLineEdit(self.obj.variables[i]['value']) + l = QLineEdit(str(self.obj.variables[i]['value'])) lay = QGridLayout() lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) lay.addWidget(l,0,1, alignment=Qt.AlignCenter) diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex d4cdec3..3386671 100644 --- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc diff --git a/UnitOperations.py b/UnitOperations.py index 1a96e59..8a3f8db 100644 --- a/UnitOperations.py +++ b/UnitOperations.py @@ -273,6 +273,7 @@ class DistillationColumn(UnitOperation): self.variables['C_Spec']['type'] = params[temp+3] if 'Compound' in self.variables['C_Spec']['type']: self.variables['C_Spec']['comp'] = params[temp+4] + # C_Spec variable value won't be updated to class here. It will be updated in result self.variables['C_Spec']['value'] = params[temp+5] for var in self.variables: if self.variables[var]['name'] == self.variables['C_Spec']['type']: @@ -338,16 +339,43 @@ class DistillationColumn(UnitOperation): self.OM_data_eqn = self.OM_data_eqn + ( 'connect(' + self.input_stms[i].name + '.Out' + ", " + self.name + '.In_s[' + str( i + 1) + ']);\n') - if self.variables['R_Spec']['type'] == "Product Molar Flow (mol/s)": - self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].name + '.' + 'F_p[1] = ' + str( - self.variables['R_Spec']['value']) + ';\n') + # ['Product Molar Flow (mol/s)', 'Temperature (K)', 'Compound Molar Fraction', + # 'Compound Molar Flow (mol/s)'] if self.variables['C_Spec']['type'] == "Reflux Ratio": self.OM_data_eqn = self.OM_data_eqn + ( self.name + '.' + 'RR' + '=' + str(self.variables['RR']['value']) + ';\n') + elif self.variables['C_Spec']['type'] == "Product Molar Flow (mol/s)": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[0].name + '.' + 'F_p[1] = ' + str( + self.variables['C_Spec']['value']) + ';\n') + elif self.variables['C_Spec']['type'] == "Temperature (K)": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[0].name + '.' + 'T = ' + str( + self.variables['C_Spec']['value']) + ';\n') + elif self.variables['C_Spec']['type'] == "Compound Molar Fraction": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[0].name + '.x_pc[1,:' + + str(self.compounds.index(self.variables['C_Spec']['comp']) + 1) + '] = ' + str( + self.variables['C_Spec']['value']) + ';\n') + elif self.variables['C_Spec']['type'] == "Compound Molar Flow (mol/s)": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[0].name + '.F_pc[1,:' + + str(self.compounds.index(self.variables['C_Spec']['comp']) + 1) + '] = ' + str( + self.variables['C_Spec']['value']) + ';\n') else: self.OM_data_eqn = self.OM_data_eqn + ( self.name + '.Condenser.' + self.mode + '=' + str(self.modeVal) + ';\n') + if self.variables['R_Spec']['type'] == "Product Molar Flow (mol/s)": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].name + '.' + 'F_p[1] = ' + str( + self.variables['R_Spec']['value']) + ';\n') + elif self.variables['R_Spec']['type'] == "Temperature (K)": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].name + '.' + 'T = ' + str( + self.variables['R_Spec']['value']) + ';\n') + elif self.variables['R_Spec']['type'] == "Compound Molar Fraction": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].name + '.x_pc[1,:' + + str(self.compounds.index(self.variables['R_Spec']['comp']) + 1) + '] = ' + str( + self.variables['R_Spec']['value']) + ';\n') + elif self.variables['R_Spec']['type'] == "Compound Molar Flow (mol/s)": + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].name + '.F_pc[1,:' + + str(self.compounds.index(self.variables['R_Spec']['comp']) + 1) + '] = ' + str( + self.variables['R_Spec']['value']) + ';\n') self.OM_data_eqn = self.OM_data_eqn + self.name + '.reboiler.P=' + str( |