unicfdlab / libAcoustics

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

cleanFrequency in FWHControl file #36

Closed SebbiWa closed 3 years ago

SebbiWa commented 4 years ago

Hi guys,

i already installed the acousticLib v1912 and applied it to a simple testcase with a rotating cuboid. The edge passing frequency is 68 Hz which is reflected in the spectra: SPL_spectra

When I apply acousticLib to a rotating fan, instead of the blade passing frequency you can see that the spectra has a periodic wave with peaks at every 100Hz (in timed domain every 10ms we got a peak) which is an artifact: SPL_spectra_2

The time signal:

time_signal

This problem may be related to the clean Frequency from FWControl file which I chose to 100 Hz. Could anybody explain the parameter "cleanFreq." or tell me how to avoid this artefact.

Many thanks in advance,

Sebastian

unicfdlab commented 4 years ago

Hi, the cleanFreq should not affect results of simulation. It determines how often the history of data on a FWH control surface must be revised to find old values, which do not influence acoustics in microphones. The larger the value - the more time slices are stored between revisions, the less the value - the more frequently data is revised.

However, I don't understand your first picture with verification case. Can you post here: system/fvSolution, system/fvSchemes, settings for FWH and figure with flow visualization ?

SebbiWa commented 4 years ago

Hi, this was my first testcase: U_x

The rotation speed is omega = 106.76 rad/s which means a "bpf" at 68Hz. In this case I had a flow velocity of 5 m/s as a background flow.

In the case with my rotating fan I do not have a flow velocity. I also found that the clean frequency does not matter. A picture of the flow field, calculated with pimplefoam, at t= 0.8s is presented here:

U_x_and_pressure

here my fvSchemes file: fvSchemes_1

and my fvSolution file: fvSolution_1

fvSolution_2

my fwh settings file:

fwh_control

And the commobn_settings file:

common_settings Many Thanks for your help.

Sebastian

unicfdlab commented 4 years ago

Hi, first of all -- do you use MRF or SRF? Because current implementation of libAcousitcs doesn't support moving frame of reference.

SebbiWa commented 4 years ago

Hi,

I am using cyclic AMIs, my solver is PimpleFoam.

unicfdlab commented 4 years ago

Do you use AMI for first test case?

Can you create FWH surface somewhere outside the moving region?

SebbiWa commented 4 years ago

I used AMIs fot both cases. The fan (which is my FWH Surface) should be moved in the simulation. That's why the FWH surface cannot be placed outside of the rotation domain.

unicfdlab commented 4 years ago

Yes, but FWH analogy doesn't impose restrictions on a place where the surface is placed. You can place FWH surface around your blades in moving or stationary region and if calculations are correct, then both surfaces should give approximately the same results

unicfdlab commented 4 years ago

Can you post here test case No. 1 ? I'll try to run it.

SebbiWa commented 4 years ago

Yes, but FWH analogy doesn't impose restrictions on a place where the surface is placed. You can place FWH surface around your blades in moving or stationary region and if calculations are correct, then both surfaces should give approximately the same results

Thank you for this comment I will make a non rotating baffle on the pressure side of my fan to check the result from the case i posted above.

Here my test_case:

rotating_cuboid.zip

thank you for testing my case!

unicfdlab commented 4 years ago

Hi, I found small error in the library (but it is not related to cleanFreq directly). Can you download latest version, recompile it and run again?

unicfdlab commented 4 years ago

Have you solved the problem?

SebbiWa commented 4 years ago

Thank you very much for updating the libAcoustic. I will recompile it and run again my test case. I will post my results as far as i can.

SebbiWa commented 4 years ago

This is the result of the rotating cuboid with the updated library:

rotating_cuboid_new_libAc

This is the result from the rotating fan with the old FWH-surface (fan istself):

fan_old_libAc

This is the result with the new FWH surface ( see the geometry in second picture) : fan_new_libAc

The inner cuboid is my FWH surface:

Fwh_surface

SebbiWa commented 4 years ago

In the fan case I analysed only a short time... I will continue the simulation and my take the time period from 1s-2s to see how the result looks like.

VamosZhi commented 3 years ago

This is the result of the rotating cuboid with the updated library:

rotating_cuboid_new_libAc

This is the result from the rotating fan with the old FWH-surface (fan istself):

fan_old_libAc

This is the result with the new FWH surface ( see the geometry in second picture) : fan_new_libAc

The inner cuboid is my FWH surface:

Fwh_surface

Hi,SebbiWa, I have simple questions, maybe you could help me?

  1. If I want to include quadrupole source term in the consideration, I think I need to create a larger surface like you, but how to do it in Openfoam, and define it in the FW-H setting?
  2. If I want to use Farassat’s formulation 1A method, I noticed the paper of the original codes said that "Farassat’s formulation 1A14, 15 is implemented to predict the noise generated by an acoustic source moving in a fluid at rest, and measured at a stationary observer located in the far-field." see paper DOI:10.2514/6.2010-3711, but we also need to set the U0 as zero while using Farassat’s formulation 1A, so how to express the relative velocity between inflow and the FW-H surfaces or observers? Many thanks! ZHI
SebbiWa commented 3 years ago

Hi ZHI,

sorry for the late response. I create my FW-H surface with createBafflesDict. I Think there is a better way with createPatchDict as in the tutorial dipole3D. Check this this tutorial. Let me know if you need further help with creating an FW-H surface.

Regarding the second qustion I cannot help you. Currently I am using U0 as zero... so the correct answer to this question is also interesting for me.

Cheers,

SebbiWa

SebbiWa commented 3 years ago

Have you solved the problem?

I solved some problems! But I have again two questions:

1)What does does "dRef" mean? How big should I chose it? For example when I am running my fan case, is it the diameter of my fan or how can I define this parameter in general.

2)Is it possible to have two FW-H surfaces? I want to simulate the flow around an heat exchanger ( see on the picture) so I have two surfaces in my simulation, the heat exchanger fins (hex_fins) and the pipes (hex_pipes). Geometrie_pipes_cutted

Is it possible to have two FW- H surfaces or do I need to merge both stl files to one and us it as one surface? I tried many possibilities to name both surfaces in the fwhControl file , see an example on the picture :

fwh_control_file

Many thanks in advance for your response,

SebbiWa

unicfdlab commented 3 years ago

1)What does does "dRef" mean? How big should I chose it? For example when I am running my fan case, is it the diameter of my fan or how can I define this parameter in general.

dRef is used in 2D simulations as an attempt to normalize results. It must be equal to size of domain depth in empty (3-rd) direction. In 3D simulations it must be negative.

unicfdlab commented 3 years ago

Is it possible to have two FW- H surfaces or do I need to merge both stl files to one and us it as one surface? I tried many possibilities to name both surfaces in the fwhControl file , see an example on the picture :

You can have as many surfaces as you need . You only limited by the size of your RAM memory:

surface ( surf1{....} surf2{....} ... surfn{....} );

JustthanuMU commented 3 years ago

This is the result of the rotating cuboid with the updated library:

rotating_cuboid_new_libAc

This is the result from the rotating fan with the old FWH-surface (fan istself):

fan_old_libAc

This is the result with the new FWH surface ( see the geometry in second picture) : fan_new_libAc

The inner cuboid is my FWH surface:

Fwh_surface

How can you plot the SPL VS Freq like that? Did you just use the .dat file in a acousticdata or it must be another steps? thanks in advance

SebbiWa commented 3 years ago

Hi ThanatMU, i used the .dat file with time data and made an fft with a python script.

JustthanuMU commented 3 years ago

On Wed, 24 Mar 2564 BE at 14:37 SebbiWa @.***> wrote:

Hi ThanatMU, i used the .dat file with time data and made an fft with a python script.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/unicfdlab/libAcoustics/issues/36#issuecomment-805575974, or unsubscribe https://github.com/notifications/unsubscribe-auth/APERATYIQU6BN6QRPFCX653TFGJDNANCNFSM4PTD5CEQ .

Can i have those scripts, i do confuse with the result i got. I just plot the spl vs freq in acoustic . Dat file. I guess that is not a proper method. Hahaa

chakshudeora commented 3 years ago

Hi Guys,

More than issue, I have some very basic questions related to libacoustics. I hope you guys can help me with it.

I am trying to simulate a UAV propeller using OpenFOAM. So far for aerodynamics, I have used MRF simualtion with steady RANS (SA, komegaSST, komegaSSTLM). In order to analyse the acoustics, I will shift to URANS, or to LES later.

Following are the questions related to libacoustics:

  1. How do we define the control surfaces? Is it a part of the mesh? I am using PointWise for meshing. Is it like a cellzone (like it is needed by MRF in openfoam)? And I have read this somewhere else as well that the control surface should be outside the rotating region, is it preferable? Can I just use the blade as a FWH source with the prescribed rotational velocity?
  2. With the URANS simulation, I should be able to get the tonal noise in the far field, is that correct?
  3. And if I want to calculate the broadband noise, I should be able to do it with LES in near field, and for far field, I can use libacoustics, is that correct?

I would really appreciate if you guys can help me with it. In the meantime, I will try to look at the test case attached in this thread.

Thanks in advance. Hope to hear from you soon. Regards, Chakshu Deora Email: deorachakshu03@gmail.com

eacfd commented 3 years ago

Dear Chakshu! The control surface is defined as an STL file and located in the triSurface folder. Yes, the FW-H surface should be outside the rotating region. You can try to use the DDES approach for numerical simulation. Regards, AE

chakshudeora commented 3 years ago

Hi AE,

Thanks for your reply. I will try that in the coming days. My questions are little naive, kindly help me.

How should I create .stl file (using what tool)? For example: if I want to simulate a 2 bladed propeller, I create a surface with encompassing the blade (lets say a sphere of radius 0.2 m if diameter of blade is 0.16m), what should be the resolution for the surface. As mentioned above, baffle zones could also be used, so I am getting little confused. It would be great if someone can help me with it.

One more question: Is it possible to obtain tonal noise using steady RANS with MRF? And is there a user-manual for libacoustics. Kindly let me know this.

Regards, Chakshu

eacfd commented 3 years ago

You can use any software to create STL surfaces (e.g Salome, OpenFOAM, or others). Try to use URANS to obtain propeller tonal noise.

Regards, AE

chakshudeora commented 3 years ago

Okay, thank you so much for your inputs.

I will try that and get back to you if there are some problems.

SebbiWa commented 3 years ago

Hi Chakshu,

as you can see in the results above, I got tonal components in my simulations. Some notes about my simulations:

-I used pimpleFoam with AMI.

-As far as I remember, I made my .stl file in Blender.

-I used a cuboid as a fwh surface.

-My fwh surface is an internal surface ( I used createBafflesDict) with cyclic boundary conditions.

Regards,

SebbiWa

chakshudeora commented 3 years ago

Hi SebbiWa,

Thanks for your inputs. Can you please share your updated testcase?

My email address: deorachakshu03@gmail.com

Thanks in advance. Regards.

chakshudeora commented 3 years ago

Hi Guys, Once again thanks for your help.

I tried to test libacoustics with propeller tutorial of openfoam. The test case is situated in tutorial/incompressible/pimplefoam/RAS/propeller.

As you guys suggested I created a .stl file using Paraview (Source-> cylinder, Filter-> extract surface, and finally Save Data as .stl file), and placed it in triSurface folder (see the figure, blue sphere is my FWH surface). I have not changed anything in the simulation. I have added fwhCommonSetting, fwhControl, probeControl in the system. image

Following are the files:


    libs ("libAcoustics.so");

    log                    true;

    writeFft               true;

    probeFrequency         1;

    timeStart              0;//0.0001;

    timeEnd                0.1;

    c0                     340;

    dRef                   -1;

    pName                  p;

    pInf                   0;

    rho                    rhoInf;

    rhoInf                 1.1225;

    CofR                   (0 0 0);

    observers
    {
        R-A
        {
            position       (0 -0.4 0);
            pRef           2.0e-5;
            fftFreq        1024;
        }
        R-B
        {
            position       (0 -0.7 0);
            pRef           2.0e-5;
            fftFreq        1024;
        }
        R-C
        {
            position       (0.2 -0.4 0);
            pRef           2.0e-5;
            fftFreq        1024;
        }
        R-D
        {
            position       (-0.2 -0.4 0);
            pRef           2.0e-5;
            fftFreq        1024;
        }
        R-E
        {
            position       (0 -0.4 0.2);
            pRef           2.0e-5;
            fftFreq        1024;
        }
        R-F
        {
            position       (0 -0.4 -0.2);
            pRef           2.0e-5;
            fftFreq        1024;
        }
    }
sphereDipole1AFassaratStl
{
    type                       FfowcsWilliamsHawkings;
    #include                   "fwhCommonSettings";
    patches                    ("propellerTip");
    interpolationScheme        cell;

    surfaces
    (
        sphere
        {
            type               sampledTriSurfaceMesh;
            surface            fwh_surface.stl;
            source             cells;
            interpolate        false;
        }
    );

    nonUniformSurfaceMotion    true;
    U0                         (0.0 0.0 0.0);
    Ufwh                       (0.0 0.0 0.0);

    cleanFreq                  100;
    formulationType            Farassat1AFormulation;
    fixedResponseDelay         true;
    responseDelay              1e-3;
}
probes
{
    // Where to load it from
    libs ( "libsampling.so" );

    type            probes;

    // Name of the directory for probe data
    name            probes;

    // Write at same frequency as fields
    writeControl   timeStep;
    writeInterval  1;

    // Fields to be probed
    fields
    (
        p U
    );

    probeLocations
    (
        (0 -0.4 0)
        (0 -0.7 0)
        (0.2 -0.4 0)
        (-0.2 -0.4 0)
        (0 -0.4 0.2)
    (0 -0.4 -0.2)
    );
}

The simulation runs for some iterations, and then stop with the following errors:

[4] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[4] #1  Foam::sigFpe::sigHandler(int) at ??:?
[4] #2  ? in /lib/x86_64-linux-gnu/libc.so.6
[4] #3  Foam::functionObjects::fwhFormulation::findExpiredIndex(Foam::Pair<Foam::DynamicList<double, 16> > const&, double) at ??:?
[4] #4  Foam::functionObjects::fwhFormulation::clearExpiredData() at ??:?
[4] #5  Foam::functionObjects::FfowcsWilliamsHawkings::correct() at ??:?
[4] #6  Foam::functionObjects::AcousticAnalogy::write() at ??:?
[4] #7  Foam::functionObjects::FfowcsWilliamsHawkings::write() at ??:?
[4] #8  Foam::functionObjects::timeControl::write() at ??:?
[4] #9  Foam::functionObjectList::execute() at ??:?
[4] #10  Foam::Time::run() const at ??:?
[4] #11  ? in ~/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/bin/pimpleFoam
[4] #12  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
[4] #13  ? in ~/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/bin/pimpleFoam
[PAD2020L367:04399] *** Process received signal ***
[PAD2020L367:04399] Signal: Floating point exception (8)
[PAD2020L367:04399] Signal code:  (-6)
[PAD2020L367:04399] Failing at address: 0x3e80000112f
[PAD2020L367:04399] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040)[0x7fe07216e040]
[PAD2020L367:04399] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7fe07216dfb7]
[PAD2020L367:04399] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040)[0x7fe07216e040]
[PAD2020L367:04399] [ 3] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libAcoustics.so(_ZN4Foam15functionObjects14fwhFormulation16findExpiredIndexERKNS_4PairINS_11DynamicListIdLi16EEEEEd+0x9b)[0x7fe04a30b47b]
[PAD2020L367:04399] [ 4] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libAcoustics.so(_ZN4Foam15functionObjects14fwhFormulation16clearExpiredDataEv+0x14e)[0x7fe04a30b5de]
[PAD2020L367:04399] [ 5] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libAcoustics.so(_ZN4Foam15functionObjects22FfowcsWilliamsHawkings7correctEv+0x6bb)[0x7fe04a31b21b]
[PAD2020L367:04399] [ 6] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libAcoustics.so(_ZN4Foam15functionObjects15AcousticAnalogy5writeEv+0x2bd)[0x7fe04a30456d]
[PAD2020L367:04399] [ 7] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libAcoustics.so(_ZN4Foam15functionObjects22FfowcsWilliamsHawkings5writeEv+0x16)[0x7fe04a31e226]
[PAD2020L367:04399] [ 8] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam15functionObjects11timeControl5writeEv+0x5e)[0x7fe0735d876e]
[PAD2020L367:04399] [ 9] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList7executeEv+0x22e)[0x7fe0735c992e]
[PAD2020L367:04399] [10] /home/cdeora/OpenFOAM/OpenFOAM-v1912/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam4Time3runEv+0x21d)[0x7fe0735e328d]
[PAD2020L367:04399] [11] pimpleFoam(+0x293ea)[0x5581bd2b23ea]
[PAD2020L367:04399] [12] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fe072150bf7]
[PAD2020L367:04399] [13] pimpleFoam(+0x2d44a)[0x5581bd2b644a]
[PAD2020L367:04399] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 4 with PID 0 on node PAD2020L367 exited on signal 8 (Floating point exception).

Is someone already familiar with this error? I am not able to find the mistakes in the files, please help me.

Thanks in advance. Regards, Chakshu

chakshudeora commented 3 years ago

Hey,

So, the error which I mentioned above is because of the bad observer position. One of the observer was on the rotor axis of the propeller, which was giving 0 denominator. After removing that observer, libacoustics worked fine. I have yet to verify the values obtained by libacoustics.

SebbiWa commented 3 years ago

Hi SebbiWa,

Thanks for your inputs. Can you please share your updated testcase?

My email address: deorachakshu03@gmail.com

Thanks in advance. Regards.

Hi chakshudeora,

what do you want from my test case? My fwh and commonSettingsfile? My fwh surface? BC files? I am not allowed to send you my fan geometry... sry for that. Cheers,

SebbiWa

chakshudeora commented 3 years ago

Hi,

Yeah, I understand. Mainly, I need the files related to FWH settings, if it is possible.

Thanks.

chakshudeora commented 3 years ago

Hi,

Another question: Can I use libacoustics with MRF? If yes, what should be the setting for nonUniformSurfaceMotion, as it says true if surface can move with mesh. But in case of MRF, there is no actual physical rotation of mesh, but just the effect of rotation is taken into account by adding some terms.

Thanks in advance. Regards, Chakshu