Example #1
0
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}$")
plt.plot(-np.array(p).T[2], alpha, label=u"- $c_N$")
plt.legend(fontsize=15)
Example #2
0
import paraBEM
from paraBEM import pan3d
from paraBEM.vtk_export import CaseToVTK
from paraBEM.mesh import mesh_object
import numpy as np

mesh = mesh_object.from_OBJ("../mesh/sphere_low_tri.obj")

case = pan3d.DirichletDoublet0Case3(mesh.panels)
case.v_inf = paraBEM.Vector3(1, 0, 0.)
case.farfield = 100
case.run()

lin = np.linspace(-0.5, 0.5, 5)
grid = [[-2, k, j] for j in lin for k in lin]

vtk_writer = CaseToVTK(case, "results/vtk_test_case")
vtk_writer.write_panels(data_type="point")
# vtk_writer.write_wake_panels()
vtk_writer.write_body_stream(mesh.panels, 50)
vtk_writer.write_field([-2, 2, 100], [-2, 2, 100], [-1, 1, 3])