Commits

Nathan Collier committed 7a4d515

working 3 blades, buggy pole

  • Participants
  • Parent commits b394f9d

Comments (0)

Files changed (1)

 blade_width    = (blade[-1,:,0]-blade[0,:,0]).max()
 
 # setup blades
+wake_history = 15
 grids = []
-grids.append(UVLMGrid(blade,spin))
-grids.append(UVLMGrid(spin(blade,1.,3.),spin))
-grids.append(UVLMGrid(spin(blade,2.,3.),spin))
+grids.append(UVLMGrid(blade,spin,maxwake=wake_history))
+grids.append(UVLMGrid(spin(blade,1.,3.),spin,maxwake=wake_history))
+grids.append(UVLMGrid(spin(blade,2.,3.),spin,maxwake=wake_history))
 
+"""
 # setup base
 pole_height = 1.2*blade_diameter
 pole_radius = 0.2*blade_width
-pole = np.zeros((10,30,3))
-ang = np.linspace(1.5*np.pi,2.0*np.pi,10)
-pole[:,:,0] = np.outer(pole_radius*np.sin(ang),np.ones(30)) + pole_radius + 0.5*(blade[-1,0,0]-blade[0,0,0])
-pole[:,:,2] = np.outer(pole_radius*np.cos(ang),np.ones(30))
-pole[:,:,1] = np.outer(np.ones(10),np.linspace(-pole_height,0,30))
-grids.append(UVLMGrid(pole,nada))
-ang = np.linspace(1.5*np.pi,np.pi,10)
-pole[:,:,0] = np.outer(pole_radius*np.sin(ang),np.ones(30)) + pole_radius + 0.5*(blade[-1,0,0]-blade[0,0,0])
-pole[:,:,2] = np.outer(pole_radius*np.cos(ang),np.ones(30))
-pole[:,:,1] = np.outer(np.ones(10),np.linspace(-pole_height,0,30))
-grids.append(UVLMGrid(pole,nada))
+pole = np.zeros((5,45,3))
+ang = np.linspace(1.5*np.pi,2.0*np.pi,5)
+pole[:,:,0] = np.outer(pole_radius*np.sin(ang),np.ones(45)) + blade[:,:,0].max()+pole_radius+0.1
+pole[:,:,2] = np.outer(pole_radius*np.cos(ang),np.ones(45))
+pole[:,:,1] = np.outer(np.ones(5),np.linspace(-pole_height,0,45))
+grids.append(UVLMGrid(pole,nada,maxwake=wake_history))
+ang = np.linspace(1.5*np.pi,np.pi,5)
+pole[:,:,0] = np.outer(pole_radius*np.sin(ang),np.ones(45)) + blade[:,:,0].max()+pole_radius+0.1
+pole[:,:,2] = np.outer(pole_radius*np.cos(ang),np.ones(45))
+pole[:,:,1] = np.outer(np.ones(5),np.linspace(-pole_height,0,45))
+grids.append(UVLMGrid(pole,nada,maxwake=wake_history))
+"""
 
 # temporal data
+advance_ratio = 1.
 fsv = np.asarray([10,0,0])
-N_period = 75
+omega = np.linalg.norm(fsv)/(0.5*blade_diameter)/advance_ratio
+t_period = 2.0*np.pi/omega
 junk,area = base.ComputeCellData(grids[0].grid)
 h = np.sqrt(area.mean())
 dt = h/np.linalg.norm(fsv)
-t_period = N_period*dt
-wake_history = 15
-t = -wake_history*dt
+N_period = int(round(t_period/dt))
 
 # solver setup
 left = [0]
 for grid in grids:
     right.append(left[-1] + grid.circ.shape[0]*grid.circ.shape[1])
     left.append(right[-1])
+N = right[-1]
 
-N = right[-1]
 step0 = -1
+t = -(wake_history+1)*dt
 for step in range(N_period+wake_history):
 
-    print "Step %d..." % step
+    print "Step %d, t = %.3f" % (step,t)
 
     # Setup grid
     for grid in grids: