Exemple #1
0
    def joukowsky(cls, m=-0.1+0.1j, numpoints=100):
        from paraBEM.airfoil.conformal_mapping import JoukowskyAirfoil
        airfoil = JoukowskyAirfoil(m)
        profile = [[c.real, c.imag] for c in airfoil.coordinates(numpoints)]

        # find the smallest xvalue to reset the nose
        x = numpy.array([i[0] for i in profile])
        profile = cls(profile, "joukowsky_" + str(m))
        profile.normalize(numpy.where(x == min(x))[0][0])
        profile.normalize()
        profile.numpoints = numpoints
        return profile
Exemple #2
0
    def joukowsky(cls, m=-0.1 + 0.1j, numpoints=100):
        from paraBEM.airfoil.conformal_mapping import JoukowskyAirfoil
        airfoil = JoukowskyAirfoil(m)
        profile = [[c.real, c.imag] for c in airfoil.coordinates(numpoints)]

        # find the smallest xvalue to reset the nose
        x = numpy.array([i[0] for i in profile])
        profile = cls(profile, "joukowsky_" + str(m))
        profile.normalize(numpy.where(x == min(x))[0][0])
        profile.normalize()
        profile.numpoints = numpoints
        return profile
z_stream = list(map(stream, z_grid))

circle = list(map(complex_to_3vec, airfoil.circle()))
# ----------------------------------------------------------

# complex zeta-plane with mapped circle (=joukowsky airfoil)
# ----------------------------------------------------------
zeta_range_x = np.linspace(-3, 3, num_x)
zeta_range_y = np.linspace(-3, 3, num_y)
zeta_grid = [x + 1j * y for y in zeta_range_y for x in zeta_range_x]
zeta_to_z = list(map(airfoil.z, zeta_grid))
zeta_vel = list(map(zeta_velocity, zeta_to_z))
zeta_pot = list(map(potential, zeta_to_z))
zeta_stream = list(map(stream, zeta_to_z))

airfoil = list(map(complex_to_3vec, airfoil.coordinates()))
# ----------------------------------------------------------


with open(check_path("results/conformal_mapping/joukowsky_z.vtk"), "w") as _file:
    writer = VtkWriter()
    writer.structed_grid(_file, "z_plane", [num_x, num_y, 1])
    writer.points(_file, list(map(complex_to_3vec, z_grid)))
    writer.data(_file, z_stream, name="stream", _type="SCALARS", data_type="POINT_DATA")
    writer.data(_file, z_pot, name="pot", _type="SCALARS", data_type="POINT_DATA")
    writer.data(_file, z_vel, name="velocity", _type="VECTORS", data_type="POINT_DATA")

with open(check_path("results/conformal_mapping/joukowsky_zeta.vtk"), "w") as _file:
    writer = VtkWriter()
    writer.structed_grid(_file, "zeta_plane", [num_x, num_y, 1])
    writer.points(_file, list(map(complex_to_3vec, zeta_grid)))