import sys sys.path.append("/Users/jonathanxavier/Developer/sim42") from ollin.Administrator.AdmOllin import Ollin from pylab import * RK = Ollin.AddModel("RK", "RK") S1 = Ollin.AddCase("S1") Ollin.Add(["N-BUTANE", "N-PENTANE", "N-HEXANE"], "RK") S1.SetX([1, 1, 1]) S1.T(322) plot_x = range(10, 1000, 10) plot_y0 = [] plot_y1 = [] plot_y2 = [] plot_y3 = [] plot_y4 = [] ##plot_y5 = [] Pr = [] print plot_x for P in plot_x: S1.P(P) Ollin.Solve() yf = S1.Get("Ki") plot_y0.append(yf[0]) plot_y1.append(yf[1]) plot_y2.append(yf[2]) ## plot_y3.append( yf[3] ) ## plot_y4.append( yf[4] )
import sys sys.path.append("/Users/jonathanxavier/Developer/sim42") from ollin.Administrator.AdmOllin import Ollin from ollin.Example.UOS import Stream, Valve,Heater,Flash PR=Ollin.AddModel("PR","PR") Ollin.Add(["METHANE","ETHANE","PROPANE","ISOBUTANE","N-BUTANE","N-PENTANE","N-HEXANE","N-HEPTANE"],"PR") Ollin.LoadConst() S1 = Stream(PR) S1.X([14520,9070,7260,770,2810,950+1630,1540,3180]) ##S1.FracVap(0.9) S1.T(273.15+40) S1.P(500) S1.Mol(455) V1 = Valve(PR) V1.DP = 11030 H1 = Heater(PR) H1.DP = 1 H1.DH = 1 F1 = Flash(PR) S1.Connect(F1) ## ##V1.Connect(H1) ##H1.Connect(F1)
from ollin.Administrator.AdmOllin import Ollin from numpy.oldnumeric import array,power,pi PR=Ollin.AddModel("PR","PR") Ollin.Add(["HYDROGEN","METHANE","BENZENE","TOLUENE","DIPHENYL",],"PR") S1=Ollin.AddCase("S1")#Alimentacion al compresor S1.SetX([0.366021,0.548913,0.062618,0.021503,0.000945]) S1.T(38+273.15) ##S1.FracVap(0.9) S1.P(3206.062) Ollin.Solve("S1")#Caculamos S1 Ollin.Resumen("S1") L = (1-S1.Get("FracVap"))*1919.605 Gv = (L*S1.Get("MolWt_l"))/( S1.Get("LiqDen")*60 ) Vr = Gv*5 Lon = power((256*Vr/pi),0.333333) Dia = Lon/4 print "Longuitud", Lon print "Diametro",Dia
from ollin.Administrator.AdmOllin import Ollin from numpy.oldnumeric import array RK = Ollin.AddModel("PR", "PR", "ANTOINE") Ollin.Add([ "METHANOL", "HYDROGEN", "CARBON MONOXIDE", "CARBON DIOXIDE", "WATER", "METHANE" ], "PR") S1 = Ollin.AddCase("S1") #Alimentacion al compresor S1.SetX([0, 69, 21, 7, 0, 3]) S1.T(25 + 273.15) S1.P(101.325 * 1) Ollin.Solve("S1") #Caculamos S1 Ollin.Resumen("S1") ##print S1.Get("H") S2 = Ollin.AddCase("S2") #salida del compresor S2.SetX(S1.Get("x")) S2.H(S1.Get("H")) #Considerando que es adiabatico dQ=0 S2.P(101.325 * 20) Ollin.Solve("S2") #Caculamos S2 Ollin.Resumen("S2") #Salida del calentador S3 = Ollin.AddCase("S3") #Alimentacion al ractor S3.SetX(S2.Get("x")) S3.T(400 + 273.15) S3.P(S2.Get("P")) Ollin.Solve("S3") #La reaccion se realiza en fase gas adiabaticamente dQ=0
from ollin.Administrator.AdmOllin import Ollin from ollin.Tools.tools import lagrange from pylab import * RK=Ollin.AddModel("RK","PR") S1=Ollin.AddCase("S1") Ollin.Add(["N-HEPTANE"],"RK") Ti = range(300,450,10) S1.SetX([1,]) Ppi=[] Ppv=[] for T in Ti: df=[] P= [] S1.P(101.325) S1.T(T) Ollin.Solve() Pvi=S1.Get("PreVap")[0] Ppi.append(Pvi) fl=S1.Get("fl_i")[0] fv=S1.Get("fv_i")[0] P.append(S1.Get("P")) df.append(fl-fv) S1.P(Pvi) Ollin.Solve() fl=S1.Get("fl_i")[0] fv=S1.Get("fv_i")[0] P.append(S1.Get("P")) df.append(fl-fv)