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)

guanjiang.chen January 4, 2022 17:36

Quote:

Originally Posted by zhangmu (Post 819600)
Dear Guanjiang:

I am trying installing libacoustic in openfoam7 in Ubuntu, but after running ./wmakeAll.sh
it shows that

dell-123@Precision-7920-Tower:~/Downloads/libAcoustics-master/OpenFOAM-4.1$ ./wmakeAll.sh wmake libso . make: *** No rule to make target '/opt/openfoam7/src/OpenFOAM/lnInclude/Xfer.H', needed by 'Make/linux64GccDPInt32Opt/SoundObserver/SoundObserver.C.dep'. Stop. make: *** No rule to make target '/opt/openfoam7/src/OpenFOAM/lnInclude/Xfer.H', needed by 'Make/linux64GccDPInt32Opt/FileInterface/FileInterface.C.dep'. Stop.

After checking the directory /opt/openfoam7/src/OpenFOAM/lnInclude/, there is no file named Xfer.H, how do you solve this problem in of6?

Best regards
Mu
04.01.2022

Hi,

I made some changes in \Make\file and \Make\options, But I am not sure is that works in your case.

file is changed to :

SoundObserver/SoundObserver.C
FoamFourierAnalysis/FoamFftwDriver.C

/* Acoustic analogies */
analogies/AcousticAnalogy/AcousticAnalogy.C
analogies/Curle/Curle.C
analogies/FfowcsWilliamsHawkings/fwhFormulation.C
analogies/FfowcsWilliamsHawkings/Farassat1AFormulation.C
analogies/FfowcsWilliamsHawkings/GTFormulation.C
analogies/FfowcsWilliamsHawkings/FfowcsWilliamsHawkings.C

/* Coupling with BEM and FFT */

samplingBEM/sampledSurface/writers/gmsh/gmshSurfaceWriter.C
samplingBEM/soundPressureSampler/soundPressureSampler.C

LIB = $(FOAM_USER_LIBBIN)/libAcoustics

and options is changed to :
fftw_root=$(FOAM_USER_LIBBIN)/fftw-3.3.3

EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/functionObjects/forces/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(fftw_root)/include

LIB_LIBS = \
-lcompressibleTransportModels \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lcompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lfileFormats \
-lfiniteVolume \
-lmeshTools \
-lforces \
-lsurfMesh \
-L$(fftw_root)/lib \
-lfftw3

zhangmu January 4, 2022 17:56

Quote:

Originally Posted by guanjiang.chen (Post 819601)
Hi,

I made some changes in \Make\file and \Make\options, But I am not sure is that works in your case.

file is changed to :

SoundObserver/SoundObserver.C
FoamFourierAnalysis/FoamFftwDriver.C

/* Acoustic analogies */
analogies/AcousticAnalogy/AcousticAnalogy.C
analogies/Curle/Curle.C
analogies/FfowcsWilliamsHawkings/fwhFormulation.C
analogies/FfowcsWilliamsHawkings/Farassat1AFormulation.C
analogies/FfowcsWilliamsHawkings/GTFormulation.C
analogies/FfowcsWilliamsHawkings/FfowcsWilliamsHawkings.C

/* Coupling with BEM and FFT */

samplingBEM/sampledSurface/writers/gmsh/gmshSurfaceWriter.C
samplingBEM/soundPressureSampler/soundPressureSampler.C

LIB = $(FOAM_USER_LIBBIN)/libAcoustics

and options is changed to :
fftw_root=$(FOAM_USER_LIBBIN)/fftw-3.3.3

EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/functionObjects/forces/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(fftw_root)/include

LIB_LIBS = \
-lcompressibleTransportModels \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lcompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lfileFormats \
-lfiniteVolume \
-lmeshTools \
-lforces \
-lsurfMesh \
-L$(fftw_root)/lib \
-lfftw3

This is the original files in libAcoustics-master/OpenFOAM-4.1/lib/Make
I checked one by one but they are the same with your post, could you please tell me where did you modified?

file:
SoundObserver/SoundObserver.C
FoamFourierAnalysis/FoamFftwDriver.C

/* Acoustic analogies */
analogies/AcousticAnalogy/AcousticAnalogy.C
analogies/Curle/Curle.C
analogies/FfowcsWilliamsHawkings/fwhFormulation.C
analogies/FfowcsWilliamsHawkings/Farassat1AFormulation.C
analogies/FfowcsWilliamsHawkings/GTFormulation.C
analogies/FfowcsWilliamsHawkings/FfowcsWilliamsHawkings.C

/* Coupling with BEM and FFT */

samplingBEM/sampledSurface/writers/gmsh/gmshSurfaceWriter.C
samplingBEM/soundPressureSampler/soundPressureSampler.C

LIB = $(FOAM_USER_LIBBIN)/libAcoustics

options:
fftw_root=$(FOAM_USER_LIBBIN)/fftw-3.3.3

EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/functionObjects/forces/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(fftw_root)/include

LIB_LIBS = \
-lcompressibleTransportModels \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lcompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lfileFormats \
-lfiniteVolume \
-lmeshTools \
-lforces \
-lsurfMesh \
-L$(fftw_root)/lib \
-lfftw3

guanjiang.chen January 4, 2022 18:14

1 Attachment(s)
Sorry, I compiled version 2.3 and version 4 to Openfoam 6, and I forget which one I changed. I have attached them. If they don't work, maybe you can try to check your environment. I couldn't do this on a computer because it didn't have fftw-3.

Voulet May 1, 2022 08:44

the Xfer method have been removed by this commit :

https://github.com/OpenFOAM/OpenFOAM...1c806ff2dd24ea


faces.xfer() is now move(faces)

hewei August 15, 2022 13:09

Quote:

Originally Posted by guanjiang.chen (Post 798311)
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

Hello guanjian,

I run the example of cylinder case in version v2112 , in the acousticData folder, there is only time, pressure fluctuation data on the overserved points. There is no Freq, and spl. Could you help me to figure out what is the problem? thanks!

hewei

guanjiang.chen November 26, 2022 17:38

Hi,

This may be a modification of the new version. As you already have time and pressure fluctuations. You can calculate spl or PSD using matlab.
https://www.mathworks.com/matlabcent...vel-calculator

Regards,
Guanjiang

hewei November 28, 2022 06:13

Hi Guanjiang,

I solved it by activating the "writeFfft"in commonSettings file. Either I can calculate spl equation using the p' value. Thank you very much!
regards,
W.
Quote:

Originally Posted by guanjiang.chen (Post 840077)
Hi,

This may be a modification of the new version. As you already have time and pressure fluctuations. You can calculate spl or PSD using matlab.
https://www.mathworks.com/matlabcent...vel-calculator

Regards,
Guanjiang


adorean September 29, 2023 03:50

compile error libAcoustics
 
Hello,

I want to compile libAcoustics-digitef-dev-2112 on OpenFOAM-v2112.
I get error /usr/bin/ld cannot find -lrandomProcesses.

Can someone please help me out?

Thank you!

Ervin


All times are GMT -4. The time now is 07:49.