Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mean value of p_Fluct is not zero in VortexShed case #95

Open
wuuyuan opened this issue Feb 23, 2023 · 5 comments
Open

The mean value of p_Fluct is not zero in VortexShed case #95

wuuyuan opened this issue Feb 23, 2023 · 5 comments

Comments

@wuuyuan
Copy link

wuuyuan commented Feb 23, 2023

hi,
I am running the VortexShed tutorial case in OpenFoam v20 and libacoustic in v20. But the p_Fluct of one observation point calculated by FWH method has non-zero mean value, which confuse me that the acoustic pressure should oscillate around the 0 rather than a non-zero value. how can I get the right value in this case?

here is the output .dat file and I used MATLAB to draw it:
image

as we can see that the point E1's p_Fluct has the non-zero mean value, it it right ?

@wuuyuan
Copy link
Author

wuuyuan commented Feb 23, 2023

here is additional comment.

I also run my own flow_past_cylinder case to obtain the p_Fluct and the same situation occurs as well.
image
as you can see, the p_Fluct at $\theta=0$ has the mean value far away from 0, but the p_Fluct at $\theta=90$ has 0 mean value, which makes the directivity shown below:
image

however, when I use "p_fluct = p_fluct - mean(p_fluct)" in post-processing, the directivity could fit in the right image :
image
image

And I am pretty sure that I set the internalField as 0 and I am using pimpleFoam solver in OpenFoam

@wuuyuan
Copy link
Author

wuuyuan commented Feb 23, 2023

here is my case set:

p file

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v2012 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
INLET
{
type zeroGradient;

}

OULET
{
	
    type            fixedValue;
    value           $internalField;
    
}

WALL
{
	type            zeroGradient;
    
}

CYLINDER
{
    type            zeroGradient;
}

FRONT
{
    type            empty;
}

BACK
{
    type            empty;
}

U file

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v2012 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0.3 0 0);

boundaryField
{
INLET
{
type fixedValue;
value uniform (0.3 0 0);//0.3
}
OULET
{
type zeroGradient;

}
WALL
{
    type		slip;
}

CYLINDER
{
	
	type		movingWallVelocity;
	value		uniform (0 0 0);
	
}

FRONT
{
    type            empty;
}

BACK
{
    type            empty;
}

fwhControl file

Farassat1A-Patch
{
type FfowcsWilliamsHawkings;
formulationType Farassat1AFormulation;
#include "commonSettings";
patches ();
interpolationScheme cell;

    surfaces
    (
            
            CYLINDER
            {
                type            patch;
                patches         (CYLINDER);
                interpolate     false;
            }
    );
    cleanFreq       100;
    fixedResponseDelay true;
    responseDelay   0.01;
    nonUniformSurfaceMotion true;
    Ufwh    (.0 .0 .0);
    U0      (.0 .0 .0);

}

commonSetting file

libs ("libAcoustics.so");

    log             true;
    
    probeFrequency  1;
    
    timeStart       200;
    
    timeEnd         1000;
    
    writeFft        false;
    
    c0              1500;
    
    pName           p;

    pInf            0;//for pisoFoam
    
    rhoName         rho;
    
    rho             rhoInf;
    
    rhoInf          1000;
    
    CofR (0 0 0);
    
    observers
    {
   
        // r = 50
        N3_1
        {
            position (50 0 1);
            pRef 0.000020;
            fftFreq 1024;
        }

...

controlDict file

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v2012 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application pimpleFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 1000;

deltaT 5e-4;

writeControl adjustableRunTime;

writeInterval 0.1;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

adjustTimeStep yes;

maxCo 0.9;

functions
{
#include "fwhControl"
}

@unicfdlab
Copy link
Owner

The E1 point is located in near field and is needed to compare pressure with direct calculation. If you are using the pimple or piso algorithm you need to set pInf equal to 0. This tutorial was created to show how to use and configure libacoustics for similar problems. Library validation cases can be found in the Tests folder. You may also be interested in the answers to these questions:
#75 (comment)
#78 (comment)

Regards,
AE

@wuuyuan
Copy link
Author

wuuyuan commented Feb 28, 2023

The E1 point is located in near field and is needed to compare pressure with direct calculation. If you are using the pimple or piso algorithm you need to set pInf equal to 0. This tutorial was created to show how to use and configure libacoustics for similar problems. Library validation cases can be found in the Tests folder. You may also be interested in the answers to these questions: #75 (comment) #78 (comment)

Regards, AE

thank you for replying,
however, in the case that I have tried above, I have already set ping equal to 0, but the mean value of p_fluct at E1 is not equal to 0, what else can I do in the setting file?

and here is my setting of pInf in common setting:
image

@unicfdlab
Copy link
Owner

unicfdlab commented Mar 3, 2023

The library calculates the total pressure (p+p'). The static pressure is non zero because the FWH surface is located close to the body. If you want to determine SPL you need to determine the root mean square (RMS) pressure.

Regards,
AE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants