Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Adaptive mesh refinemend during parametric sweep

Please login with a confirmed email address before reporting spam

Hi,

I want to run a parametric sweep with a model, where I first solve for u v p with the swept variable being the inlet volumetric flow rate, then solve for c, where I use adaptive mesh refinement.

The problem is, that after the first parameter, the strongly refined mesh is used in the next parameter calculation and not the initial mesh.

How can I tell comsol from the GUI to start with equal meshes (the intial low resolution mesh) for each parameter but do mesh refinement steps during solving.

Regards

Matthias

4 Replies Last Post Mar 24, 2011, 3:10 a.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 Jan 11, 2011, 11:51 a.m. EST
Hi

in 3.5 (comapred to v4) you have less control on your meshing, I'm not sure how to "restart" the meshing for the parametric sweep anylonger in 3.5a, passing via matlab is certainly possible

--
Good luck
Ivar
Hi in 3.5 (comapred to v4) you have less control on your meshing, I'm not sure how to "restart" the meshing for the parametric sweep anylonger in 3.5a, passing via matlab is certainly possible -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 11, 2011, 3:16 p.m. EST
Hi Ivar,

thanks for your response.

I managed to get a solution by using Matlab and a loop, where the swept parameter is changed by multiplication with the loop counter "i" and the mesh is reset at each loop run.

Still, I have a question concerning the call of parameters which could be used as a list, e.g. in a text file.

Is it possible to read single defined values from such a textfile and use them in a loop in the comsol m-file, e.g. entry at line "i" in the text file according to the "i" given in the loop counter with "for i = 1:x"?

The intention is to use arbitrary sets of values, which can not be expressed by a function or series.

I only know from the manual how to call functions from text files with "fem.functions{2}.fileindex = {i,...};" but can this be applied in my case?

I feel, there should be an elegant solution to this, which I might not be able so see.

(have to try this out though)


Regards

Matthias
Hi Ivar, thanks for your response. I managed to get a solution by using Matlab and a loop, where the swept parameter is changed by multiplication with the loop counter "i" and the mesh is reset at each loop run. Still, I have a question concerning the call of parameters which could be used as a list, e.g. in a text file. Is it possible to read single defined values from such a textfile and use them in a loop in the comsol m-file, e.g. entry at line "i" in the text file according to the "i" given in the loop counter with "for i = 1:x"? The intention is to use arbitrary sets of values, which can not be expressed by a function or series. I only know from the manual how to call functions from text files with "fem.functions{2}.fileindex = {i,...};" but can this be applied in my case? I feel, there should be an elegant solution to this, which I might not be able so see. (have to try this out though) Regards Matthias

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 23, 2011, 3:04 p.m. EDT

Hi

in 3.5 (comapred to v4) you have less control on your meshing, I'm not sure how to "restart" the meshing for the parametric sweep anylonger in 3.5a, passing via matlab is certainly possible

--
Good luck
Ivar


Would you happen to now how to "restart" the meshing in between parameter steps in version 4.1?

Thanks,
John
[QUOTE] Hi in 3.5 (comapred to v4) you have less control on your meshing, I'm not sure how to "restart" the meshing for the parametric sweep anylonger in 3.5a, passing via matlab is certainly possible -- Good luck Ivar [/QUOTE] Would you happen to now how to "restart" the meshing in between parameter steps in version 4.1? Thanks, John

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 Mar 24, 2011, 3:10 a.m. EDT
Hi

normally with a "true "Parametric Sweep, if you change the geometry, it will remesh at each step (V4.1)

--
Good luck
Ivar
Hi normally with a "true "Parametric Sweep, if you change the geometry, it will remesh at each step (V4.1) -- Good luck Ivar

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.