Residuals Question

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Brennen Carr
Posts: 7
Joined: Mon Jun 12, 2017 8:50 am

Residuals Question

Post by Brennen Carr » Fri Jul 28, 2017 9:03 am

Hey Simvascular Team,

I am trying to produce a convergence plot using the residuals show after a simulation is finished but I have a few questions about the nature of them.

What type of residual is given? The only thing I found in the documentation states that these are non-linear residuals but do they corresponded to velocity, continuity, momentum, etc?

Additionally, I set my simulation to have 5 step constructions and I expected that I would fin 5 different instances of each time step in the "histor.dat" file, but I find anywhere from 3 to 5. I.e. time step 1 appears 5 times but then time step 200 will only appear 3 times, and then time step 320 appears 4 times. What does this mean and how will this affect the convergence plot I am trying to create?

User avatar
Hongzhi Lan
Posts: 125
Joined: Mon Aug 04, 2014 3:55 pm

Re: Residuals Question

Post by Hongzhi Lan » Fri Jul 28, 2017 11:05 am

Hi Brennen,

The non-linear residuals are based on Navier-Stoke equations (which contain non-linear terms). the number 5 for step constructions is the maximum steps. in solver parameters, we also have a few options for non-linear control:
Residual Control: True
Residual Criteria: 0.01
Minimum Required Iterations: 3

It means solver needs to run 3 steps at least, and after that if the residual is below than the criteria in a certain step, it will skip the rest steps.

Thanks,
Hongzhi

SimVascular Development Team

User avatar
Rodrigo Romarowski
Posts: 16
Joined: Sat Apr 15, 2017 10:06 am

Re: Residuals Question

Post by Rodrigo Romarowski » Wed Mar 28, 2018 7:54 am

Hi,

After reading this post I still couldn't understand some of the settings. Lets say I want a very accurate simulation and use a residual tolerance of 1e-7 or 1e-9 with GMRES. Which are the right settings to use?

Using

Residual Control: True
Residual Criteria: 0.0000001
Minimum Required Iterations: 3
svLS Type: GMRES

will not do the job.

Even if the step construction is set to (for example) 10, I get 10 iterations but still don't reach the desired residual. Which would be the best way to have a good control of the residual?

Thanks a lot,

Rodrigo

User avatar
Justin Tran
Posts: 109
Joined: Mon Sep 30, 2013 4:10 pm

Re: Residuals Question

Post by Justin Tran » Wed Mar 28, 2018 9:26 am

Hi Rodrigo,

Thanks for your question! There are multiple levels of residuals and tolerances that the user has the option of setting. As Hongzhi mentioned, the non-linear residual is the residual of the Navier-Stokes equations. Like most finite element solvers, SimVascular wants to form this non-linear equation into a system of linear equations in the form Ax = b (where x is a vector which contains all the velocities and pressures at all the nodes). It has to do this by linearizing the Navier-Stokes equations using Newton's method. After linearizing, SimVascular uses a linear solver (which we will return to later) to solve the matrix set of equations Ax = b. Let's pretend that we can solve this system exactly for x. After we get x, we plug those velocities and pressures back into the NON-LINEAR Navier-Stokes equations. Because of our approximation error, this will not satisfy it exactly and thus there will be a non-linear residual. This Newton's iterations comprises the "residual criteria" and "step construction" and "minimum required iterations" that you have referred to in your post. Residual criteria specifies the tolerance of the residual that we would like to see, step construction specifies the maximum number of Newton iterations that you will allow SimVascular to do, and minimum required iterations will specify the minimum Newton iterations.

There are also settings you can specify for the linear solver tolerances when solving the Ax=b system. These settings are below:

Number of Krylov Vectors per GMRES Sweep: 100
Number of Solves per Left-hand-side Formation: 1
Tolerance on Momentum Equations: 0.001
Tolerance on Continuity Equations: 0.001
Tolerance on svLS NS Solver: 0.001
Maximum Number of Iterations for svLS NS Solver: 10
Maximum Number of Iterations for svLS Momentum Loop: 2
Maximum Number of Iterations for svLS Continuity Loop: 400

Of note are the "Tolerance" settings. This sets a tolerance on how accurately you solve the Ax=b system. The defaults for these are very lax (to accommodate users running on laptop computers) so for larger scale simulations we recommend cranking these up (0.001 is a good starting point). Using these linear solver tolerances in combination with the residual criteria you are using should result in more accurate simulations.

Hope that helps! Let us know how it goes.

User avatar
Rodrigo Romarowski
Posts: 16
Joined: Sat Apr 15, 2017 10:06 am

Re: Residuals Question

Post by Rodrigo Romarowski » Thu Mar 29, 2018 12:14 am

Thank you! that's a great answer. I'll try what you've just said.

POST REPLY