Room modes in 3D using sketchup and FEM

In this post, I’m examining the low frequency response of my living room. I’m going to compare it to a theoretical model obtained using FEM and see how much useful information FEM gives me.

I’m going to do the following:

  • Model the room using sketchup
  • Import it into python
  • Place the subwoofer in the corner
  • Calculate the response at the listening position using FEM
  • Measure the real response at the same position and compare it with the result of the model

The setup

My living room

My living room

My living room has two open doorways without a door, which means that the geometry will usually be like the one to the left (with all other doors closed). I was really curious as to what the effect of the two “chambers” (the entryway and the kitchen) have on the response of the room.

FEM

The mesh

The mesh

I divided the model into tetrahedrons using MeshPy, resulting in the figure you can see above. The mesh is quite coarse, but dense enough for the purpose. In addition, I used linear elements. The room modes took about a second to calculate once the mesh was done (with the meshing only taking a few seconds), which I found impressive.

I added a tiny amount of damping to the system and assumed that the boundaries were perfectly rigid.

The measurement

I recorded the signal in the middle of the room and applied the popular exponential sine sweep technique by Farina.

The results

The rigid assumption resulted in the resonant response being slightly “higher up” as compared to the measured one. Still, I find the correlation between the responses below 100 Hz fantastic. Apparently there are some details above 100 Hz which should be taken into account (probably furniture, and also less damping), but below 100 Hz there are a lot of similarities. Additionally, I’m thinking that the mesh with linear elements might not be dense enough for over 100 Hz. The speaker I used has a poor response below 50 Hz, so the sharp peaks there were regrettably not visible in the measurement. Note that I wasn’t really measuring the response at 170 dB 🙂 .

plot

The modes

I tried a few different techniques to visualize the modes, and found it surprisingly difficult to get a nice looking result.

Using iso surfaces in mayavi resulted in a result I think looks decent. Here’s the mode representing the peak you can see at about 50 Hz, with the surfaces showing constant pressure values. As you can see, the whole room is actively participating in the mode.

Mode at ~50 Hz

Mode at ~50 Hz

Another interesting mode is the lowest mode at ~20 Hz. It’s far lower than one would estimate using just the rectangular part of the room (37 Hz). It’s fascinating how the gradient of the pressure field goes from one chamber to the other.

Lowest mode at ~20 Hz

Lowest mode at ~20 Hz

Conclusion

The living room seems to be a prime example of a room where FEM gives very nice results. I would argue that there would be absolutely no point in trying to deduce the lowest modes from the rectangular dimensions of the room, when the real room modes are so specific to the whole geometry. This analysis is also really quick to do, so it doesn’t add that much extra time to a project.

5 thoughts on “Room modes in 3D using sketchup and FEM

  1. Miguel

    Hi ! i want to try to reproduce your method but i don’t understand how you export/import the 3d model from sketchup to a python script. is it me that understood it wrong and in fact you write the coordenades of the room in the script and simly use the sketchup model to show the final results ?
    thank you !

    Reply
  2. Kai Post author

    Hi – I used some open source 3D file format for that, i.e. the model is done in sketchup and everything else in python. The final results are shown with mayavi.

    Reply
  3. Shenuka

    Hi Kai,

    Everything on your website looks absolutley fantastic, and exciting. Could I please ask that you detail a bit more on the process of how you get from point A to B. For example, which mesh format did you use? .smesh? Did you use gmesh to process it? Which package did you use to calculate the modes? Which PDE equations did you use? How did you define the boundaries? You’ve done a great job here. I’d really be interested to know more sepcifics.

    Reply
    1. Kai Post author

      Hi Shenuka, thank you. I used MeshPy to get the mesh and integrated the Helmholtz equation by parts to get the functional representation etc. Basically this but 3D: https://blog.kaistale.com/?p=574 . I didn’t use any particular package to get the modes, just coded and solved for it in Python with NumPy. The boundaries were rigid, which makes things easier. It has been a while since I did this, so regrettably I do not remember the specifics right now without delving into details. I hope that is helpful.

      Reply

Leave a Reply to Shenuka Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.