diff --git a/FlowMeters/Double_S_Elbow/Ultrasonic_diametral_1_30.npz b/FlowMeters/Double_S_Elbow/Ultrasonic_diametral_1_30.npz new file mode 100644 index 0000000000000000000000000000000000000000..0c4525f9c60354e9193986ac8b25edacbee3845f Binary files /dev/null and b/FlowMeters/Double_S_Elbow/Ultrasonic_diametral_1_30.npz differ diff --git a/Flow_class.py b/Flow_class.py index 2a308511bae1b5e401f4cc080c0889b91f29380f..584edc21500b2a71f8efe9896c66eefb604f5ef0 100644 --- a/Flow_class.py +++ b/Flow_class.py @@ -277,13 +277,13 @@ class Elbow_profile(): # to evaluate the spline interpolation and get the coefficient matrix at the desired # values of dist and Rk if self.case=="SingleElbow": - A_ux = np.array([int_i((Rk,dist)) for int_i in self.regint_ux] ).T - A_uy = np.array([int_i((Rk,dist)) for int_i in self.regint_uy] ).T - A_uz = np.array([int_i((Rk,dist)) for int_i in self.regint_uz] ).T + A_ux = np.array([int_i((Rk,dist)).T for int_i in self.regint_ux] ).T + A_uy = np.array([int_i((Rk,dist)).T for int_i in self.regint_uy] ).T + A_uz = np.array([int_i((Rk,dist)).T for int_i in self.regint_uz] ).T else: - A_ux = np.array([int_i((Rk,dl,dist)) for int_i in self.regint_ux] ).T - A_uy = np.array([int_i((Rk,dl,dist)) for int_i in self.regint_uy] ).T - A_uz = np.array([int_i((Rk,dl,dist)) for int_i in self.regint_uz] ).T + A_ux = np.array([int_i((Rk,dl,dist)).T for int_i in self.regint_ux] ).T + A_uy = np.array([int_i((Rk,dl,dist)).T for int_i in self.regint_uy] ).T + A_uz = np.array([int_i((Rk,dl,dist)).T for int_i in self.regint_uz] ).T # # print("this is A for dist = " + str(dist) + " and Rk = " + str(Rk) + ":") # print(A_uz) @@ -430,23 +430,35 @@ class Elbow_profile(): # return the radial velocity part and the axial velocity return (wx*ux + wy*uy,uz) - def make_fully(self,Re = 5e4,ks=0.0,ret=False): + def make_fully(self,Re = 5e4,ks=0.0,ret=False,r = np.array([0])): # generating fully uvol = 1 self.Re = Re visc = self.D*uvol/self.Re Q = uvol*pi*(self.D/2)**2 *3600 # - fully_class = flowprofiles(Q,self.D,visc,ks= ks*self.D) + self.fully_class = flowprofiles(Q,self.D,visc,ks= ks*self.D) # fully profile - self.u_fully = fully_class.get_u_u_vol(self.r) + if r.any(): + return self.fully_class.get_u_u_vol(r) + self.u_fully = self.fully_class.get_u_u_vol(self.r) #plt.plot(r.ravel(),u_fully) #self.uall = self.uall + minus*self.u_fully #self.get_profile = interpol.RegularGridInterpolator((self.Rk,self.dist), self.uall) # return the profile if wanted + self.make_kfac_fully() if ret: return self.u_fully # + def make_kfac_fully(self,flowmeter = None,ret = False): + rfine = np.linspace(0,1,int(1e6)) + ufine = self.fully_class.get_u_u_vol(rfine) + self.up_fully = np.trapz(rfine,ufine) + self.k_fully = 1/self.up_fully + if ret: + return self.up_fully,self.k_fully + + # constructs the ultrasonic path for a given angle phi, alpha and type def get_US_pathdist(self, reflections = 0, alpha = pi/4,R=1): diff --git a/GUI_Elbow.py b/GUI_Elbow.py index 8b75242e11a6e0cc458caa38295b6e64d1f70f20..fa8f11ca87e3c383153627bfc83d7840fdad1120 100644 --- a/GUI_Elbow.py +++ b/GUI_Elbow.py @@ -1044,21 +1044,22 @@ class Main(wx.Frame): global flow flow = Elbow_profile('SingleElbow') del self.mypanel - wx.Frame.__init__(self, parent = None,id = wx.ID_ANY, title = "Flowmeter behind Elbow", size = (1400,1000)) + wx.Frame.clear() + wx.Frame.__init__(self, parent = None,id = wx.ID_ANY, title = "Flowmeter behind Single Elbow", size = (1400,1000)) self.mypanel = mainPanel(self) self.mypanel.__init__(self) def OnLoad_DE(self,e): global flow flow = Elbow_profile('DoubleElbow') del self.mypanel - wx.Frame.__init__(self, parent = None,id = wx.ID_ANY, title = "Flowmeter behind Elbow", size = (1400,1000)) + wx.Frame.__init__(self, parent = None,id = wx.ID_ANY, title = "Flowmeter behind Double Elbow", size = (1400,1000)) self.mypanel = mainPanel(self) self.mypanel.__init__(self) def OnLoad_DSE(self,e): global flow flow = Elbow_profile('Double_S_Elbow') del self.mypanel - wx.Frame.__init__(self, parent = None,id = wx.ID_ANY, title = "Flowmeter behind Elbow", size = (1400,1000)) + wx.Frame.__init__(self, parent = None,id = wx.ID_ANY, title = "Flowmeter behind Double S Elbow", size = (1400,1000)) self.mypanel = mainPanel(self) self.mypanel.__init__(self) @@ -1070,7 +1071,7 @@ class Main(wx.Frame): if __name__ == "__main__": # - flow = Elbow_profile('SingleElbow') + flow = Elbow_profile('Double_S_Elbow') fm = FlowMeter() # app = wx.App()