Пример #1
0
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import paraBEM
from paraBEM import pan3d
from paraBEM.mesh import mesh_object
from paraBEM.utils import check_path

# plots the values of the numerical solution as a scatter plot.

# running the case
mesh = mesh_object.from_OBJ("../mesh/sphere_low_tri.obj")
case = pan3d.DirichletDoublet0Case3(mesh.panels)
case.v_inf = paraBEM.Vector3(1, 0, 0)
case.run()

#  plotting the analytic solution
fig = plt.figure()
pot_f = lambda z: z * 3 / 2
pot_n_x, pot_n_y = np.array([[i.center.x, i.potential] for i in case.panels]).T

pot_x = np.arange(-1., 1.001, 0.1)
pot_y = list(map(pot_f, pot_x))

ax1 = fig.add_subplot(311)
ax1.plot(pot_x, pot_y, c=[0, 0, 0], label="Analytisch")
ax1.scatter(pot_n_x, pot_n_y, marker="+", label="Panelmethode")
ax1.set_xlabel('x')
ax1.set_ylabel('Potential')
ax1.legend(loc="upper left", fontsize=8)
Пример #2
0
import paraBEM
from paraBEM import pan3d
from paraBEM.mesh import mesh_object

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

case = pan3d.DirichletDoublet0Case3(mesh.panels, mesh.trailing_edges)
case.v_inf = paraBEM.Vector3(10, 0, 0)
case.create_wake(length=100, count=2)
case.run()
Пример #3
0
import paraBEM
from paraBEM import pan3d

v1 = paraBEM.PanelVector3(-0.5, -0.5, 0)
v2 = paraBEM.PanelVector3(0.5, -0.5, 0)
v3 = paraBEM.PanelVector3(0.5, 0.5, 0)
v4 = paraBEM.PanelVector3(-0.5, 0.5, 0)
v5 = paraBEM.PanelVector3(0.5, 1.5, 1)
v6 = paraBEM.PanelVector3(-0.5, 1.5, 1)

p1 = paraBEM.Panel3([v1, v2, v3, v4])
p2 = paraBEM.Panel3([v4, v3, v5, v6])

v_inf = paraBEM.Vector3(0, 1, 0)

c = pan3d.DirichletDoublet0Case3([p1, p2], [v1, v2, v3])
c.run()