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) p = paraBEM.Panel3([v1, v2, v3, v4]) # p = paraBEM.Panel3([v1, v2, v3]) # triangle p.potential = 1. n = 50 a = numpy.linspace(-1, 1, n).tolist() b = [paraBEM.PanelVector3(i, j, k) for i in a for j in a for k in a] pot = [doublet_3_0_sphere(i, p) for i in b] vel = [doublet_3_0_vsaero_v(i, p) for i in b] writer = VtkWriter() with open(check_path("results/panel_influence.vtk"), "w") as _file: writer.structed_grid(_file, "duplet", [n, n, n]) writer.points(_file, b) writer.data(_file, pot, name="potential", _type="SCALARS", data_type="POINT_DATA") writer.data(_file, vel, name="velocity", _type="VECTORS", data_type="POINT_DATA")
import paraBEM from paraBEM.pan3d import doublet_3_0_vsaero, doublet_3_0_vsaero_v, doublet_3_0_sphere from paraBEM.vtk_export import VtkWriter import numpy from paraBEM.utils import check_path 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) p = paraBEM.Panel3([v1, v2, v3, v4]) # p = paraBEM.Panel3([v1, v2, v3]) # triangle p.potential = 1. n = 50 a = numpy.linspace(-1, 1, n).tolist() b = [paraBEM.PanelVector3(i, j, k) for i in a for j in a for k in a] pot = [doublet_3_0_sphere(i, p) for i in b] vel = [doublet_3_0_vsaero_v(i, p) for i in b] writer = VtkWriter() with open(check_path("results/panel_influence.vtk"), "w") as _file: writer.structed_grid(_file, "duplet", [n, n, n]) writer.points(_file, b) writer.data(_file, pot, name="potential", _type="SCALARS", data_type="POINT_DATA") writer.data(_file, vel, name="velocity", _type="VECTORS", data_type="POINT_DATA")
import paraBEM from paraBEM.pan3d import doublet_3_0_vsaero_v, vortex_3_0_v 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) source = paraBEM.Panel3([v1, v2, v3, v4]) targets = [paraBEM.Vector3([0, 0, 0])] for target in targets: print(doublet_3_0_vsaero_v(target, source)) vortex_ring = (vortex_3_0_v(target, v2, v3), vortex_3_0_v(target, v3, v4), vortex_3_0_v(target, v4, v1), vortex_3_0_v(target, v1, v2)) print(vortex_ring)