diff options
author | pravindalve | 2021-04-09 18:43:53 +0530 |
---|---|---|
committer | pravindalve | 2021-04-09 18:43:53 +0530 |
commit | f788ec71ae3fe5e015bb16c1c76b0d278e8a4223 (patch) | |
tree | 61242c7ae3f4cf5bd55bbd55431f380644b56d54 | |
parent | 129568baf9da34272127507a138ec30af888b40c (diff) | |
download | Chemical-Simulator-GUI-f788ec71ae3fe5e015bb16c1c76b0d278e8a4223.tar.gz Chemical-Simulator-GUI-f788ec71ae3fe5e015bb16c1c76b0d278e8a4223.tar.bz2 Chemical-Simulator-GUI-f788ec71ae3fe5e015bb16c1c76b0d278e8a4223.zip |
Distillation Column Results added
-rw-r--r-- | DockWidgets/DistillationColumnStagewiseResults.py | 12 | ||||
-rw-r--r-- | DockWidgets/DistillationColumnStagewiseResults.ui | 62 | ||||
-rw-r--r-- | DockWidgets/DockWidgetDistillationColumn.py | 178 | ||||
-rw-r--r-- | DockWidgets/DockWidgetDistillationColumn.ui | 57 | ||||
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.ui | 4 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidget.cpython-37.pyc | bin | 4390 -> 4411 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc | bin | 5603 -> 9426 bytes | |||
-rw-r--r-- | Simulator/Simulator/UnitOperations/DistillationColumn/Cond.mo | 4 | ||||
-rw-r--r-- | Undo.dat | bin | 1788 -> 28916 bytes | |||
-rw-r--r-- | UnitOperations.py | 27 |
10 files changed, 318 insertions, 26 deletions
diff --git a/DockWidgets/DistillationColumnStagewiseResults.py b/DockWidgets/DistillationColumnStagewiseResults.py new file mode 100644 index 0000000..c5bd67d --- /dev/null +++ b/DockWidgets/DistillationColumnStagewiseResults.py @@ -0,0 +1,12 @@ +from PyQt5.uic import loadUiType +from PyQt5.QtWidgets import QWidget + +ui_dialog,_ = loadUiType('DockWidgets/DistillationColumnStagewiseResults.ui') + + +class DistillationColumnStagewiseResults(QWidget,ui_dialog): + + def __init__(self, parent=None): + QWidget.__init__(self, parent) + self.setupUi(self) + # self.setWindowTitle(self.parent.obj.name) diff --git a/DockWidgets/DistillationColumnStagewiseResults.ui b/DockWidgets/DistillationColumnStagewiseResults.ui new file mode 100644 index 0000000..9ce4060 --- /dev/null +++ b/DockWidgets/DistillationColumnStagewiseResults.ui @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DistillationColumnStagewiseResults</class> + <widget class="QWidget" name="DistillationColumnStagewiseResults"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>594</width> + <height>411</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <widget class="QTabWidget" name="tabWidget"> + <property name="geometry"> + <rect> + <x>-1</x> + <y>-1</y> + <width>591</width> + <height>411</height> + </rect> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="T"> + <attribute name="title"> + <string>Temperature(K)</string> + </attribute> + <widget class="QTableWidget" name="T_table"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>591</width> + <height>391</height> + </rect> + </property> + </widget> + </widget> + <widget class="QWidget" name="x_pc"> + <attribute name="title"> + <string>Component Mole Fractions</string> + </attribute> + <widget class="QTableWidget" name="x_pc_table"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>591</width> + <height>391</height> + </rect> + </property> + </widget> + </widget> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/DockWidgets/DockWidgetDistillationColumn.py b/DockWidgets/DockWidgetDistillationColumn.py index e93ed47..e98ba03 100644 --- a/DockWidgets/DockWidgetDistillationColumn.py +++ b/DockWidgets/DockWidgetDistillationColumn.py @@ -6,11 +6,13 @@ import pandas as pd from functools import partial from ComponentSelector import * from collections import defaultdict +from DockWidgets.DistillationColumnStagewiseResults import DistillationColumnStagewiseResults from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidgetDistillationColumn.ui') -class DockWidgetDistillationColumn(QDockWidget,ui_dialog): + +class DockWidgetDistillationColumn(QDockWidget, ui_dialog): def __init__(self,name,comptype,obj,container,parent=None): QDockWidget.__init__(self,parent) @@ -25,6 +27,8 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): self.input_params_list() self.name_type = None self.container = container + self.stage_res_table = DistillationColumnStagewiseResults() + self.stageResultsButton.clicked.connect(self.showStagewiseResults) # input data tab @@ -40,7 +44,6 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): self.lay1.addWidget(l1,0,1, alignment=Qt.AlignLeft) self.input_dict.append(l1) - for i in range(self.obj.variables['Ni']['value']): print(i) l = QLineEdit() @@ -171,14 +174,175 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): except Exception as e: print(e) + def showStagewiseResults(self): + self.stage_res_table.show() @staticmethod def showResult(lst): - #DockWidget1.flag = True + # DockWidget1.flag = True for i in lst: - i.resultsCategory(i.name) - #i.show() + try: + i.results_category(i.name) + except AttributeError: + pass + + def clear_results(self): + self.tableWidget.setRowCount(0) + self.stage_res_table.T_table.setRowCount(0) + self.stage_res_table.T_table.setColumnCount(0) + self.stage_res_table.x_pc_table.setRowCount(0) + self.stage_res_table.x_pc_table.setColumnCount(0) # result data tab - def resultsCategory(self,name): - pass
\ No newline at end of file + def results_category(self,name): + flag = True + try: + print("Under result category name ", name) + result = self.container.result + obj = self.container.fetch_object(name) + self.tableWidget.setRowCount(0) + variKeys = obj.result_parameters + print(variKeys) + for i, val in enumerate(variKeys): + propertyname = name + '.' + val + print(i, val, propertyname) + if propertyname in result[0]: + ind = result[0].index(propertyname) + resultval = str(result[-1][ind]) + obj.variables[val]['value'] = result[-1][ind] + print("######Resultsfetch####", val, resultval) + rowPosition = self.tableWidget.rowCount() + self.tableWidget.insertRow(rowPosition) + self.tableWidget.setItem(rowPosition, 0, QTableWidgetItem(obj.variables[val]['name'])) + self.tableWidget.setItem(rowPosition, 1, QTableWidgetItem(resultval)) + self.tableWidget.setItem(rowPosition, 2, QTableWidgetItem(obj.variables[val]['unit'])) + self.tableWidget.resizeColumnsToContents() + + # Stagewise Results + Nt = self.obj.variables['Nt']['value'] + Nc = len(self.obj.compounds) + # initializing temporary arrays + Stages_T = [None]*Nt + # Can be uncommented when F_p and F_pc implemented in modelica table + # Stages_F_p = [[None for i in range(3)] for j in range(Nt)] + # Stages_F_pc = [[[None for i in range(3)] for j in range(Nc)] for k in range(Nt)] + Stages_x_pc = [[[None for i in range(3)] for j in range(Nc)] for k in range(Nt)] + + Stages_res_varikeys = ['T'] + for i in range(Nc): + for j in range(3): + Stages_res_varikeys.append('x_pc[' + str(j + 1) + ',' + str(i + 1) + ']') + + for v in Stages_res_varikeys: + propertyname = name + '.condenser.' + v + if propertyname in result[0]: + ind = result[0].index(propertyname) + if v == 'T': + Stages_T[0] = result[-1][ind] + # Can be uncommented when F_p is implemented in modelica model + # elif v == 'F_p': + # if result[0][ind][result[0][ind].index('[') + 1] == '1': + # Stages_F_p[0][0] = result[-1][ind] + # elif result[0][ind][result[0][ind].index('[') + 1] == '2': + # Stages_F_p[0][1] = result[-1][ind] + # else: + # Stages_F_p[0][2] = result[-1][ind] + else: + print(ind) + phase_no = int(result[0][ind][result[0][ind].index('[') + 1]) + comp_no = int(result[0][ind][result[0][ind].index(']') - 1]) + Stages_x_pc[0][comp_no - 1][phase_no - 1] = result[-1][ind] + # Can be uncommented and improved when F_pc implemented in modelica model + # if v == 'F_pc': + # Stages_F_pc[0][comp_no - 1][phase_no - 1] = result[-1][ind] + # else: + # Stages_x_pc[0][comp_no - 1][phase_no - 1] = result[-1][ind] + + for i in range(1, Nt - 1): + propertyname = name + '.tray[' + str(i) + '].' + v + if propertyname in result[0]: + ind = result[0].index(propertyname) + if v == 'T': + Stages_T[i] = result[-1][ind] + # Can be uncommented when F_p implemented in modelica model + # elif v == 'F_p': + # if result[0][ind][result[0][ind].index('[') + 1] == '1': + # Stages_F_p[i][0] = result[-1][ind] + # elif result[0][ind][result[0][ind].index('[') + 1] == '2': + # Stages_F_p[i][1] = result[-1][ind] + # else: + # Stages_F_p[i][2] = result[-1][ind] + else: + print(ind) + print(result[0][ind]) + phase_no = int(result[0][ind].split('.')[-1][result[0][ind].split('.')[-1].index('[') + 1]) + comp_no = int(result[0][ind].split('.')[-1][result[0][ind].split('.')[-1].index(']') - 1]) + Stages_x_pc[i][comp_no - 1][phase_no - 1] = result[-1][ind] + # Can be uncommented when F_pc implemented in modelica model + # if v == 'F_pc': + # Stages_F_pc[i][comp_no - 1][phase_no - 1] = result[-1][ind] + # else: + # Stages_x_pc[i][comp_no - 1][phase_no - 1] = result[-1][ind] + + propertyname = name + '.reboiler.' + v + if propertyname in result[0]: + ind = result[0].index(propertyname) + if v == 'T': + Stages_T[-1] = result[-1][ind] + # Can be uncommented when F_p implemented in modelica model + # elif v == 'F_p': + # if result[0][ind][result[0][ind].index('[') + 1] == '1': + # Stages_F_p[-1][0] = result[-1][ind] + # elif result[0][ind][result[0][ind].index('[') + 1] == '2': + # Stages_F_p[-1][1] = result[-1][ind] + # else: + # Stages_F_p[-1][2] = result[-1][ind] + else: + print(ind) + phase_no = int(result[0][ind][result[0][ind].index('[') + 1]) + comp_no = int(result[0][ind][result[0][ind].index(']') - 1]) + Stages_x_pc[-1][comp_no - 1][phase_no - 1] = result[-1][ind] + # Can be uncommented when F_pc implemented in modelica model + # if v == 'F_pc': + # Stages_F_pc[-1][comp_no - 1][phase_no - 1] = result[-1][ind] + # else: + # Stages_x_pc[-1][comp_no - 1][phase_no - 1] = result[-1][ind] + + # Assigning temp variables to obj variabes + self.obj.variables['Stages.T']['value'] = Stages_T + # Can be uncommented when F_p and F_pc implemented in modelica model + # self.obj.variables['Stages.F_p']['value'] = Stages_F_p + # self.obj.variables['Stages.F_pc']['value'] = Stages_F_pc + self.obj.variables['Stages.x_pc']['value'] = Stages_x_pc + + # filling stagewise result table + tables = [self.stage_res_table.T_table, self.stage_res_table.x_pc_table] + # Can be uncommented when F_p and F_pc implemented in modelica model + # tables = [self.stage_res_table.T_table, self.stage_res_table.F_p_table, self.stage_res_table.F_pc_table, self.stage_res_table.x_pc_table] + + for t in tables: + t.setRowCount(Nt) + t.setVerticalHeaderItem(0, QTableWidgetItem('Condenser')) + t.setVerticalHeaderItem(Nt -1, QTableWidgetItem('Reboiler')) + for i in range(1, Nt - 1): + t.setVerticalHeaderItem(i, QTableWidgetItem('Stage ' + str(i))) + + T_table = self.stage_res_table.T_table + T_table.setColumnCount(1) + for i in range(Nt): + T_table.setItem(i, 0, QTableWidgetItem(Stages_T[i])) + + x_pc_table = self.stage_res_table.x_pc_table + x_pc_table.setColumnCount(2*Nc) + for i in range(Nc): + x_pc_table.setHorizontalHeaderItem(2*i, QTableWidgetItem(self.obj.compounds[i] + '(Vapor)')) + x_pc_table.setHorizontalHeaderItem(2*i + 1, QTableWidgetItem(self.obj.compounds[i] + '(Liquid)')) + + for i in range(Nt): + for j in range(Nc): + x_pc_table.setItem(i, 2*j, QTableWidgetItem(Stages_x_pc[i][j][1])) + x_pc_table.setItem(i, 2 * j + 1, QTableWidgetItem(Stages_x_pc[i][j][2])) + for t in tables: + t.resizeColumnsToContents() + except Exception as e: + print(e) diff --git a/DockWidgets/DockWidgetDistillationColumn.ui b/DockWidgets/DockWidgetDistillationColumn.ui index 95f258b..932cbdd 100644 --- a/DockWidgets/DockWidgetDistillationColumn.ui +++ b/DockWidgets/DockWidgetDistillationColumn.ui @@ -33,15 +33,15 @@ <rect> <x>0</x> <y>30</y> - <width>351</width> - <height>451</height> + <width>381</width> + <height>481</height> </rect> </property> <property name="autoFillBackground"> <bool>true</bool> </property> <property name="currentIndex"> - <number>0</number> + <number>1</number> </property> <widget class="QWidget" name="tab"> <attribute name="title"> @@ -253,7 +253,56 @@ <attribute name="title"> <string>Results</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_3"/> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <item> + <widget class="QGroupBox" name="groupBox_3"> + <property name="title"> + <string/> + </property> + <widget class="QTableWidget" name="tableWidget"> + <property name="geometry"> + <rect> + <x>12</x> + <y>15</y> + <width>341</width> + <height>151</height> + </rect> + </property> + <property name="columnCount"> + <number>3</number> + </property> + <attribute name="horizontalHeaderDefaultSectionSize"> + <number>110</number> + </attribute> + <attribute name="horizontalHeaderStretchLastSection"> + <bool>true</bool> + </attribute> + <column> + <property name="text"> + <string>Attribute</string> + </property> + </column> + <column> + <property name="text"> + <string>Value</string> + </property> + </column> + <column> + <property name="text"> + <string>Unit</string> + </property> + </column> + </widget> + </widget> + </item> + <item> + <widget class="QPushButton" name="stageResultsButton"> + <property name="text"> + <string>Stagewise Results</string> + </property> + </widget> + </item> + </layout> </widget> </widget> </widget> diff --git a/DockWidgets/DockWidgetMaterialStream.ui b/DockWidgets/DockWidgetMaterialStream.ui index 15807ca..8b9df28 100644 --- a/DockWidgets/DockWidgetMaterialStream.ui +++ b/DockWidgets/DockWidgetMaterialStream.ui @@ -305,8 +305,8 @@ <rect> <x>0</x> <y>0</y> - <width>137</width> - <height>96</height> + <width>341</width> + <height>518</height> </rect> </property> <property name="styleSheet"> diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex 1a43e5b..a8934e2 100644 --- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc Binary files differindex 900b9c6..ee33ca4 100644 --- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc diff --git a/Simulator/Simulator/UnitOperations/DistillationColumn/Cond.mo b/Simulator/Simulator/UnitOperations/DistillationColumn/Cond.mo index 9518248..29fc163 100644 --- a/Simulator/Simulator/UnitOperations/DistillationColumn/Cond.mo +++ b/Simulator/Simulator/UnitOperations/DistillationColumn/Cond.mo @@ -71,8 +71,8 @@ within Simulator.UnitOperations.DistillationColumn; En.Q = Q; //Adjustment for thermodynamic packages x_pc[1, :] = (Fout .* xout_c[:] + Fliqout .* xliqout_c[:]) ./ (Fout + Fliqout); - x_pc[2, :] = xliqout_c[:]; - x_pc[3, :] = K_c[:] .* x_pc[2, :]; + x_pc[2, :] = xliqout_c[:]; + x_pc[3, :] = K_c[:] .* x_pc[2, :]; //Bubble point calculation Pbubl = sum(gmabubl_c[:] .* x_pc[1, :] .* Pvap_c[:] ./ philiqbubl_c[:]); //Dew point calculation Binary files differdiff --git a/UnitOperations.py b/UnitOperations.py index 833d972..7f9ed5e 100644 --- a/UnitOperations.py +++ b/UnitOperations.py @@ -247,6 +247,7 @@ class DistillationColumn(UnitOperation): self.modes_list = [] self.parameters = ['Nt', 'Ni', 'Ctype', 'Pcond', 'condmode', 'C_comp', 'C_Spec', 'Preb', 'rebmode', 'rebcomp', 'R_Spec'] #self.parameters = ['Nt', 'InT_s', 'In_s', 'thermo_package', 'Ctype', 'Pcond', 'Preb'] + self.result_parameters = ['Cduty.Q', 'Rduty.Q'] self.Cspec_list = ['Reflux Ratio','Product Molar Flow (mol/s)', 'Temperature (K)', 'Compound Molar Fraction', 'Compound Molar Flow (mol/s)'] self.Rspec_list = ['Product Molar Flow (mol/s)', 'Temperature (K)', 'Compound Molar Fraction', 'Compound Molar Flow (mol/s)'] @@ -258,12 +259,16 @@ class DistillationColumn(UnitOperation): 'Nout' : {'name':'No of Sidedraws', 'value':None, 'unit':''}, 'Nt' : {'name':'No of Stages', 'value':12, 'unit':''}, 'InT_s' : {'name':'Feed Stage', 'value':[], 'unit':''}, - 'thermo_package' : {'name':'Thermo Package', 'value':'Raoults_Law', 'unit':''}, + 'thermo_package' : {'name':'Thermo Package', 'value':'Raoults_Law', 'unit':''}, 'Ctype' : {'name':'Condenser Type', 'value':'Total', 'unit':''}, 'Pcond' : {'name':'Condenser Pressure', 'value':101325, 'unit':'Pa'}, 'Preb' : {'name':'Reboiler Pressure', 'value':101325, 'unit':'Pa'}, 'C_Spec': {'name':'Condenser Specification', 'type':self.Cspec_list[0], 'value':'', 'comp':compound_selected[0], 'unit':''}, 'R_Spec': {'name':'Reboiler Specification', 'type':self.Rspec_list[0], 'value':'', 'comp':compound_selected[0], 'unit':''}, + 'Cduty.Q': {'name':'Condenser Duty', 'value': '', 'unit':'W'}, + 'Rduty.Q': {'name':'Reboiler Duty', 'value': '', 'unit': 'W'}, + 'Stages.T': {'name':'Stagewise Temperature', 'value':[], 'unit':'K'}, + 'Stages.x_pc': {'name': 'Stagewise Component Mole Fraction', 'value':[],'unit':''} } def param_setter(self,params): @@ -339,9 +344,9 @@ class DistillationColumn(UnitOperation): # self.OM_data_eqn = self.OM_data_eqn + ( # 'connect(' + self.name + '.reboiler_duty' + ', ' + self.EngStm2.name + '.inlet);\n') self.OM_data_eqn = self.OM_data_eqn + ( - 'connect(' + self.name + '.Dist' + ", " + self.output_stms[0].name + '.In);\n') + 'connect(' + self.name + '.Dist' + ", " + self.output_stms[1].name + '.In);\n') self.OM_data_eqn = self.OM_data_eqn + ( - 'connect(' + self.name + '.Bot' + ", " + self.output_stms[1].name + '.In);\n') + 'connect(' + self.name + '.Bot' + ", " + self.output_stms[2].name + '.In);\n') for i in range(len(self.input_stms)): self.OM_data_eqn = self.OM_data_eqn + ( 'connect(' + self.input_stms[i +1].name + '.Out' + ", " + self.name + '.In_s[' + str( @@ -352,17 +357,17 @@ class DistillationColumn(UnitOperation): 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.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].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.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].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,:' + + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].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,:' + + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[1].name + '.F_pc[1,:' + str(self.compounds.index(self.variables['C_Spec']['comp']) + 1) + '] = ' + str( self.variables['C_Spec']['value']) + ';\n') else: @@ -370,17 +375,17 @@ class DistillationColumn(UnitOperation): 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.OM_data_eqn = self.OM_data_eqn + (self.output_stms[2].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.OM_data_eqn = self.OM_data_eqn + (self.output_stms[2].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,:' + + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[2].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,:' + + self.OM_data_eqn = self.OM_data_eqn + (self.output_stms[2].name + '.F_pc[1,:' + str(self.compounds.index(self.variables['R_Spec']['comp']) + 1) + '] = ' + str( self.variables['R_Spec']['value']) + ';\n') |