Пример #1
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vy')
    ax.plot(doublet[:, 1], doublet[:, 4], '-x')
    ax.plot(vring[:, 1], vring[:, 4])
    ax.grid()
    ax.legend(['Tri doublet', 'Vortex ring'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.plot(doublet[:, 1], doublet[:, 5], '-x')
    ax.plot(vring[:, 1], vring[:, 5])
    ax.grid()
    ax.legend(['Tri doublet', 'Vortex ring'])
    plt.show()


if __name__ == "__main__":

    doublet = ld('tri_doublet1.dat')
    vring = ld('vring4.dat')

    doublet_vs_vring(doublet, vring)
Пример #2
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vy')
    ax.plot(doublet[:, 1], doublet[:, 4], '-x')
    ax.plot(vring[:, 1], vring[:, 4])
    ax.grid()
    ax.legend(['Quad doublet', 'Vortex ring'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.plot(doublet[:, 1], doublet[:, 5], '-x')
    ax.plot(vring[:, 1], vring[:, 5])
    ax.grid()
    ax.legend(['Quad doublet', 'Vortex ring'])
    plt.show()


if __name__ == "__main__":

    doublet = ld('doublet1.dat')
    vring1 = ld('vring1.dat')

    doublet_vs_vring(doublet, vring1)
Пример #3
0
  fig, ax = plt.subplots()
  ax.set_xlabel('x')
  ax.set_ylabel('Vy')
  ax.plot(source[:,0], source[:,4], '-x')
  ax.plot(source2[:,0], source2[:,4], '-+', markersize=10)
  ax.plot(sourcearr[:,0], sourcearr[:,4])
  ax.grid()
  ax.legend(['Quad source', 'Tri sources', 'Source array'])
  plt.show()

  # Plot z velocity
  plt.clf()
  plt.close()
  fig, ax = plt.subplots()
  ax.set_xlabel('x')
  ax.set_ylabel('Vz')
  ax.plot(source[:,0], source[:,5], '-x')
  ax.plot(source2[:,0], source2[:,5], '-+', markersize=10)
  ax.plot(sourcearr[:,0], sourcearr[:,5])
  ax.grid()
  ax.legend(['Quad source', 'Tri sources', 'Source array'])
  plt.show()

if __name__ == "__main__":

  source = ld('source1.dat')
  source2 = ld('source2.dat')
  sourcearr = ld('sourcearr1.dat')

  source_vs_sourcearr(source, source2, sourcearr)
Пример #4
0
#!/usr/bin/env python

from data_loader import load_data as ld
from matplotlib import pyplot as plt

def below_and_above(below, above):

  # Plot Phi
  plt.clf()
  plt.close()
  fig, ax = plt.subplots()
  ax.set_xlabel('Phi')
  ax.set_ylabel('z')
  ax.plot(below[:,3], below[:,2], '-x')
  ax.plot(above[:,3], above[:,2], '-o')
  ax.grid()
  ax.legend(['Below panel', 'Above panel'])
  plt.show()

if __name__ == "__main__":

  below = ld('quad_doublet2_below.dat')
  above = ld('quad_doublet2_above.dat')

  below_and_above(below, above)
Пример #5
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('x')
    ax.set_ylabel('Vy')
    ax.plot(mirror1[:, 0], mirror1[:, 4], '-x')
    ax.plot(mirror2[:, 0], mirror2[:, 4])
    ax.grid()
    ax.legend(['Mirror', 'Two panels'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('x')
    ax.set_ylabel('Vz')
    ax.plot(mirror1[:, 0], mirror2[:, 5], '-x')
    ax.plot(mirror1[:, 0], mirror2[:, 5])
    ax.grid()
    ax.legend(['Mirror', 'Two panels'])
    plt.show()


if __name__ == "__main__":

    mirror1 = ld('mirror1.dat')
    mirror2 = ld('mirror2.dat')

    mirror_vs_twopanels(mirror1, mirror2)
Пример #6
0
#!/usr/bin/env python

from data_loader import load_data as ld
from matplotlib import pyplot as plt

def plot_velocity(vortex1, vortex2):

  # Plot z velocity
  plt.clf()
  plt.close()
  fig, ax = plt.subplots()
  ax.set_xlabel('y')
  ax.set_ylabel('Vz')
  ax.plot(vortex1[:,1], vortex1[:,5], '-o')
  ax.plot(vortex2[:,1], vortex2[:,5], '-x')
  ax.grid()
  ax.legend(['rcore = 1e-3', 'rcore = 1e-12'])
  plt.show()

if __name__ == "__main__":

  vortex1 = ld('vortex_core1.dat')
  vortex2 = ld('vortex_core2.dat')
  plot_velocity(vortex1, vortex2)
Пример #7
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vy')
    ax.plot(tri_doublet[:, 1], tri_doublet[:, 4], '-x')
    ax.plot(vring[:, 1], vring[:, 4])
    ax.grid()
    ax.legend(['Tri doublets', 'Vortex ring'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.plot(tri_doublet[:, 1], tri_doublet[:, 5], '-x')
    ax.plot(vring[:, 1], vring[:, 5])
    ax.grid()
    ax.legend(['Tri doublets', 'Vortex ring'])
    plt.show()


if __name__ == "__main__":

    tri_doublet = ld('tri_doublets1.dat')
    vring1 = ld('vring1.dat')

    tri_doublet_vs_vring(tri_doublet, vring1)
Пример #8
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vy')
    ax.plot(doublet[:, 1], doublet[:, 4], '-x')
    ax.plot(vring[:, 1], vring[:, 4])
    ax.grid()
    ax.legend(['Quad doublet', 'Vortex ring'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.plot(doublet[:, 1], doublet[:, 5], '-x')
    ax.plot(vring[:, 1], vring[:, 5])
    ax.grid()
    ax.legend(['Quad doublet', 'Vortex ring'])
    plt.show()


if __name__ == "__main__":

    doublet = ld('quad_doublet1.dat')
    vring = ld('vring5.dat')

    doublet_vs_vring(doublet, vring)
Пример #9
0
  # Plot y velocity
  plt.clf()
  plt.close()
  fig, ax = plt.subplots()
  ax.set_xlabel('y')
  ax.set_ylabel('Vy')
  ax.plot(doublet[:,1], doublet[:,4], '-x')
  ax.plot(doubletarr[:,1], doubletarr[:,4])
  ax.grid()
  ax.legend(['Quad doublet', 'Doublet array'])
  plt.show()

  # Plot z velocity
  plt.clf()
  plt.close()
  fig, ax = plt.subplots()
  ax.set_xlabel('y')
  ax.set_ylabel('Vz')
  ax.plot(doublet[:,1], doublet[:,5], '-x')
  ax.plot(doubletarr[:,1], doubletarr[:,5])
  ax.grid()
  ax.legend(['Quad doublet', 'Doublet array'])
  plt.show()

if __name__ == "__main__":

  doublet = ld('doublet1.dat')
  doubletarr = ld('doubletarr1.dat')

  doublet_vs_doubletarr(doublet, doubletarr)
Пример #10
0
#!/usr/bin/env python

from data_loader import load_data as ld
from matplotlib import pyplot as plt

def below_and_above(below, above, title):

  # Plot Phi
  plt.clf()
  plt.close()
  fig, ax = plt.subplots()
  ax.set_xlabel('Phi')
  ax.set_ylabel('z')
  ax.set_title(title)
  ax.plot(below[:,3], below[:,2], '-x')
  ax.plot(above[:,3], above[:,2], '-o')
  ax.grid()
  ax.legend(['Below panel', 'Above panel'])
  plt.show()

if __name__ == "__main__":

  below1 = ld('quad_source1_below.dat')
  above1 = ld('quad_source1_above.dat')
  below2 = ld('quad_source2_below.dat')
  above2 = ld('quad_source2_above.dat')

  below_and_above(below1, above1, "Inside panel border")
  below_and_above(below2, above2, "Outside panel border")
Пример #11
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vy')
    ax.plot(panel1[:, 1], panel1[:, 4], '-o')
    ax.plot(panel2[:, 1], panel2[:, 4], '-x')
    ax.grid()
    ax.legend(['Exact', 'Finite difference potential'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.plot(panel1[:, 1], panel1[:, 5], '-o')
    ax.plot(panel2[:, 1], panel2[:, 5], '-x')
    ax.grid()
    ax.legend(['Exact', 'Finite difference potential'])
    plt.show()


if __name__ == "__main__":

    panel1 = ld('quad_panel1.dat')
    panel2 = ld('quad_panel2.dat')

    exact_vs_fd(panel1, panel2)
    ax.set_xlabel('x')
    ax.set_ylabel('Vy')
    ax.plot(source[:, 0], source[:, 4], '-x')
    ax.plot(source2[:, 0], source2[:, 4], '-+', markersize=10)
    ax.plot(sourcearr[:, 0], sourcearr[:, 4])
    ax.grid()
    ax.legend(['Quad source', 'Tri sources', 'Source array'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('x')
    ax.set_ylabel('Vz')
    ax.plot(source[:, 0], source[:, 5], '-x')
    ax.plot(source2[:, 0], source2[:, 5], '-+', markersize=10)
    ax.plot(sourcearr[:, 0], sourcearr[:, 5])
    ax.grid()
    ax.legend(['Quad source', 'Tri sources', 'Source array'])
    plt.show()


if __name__ == "__main__":

    source = ld('source3.dat')
    source2 = ld('source4.dat')
    sourcearr = ld('sourcearr2.dat')

    source_vs_sourcearr(source, source2, sourcearr)
Пример #13
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.set_title(title)
    ax.plot(hshoe[:, 1], hshoe[:, 5])
    ax.plot(vring[:, 1], vring[:, 5], '-o')
    ax.plot(doublet[:, 1], doublet[:, 5], '-x')
    ax.grid()
    ax.legend(['Horseshoe vertex', 'Vortex ring', 'Quad doublet'])
    plt.show()


if __name__ == "__main__":

    hshoe = ld('hshoe1.dat')
    vring1 = ld('vring1.dat')
    vring2 = ld('vring2.dat')
    vring3 = ld('vring3.dat')
    doublet1 = ld('quad_doublet3.dat')
    doublet2 = ld('quad_doublet4.dat')
    doublet3 = ld('quad_doublet5.dat')

    hshoe_vs_vring_vs_doublet(hshoe, vring1, doublet1,
                              'Ring/doublet length = 1')
    hshoe_vs_vring_vs_doublet(hshoe, vring2, doublet2,
                              'Ring/doublet length = 2')
    hshoe_vs_vring_vs_doublet(hshoe, vring3, doublet3,
                              'Ring/doublet length = 10')
Пример #14
0
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vy')
    ax.plot(panel1[:, 1], panel1[:, 4], '-o')
    ax.plot(panel2[:, 1], panel2[:, 4], '-x')
    ax.grid()
    ax.legend(['Exact', 'Finite difference potential'])
    plt.show()

    # Plot z velocity
    plt.clf()
    plt.close()
    fig, ax = plt.subplots()
    ax.set_xlabel('y')
    ax.set_ylabel('Vz')
    ax.plot(panel1[:, 1], panel1[:, 5], '-o')
    ax.plot(panel2[:, 1], panel2[:, 5], '-x')
    ax.grid()
    ax.legend(['Exact', 'Finite difference potential'])
    plt.show()


if __name__ == "__main__":

    panel1 = ld('tri_panel1.dat')
    panel2 = ld('tri_panel2.dat')

    exact_vs_fd(panel1, panel2)