Beispiel #1
0
    def vandevooren(cls, tau=0.05, epsilon=0.05, numpoints=100):
        from paraBEM.airfoil.conformal_mapping import VanDeVoorenAirfoil
        airfoil = VanDeVoorenAirfoil(tau=tau, epsilon=epsilon)
        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, "VanDeVooren_tau=" + str(tau) + "_epsilon=" + str(epsilon))
        profile.normalize(numpy.where(x == min(x))[0][0])
        profile.normalize()
        profile.numpoints = numpoints
        return profile
Beispiel #2
0
    def vandevooren(cls, tau=0.05, epsilon=0.05, numpoints=100):
        from paraBEM.airfoil.conformal_mapping import VanDeVoorenAirfoil
        airfoil = VanDeVoorenAirfoil(tau=tau, epsilon=epsilon)
        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,
            "VanDeVooren_tau=" + str(tau) + "_epsilon=" + str(epsilon))
        profile.normalize(numpy.where(x == min(x))[0][0])
        profile.normalize()
        profile.numpoints = numpoints
        return profile
z_range_y = np.linspace(-3, 3, num_y)
z_grid = [x + 1j * y for y in z_range_y for x in z_range_x]

# remove all points lying inside the circle with radius r
r = airfoil.radius
z_grid = [z for z in z_grid if abs(z) > r]
# ----------------------------------------------------------

# complex zeta-plane with mapped circle (=joukowsky airfoil)
# ----------------------------------------------------------
z_to_zeta = list(map(airfoil.zeta, z_grid))
zeta_vel = list(map(zeta_velocity, z_grid))
zeta_pot = list(map(potential, z_grid))
zeta_stream = list(map(stream, z_grid))

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



with open(check_path("results/conformal_mapping/vandevooren_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, z_to_zeta)))
    writer.data(_file, zeta_stream, name="stream", _type="SCALARS", data_type="POINT_DATA")
    writer.data(_file, zeta_pot, name="pot", _type="SCALARS", data_type="POINT_DATA")
    writer.data(_file, zeta_vel, name="velocity", _type="VECTORS", data_type="POINT_DATA")


with open(check_path("results/conformal_mapping/vandevooren_airfoil.vtk"), "w") as _file:
    writer = VtkWriter()
Beispiel #4
0
z_range_y = np.linspace(-3, 3, num_y)
z_grid = [x + 1j * y for y in z_range_y for x in z_range_x]

# remove all points lying inside the circle with radius r
r = airfoil.radius
z_grid = [z for z in z_grid if abs(z) > r]
# ----------------------------------------------------------

# complex zeta-plane with mapped circle (=joukowsky airfoil)
# ----------------------------------------------------------
z_to_zeta = list(map(airfoil.zeta, z_grid))
zeta_vel = list(map(zeta_velocity, z_grid))
zeta_pot = list(map(potential, z_grid))
zeta_stream = list(map(stream, z_grid))

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

with open(check_path("results/conformal_mapping/vandevooren_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, z_to_zeta)))
    writer.data(_file,
                zeta_stream,
                name="stream",
                _type="SCALARS",
                data_type="POINT_DATA")
    writer.data(_file,
                zeta_pot,
                name="pot",