Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How do I map an imported variable to a field function?

Please login with a confirmed email address before reporting spam

Hello,

I am working on aero-acoustic simulation and I have the CFD results from COMSOL. I am now trying to run the acoustic model (LNSF) and wish to add impedance condition on a particular boundary. I have set up the boundary condition for the same.

The simulation is run over a frequency range and each value of frequercy has it's unique impedance value that i've obtained from a different calculation and wish to integrate it in the simulation.

I want the 1st value of impedance to match the 1st value of frequency and so on. I've defined the frequency as a range function i.e, range(f1,n,fn). Since the impedance values are comples, I've imported them using 2 integration functions for the respective imaginary and real parts and created the a variable.

How do i ensure that the values of imepdance maps with the corresponding index of frequency? i.e, Z[f1] = f1, Z[f2] = f2..

I've tried using Z[lnsf.freq] but i get an error and doesn't seem to work.

Any help/alterenate approach would be highly appreciated. Thank you



1 Reply Last Post 20 mai 2024, 08:33 UTC−4
Mark Cops COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 months ago 20 mai 2024, 08:33 UTC−4

The files for the interpolation functions have not been imported to the model so we can't plot the functions themselves in the model without the files.

The described approach seems mostly right, but not implemented correctly. The unit for the interpolation function arguement should be Hz, not m for unit consistency. The expression for the boundary condition would be something like: Z_R(lnsf.freq)+1i * ZI(lnsf.freq) . Please note there is no need to create a freq_V range vector, and also that parenthesis () are used for function arguements, not brackets. Brackets [] are used for units.

-Mark

The files for the interpolation functions have not been imported to the model so we can't plot the functions themselves in the model without the files. The described approach seems mostly right, but not implemented correctly. The unit for the interpolation function arguement should be Hz, not m for unit consistency. The expression for the boundary condition would be something like: Z_R(lnsf.freq)+1i * ZI(lnsf.freq) . Please note there is no need to create a freq_V range vector, and also that parenthesis () are used for function arguements, not brackets. Brackets [] are used for units. -Mark

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.