CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Aeroacoustics in OpenFOAM... (

Bertrand November 22, 2010 15:15

Aeroacoustics in OpenFOAM...

I am pretty new to the great OF Community. For my PhD, I need to study the acoustics coming out of a shaped tube (like blowing into an instrument).

My geometry is the following : inlet, shaped tube, outlet consisting in a hemisphere (open atmosphere). I settled periodic boundary condition for velocity as the inlet and "open atmosphere" for the outlet .

I solve the problem with rhoPisoFoam, LES.

Up to now, I've found pretty nice results, using, among others this great tool audioToProbe, to check up with the acoustic signal at different places, but unfortunately, my signal gets noisier with the distance increasing from the source, right when it goes into the hemisphere. I suspect the outlet boundary condition.

Up to now, I tried

type totalPressure;
p0 uniform 1e5;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 1e5;

type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);

Or p with "waveTransmissive"

But I don't know how to deal with this issue about "non-reflective boundary condition" when dealing with aeroacoustics.

It would be great if someone could give me some hints on these issues :

1. How to set this "open atmosphere" boundary condition?
2. How to take into account the non-reflective boundary condition?
3. How to adapt U outlet condition in accordingly?
4. Is that a good solver for Aeroacoustics?

Thank you very much for your answers...


7islands November 23, 2010 00:33

Hi Bertrand,
I can't say much about compressible aeroacoustics itself, but one thing to note about probeToAudio is that it normalizes the input acoustic waveform with its maximum amplitude to avoid saturation and to obtain maximum S/N ratio. However there could be several potential problems by this feature under your scenario, two of which I can think of are:
  1. If your case generates characteristic narrow band tone at the source and it fades over distance, you might have an impression that the overall signal (including noises) gets noisier over distance because noises typically has broader spectrum.
  2. It could be that your simulation has a pressure fluctuation of very low frequency that is under human audible range but very large amplitude around the source. In such a case the acoustic tone of your interested frequency could be very small. (by the way this is quite a typical case for wind-tunnel measurements)
In any case, you might visually check if your simulation is going well and the waveforms fade over distance.


Bertrand November 25, 2010 05:15

Hi Takuya,

Thank you very much for your answer!
Your insights gave me some ideas...

1. How can I (simply?) modify probeToAudio in order not to normalize the sampled pressure with the maximum amplitude?

2. Concerning your suggestion 2, I have an input of a sinus (or half a sinus) for the velocity, with a fundamental frequency of 100 Hz. So there is no problem about being out of the audible range. Whenever I am "in the tube" it is a nice warm sound of 100 Hz, but as soon as I am out of the tube, in the open-atmosphere, the sound is still 100 Hz fundamental frequency (hopefully!) but gets noisier.

3. Therefore, when I add the visualization of what happens about p and U in this outlet hemisphere, I am very suspicious about the outlet boundary condition for both p and U : I really wonder how to implement such an "open atmospehre"... Would you have any idea?



7islands November 27, 2010 09:20

Hi Bertrand,

@1., @2: I haven't tried by myself but you should be able to modify the following bits to replace max(bias - minValue, maxValue - bias) with a fixed value.

// scale and convert the data to be fit into the int16_t range
scalar scaleFactor = max(bias - minValue, maxValue - bias);

@3.: Is your flow reaching the outlet smoothly? If not let's hope an expert in compressible aeroacoustics chimes in - I only have experience with incompressible one using acoustic analogy with my own simulation code.


Bertrand December 3, 2010 06:57

Hi Takuya,

Thank you for your answer, I am now using Audacity, as you suggested months ago, in order to plot the spectrum : really helpfull in my case.

1. I have been modifying the code for audioToProbe, so that it doesn't normalize it, but how shall I "compile" this new code, (and from which location), in order to use it as an alternative audioToProbe utility? Sorry if my question may sound like a newbie one, but I am pretty new to OF, and still didn't implement my own functions, but I am looking forward to it.

2. I am still busy trying to figure out a way of implementing a far-field condition such as it would be an open atmosphere, non-reflective boundary condition, and wave-transmissive. As I saw in other posts, it looks like you are busy with this as well, so if you have more hints on that, I would definitely enjoy if you could share...

3. I've downloaded your last contribution to OF, still have to give it a look, but the principle looks amazing! Congrats'



7islands December 3, 2010 23:32

Hi Bertrand,
@Compiling: take a look at the User Guide first,

@farfield condition: I know a convective outlet BC works well for low-Mach incompressible cases (which I studied with my own Fortran code) but not sure about compressible cases thus can't be of much help. As far as I've read in this forum the waveTransmissive BC should work?


Bertrand December 7, 2010 06:59

Hi Takuya,

@Compiling : it didn't work, because there were some files missing in the official link to probeToAudio, but I could use the one from potentialWaveFoam, so no problem.

@probeToAudio : I have a question : what is the meaning of 32767.0 in line 209?

@convectiveOutlet : I am gonna try now, and do comparison cases with waveTransmissive.


7islands December 7, 2010 12:22

Hi Bertrand,


Originally Posted by Bertrand (Post 286346)
@probeToAudio : I have a question : what is the meaning of 32767.0 in line 209?

It's 2^15 - 1, the maximum amplitude that can be represented by 16-bit linear PCM audio format.


All times are GMT -4. The time now is 08:21.