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.

Tracking Residual

Jonathan Olsen
I need to track the residual in my simulation in order to represent how closely the governing equations are being represented. I know comsol keeps track of residual since ive had several errors referring to it. Post processing doesnt have residual as a specific plotting value as far as i know.

Do i need to use a specific solver which uses residual? Does any one know how to access its value? I can use matlab live link if necessary.

4 Replies Last Post Jul 5, 2016, 8:04 PM EDT
Posted: 6 years ago Apr 4, 2011, 1:12 AM EDT
Hi

you have an interesting remark there, I would also like to see more in the log, there is a log "detailed" option in the solver node, but it mainly adds the scaling factors, a "verbose" option in addition could sometime help.

The convergence plotting is supposed to come back in one of the next version I have heard

--
Good luck
Ivar
Hi you have an interesting remark there, I would also like to see more in the log, there is a log "detailed" option in the solver node, but it mainly adds the scaling factors, a "verbose" option in addition could sometime help. The convergence plotting is supposed to come back in one of the next version I have heard -- Good luck Ivar

Posted: 4 years ago Jul 26, 2013, 2:27 PM EDT
Hi,

I've got a similar question. Is there any way to export the residuals to MATLAB for each time step? I mean I need to do some algebra on residual of each cell.

Thanks,
Farid
Hi, I've got a similar question. Is there any way to export the residuals to MATLAB for each time step? I mean I need to do some algebra on residual of each cell. Thanks, Farid

Evgeni Sergeev
Posted: 2 years ago Mar 9, 2016, 3:21 AM EST
As of Comsol 5.2, one can now plot residual(u), provided they enable storing the residual in output under "Advanced" solver settings. That has already saved me hours to days of time, because looking at the residual is much better than guessing; without this I would be following a false trail. (I used to use AMR for this, which tends to refine in problematic areas, but that was a bit too indirect and hard to see in 3D models.)
As of Comsol 5.2, one can now plot [b]residual(u)[/b], provided they enable storing the residual in output under "Advanced" solver settings. That has already saved me hours to days of time, because looking at the residual is much better than guessing; without this I would be following a false trail. (I used to use AMR for this, which tends to refine in problematic areas, but that was a bit too indirect and hard to see in 3D models.)

Mehrdad Bastani
Posted: 1 year ago Jul 5, 2016, 8:04 PM EDT

As of Comsol 5.2, one can now plot residual(u), provided they enable storing the residual in output under "Advanced" solver settings. That has already saved me hours to days of time, because looking at the residual is much better than guessing; without this I would be following a false trail. (I used to use AMR for this, which tends to refine in problematic areas, but that was a bit too indirect and hard to see in 3D models.)


Hi Evgeni,

That's right. I tried "residual" operator for "Darcy's Law" to get the residuals for flow velocity field. It worked and I was able to plot "error vs. time". BUT when I want to use it for "Transport of Dilute Solution in Porous Media" physics for "concentration" , it does not work. It just shows me an empty geometry without any saved result. Do you have any idea about plotting error vs. time for solute transport problems? The dependent variable is "concentration (c)" in these problems.

Thanks,
Mehrdad
[QUOTE] As of Comsol 5.2, one can now plot [b]residual(u)[/b], provided they enable storing the residual in output under "Advanced" solver settings. That has already saved me hours to days of time, because looking at the residual is much better than guessing; without this I would be following a false trail. (I used to use AMR for this, which tends to refine in problematic areas, but that was a bit too indirect and hard to see in 3D models.) [/QUOTE] Hi Evgeni, That's right. I tried "residual" operator for "Darcy's Law" to get the residuals for flow velocity field. It worked and I was able to plot "error vs. time". BUT when I want to use it for "Transport of Dilute Solution in Porous Media" physics for "concentration" , it does not work. It just shows me an empty geometry without any saved result. Do you have any idea about plotting error vs. time for solute transport problems? The dependent variable is "concentration (c)" in these problems. Thanks, Mehrdad

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.