CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   how to use acoustic lib in openfoam (https://www.cfd-online.com/Forums/openfoam-solving/224260-how-use-acoustic-lib-openfoam.html)

zeinelserfy February 11, 2020 20:54

how to use acoustic lib in openfoam
 
Hi all,

Have anyone used acoustic library developed by unicfdlab?
http://github.com/unicfdlab/libAcoustics

I want to use it for predicting the far-field noise for flow over aerofoil.I have also found the presentation for some tutorials for using it named ofwAcoustics.pdf
https://github.com/unicfdlab/Trainin...ustics-OFv1812

can anyone give some help concerning how to used and it capabilities?

HPE February 11, 2020 23:12

i would dive into trying to use it in some way, and ask more specific questions along the way for the problems that appear.

zeinelserfy February 12, 2020 18:19

Quote:

Originally Posted by HPE (Post 757808)
i would dive into trying to use it in some way, and ask more specific questions along the way for the problems that appear.

have to use it before?I am afraid of spending time on it without being able to use it.

is it reliable tool to use?

HPE February 13, 2020 01:45

never used it.

mkraposhin May 18, 2020 02:45

Quote:

Originally Posted by zeinelserfy (Post 757802)
Hi all,

Have anyone used acoustic library developed by unicfdlab?
http://github.com/unicfdlab/libAcoustics

I want to use it for predicting the far-field noise for flow over aerofoil.I have also found the presentation for some tutorials for using it named ofwAcoustics.pdf
https://github.com/unicfdlab/Trainin...ustics-OFv1812

can anyone give some help concerning how to used and it capabilities?

The library libAcoustics was developed to simulate far-field acoustics using Curle and FWH analogies with integral approach. The library was verified for monopole, dipole source and it was validated for multiple free jet flows. I would recommend you to use latest - OF1912 version. If you find bugs, please report them to issues on GitHub.

HPE May 18, 2020 16:41

sorry - mistaken - thus deleted. Great work, thank you!

Tj_m3 October 7, 2020 18:51

Quote:

Originally Posted by mkraposhin (Post 770903)
The library libAcoustics was developed to simulate far-field acoustics using Curle and FWH analogies with integral approach. The library was verified for monopole, dipole source and it was validated for multiple free jet flows. I would recommend you to use latest - OF1912 version. If you find bugs, please report them to issues on GitHub.


Hi Matvey,

Many thanks for making this library available! I am trying to use it to compute airfoil noise for a low mach number flow, using the FWH analogy. I am running into some trouble using the library with an incompressible solver (pimplefoam).

The error occurs when reading the velocity field:
"request for volScalarField rho from objectRegistry region0 failed"

I have set a uniform volScalarField "rho" in the "0" folder, but it doesn't appear to be read by the library. I was wondering if you had any advice on using libAcoustics.so with an incompressible solver.

thank you!
Tommy Malkus

mkraposhin October 8, 2020 05:28

Hello, when you use pimpleFoam, you have to specify value of density in the dictionary where other properties of the acoustic analogy are given:


Code:

rho rhoInf; //indicates that you must use constant value for density

rhoInf 1; //value of density

Placing "rho" in the 0/ directory does nothing, because this field is not created in pimpleFoam solver.

Tj_m3 October 9, 2020 14:00

Quote:

Originally Posted by mkraposhin (Post 784757)
Hello, when you use pimpleFoam, you have to specify value of density in the dictionary where other properties of the acoustic analogy are given:


Code:

rho rhoInf; //indicates that you must use constant value for density

rhoInf 1; //value of density

Placing "rho" in the 0/ directory does nothing, because this field is not created in pimpleFoam solver.

Got it! thanks a lot for the quick reply

-Tommy

Tj_m3 November 9, 2020 15:00

Quote:

Originally Posted by mkraposhin (Post 784757)
Hello, when you use pimpleFoam, you have to specify value of density in the dictionary where other properties of the acoustic analogy are given:


Code:

rho rhoInf; //indicates that you must use constant value for density

rhoInf 1; //value of density

Placing "rho" in the 0/ directory does nothing, because this field is not created in pimpleFoam solver.

Hi Matvey,

I had a few more quick questions if you don't mind:

1) Is there a way to run libAcoustics after a finished run, i.e. if the pressure on the FWH surface has been stored. I am running relatively large LES cases and was hoping I could run the FWH on the stored data.

2) How does the value of dRef scale pFluct for a 3D simulation/what should this be set at for a 3D sim? It seems like it is scaling the output of as 1/dRef^2.

I have dRef=1 but am off by a scale factor when validating against an experiment with a different span length. My SPL spectrum is suspiciously off by a factor of 10*log(span), but this could very well be another error in the scaling somewhere which I am chasing down


thanks again
Tommy

mkraposhin November 10, 2020 09:41

Quote:

Originally Posted by Tj_m3 (Post 787263)
Hi Matvey,

I had a few more quick questions if you don't mind:

1) Is there a way to run libAcoustics after a finished run, i.e. if the pressure on the FWH surface has been stored. I am running relatively large LES cases and was hoping I could run the FWH on the stored data.

2) How does the value of dRef scale pFluct for a 3D simulation/what should this be set at for a 3D sim? It seems like it is scaling the output of as 1/dRef^2.

I have dRef=1 but am off by a scale factor when validating against an experiment with a different span length. My SPL spectrum is suspiciously off by a factor of 10*log(span), but this could very well be another error in the scaling somewhere which I am chasing down


thanks again
Tommy


Hi,



1) we have this in plans, we still don't have enough time for the implementation
2) dRef can be used only for 2D simulations -- it is and attempt to normalize results, obtained in 2D OpenFOAM simulations by the depth in empty direction. For 3D it must -1.

guanjiang.chen January 27, 2021 12:26

Quote:

Originally Posted by zeinelserfy (Post 757802)
Hi all,

Have anyone used acoustic library developed by unicfdlab?
http://github.com/unicfdlab/libAcoustics

I want to use it for predicting the far-field noise for flow over aerofoil.I have also found the presentation for some tutorials for using it named ofwAcoustics.pdf
https://github.com/unicfdlab/Trainin...ustics-OFv1812

can anyone give some help concerning how to used and it capabilities?

just compile it and run the tutorials. I run the 3d monopole in openfoam 2, and the dipole3D in openfoam 4.

guanjiang.chen February 21, 2021 18:35

Quote:

Originally Posted by mkraposhin (Post 787330)
Hi,



1) we have this in plans, we still don't have enough time for the implementation
2) dRef can be used only for 2D simulations -- it is and attempt to normalize results, obtained in 2D OpenFOAM simulations by the depth in empty direction. For 3D it must -1.

Hi Kraposhin,

I have a question. How do you produce triSurface for the FWH calculation? Which software is chosen? I use UG NX, but the trisurface is too coarse, having only few triangle surfaces.

Thanks,
Guanjiang

thanat March 2, 2021 15:33

Could anyone pls provide me a case of turbulence and laminar flow
 
Could anyone provide me a tutorial cases for turbulence and laminar flow through a rigid surface integrate with acoustic library. I use openFoam v2012. I spent so much time with it but still not used to it yet. So, I hope anyone can provide me some cases for me to learn about it more easier.
Thanks in advance

thanat March 3, 2021 09:34

--> FOAM FATAL ERROR: (openfoam-2012)
Could not find rho:rho

From void Foam::functionObjects::forces::initialise()
in file forces/forces.C at line 235.

FOAM exiting






I have this issue when i used acoustic lib
Do you have any ideas about it `?

guanjiang.chen March 3, 2021 13:27

Quote:

Originally Posted by thanat (Post 797770)
--> FOAM FATAL ERROR: (openfoam-2012)
Could not find rho:rho

From void Foam::functionObjects::forces::initialise()
in file forces/forces.C at line 235.

FOAM exiting






I have this issue when i used acoustic lib
Do you have any ideas about it `?

rho rhoInf; //indicates that you must use constant value for density

rhoInf 1; //value of density

I think this can help. delete your rho in 0 and constant folder.

guanjiang.chen March 8, 2021 18:46

Flow past a cylinder
 
Hi,

I am trying to use acoustic analogy methods to a LES case of flow past a cylinder. I have tried the curle and Farassate1A methods. The observers are set around the cylinder with a distance of 100D from the origin. For the results of curle, the frequency of the tonal peak seems right, but the results of farassat are totally different. I think there may be something wrong in my fwh set. What I think may have problems are interpolationScheme, nonUniformSurfaceMotion, responseDelay. Maybe my control surface is not good. Could anyone give me some suggestions?

[IMG]D:\case\transfer\openfoamonline\libacoustic\comput ational domain and control surface.tif[/IMG]

[IMG]D:\case\transfer\openfoamonline\libacoustic\curle vs farassat.tif[/IMG]

Code:

CurleAnalogy1
    {
        functionObjectLibs ("libAcoustics.so");
       
        type                Curle;
       
        log                true;
       
        order                second;

        probeFrequency        2;
       
        patches ("CYLINDER");
       
        interpolationScheme  cell;
       
        surfaces
        (                                                                   
                CYLINDER
                {
                    type            patch;
                    patches        ("CYLINDER");
                    interpolate    false;
                }
        );
       
        timeStart        1.4;
       
        timeEnd                2;
       
        c0                340;
       
        dRef                -1;

        pInf                0.0;
       
        pName                p;
       
        rho                rhoInf;
       
        rhoInf                1.205;
       
        CofR (0 0 0);
       
        cleanFreq 100;

        writeFft true;

        observers
        {
                R-1
                {
                        position        (-2 0 0);
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
               
                R-2
                {
                        position        ( -1.931852e+00  5.176381e-01  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-3
                {
                        position        ( -1.732051e+00  1  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-4
                {
                        position        ( -1.414214e+00  1.414214e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-5
                {
                        position        ( -1  1.732051e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-6
                {
                        position        ( -5.176381e-01  1.931852e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-7
                {
                        position        ( -1.225150e-16  2  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-8
                {
                        position        ( 5.176381e-01  1.931852e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-9
                {
                        position        ( 1  1.732051e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-10
                {
                        position        ( 1.414214e+00  1.414214e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-11
                {
                        position        ( 1.732051e+00  1  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-12
                {
                        position        ( 1.931852e+00  5.176381e-01  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-13
                {
                        position        ( 2  2.450300e-16  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
        }
               
               
        }

       
    }

Code:

smallLEStrisurface_farassat
{       
        type                FfowcsWilliamsHawkings;

        functionObjectLibs ("libAcoustics.so");       

        log                true;
       
        probeFrequency        2;
       
        timeStart        1.4;//0.0001;
       
        timeEnd                2;
       
        c0                340;
       
        dRef                -1; //a coefficients for 2D case; set -1 for 3D cases
       
        pName                p;
       
        pInf                0;

        rho                rhoInf;
       
        rhoInf                1.205;
       
        CofR (0 0 0);
       
        writeFft        true;
       
        patches ("CYLINDER");

        interpolationScheme cell;//////
       
        surfaces
        (
                CYLINDER1
                {
                    type            sampledTriSurfaceMesh;
                    surface        smallLES_trisurface_refine2.stl;
                    source          cells;
                    interpolate    false;
                }
        );
       
        nonUniformSurfaceMotion false;////////
        U0                (7.572614108 0 0);
        Ufwh                (.0 .0 .0);
       
        cleanFreq 100;
        formulationType Farassat1AFormulation;
        fixedResponseDelay true;
        responseDelay  1e-3;/////////

        observers
        {
                R-1
                {
                        position        (-2 0 0);
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
               
                R-2
                {
                        position        ( -1.931852e+00  5.176381e-01  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-3
                {
                        position        ( -1.732051e+00  1  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-4
                {
                        position        ( -1.414214e+00  1.414214e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-5
                {
                        position        ( -1  1.732051e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-6
                {
                        position        ( -5.176381e-01  1.931852e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-7
                {
                        position        ( -1.225150e-16  2  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-8
                {
                        position        ( 5.176381e-01  1.931852e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-9
                {
                        position        ( 1  1.732051e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-10
                {
                        position        ( 1.414214e+00  1.414214e+00  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-11
                {
                        position        ( 1.732051e+00  1  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-12
                {
                        position        ( 1.931852e+00  5.176381e-01  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
                R-13
                {
                        position        ( 2  2.450300e-16  0 );
                        pRef                2.0e-5;
                        fftFreq                1024;
                }
        }

}


guanjiang.chen March 8, 2021 18:56

4 Attachment(s)
These are attached files for my former message.

thanat March 9, 2021 04:49

Can you tell me how to plot SPL with the strouhal number. Is there any essential functions, which needs to declare in the system file ?. Also can i change the SPL data into frequency domain, If i can then which function need to be used in openfoam

guanjiang.chen March 9, 2021 05:22

Quote:

Originally Posted by thanat (Post 798309)
Can you tell me how to plot SPL with the strouhal number. Is there any essential functions, which needs to declare in the system file ?. Also can i change the SPL data into frequency domain, If i can then which function need to be used in openfoam

Hi thanat,

After simulation finished, you can find the result in the acousticData folder. For each observer, there is a file which has Freq, p', spl. just drawing it is OK. What makes me confused is that the spl in the file shows a symmetry distribution in the frequency range.

Regards,
Guanjiang


All times are GMT -4. The time now is 23:02.