Esempio n. 1
0
def min_func(x):
    global count
    count += 1
    print("\niteration: " + str(count))
    _glider2d = deepcopy(glider2d)
    glider_set_controlpoint(_glider2d, x)
    glider3d = _glider2d.get_glider_3d()
    panels = paraBEM_Panels(glider3d,
                        midribs=0,
                        profile_numpoints=40,
                        symmetric=True,
                        distribution=Distribution.from_nose_cos_distribution(40, 0.2),
                        num_average=0)
    case = Case(panels[1], panels[2])
    case.farfield = 5
    case.drag_calc = "trefftz"
    case.A_ref = 23

    case.create_wake(length=10000, count=5)
    case.v_inf = paraBEM.Vector3(8, 0, 1)
    case.trefftz_cut_pos = case.v_inf * 50
    alpha = v_inf_deg_range3(case.v_inf, 5, 9, 20)
    polars = case.polars(alpha)
    vtk_writer = CaseToVTK(case, "results/vtk_opt", suffix=str(count))
    vtk_writer.write_panels(data_type="point")
    cL = []
    cD = []
    for i in polars.values:
        cL.append(i.cL)
        cD.append(i.cD)
    return np.interp(0.6, cL, cD)
Esempio n. 2
0
from paraBEM.mesh import mesh_object
from paraBEM.pan3d import DirichletDoublet0Source0Case3 as Case
from paraBEM.vtk_export import CaseToVTK


mesh = mesh_object.from_OBJ("../mesh/sphere_half.obj")
for panel in mesh.panels:
    panel.set_symmetric()

case = Case(mesh.panels)
case.run()

writer = CaseToVTK(case, "results/symmetric_test")
writer.write_panels(data_type="point")
writer.write_field([-2, 2, 20], [-2, 2, 20], [-2, 2, 20])
Esempio n. 3
0
v_inf = [8, 0, 1]

case = Case(panels, trailing_edge)
case.mom_ref_point = paraBEM.Vector3(1.25, 0, -6)
case.A_ref = parametricGlider.shape.area
case.farfield = 5
case.drag_calc = "on_body"
case.trefftz_cut_pos = case.v_inf * 800

case.v_inf = paraBEM.Vector3(v_inf)
case.create_wake(length=10000, count=4)    # length, count
polars = case.polars(v_inf_deg_range3(case.v_inf, -5, 12, 15))


vtk_writer = CaseToVTK(case, "results/vtk_glider_case")
vtk_writer.write_panels(data_type="cell")
vtk_writer.write_wake_panels()
vtk_writer.write_body_stream(panels, 100)

p = []
alpha = []
for i in polars.values:
    alpha.append(np.rad2deg(i.alpha))
    p.append((i.cL, i.cD, i.cP, i.cop.x, i.cop.z))
plt.figure(figsize=(10, 4))
# plt.title(u"Beiwerte bei variiertem Anströmwinkel")
plt.ylabel(u"$\\alpha$", rotation=0, fontsize=20)
plt.xlabel(u"$c_{Wi}$, $c_N$, $c_A$", rotation=0, fontsize=20)

plt.plot(np.array(p).T[0], alpha, label=u"$c_A$")
plt.plot(np.array(p).T[1], alpha, label=u"$c_{Wi}$")
Esempio n. 4
0
with open("../openglider/glider/referenz_schirm_berg.json") as _file:
    glider = load(_file)["data"]
    panels = paraBEM_Panels(glider.get_glider_3d() , 0, 30, 0, False)

case = Case(panels[1], panels[2])
case.v_inf = paraBEM.Vector(glider.v_inf)
case.drag_calc = "on_body"
case.A_ref = glider.shape.area

#wake parallel to the x axis
print("*    wake parallel to the x-axis")
case.create_wake(50, 100, paraBEM.Vector3(1., 0., 0.))
case.run()
writer = CaseToVTK(case, "results/wake/x-parallel")
writer.write_panels()
writer.write_wake_panels()
print("F_l = ", case.cL * case.A_ref * 1.2 * 11**2 / 2.,
      "F_w = ", case.cD * case.A_ref * 1.2 * 11**2 / 2.)


#wake parallel to v_inf
print("*    wake parallel to v_inf")
case.create_wake(50, 100, case.v_inf)
case.run()
writer = CaseToVTK(case, "results/wake/v_inf-parallel")
writer.write_panels()
writer.write_wake_panels()
print("F_l = ", case.cL * case.A_ref * 1.2 * 11**2 / 2.,
      "F_w = ", case.cD * case.A_ref * 1.2 * 11**2 / 2.)