diff --git a/GasFill_GUI.py b/GasFill_GUI.py index 8eefb08923358f663eb83644d1ece6dd4dcf15b0..7d0da7dcdc4a90c173fb485b4027b0b3201274f9 100644 --- a/GasFill_GUI.py +++ b/GasFill_GUI.py @@ -9,9 +9,7 @@ __version__ = "1.0" #Packages import numpy -import math -from scipy import constants -from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QPushButton, QLabel, QApplication, QGridLayout, QCheckBox, QRadioButton, QFileDialog, QLineEdit, QSlider, QGroupBox, QVBoxLayout) +from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QPushButton, QLabel, QApplication, QGridLayout, QFileDialog, QLineEdit, QGroupBox, QVBoxLayout) from PyQt5.QtGui import (QPixmap, QIntValidator, QDoubleValidator, QPalette) from PyQt5.QtCore import Qt import sys @@ -19,8 +17,9 @@ import GasFill_times #fiber variables -dia_tube = 0.02 #(mm) capillary diameter +dia_tube = 0.20 #(mm) capillary diameter len_tube = 2.7 #(m) + #gas variables P = 10 #(mbar) average pressure inside capillary mW = 28.97 #(g/mol) diff --git a/GasFill_times.py b/GasFill_times.py index be857ee285cbf2aab7bdd42fa86835eb7ff6da61..d62c2820a963fa9e59452dcfe2c9e37176a9f2e3 100644 --- a/GasFill_times.py +++ b/GasFill_times.py @@ -11,12 +11,12 @@ __version__ = "0.1" #Pacakges import numpy -import math -import fluids -from scipy import constants +#Gas fill times function def filltime (dia_tube,len_tube,P,mW,temp,dia_mol): + boltzmann = 1.38064852e-23 + #varable scale fixing rad_tube = dia_tube/2 #(mm) P = P*100 #(PA) average pressure inside capillary @@ -29,7 +29,7 @@ def filltime (dia_tube,len_tube,P,mW,temp,dia_mol): mM = mW / 6.02214e23 #(kg) #Knudsen number --------------- - lamda = constants.Boltzmann*temp / (numpy.sqrt(2)*numpy.pi*Pav*numpy.power(dia_mol,2)) #from "Analytical modeling of the gas-filling dynamics in photonic crystal fibers" + lamda = boltzmann*temp / (numpy.sqrt(2)*numpy.pi*Pav*numpy.power(dia_mol,2)) #from "Analytical modeling of the gas-filling dynamics in photonic crystal fibers" #Kn = lamda/(Pav*dia_tube) #from "Flow of gases through tubes and orifices" where lamda = 0.066 for air at 20 deg Kn = lamda/rad_tube #from others @@ -37,7 +37,7 @@ def filltime (dia_tube,len_tube,P,mW,temp,dia_mol): #Diffusion coefficent --------------- - mol_vel = numpy.sqrt((8*constants.Boltzmann*temp)/(numpy.pi*mM)) #mean molecular velocity + mol_vel = numpy.sqrt((8*boltzmann*temp)/(numpy.pi*mM)) #mean molecular velocity viscosity = (mol_vel*mM)/(2*numpy.sqrt(2)*numpy.pi*numpy.power(dia_mol,2)) print ("Viscosity: "+ str(round(viscosity,3))) @@ -47,7 +47,7 @@ def filltime (dia_tube,len_tube,P,mW,temp,dia_mol): #Fill time --------------- squigle = 2 - Ppercent = 85 #percent ratio + Ppercent = 1 #percent ratio Pred = P/100*Ppercent Pratio = P/(P-Pred) t_fill = (numpy.power((squigle*len_tube),2) / (numpy.power(numpy.pi,2)*diff_coeff))*numpy.log((numpy.power(numpy.pi,2)/8)*Pratio) @@ -57,17 +57,16 @@ def filltime (dia_tube,len_tube,P,mW,temp,dia_mol): if __name__ == '__main__': -#Variables --------------- #fiber variables - dia_tube = 0.02 #(mm) capillary diameter - len_tube = 2.7 #(m) + dia_tube = 0.0005 #(mm) capillary diameter + len_tube = 2 #(m) + #gas variables - P = 10 #(mbar) average pressure inside capillary + P = 3.5 #(mbar) average pressure inside capillary mW = 26.04 #(g/mol) temp = 21 #(degC) Temperature of system dia_mol = 359.99 #(pm) diameter of gas molecule - # execute only if run as the entry point into the program filltime(dia_tube,len_tube,P,mW,temp,dia_mol) diff --git a/__pycache__/GasFill_times.cpython-36.pyc b/__pycache__/GasFill_times.cpython-36.pyc index e22bd5df34e4a4b0fd67e037d219eeccfb8c4f07..91e0f44e6f00e5c75fd02f0b6f15e040f8c7e491 100644 Binary files a/__pycache__/GasFill_times.cpython-36.pyc and b/__pycache__/GasFill_times.cpython-36.pyc differ