Administrator approval is now required for registering new accounts. If you are registering a new account, and are external to the University, please ask the repository owner to contact ServiceLine to request your account be approved. Repository owners must include the newly registered email address, and specific repository in the request for approval.

Commit 8927db13 authored by Matthew Partridge's avatar Matthew Partridge
Browse files

Optimised the python scripts to remove some unnecessary packages

parent 25aec403
......@@ -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)
......
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment