I’ve been following this amazing tutorial that Antonio @bay_swiss published on Youtube, Open source computational acoustics with FEniCSx
I’m running FEniCSx in a docker container.
I’ve had to deviate from the tutorial just to get it to run, any of these deviations could be a reason my results do not match the results Antonio gets at the end of part one.
When running the mesher the program seems to freeze on the first surface.
Since I didn’t want to give up five minutes into the tutorial I manually assigned the velocity BC and impedance using the Gmsh GUI. Making sure to set the mesh elements to be second order.
From there I replaced BoundingBoxTree with bb_tree
and geometry.compute_collisions with geometry.compute_collisions_points
Finally I changed plt.plot(f_axis, 20 * np.log10(np.abs(p_mic/2e-5)))
to plt.plot(f_axis, 20 * np.log10(np.abs(p_mic)/2e-5))
Since the plot wouldn’t print giving me the traceback: TypeError: unsupported operand type(s) for /: 'list' and 'float'
Finally if I’m using the nightly build I replace FunctionSpace
with functionspace
Can someone spot the error of my ways?
Geometry files and code can be found here.
My instinct is that by taking only the magnitude of p_mic solves the issue and allows the plot to print, but the fact that you were able to run it as is and how vastly different the visualization turns out tells me that there is some underlying problem that I am still not addressing.
Changing the export units from FreeCAD was not enough.
I ended up changing the units in the step file from meters to mm. Suspicious if you ask me.
Short unlisted youtube video of how things behave.
Another question
What is the point of
gmsh.model.add("air_mesh")
The code seems to output the same mesh whether the line is commented out or not