Predefined Cylinder Meshes
The dream.mesh module provides several helper functions to generate predefined meshes that are commonly used in aeroacoustic simulations around bluff bodies. Here, we showcase two of them:
get_cylinder_mesh: an unstructured mesh around a cylinder, optionally with a fitted boundary layer, a graded transition region, and an outer sponge layer used to damp outgoing acoustic waves.get_cylinder_omesh: a structured O-grid (ring) mesh around a cylinder, with a fixed number of elements in the radial and polar directions.
[1]:
import ngsolve as ngs
from ngsolve.webgui import Draw
from dream.mesh import get_cylinder_mesh, get_cylinder_omesh
Unstructured mesh with a sponge layer
We generate a mesh with radius \(0.5\) and an outer sponge layer used to damp outgoing waves, and inspect the resulting domains and boundaries.
[2]:
mesh = get_cylinder_mesh(radius=0.5, sponge_layer=True, curve_layers=True)
print("Materials:", mesh.GetMaterials())
print("Boundaries:", mesh.GetBoundaries())
mesh.Curve(3)
Draw(mesh)
Materials: ('sponge', 'sound', 'sound', 'sound', 'sound', 'sound', 'sound', 'sound')
Boundaries: ('inflow', 'outflow', 'default', 'default', 'default', 'default', 'default', 'default', 'default', 'default', 'default', 'default', 'default', 'cylinder')
[2]:
WebGLScene
Structured O-grid mesh
Alternatively, get_cylinder_omesh generates a fully structured ring mesh, here with \(32\) elements in the polar direction and \(8\) in the radial direction.
[3]:
omesh = get_cylinder_omesh(ri=0.5, ro=5.0, n_polar=32, n_radial=8)
print("Materials:", omesh.GetMaterials())
print("Boundaries:", omesh.GetBoundaries())
Draw(omesh)
Materials: ('default',)
Boundaries: ('cylinder', 'left', 'right')
[3]:
WebGLScene