unicfdlab / libAcoustics

libAcoustics - OpenFOAM library for far-field noise computation
140 stars 57 forks source link

The p_Fluc value of only the last microphone for moving surface is calculated and all others are printed out as zero #62

Closed AmmadF closed 2 years ago

AmmadF commented 2 years ago

I am calculating SPL using FWH analogy. Every thing is working smoothly on local server but when i shift my simulation to high performance computing lab libAcoustic writes out only the P_Fluc values of last microphone. (Doesnt matter which observer position i put in, it calculates only the last observer). I contacte the guy in high computing lab and i got the following bug report from him.

" it seems, that there is a bug in the library libAcoustics.

[1] [1] [1] --> FOAM FATAL ERROR: [1] attempt to access element 0 from zero sized list [1] [1] From function void Foam::UList::checkIndex(Foam::label) const [with T = Foam::autoPtr; Foam::label = int] [1] in file ...OpenFOAM-v1912/src/OpenFOAM/lnI nclude/UListI.H at line 132. [1] FOAM parallel run aborting

And goes down to file soundPressureSampler.C at line 471

sampleAndWrite(p,surfI,soundPressureSamplerFilePtr_[surfI],cTime);

by wrong use of AutoPtr probably. "

this error occurs only if i put "nonUniformSurfaceMotion true;"

Can you kindly look into this bug?

unicfdlab commented 2 years ago

Hi, thank you for finding the bug.

Can you please upload here the case which reproduces it?