summaryrefslogtreecommitdiff
path: root/Streams.py
diff options
context:
space:
mode:
authorbrenda-br2023-01-30 23:57:17 +0530
committerbrenda-br2023-01-30 23:57:17 +0530
commit60f3a5a1d15274d43d2a929922b5f001fe7d9e51 (patch)
treecc5f368597f8546c44474050cad4422dcbb7add0 /Streams.py
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
Diffstat (limited to 'Streams.py')
-rw-r--r--Streams.py72
1 files changed, 41 insertions, 31 deletions
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):