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.

Frequency-dependent meshing with parametric sweep

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

I found this nice model of how to do frequency-dependent meshing with parametric sweep in the knwoledge base:

www.comsol.com/support/knowledgebase/1103/

What I am having trouble with is plotting a single point graph with all the calculated frequencies. Only the frequencies for one parameter value is available at a time. In this example it would be nice to plot the entire range from 100-1500 Hz, instead of only 100-500Hz OR 600-1000Hz OR 1100-1500Hz.

Is it possible to do this?

If not, it seems to be a drawback of using a parametric sweep. It would be nice if the model would remesh itself if the maximum element size was defined as: 340/freq/6



10 Replies Last Post Jul 29, 2016, 3:01 p.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 24, 2011, 8:35 a.m. EST
Hi Tom

In v4.1 if you use an "external" parametric sweep (not a solver continuation) you can get the model to remesh (or adapt the geometry if needed) based on a mesh dependence i.e. on frequency.

There is an example somewhere, (or was i at one of the COMSOL conference mini-courses ?)

--
Good luck
Ivar
Hi Tom In v4.1 if you use an "external" parametric sweep (not a solver continuation) you can get the model to remesh (or adapt the geometry if needed) based on a mesh dependence i.e. on frequency. There is an example somewhere, (or was i at one of the COMSOL conference mini-courses ?) -- Good luck Ivar

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 24, 2011, 11:43 a.m. EST

Thanks for your input, Ivar.

I don't know if you looked at the example-model in the link, but it is using a Frequency Domain study and already remeshes with increasing frequency. The problem is plotting for example SPL as a function of frequency over the entire range. I don't see how your suggestion helps this issue. Do you mean that changing to a Stationary study will help?

--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
Thanks for your input, Ivar. I don't know if you looked at the example-model in the link, but it is using a Frequency Domain study and already remeshes with increasing frequency. The problem is plotting for example SPL as a function of frequency over the entire range. I don't see how your suggestion helps this issue. Do you mean that changing to a Stationary study will help? -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 24, 2011, 6:04 p.m. EST
Hi

I believe the trick used in the example (indeed I thought of another example with only an external parametrical sweep, somewhere in the RF, but its the same story) is that the external parametrical sweep not only remeshes, (and updates the geoemtry if required) but ALSO restarts the solver with "0" as initial conditions.

While the parametrical sweep in the solver continuatiuon node is running from previous calculated initial conditions as initial state for each internal parametrical sweep.

So you can fully drop the internal sweep and put everything on the external one, but the solver will fight longer as it starts each time from the original initial conditions

--
Good luck
Ivar
Hi I believe the trick used in the example (indeed I thought of another example with only an external parametrical sweep, somewhere in the RF, but its the same story) is that the external parametrical sweep not only remeshes, (and updates the geoemtry if required) but ALSO restarts the solver with "0" as initial conditions. While the parametrical sweep in the solver continuatiuon node is running from previous calculated initial conditions as initial state for each internal parametrical sweep. So you can fully drop the internal sweep and put everything on the external one, but the solver will fight longer as it starts each time from the original initial conditions -- Good luck Ivar

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 25, 2011, 6:30 a.m. EST

Your explanation sounds logical, but I cannot quite understand how to translate it to the model. I am not sure what you mean with. Internal or external parametric sweeps. Do you mean that the "Parametric Sweep" as the external and the "Frequencies" under study settings of the "Frequency Domain" as the internal sweep?

I am also not sure of what you mean by the "solver continuatiuon node".


Thanks,
Tom A.
--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
Your explanation sounds logical, but I cannot quite understand how to translate it to the model. I am not sure what you mean with. Internal or external parametric sweeps. Do you mean that the "Parametric Sweep" as the external and the "Frequencies" under study settings of the "Frequency Domain" as the internal sweep? I am also not sure of what you mean by the "solver continuatiuon node". Thanks, Tom A. -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 25, 2011, 11:06 a.m. EST
Hi

Indeed, for me what I call an "external parametric sweep" is the "Study node "Parametric Sweep", I call it external while it loops around the full node tree from first to last node (including geometry, mesh, and considering the initial conditions as fresh from (usually default" "zero" initial state

The "internal sweep" is in the "Stationary Extension - Continuation sweep" or a "Time Dependent - Times = range()" or a "Frequency Domain - Frequencies = range()" ... This "sweep" does normally not reconsider the geometry, nor the mesh and restarts (for the initial conditions) the solver at step 2 and on from the previous step last calculated conditions

Hope I'm clearer now ;)

--
Good luck
Ivar
Hi Indeed, for me what I call an "external parametric sweep" is the "Study node "Parametric Sweep", I call it external while it loops around the full node tree from first to last node (including geometry, mesh, and considering the initial conditions as fresh from (usually default" "zero" initial state The "internal sweep" is in the "Stationary Extension - Continuation sweep" or a "Time Dependent - Times = range()" or a "Frequency Domain - Frequencies = range()" ... This "sweep" does normally not reconsider the geometry, nor the mesh and restarts (for the initial conditions) the solver at step 2 and on from the previous step last calculated conditions Hope I'm clearer now ;) -- Good luck Ivar

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 26, 2011, 5:48 a.m. EST

Thanks for clarifying that, Ivar.

Bertil Nistad at COMSOL support sent me this model which I have modified slightly. It does what I wanted, and I learned something. :)


--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
Thanks for clarifying that, Ivar. Bertil Nistad at COMSOL support sent me this model which I have modified slightly. It does what I wanted, and I learned something. :) -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 31, 2011, 6:07 p.m. EDT

Bertil Nistad at COMSOL support sent me this model which I have modified slightly. It does what I wanted, and I learned something. :)


Your attached file is for Comsol 4.1

Could you describe how it is set up?

Thanks
TT
[QUOTE] Bertil Nistad at COMSOL support sent me this model which I have modified slightly. It does what I wanted, and I learned something. :) [/QUOTE] Your attached file is for Comsol 4.1 Could you describe how it is set up? Thanks TT

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 4, 2011, 4:02 a.m. EDT
-"freq" is set up as a global parameter.
-A parametric sweep is added with "freq" as the parameter and the wanted frequencies as parameter values.

The trick is to use a stationary study instead of a frequency domain study.

I hope this helps!
--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
-"freq" is set up as a global parameter. -A parametric sweep is added with "freq" as the parameter and the wanted frequencies as parameter values. The trick is to use a stationary study instead of a frequency domain study. I hope this helps! -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3

Tom Alexander Solgård

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 4, 2011, 4:04 a.m. EDT
And of course that the Maximum Element Size of the mesh is set to:

343/freq/5

(speed of sound/frequency variable/elements per wavelength)
--
MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics.
no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3
And of course that the Maximum Element Size of the mesh is set to: 343/freq/5 (speed of sound/frequency variable/elements per wavelength) -- MSc. Acoustics using COMSOL for modelling loudspeakers and room acoustics. http://no.linkedin.com/pub/tom-alexander-solg%C3%A5rd/27/600/1b3

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jul 29, 2016, 3:01 p.m. EDT
I found this article via Google as I would like to have some information about frequency-dependent meshing with the parametric sweep.
Unfortunately the link in the first post, to knowledge base article 1103, is not working anymore.

Maybe is someone ably to help me?
My model contains a Frequency Domain study over a frequency range; range(fMin,fInterval,fMax)
A Parametric Sweep is added which sweeps the number of elements per wavelength. The parameter defining the maximum mesh size is a function of the number of elements per wavelength.
Is it possible to change a setting which causes the model to remesh the geometry for every frequency it sweeps through, as defined in the Frequency Domain study step?
I found this article via Google as I would like to have some information about frequency-dependent meshing with the parametric sweep. Unfortunately the link in the first post, to knowledge base article 1103, is not working anymore. Maybe is someone ably to help me? My model contains a Frequency Domain study over a frequency range; range(fMin,fInterval,fMax) A Parametric Sweep is added which sweeps the number of elements per wavelength. The parameter defining the maximum mesh size is a function of the number of elements per wavelength. Is it possible to change a setting which causes the model to remesh the geometry for every frequency it sweeps through, as defined in the Frequency Domain study step?

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.