summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrenda-br2023-01-30 23:57:17 +0530
committerbrenda-br2023-01-30 23:57:17 +0530
commit60f3a5a1d15274d43d2a929922b5f001fe7d9e51 (patch)
treecc5f368597f8546c44474050cad4422dcbb7add0
parenta9e09576c8e977e9fc838fabf2116d5e2cae9e7e (diff)
downloadChemical-Simulator-GUI-60f3a5a1d15274d43d2a929922b5f001fe7d9e51.tar.gz
Chemical-Simulator-GUI-60f3a5a1d15274d43d2a929922b5f001fe7d9e51.tar.bz2
Chemical-Simulator-GUI-60f3a5a1d15274d43d2a929922b5f001fe7d9e51.zip
Fix #50 Mixture Mass Flow Value added to phase properties tab in result
-rw-r--r--DockWidgets/DockWidgetMaterialStream.py2
-rw-r--r--DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pycbin9230 -> 9254 bytes
-rw-r--r--Graphics.py12
-rw-r--r--OMChem/Flowsheet.py2
-rw-r--r--Streams.py72
5 files changed, 50 insertions, 38 deletions
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py
index a7f06df..a6396ef 100644
--- a/DockWidgets/DockWidgetMaterialStream.py
+++ b/DockWidgets/DockWidgetMaterialStream.py
@@ -211,7 +211,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
klst = list(d.values())
p = {"Pressure":"P", "Temperature":"T","Vapour Phase Mole Fraction":"xvap", "Phase Molar Enthalpy":"H_p",
- "Phase Molar Entropy":"S_p", "Molar Flow Rate":"F_p"}
+ "Phase Molar Entropy":"S_p", "Molar Flow Rate":"F_p","Mass Flow Rate":"Fm_p"}
# Amounts Tab
if obj.type == 'MaterialStream':
diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
index 16c3008..f523058 100644
--- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
Binary files differ
diff --git a/Graphics.py b/Graphics.py
index d87e8b8..9969647 100644
--- a/Graphics.py
+++ b/Graphics.py
@@ -51,14 +51,15 @@ class Graphics(QDialog, QtWidgets.QGraphicsItem):
else:
self.unit_operations.append(i)
type(i).counter += 1
- print(self.unit_operations)
+ #print(self.unit_operations)
new_box = self.create_node_item(i, container)
new_box.setPos(i.pos.toPoint().x(), i.pos.toPoint().y())
self.scene.addItem(new_box)
for i in obj:
if i.type == "MaterialStream":
- print(eval(i.type))
+ pass
+ #print(eval(i.type))
elif i.type not in stm:
ip = i.input_stms
op = i.output_stms
@@ -336,7 +337,7 @@ class NodeSocket(QtWidgets.QGraphicsItem):
self.new_line.target = item
item.in_lines.append(self.new_line)
self.new_line.pointB = item.get_center()
- print(type(self.new_line.source))
+ #print(type(self.new_line.source))
if self.new_line.source.parent.obj.type not in stm:
self.new_line.source.parent.obj.add_connection(0, self.new_line.source.id, self.new_line.target.parent.obj)
if self.new_line.target.parent.obj.type not in stm:
@@ -347,7 +348,7 @@ class NodeSocket(QtWidgets.QGraphicsItem):
self.new_line.target = self
item.out_lines.append(self.new_line)
self.new_line.pointA = item.get_center()
- print(type(self.new_line.source))
+ #print(type(self.new_line.source))
if self.new_line.source.parent.obj.type not in stm:
self.new_line.source.parent.obj.add_connection(0, self.new_line.source.id, self.new_line.target.parent.obj)
if self.new_line.target.parent.obj.type not in stm:
@@ -482,7 +483,8 @@ class NodeItem(QtWidgets.QGraphicsItem):
# updating input values
if self.dock_widget.obj.type != 'MaterialStream':
- print(self.dock_widget.obj.type)
+ pass
+ #print(self.dock_widget.obj.type)
try:
self.dock_widget.obj.param_setter(self.dock_widget.obj.param_getter(self.dock_widget.obj.mode))
except Exception as e:
diff --git a/OMChem/Flowsheet.py b/OMChem/Flowsheet.py
index ce0da55..c38b94e 100644
--- a/OMChem/Flowsheet.py
+++ b/OMChem/Flowsheet.py
@@ -152,7 +152,7 @@ class Flowsheet():
mosFile.write('loadFile(\"Flowsheet.mo\");\n')
mosFile.write('simulate(Flowsheet, outputFormat=\"csv\", stopTime=1.0, numberOfIntervals=1);\n')
- print('Initiating Simulation in Equation Oriented Mode')
+ #print('Initiating Simulation in Equation Oriented Mode')
self.send_for_simulation_Eqn()
diff --git a/Streams.py b/Streams.py
index 739010a..f90546b 100644
--- a/Streams.py
+++ b/Streams.py
@@ -35,19 +35,20 @@ class MaterialStream():
self.variables = {
'P' : {'name':'Pressure', 'value':101325, 'unit':'Pa'},
'T' : {'name':'Temperature', 'value':300, 'unit':'K'},
+
+ 'xvap' : {'name':'Vapour Mole Fraction', 'value':None, 'unit':''},
+ 'H_p[1]' : {'name':'Mixture Molar Entalpy', 'value':None, 'unit':'J/mol'},
+ 'S_p[1]' : {'name':'Mixture Molar Entropy', 'value':None, 'unit':'J/mol.K'},
+ 'F_p[1]' : {'name':'Mixture Molar Flow', 'value':100, 'unit':'mol/s'},
+ 'Fm_p[1]' : {'name':'Mixture Mass Flow', 'value':None, 'unit':'g/s'},
- 'xvap' : {'name':'Vapour Phase Mole Fraction', 'value':None, 'unit':''},
- 'H_p[1]' : {'name':'Mixture Phase Molar Entalpy', 'value':None, 'unit':'J/mol'},
- 'S_p[1]' : {'name':'Mixture Phase Molar Entropy', 'value':None, 'unit':'J/mol.K'},
- 'F_p[1]' : {'name':'Mixture Molar Flow Rate', 'value':100, 'unit':'mol/s'},
-
- 'H_p[2]' : {'name':'Liquid Phase Molar Entalpy', 'value':None, 'unit':'J/mol'},
- 'S_p[2]' : {'name':'Liquid Phase Molar Entropy', 'value':None, 'unit':'J/mol.K'},
- 'F_p[2]' : {'name':'Liquid Molar Flow Rate', 'value':None, 'unit':'mol/s'},
+ 'H_p[2]' : {'name':'Liquid Molar Entalpy', 'value':None, 'unit':'J/mol'},
+ 'S_p[2]' : {'name':'Liquid Molar Entropy', 'value':None, 'unit':'J/mol.K'},
+ 'F_p[2]' : {'name':'Liquid Molar Flow', 'value':None, 'unit':'mol/s'},
- 'H_p[3]' : {'name':'Vapour Phase Molar Entalpy', 'value':None, 'unit':'J/mol'},
- 'S_p[3]' : {'name':'Vapour Phase Molar Entropy', 'value':None, 'unit':'J/mol.K'},
- 'F_p[3]' : {'name':'Vapour Molar Flow Rate', 'value':None, 'unit':'mol/s'},
+ 'H_p[3]' : {'name':'Vapour Molar Entalpy', 'value':None, 'unit':'J/mol'},
+ 'S_p[3]' : {'name':'Vapour Molar Entropy', 'value':None, 'unit':'J/mol.K'},
+ 'F_p[3]' : {'name':'Vapour Molar Flow', 'value':None, 'unit':'mol/s'},
'x_pc' : {'name':'Mole Fraction', 'value':[], 'unit':''},
'xm_pc' : {'name':'Mass Fraction', 'value':None, 'unit':''},
@@ -140,26 +141,35 @@ class MaterialStream():
def param_getter_tooltip_selectedVar(self):
dict = {}
- var1_name = self.variables['P']['name']
- var1_val = self.variables['P']['value']
- var1_unit = self.variables['P']['unit']
- var2_name = self.variables['T']['name']
- var2_val = self.variables['T']['value']
- var2_unit = self.variables['T']['unit']
- var3_name = self.variables['H_p[1]']['name']
- var3_val = self.variables['H_p[1]']['value']
- var3_unit = self.variables['H_p[1]']['unit']
- var4_name = self.variables['S_p[1]']['name']
- var4_val = self.variables['S_p[1]']['value']
- var4_unit = self.variables['S_p[1]']['unit']
- var5_name = self.variables['xvap']['name']
- var5_val = self.variables['xvap']['value']
- var5_unit = self.variables['xvap']['unit']
- dict = {var1_name:str(var1_val)+' '+var1_unit,
- var2_name:str(var2_val)+' '+var2_unit,
- var3_name:str(var3_val)+' '+var3_unit,
- var4_name:str(var4_val)+' '+var4_unit,
- var5_name:str(var5_val)+' '+var5_unit, }
+ pressure_name = self.variables['P']['name']
+ pressure_val = self.variables['P']['value']
+ pressure_unit = self.variables['P']['unit']
+ temp_name = self.variables['T']['name']
+ temp_val = self.variables['T']['value']
+ temp_unit = self.variables['T']['unit']
+ mixMolEntal_name = self.variables['H_p[1]']['name']
+ mixMolEntal_val = round(float(self.variables['H_p[1]']['value']),2)
+ mixMolEntal_unit = self.variables['H_p[1]']['unit']
+ mixMolEntro_name = self.variables['S_p[1]']['name']
+ mixMolEntro_val = round(float(self.variables['S_p[1]']['value']),2)
+ mixMolEntro_unit = self.variables['S_p[1]']['unit']
+ vapMolFrac_name = self.variables['xvap']['name']
+ vapMolFrac_val = self.variables['xvap']['value']
+ vapMolFrac_unit = self.variables['xvap']['unit']
+ mixMolFlo_name = self.variables['F_pc']['name']
+ mixMolFlo_val = self.variables['F_pc']['value']
+ mixMolFlo_unit = self.variables['F_pc']['unit']
+ mixMassFlo_name = self.variables['Fm_p[1]']['name']
+ mixMassFlo_val = self.variables['Fm_p[1]']['value']
+ mixMassFlo_unit = self.variables['Fm_p[1]']['unit']
+
+ dict = {pressure_name:str(pressure_val)+' '+pressure_unit,
+ temp_name:str(temp_val)+' '+temp_unit,
+ vapMolFrac_name:str(vapMolFrac_val)+' '+vapMolFrac_unit,
+ mixMolEntal_name:str(mixMolEntal_val)+' '+mixMolEntal_unit,
+ mixMolEntro_name:str(mixMolEntro_val)+' '+mixMolEntro_unit,
+ mixMolFlo_name:str(mixMolFlo_val)+' '+mixMolFlo_unit,
+ mixMassFlo_name:str(mixMassFlo_val)+' '+mixMassFlo_unit}
return dict
def param_getter(self,mode):