Complicate Noise Source Input in Acoustic Analysis

Numerical methods and mathematical models of Elmer
JamesMarine
Posts: 28
Joined: 10 Jul 2019, 17:12
Antispam: Yes

Complicate Noise Source Input in Acoustic Analysis

Post by JamesMarine »

Is that possible to include relevant complicate noise sources in acoustic analysises in Elemer? For example, noise sources calculated from pressure field or monopole source / Dipole source / Quadrupole source?

Is there any examples on this?
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Complicate Noise Source Input in Acoustic Analysis

Post by raback »

Hi

Yes, the Helmholtz solver looks for source terms named "Pressure Source 1" and "... 2" in Body Force section. Just create your own small user functions for them.

Do you have some functional form or would you rather associate the source with discrete nodes?

-Peter
JamesMarine
Posts: 28
Joined: 10 Jul 2019, 17:12
Antispam: Yes

Re: Complicate Noise Source Input in Acoustic Analysis

Post by JamesMarine »

Hi Peter, many thanks for the kind response!

I am thinking to associate the source item with discrete nodes. Do you have any kind suggestions on how this can be done?
raback wrote: 27 Jun 2020, 02:24 Hi

Yes, the Helmholtz solver looks for source terms named "Pressure Source 1" and "... 2" in Body Force section. Just create your own small user functions for them.

Do you have some functional form or would you rather associate the source with discrete nodes?

-Peter
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Complicate Noise Source Input in Acoustic Analysis

Post by raback »

Hi

You could use the "Body Force" or "Boundary Condition" named "Pressure 1 Load" and "Pressure 2 Load". I'm a little unsure whether this works with "Target Coordinates" keyword but that would be simplest way forward. Also writing a UDF that locates the 1,2,3,... nodes while 1st visited and then applies nonzero Load to these would be possible. That would require ~10 lines of code.

-Peter
JamesMarine
Posts: 28
Joined: 10 Jul 2019, 17:12
Antispam: Yes

Re: Complicate Noise Source Input in Acoustic Analysis

Post by JamesMarine »

Many thanks for the kind help, Peter. By meaning UDF, do you mean that writing a .f90 file and compile it as an solver? Or just write some functions within the .sif file? What i am trying to do is to assign differnt pressure wave values on differnts nodes.

Very sorry that I am a starter of UDF and is not familar witht this yet. but i am very willing to try this. Do you have any existing examples that i can refer to?
raback wrote: 28 Jun 2020, 01:10 Hi

You could use the "Body Force" or "Boundary Condition" named "Pressure 1 Load" and "Pressure 2 Load". I'm a little unsure whether this works with "Target Coordinates" keyword but that would be simplest way forward. Also writing a UDF that locates the 1,2,3,... nodes while 1st visited and then applies nonzero Load to these would be possible. That would require ~10 lines of code.

-Peter
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Complicate Noise Source Input in Acoustic Analysis

Post by kevinarden »

I think he means page 94 of the Elmer solver manual which means writing and compiling an F90 user function as opposed to a solver.
JamesMarine
Posts: 28
Joined: 10 Jul 2019, 17:12
Antispam: Yes

Re: Complicate Noise Source Input in Acoustic Analysis

Post by JamesMarine »

I noted in the models manual it mentioned the use of pressure body forces is rather seldom, is there any differences between body forces or boundary conditions? In previous simulations, i just used boundary conditions such as wave flux or pressure etc? I now already have noirse source in terms of dBL on a surface (varying from location to location), shall i use boundary conditions instead of body forces?

I am trying to use a defined function to read external file -> get the pressure source on each nodes and then apply it on the discrete nodes using UDF, do you think i am on the right track?
raback wrote: 28 Jun 2020, 01:10 Hi

You could use the "Body Force" or "Boundary Condition" named "Pressure 1 Load" and "Pressure 2 Load". I'm a little unsure whether this works with "Target Coordinates" keyword but that would be simplest way forward. Also writing a UDF that locates the 1,2,3,... nodes while 1st visited and then applies nonzero Load to these would be possible. That would require ~10 lines of code.

-Peter
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Complicate Noise Source Input in Acoustic Analysis

Post by raback »

Hi

The difference is that in PDEs the "bofy force" is typically a source term integrated over volume and the "boundary condition" often comes from the weak formulation and is integrated over the boundary area.

When using nodal loads an discrete level these are more alike.

-Peter
JamesMarine
Posts: 28
Joined: 10 Jul 2019, 17:12
Antispam: Yes

Re: Complicate Noise Source Input in Acoustic Analysis

Post by JamesMarine »

Thanks to your kind help, i wrote the attached example user functions and try to assign different acoustic pressure loads to node points. I am sorry but i have below additional questions:

1. It seems body force user functions is relatively simple, but i assume body forces can only be applied to a body install of a boundary surface, for my case, the acoustic pressure are extracted from CFD on a surface. So i assume body force can not be used in this case, is that correct?

2. I am trying to use the below boundary conditions:

Boundary Condition 12
Target Boundaries(1) = 1 3 6 7
Name = "Acoustic Pressure from CFD"
Pressure Wave 2 = 0
Pressure Wave 1 = 23
End

In this condition, the pressure wave have two values (Pressure Wave 1 & Pressure Wave 2), how can this be applied through the user function? In the attached file, it seems only one value (load) can be returned from user function.

3. When using user function, is that correct the boundary condition mentioned in item 2 should be changed to:

Boundary Condition 2
Target Boundaries(1) = 1 3 6 7
Name = "Acoustic Pressure from CFD"
Boundary Type = String "Given Temperature"
External Load
Real Procedure "AcousticPressure.exe" "AcousticPressure"
End

4. If possible, it would be appreciated if you could kindly help to quick check the attached functions and see whether there is any obvious errors.

Many thanks for the great help from the forum and very sorry that i am still a beginner to use the user function.
raback wrote: 30 Jun 2020, 01:40 Hi

The difference is that in PDEs the "bofy force" is typically a source term integrated over volume and the "boundary condition" often comes from the weak formulation and is integrated over the boundary area.

When using nodal loads an discrete level these are more alike.

-Peter
Last edited by JamesMarine on 13 Jul 2020, 06:06, edited 1 time in total.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Complicate Noise Source Input in Acoustic Analysis

Post by raback »

Hi

Before going to analyze the code I would take a step back. In what format is your data at the boundary available? Is it on the same nodes as the boundary condition uses, or are the meshes nonconforming? Do you maybe have the luxury of knowing the nodal indexes?

I would guess that you have something like

Code: Select all

x y z p_re p_im
...
You should first read all the data and create mapping to this tabulated data by some search algo.

-Peter
Post Reply