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.

No convergence in the parametric sweep for all parameters

Please login with a confirmed email address before reporting spam

Dear all,

I’m writing about the parametric sweep.

I’m simulating the flow field in a 2D porous media. My domain has size about 0.5 µm and there are many small flow channel (about 0.0005 µm).
I’m studying the flow field changing the input flow velocity, using the parametric sweep in order to study the pressure drop vs. input velocity.

Comsol can’t solve the flow field for high-speed ( 10 m/s) and even decreasing the relative tolerance it approaches the desired speed (but does not reach it), but the computation takes a lot of time ( 5 days).

Is it possible, in order to speed up the calculation, to use the flow field relative to the previous simulation as initial condition for the next value of inlet velocity in the parametric sweep?

Or it is possible to use the results of a model as initial conditions for another model file?

I also noticed, in the progress window, that, during the calculation (using the parametric sweep), Comsol uses also values of inlet velocity that I didn’t specify in the vector definition of V (inlet velocity) in the parametric sweep section, but at the end it gives me the solutions only for the specified values of the parameter (V). Why? Is it possible to avoid this in order to speed up the calculation?

Thanks a lot for your help.
Best Regards,

Francesca Messina

2 Replies Last Post May 30, 2012, 4:16 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 May 29, 2012, 1:54 p.m. EDT
Hi

you have 2 types of paremeter sweep solver sequences:

1) the Parametric Sweep Node you put explicitely in front of your solver study sequence, this one loops around the full model, including parameters, geometry, mesh, physics and study nodes. It will restart each solver sequence with the initial conditions you specified !

2) the solver "continuation parameter sweep" typically for steady state solvers, but also in some sens for frequency domain and temporal solvers. These do NOT loop around the geometry and mesh nodes (so you geometry or topology is not changes), and each solver parameter step is using the PREVIOUSLY solved solution as initial condition for the next step.

1) is used when you change the geometry by a Pareameter sweep, 2) should be used when you build a sequence of increasing or decreasing BC conditions, or frequency sweep or ..., you gain time to solve, then by reusing "better" initial conditions

Your second question concerns the steps of the solver:
Mostly COMSOL decides for "free" running stepping, that is it adapts the steps to the results as progressing, by using internal residuals and norms and the Jacobian of the model to guess next step and decide how far it "throughs" the step, into the multidomain of unknown results. Mostly it does this to minimise integration errors, but the non linear models can easily too get into a loop and you see the progress bar move left and right endlessly. Furthermore, the free running algorithm assumes a more or less assymptotically converging process, so it tries to regularly double the step size, which is very efficient for most diffsion type equations, but can be catastrophic for repetitive BC conditions, as the solver will skip many oscillations and smoothen the response completly. That is why for time stepping, you should always ask yourself if the BC and the solution is a HT or diffusion problem converging assymptotically (more or less) or do you have oscilalting BC defined ? if so, use intermediate or strict stepping, this will enforce at least one step inbetween your defined steps (free might interpolate, sometimes wrongly, many if not all of your steps from 2 true solver steps and results).
here is the time discrete solver too ,that enforeces a strict, regular, time stepping, and many intermediate cases obtained by tweaking all the solver parameters. You can observe this on your solver log section, the "out" flag indicates when COMSOL stores the results you asked for, if you see several consecutive "out" without any solver steps, you know that COMSOL is interpolating (which might be perfectly valid), if you see many step in between the out then the convergence is difficult and either you should increase the steps to store as there might be interesting physics going on, not to be missed, or you should reduce some other resolution parameter, or increase the step amplification, all depends on the solver. Tweaking the solver is tricky and require experience and knowledge (often of the expected result). personally I mostly use the default from COMSOL.
So there is no clear response if the results are better by forcing less intermediate results, it all depends on the model and the non linearities.

The best way I know about , to improve convergence, is to give intial conditions as close a possible to the final results (for the starting BC values), all "0", as is the default by COMSO,L is far from optimum for many cases, but as good as any other starting point still, so often perfectly acceptable.

--
Have fun Comsoling
Ivar
Hi you have 2 types of paremeter sweep solver sequences: 1) the Parametric Sweep Node you put explicitely in front of your solver study sequence, this one loops around the full model, including parameters, geometry, mesh, physics and study nodes. It will restart each solver sequence with the initial conditions you specified ! 2) the solver "continuation parameter sweep" typically for steady state solvers, but also in some sens for frequency domain and temporal solvers. These do NOT loop around the geometry and mesh nodes (so you geometry or topology is not changes), and each solver parameter step is using the PREVIOUSLY solved solution as initial condition for the next step. 1) is used when you change the geometry by a Pareameter sweep, 2) should be used when you build a sequence of increasing or decreasing BC conditions, or frequency sweep or ..., you gain time to solve, then by reusing "better" initial conditions Your second question concerns the steps of the solver: Mostly COMSOL decides for "free" running stepping, that is it adapts the steps to the results as progressing, by using internal residuals and norms and the Jacobian of the model to guess next step and decide how far it "throughs" the step, into the multidomain of unknown results. Mostly it does this to minimise integration errors, but the non linear models can easily too get into a loop and you see the progress bar move left and right endlessly. Furthermore, the free running algorithm assumes a more or less assymptotically converging process, so it tries to regularly double the step size, which is very efficient for most diffsion type equations, but can be catastrophic for repetitive BC conditions, as the solver will skip many oscillations and smoothen the response completly. That is why for time stepping, you should always ask yourself if the BC and the solution is a HT or diffusion problem converging assymptotically (more or less) or do you have oscilalting BC defined ? if so, use intermediate or strict stepping, this will enforce at least one step inbetween your defined steps (free might interpolate, sometimes wrongly, many if not all of your steps from 2 true solver steps and results). here is the time discrete solver too ,that enforeces a strict, regular, time stepping, and many intermediate cases obtained by tweaking all the solver parameters. You can observe this on your solver log section, the "out" flag indicates when COMSOL stores the results you asked for, if you see several consecutive "out" without any solver steps, you know that COMSOL is interpolating (which might be perfectly valid), if you see many step in between the out then the convergence is difficult and either you should increase the steps to store as there might be interesting physics going on, not to be missed, or you should reduce some other resolution parameter, or increase the step amplification, all depends on the solver. Tweaking the solver is tricky and require experience and knowledge (often of the expected result). personally I mostly use the default from COMSOL. So there is no clear response if the results are better by forcing less intermediate results, it all depends on the model and the non linearities. The best way I know about , to improve convergence, is to give intial conditions as close a possible to the final results (for the starting BC values), all "0", as is the default by COMSO,L is far from optimum for many cases, but as good as any other starting point still, so often perfectly acceptable. -- Have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 30, 2012, 4:16 a.m. EDT

Thanks Ivar, you've been very clear!
I will try to use the continuation parameter sweep and study the better BCs form my model.
Thanks a lot.
Francesca
Thanks Ivar, you've been very clear! I will try to use the continuation parameter sweep and study the better BCs form my model. Thanks a lot. Francesca

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.