Skip to content

Post Processing

Simulation Output

Below is a sample of the output log, histor.dat:

1 0.000E+00 1.834E+01 ( 0) 8.209E+01 4.917E+25 < 173- 9| 12> [ 0 - 0]
1 1.000E+00 1.342E+01 ( -1) 2.997E-01 5.017E-02 < 269-10| 13> [ 0 - 0]
1 1.000E+00 5.032E+00 ( -5) 1.416E-01 1.922E-01 < 270-10| 12> [ 0 - 0]
1 1.000E+00 3.139E+00 ( -7) 3.029E-02 5.698E-03 < 269-10| 12> [ 0 - 0]
1 1.000E+00 1.636E+00 ( -10) 2.997E-02 3.644E-02 < 270-10| 11> [ 0 - 0]
2 1.000E+00 1.024E+02 ( 7) 3.599E-01 1.125E-01 < 269-10| 11> [ 0 - 0]
2 1.000E+00 1.540E+01 ( 0) 4.275E-02 5.029E-04 < 113-10| 10> [ 0 - 0]
2 1.000E+00 6.642E+00 ( -4) 6.714E-02 1.697E-01 < 514-10| 9> [ 0 - 0]
2 1.000E+00 3.870E+00 ( -6) 1.070E-02 2.346E-04 < 269-10| 12> [ 0 - 0]
2 1.000E+00 1.946E+00 ( -9) 1.418E-02 2.712E-03 < 270-10| 12> [ 0 - 0]
3 1.000E+00 1.186E+02 ( 8) 1.201E-01 6.028E-02 < 269-10| 12> [ 0 - 0]
3 1.000E+00 1.094E+01 ( -2) 1.863E-01 3.961E-01 < 173- 9| 11> [ 0 - 0]
3 1.000E+00 9.879E+00 ( -2) 1.234E-02 8.488E-05 < 269-10| 13> [ 0 - 0]
3 1.000E+00 5.180E+00 ( -5) 5.644E-02 3.730E-02 < 10- 6| 12> [ 0 - 0]
3 1.000E+00 2.757E+00 ( -8) 1.851E-02 3.964E-03 < 401- 6| 10> [ 0 - 0]
4 1.000E+00 1.630E+02 ( 9) 1.106E-01 4.384E-02 < 269-10| 12> [ 0 - 0]
4 1.000E+00 1.482E+01 ( 0) 1.591E-01 3.043E-01 < 371- 6| 10> [ 0 - 0]
4 1.000E+00 1.209E+01 ( -1) 1.232E-02 8.112E-05 < 269-10| 13> [ 0 - 0]
4 1.000E+00 6.494E+00 ( -4) 2.323E-02 3.934E-03 < 488-10| 13> [ 0 - 0]
4 1.000E+00 3.595E+00 ( -7) 3.799E-02 3.346E-02 < 488-10| 11> [ 0 - 0]

The solver output consists of multiple columns, however the most important are the first 4 columns which we describe in detail now.

In the first column is the current time step. Note that each time step appears multiple times as within each step the blood flow equations are solved multiple times, increasing the accuracy of the numerical solution before proceeding to the next step. The values in this column begin at 1 and end at the total number of time steps defined for our problem, here set to 1100.

In the second column is the elapsed simulation time in seconds.

In the third column is the non-linear residual. This value is a measure of the quality of the current solution. This number indicates how accurate the current solution is, with lower values indicating an improved solution. Within each time step, the value of the residual decreases, indicating the solution is improving.

In the fourth column is the logarithmic value of the current residual compared to the initial residual at the start of the simulation. This number provides a measure of the current residual relative to the initial starting point. The lower the negative number, the more accurate the solution is relative to its initial starting point.

Simulation Analysis

The solver will create a folder called n-procs-case (where n is the number of processors). To post-process the results, navigate to the n-procs-case folder in the desired simulation.

The executables described below (postsolver and multipostsolver) can be found in the CRIMSON flowsolver install files, cd to this directory or add it to your PATH:

cd 'C:/Program Files/CRIMSON XXXX.XX.XX/bin/Python/lib/site-packages/CRIMSONSolver/SolverStudies/flowsolver'

First, we can generate the ybar (error) file:

postsolver -sn <last step> -td -ph -ybar

then to combine the restart files:

multipostsolver <first step> <last step> <increment> <foldername>`

This command retrieves the results every N steps. So if you had 1000 steps and set N to 100, you would have the results from every 100 steps (100,200,300... etc.)

Once this is finished you should have a folder

restarts-<foldername>-<first step>-<last step>-<increment>

(a directory up) containing the simulation results. This will have all files you need to post-process and visualize your results.

The residuals can be plotted using a Matlab script plotResidual() using the histor.dat file. Mass conservation can be verified by inspecting FlowHist.dat, and pressure can be confirmed to be in the appropriate range by looking at PressHist.dat.

Some post-processing can be done on Conflux using gnuplot. To plot the reisduals run the following command from the n-procs-case folder:

writeresiduals.gpi histor.dat

These can then be plotted using gnuplot. Type gnuplot in the command line to enter the program and then enter the following lines depending on your desired output:

Type exit to leave the gnuplot environment.

Notes:

  • Always copy myjob and multidomain.dat (what is this??) from home to folder with simulation files

  • In solver.inp put experimental on 3 lines before RCR

  • For steady flow use bct_steady.dat and rename bct.dat

  • Check for convergence with tail -f 80-procs-case/histor.dat

Windows (Local)

Linux (Clusters)

Analyzing the Output Files