Código de visual Basic
Enviado por Helena • 19 de Diciembre de 2018 • 4.646 Palabras (19 Páginas) • 512 Visitas
...
End Function
Function SL(P) As Double
Dim AL As Double, BL As Double, CL As Double, DL As Double, EL As Double, FL As Double, GL As Double
AL = -0.000167772
BL = 0.004272688
CL = 0.01048048
DL = 0.05801509
EL = 0.00000009101291
FL = -0.000000000027592
GL = 0.11801
P = P * 14.5038 'Conversion de bar a psia
SL = AL * P + BL / P + CL * (P) ^ 0.5 + DL * Log(P) + EL * (P) ^ 2 + FL * (P) ^ 3 + GL
SL = SL * 4.1868 'KJ/Kg*K
End Function
Function SV(P) As Double
Dim AV As Double, BV As Double, CV As Double, DV As Double, EV As Double, FV As Double, GV As Double
AV = -0.0001476933
BV = 0.0012617946
CV = 0.00344201
DV = -0.08494128
EV = 0.0000000689138
FV = -0.000000000024941
GV = 1.97364
P = P * 14.5038 'Conversion de bar a psia
SV = AV * P + BV / P + CV * (P) ^ 0.5 + DV * Log(P) + EV * (P) ^ 2 + FV * (P) ^ 3 + GV 'Unidadades PSIA/Lb °R
SV = SV * 4.1868 'KJ/Kg*K
End Function
Public Function Tprom(T)
Dim ValorCelda5 As Double
ValorCelda5 = Worksheets("propiedades").Range("B4").Value 'Tsat
Tprom = (T * ValorCelda5) ^ 0.5
End Function
Function SSc()
SSc = SVapSatAgua + (HVapSCAgua - HVapSatAgua) / Tprom
End Function
'tension sup agua
Function Ts(T) As Double
T = 1.8 * (T - 273) + 32 '°F
Ts = 79.5118 - 0.09605 * T
End Function
' conductividad agua
Function K(T)
T = (T - 273)
K = 0.31431 + 0.00047673 * T
K = K * (1.05506 * 3.281)
End Function
'Viscosidad agua
Function v(T)
T = 1.8 * (T - 273) + 32
v = 62.233 / T
End Function
' Densidad agua
Function D(T)
Dim dref As Double
T = 1.8 * (T - 273) + 32
dref = 0.997375 + 0.00012 * T - 0.000001601 * (T) ^ 2 + 0.000000001601 * (T) ^ 3
D = 62.47 * (dref)
D = D * (0.453592 / 28.3168)
End Function
'Densidad metanol
Function Den(P) 'Densidad CHECAR
Dim b As Double, C As Double, D As Double, Tr As Double, R As Double, Vs As Double
Dim w As Double, Zc As Double, Tc As Double, Pc As Double, Vc As Double, A As Double
Dim Aa As Double, Ba As Double, Ca As Double, Pvap As Double, v0 As Double, T As Double
Zc = 0.224
Vc = 118 '(cm^3*mol)^-1
w = 0.564
Aa = 16.5785 'Parametros Antoine
Ba = 3638.27 'Parametros Antoine
Ca = 239.5 'Parametros Antoine
Pc = 80.97 'bar
C = 2.71828
D = 1.0058
Tc = 512.6 'K 'Para calculo de Vs 'no necesario
R = 8.314 'Para calculo de Vs 'no necesario
T = 325 'PENDIEEEEEEEEEENTEEEEEEEE DICULPE USTED NO SE COMO HACERLE
Tr = T / Tc
Vs = Vc * (Zc ^ ((1 - Tr) ^ (2 / 7)))
b = 0.164813 - 0.0914427 * w
A = -170.335 - 28.578 * Tr + 124.809 * (Tr ^ 3) - 55.5393 * (Tr ^ 6) + (130.01 / Tr)
Pvap = Exp(Aa - (Ba / (T - 273 + Ca))) ' Antoine kPa NO PIDE Psat solo Pvap? ' CHECAR
Pvap = Pvap / (10 ^ 5) 'de kPa a bar
v0 = Vs * ((A * Pc + (C ^ ((D - Tr) ^ b)) * (P - Pvap)) / (A * Pc + C * (P - Pvap)))
Den = 1 / v0 'mol/cm^3
Den = Den * 32 'Multiplicado por el PM
End Function
'Viscosidad metanol
Function VMet(T) As Double 'Viscosidad del Metanol
Dim Am As Double, Bm As Double, mm As Double, Den As Double
...