diff options
author | pravindalve | 2020-06-23 20:17:20 +0530 |
---|---|---|
committer | GitHub | 2020-06-23 20:17:20 +0530 |
commit | d3bed1ef7150f8e493ebaed3b841b1fe781e974d (patch) | |
tree | f7da5c3e6437fb270a6cb6b5aedb3af1690fdbce /Simulator | |
parent | a80b6726f5f70d9a2ec1cbf361e7f607849343bf (diff) | |
parent | 781a2ca03807d166498c0d95ef8c62d9ef3404d6 (diff) | |
download | Chemical-Simulator-GUI-d3bed1ef7150f8e493ebaed3b841b1fe781e974d.tar.gz Chemical-Simulator-GUI-d3bed1ef7150f8e493ebaed3b841b1fe781e974d.tar.bz2 Chemical-Simulator-GUI-d3bed1ef7150f8e493ebaed3b841b1fe781e974d.zip |
Merge pull request #3 from pravindalve/master
Updates and some bug fixes
Diffstat (limited to 'Simulator')
-rw-r--r-- | Simulator/Databases/Databases.py | 29 | ||||
-rw-r--r-- | Simulator/Simulator/UnitOperations/Mixer.mo | 32 |
2 files changed, 23 insertions, 38 deletions
diff --git a/Simulator/Databases/Databases.py b/Simulator/Databases/Databases.py index d7dc797..4b3a4c6 100644 --- a/Simulator/Databases/Databases.py +++ b/Simulator/Databases/Databases.py @@ -17,16 +17,12 @@ class ChemsepDatabase(): self.name = 'chemsep' for comp in compound: self.compName=comp.getElementsByTagName('CompoundID')[0].getAttribute('value') - self.comp_name_list.append(self.compName+'(' + self.name + ')') - - self.comp_prop_list=list() - + self.comp_name_list.append(self.compName+'(' + self.name + ')') + self.comp_prop_list=list() def get_comp_name_list(self): return self.comp_name_list - - #attrib: #CAS fro CAS Number #CompoundID for Name @@ -35,9 +31,7 @@ class ChemsepDatabase(): #GETTING 'ATTRIBUTE''S VALUE OF THE COMPOUND 'COMPS' -#COMP IS AN ITERATING VALUE IN THE XML TAG COMPOUND - - +#COMP IS AN ITERATING VALUE IN THE XML TAG COMPOUND def get_value(self,comps,attrib): self.comps=comps self.x='' @@ -47,8 +41,7 @@ class ChemsepDatabase(): try: self.x=comp.getElementsByTagName(attrib)[0].getAttribute("value") except IndexError: - self.x = "-" - + self.x = "-" return (self.x) #CREATING comp_prop_list LIST OF THE COMPOUND SELECTED @@ -58,9 +51,7 @@ class ChemsepDatabase(): self.comps = comps for comp in compound: compName = comp.getElementsByTagName("CompoundID")[0].getAttribute("value") - if compName==self.comps: - - + if compName==self.comps: CompName = compName.replace(" ","") CompName = CompName.replace("-","") CompName = CompName.replace(",","") @@ -140,8 +131,7 @@ class ChemsepDatabase(): RacketParam = comp.getElementsByTagName("RacketParameter")[0].getAttribute("value") except IndexError: RacketParam = "0" - - + try: LiqDen = comp.getElementsByTagName("LiquidDensity")[0] LiqDenEqn = LiqDen.getElementsByTagName("eqno")[0].getAttribute("value") @@ -358,8 +348,6 @@ class ChemsepDatabase(): except IndexError: ChaoSeadLV = 0 - - #f.write('Package database') self.comp_prop_list.append('model '+CompName) #f.write('\n') @@ -440,7 +428,4 @@ class ChemsepDatabase(): #return self.comp_prop_list return self.comp_prop_list - - - -
\ No newline at end of file +
\ No newline at end of file diff --git a/Simulator/Simulator/UnitOperations/Mixer.mo b/Simulator/Simulator/UnitOperations/Mixer.mo index 1be69eb..ae0a1d9 100644 --- a/Simulator/Simulator/UnitOperations/Mixer.mo +++ b/Simulator/Simulator/UnitOperations/Mixer.mo @@ -26,9 +26,9 @@ model Mixer "Model of a mixer to mix multiple material streams" Real xout_c[Nc](each unit = "-", each min = 0, each max = 1, start = xguess) "Outlet stream component mol fraction"; //================================================================================ // Files.Interfaces.matConn inlet[NI](each Nc = Nc); - Simulator.Files.Interfaces.matConn outlet(Nc = Nc) annotation( + Simulator.Files.Interfaces.matConn Out(Nc = Nc) annotation( Placement(visible = true, transformation(origin = {100, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Simulator.Files.Interfaces.matConn inlet[NI](each Nc = Nc) annotation( + Simulator.Files.Interfaces.matConn In[NI](each Nc = Nc) annotation( Placement(visible = true, transformation(origin = {-100, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); extends GuessModels.InitialGuess; @@ -36,21 +36,21 @@ model Mixer "Model of a mixer to mix multiple material streams" equation //Connector equation for i in 1:NI loop - inlet[i].P = Pin[i]; - inlet[i].T = Tin_s[i]; - inlet[i].F = Fin_s[i]; - inlet[i].H = Hin_s[i]; - inlet[i].S = Sin_s[i]; - inlet[i].x_pc[1, :] = xin_sc[i, :]; - inlet[i].xvap = xvapin_s[i]; + In[i].P = Pin[i]; + In[i].T = Tin_s[i]; + In[i].F = Fin_s[i]; + In[i].H = Hin_s[i]; + In[i].S = Sin_s[i]; + In[i].x_pc[1, :] = xin_sc[i, :]; + In[i].xvap = xvapin_s[i]; end for; - outlet.P = Pout; - outlet.T = Tout; - outlet.F = Fout; - outlet.H = Hout; - outlet.S = Sout; - outlet.x_pc[1, :] = xout_c[:]; - outlet.xvap = xvapout; + Out.P = Pout; + Out.T = Tout; + Out.F = Fout; + Out.H = Hout; + Out.S = Sout; + Out.x_pc[1, :] = xout_c[:]; + Out.xvap = xvapout; //=================================================================================== //Output Pressure if outPress == "Inlet_Minimum" then |