-
Notifications
You must be signed in to change notification settings - Fork 11
/
docsFlowSolver.html
2751 lines (2355 loc) · 116 KB
/
docsFlowSolver.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>SimVascular Docs</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/shop-item.css" rel="stylesheet" type="text/css" />
<link href="css/codestyle.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="font-awesome-4.1.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css">
<link rel="shortcut icon" href="img/favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
<i class="fa fa-bars" id="barIcon"></i>
</button>
<a class="navbar-brand" id="brandName" href="index.html">
<img src="img/svlogo/svLogoSmallText.png" alt="...">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- USER GUIDES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><span class="fa fa-user"></span> User Guides</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsQuickGuide.html"><b><span class="icon ion-ios7-bolt"></span> Getting Started</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsModelGuide.html"><b><span class="icon ion-settings"></span> Modeling</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsMeshing.html"><b><span class="icon ion-ios7-keypad"></span> Meshing</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsFlowSolver.html"><b><span class="icon ion-play"></span> Simulation</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docssvFSI.html"><b><span class="icon ion-plus-round"></span> svFSI</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsSimCardio.html"><b><span class="icon ion-plus-round"></span> SimCardio</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsROMSimulation.html"><b><span class="icon ion-plus-round"></span> ROM Simulation</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsGenBC.html"><b><span class="icon ion-refresh"></span> GenBC</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsPythonInterface.html"><b><span class="icon ion-refresh"></span> Python Interface</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="docsReferences.html"><b><span class="icon ion-refresh"></span> References </b></a></li>
</ul>
</li>
<!-- CLINCAL CASES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><i class="fa fa-stethoscope"></i> Clinical Cases</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase3.html"><b><span class="fa fa-user-md"></span> Coronary Normal</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase1.html"><b><span class="fa fa-user-md"></span> Aortofemoral Normal - 1</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase2.html"><b><span class="fa fa-user-md"></span> Aortofemoral Normal - 2</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="clinicalCase4.html"><b><span class="fa fa-user-md"></span> Healthy Pulmonary</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/projects/sv_tests"><b><span class="fa fa-user-md"></span> All demo projects</b></a></li>
</ul>
</li>
<!-- DEVELOPER GUIDES -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><span class="fa fa-caret-square-o-right"></span> Developer Guides</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/wiki/wiki_for_developers"><b><span class="fa fa-file-text-o"></span> Compile Source Code</b></a></li>
</ul>
</li>
<!-- svCOMMUNITY -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b><i class="fa fa-users"></i> svCommunity</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/forums/viewforum.php?f=188"><b><span class="fa fa-users"></span> Public Forum</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/wiki/"><b><span class="fa fa-file-text-o"></span> Wiki</b></a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/mailman/listinfo/simvascular-news"><b><span class="fa fa-sign-in"></span> Join News Mailing List</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://simtk.org/pipermail/simvascular-news/"><b><span class="fa fa-pencil-square-o"></span> News Mailing List Archive</b></a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/SimVascular/SimVascular/issues"><b><span class="fa fa-bug"></span> Report bugs and request features</b></a></li>
</ul>
</li>
<!-- REFERENCES -->
<li>
<a href="docsRefs.html" id="dropdownMenu1" >
<b><span class="icon ion-document-text"></span>References</b>
</a>
</li>
<!-- Archives -->
<li>
<a href="#" id="dropdownMenu1" data-toggle="dropdown">
<b> Archives</b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="archiveQuickGuideSV2.html"><b>SimVascular 2.0</b></a></li>
</ul>
</li>
<!-- <li><a href="docsQuickGuide.html" id="btnQuickGuide"><b><span class="icon ion-ios7-bolt"></span> Quick Guide</b></a></li>
<li><a href="docsModelGuide.html" id="btnModelGuide"><b><span class="icon ion-settings"></span> Modeling</b></a></li>
<li><a href="docsMeshing.html" id="btnMeshing"><b><span class="icon ion-ios7-keypad"></span> Meshing</b></a></li>
<li><a href="docsPresolver.html" id="btnPresolver"><b><span class="icon ion-log-in"></span> svPre</b></a></li>
<li><a href="docsFlowSolver.html" id="btnFlowSolver"><b><span class="icon ion-play"></span> svSolver</b></a></li>
<li><a href="docsRefs.html" id="btnRefs"><b><span class="icon ion-document-text"></span> References</b></a></li>
<li><a href="clinicalCase1.html" id="btnRefs"><b>Case Studies</b></a></li> -->
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<!--Nav Bar -->
<div class="row">
<div class="col-xs-1 col-sm-1 hidden-md hidden-lg">
</div>
<!-- ONE COLUMN OF SPACE -->
<nav class="hidden-xs hidden-sm col-md-2 col-lg-2 bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed manFlowSolver"> <!--Nav Bar -->
<h3>Simulation Guide</h3>
<li><a href="#intro">Introduction</a></li>
<li><a href="#overview">Overview</a></li>
<li><a href="#bcphysics">Boundary Conditions</a></li>
<li><a href="#creatingjob">Creating Job</a></li>
<li><a href="#basic">Basic Parameters</a></li>
<li><a href="#inflowbc">Inflow BC</a></li>
<li><a href="#outletbc">Outlet BC</a></li>
<li><a href="#wallproperties">Wall Properties</a></li>
<li><a href="#solverparameters">Solver Parameters</a></li>
<li><a href="#creatingdata">Creating Data Files</a></li>
<li><a href="#runningjob">Running Job</a></li>
<li><a href="#postprocess">Postprocessing</a></li>
<li><a href="#examples">Examples</a>
<ul class="nav nav-stacked">
<li><a href="#example2">Example 2</a></li>
<li><a href="#example3">Example 3</a></li>
<li><a href="#example4">Example 4</a></li>
</ul>
</li>
<li><a href="#appendix">Appendix</a>
<ul class="nav nav-stacked">
<li><a href="#solverconfiguration">Configurating Solvers</a></li>
<li><a href="#presolvercommands">svPre Commands</a></li>
<li><a href="#bctfile">BCT File</a></li>
<li><a href="#solverinp">solver.inp Guide</a></li>
<li><a href="#impbcfile">Impedance BC Files</a></li>
<li><a href="#rcrtfile">RCR BC File</a></li>
<li><a href="#cortfile">COR BC File</a></li>
</ul>
</li>
<h3>Download</h3>
<a href="https://simtk.org/frs/download_confirm.php/file/5114/CylinderProject.zip?group_id=930">Cylinder Example Project</a>
</ul>
</nav>
<!--Main Content -->
<div class="col-xs-10 col-sm-10 col-md-9 col-lg-9" id="manualContent">
<!-- ACTUAL CONTENT -->
<div class="manFlowSolver"> <section id="intro" class="group"><h2>Introduction</h2>
<p><strong>SV Simulation</strong> tool can solve the three-dimensional incompressible Navier-Stokes equations in an arbitrary domain, generally a vascular model reconstructed from image data. This is a complex subject with extensive underlying theory, and therefore this document will focus mainly on the practical aspects of simulation and analysis. </p>
<p><strong>Notice</strong>: To get full functions from the Simulation tool, it uses three solvers: <strong>Presolver (svPre), Flowsolver (svSolver), Postsolver (svPost)</strong>. Normally, SimVascular already includes the solvers and can find them automatically. Users don’t need to set up the solvers. However, in case SimVascular can’t find them while users are using the Simulation tool, refer to <a href="#solverconfiguration">Solver Configuration</a>.</p>
<p>The <strong>svSolver</strong> evolved from the academic finite element code PHASTA (Parallel, Hierarchical, Adaptive, Stabilized, Transient Analysis), developed mainly at RPI (Rensselaer Polytechnic Institute, Troy, NY) by Professor Kenneth Jansen. This code was in turned inspired by the Stabilized Finite Element theory developed by Professor Thomas J.R. Hughes during his Stanford years.</p>
<p>Building on the original PHASTA code, there have been a number of important additions and modifications. Professor Charles Taylor’s group at Stanford University developed key additions in the areas of Boundary Conditions and Fluid-Solid Interaction (FSI) coupling. These additions are crucial to represent with a high level of realism the way blood flows in arteries, since this flow is highly dependent on the characteristics of the vascular trees that are downstream of our three-dimensional model, and the compliance of the three-dimensional vascular tree.</p>
<h3>What’s New?</h3>
<p>Building on the above features, the Marsden lab at Stanford has added additional key functionality enabling efficient and stable solutions with models of the circulatory physiology:</p>
<ul>
<li><p><a href="docsRefs.html#refSec2"><strong>Backflow stabilization.</strong></a> This problem usually arises in large vessels that are exposed to backflow in 3D and 2D flow simulations. This phenomenon may be a cause of divergence of the numerical scheme due to bulk reversal of the flow through an outlet, localized areas of flow reversal or use of a boundary 0D circulation model. </p></li>
<li><p>Custom and efficient <a href="docsRefs.html#refSec3"><strong>linear solver.</strong></a> Accurate simulation of blood flow in vessels require the repeated solution of linear systems of equations with millions of unknowns. Moreover, use of closed-loop boundary models significantly increases the degree of coupling between boundary degrees of freedoms. The <strong>svLS</strong> linear solver is designed to efficiently handle large cardiovascular simulations with arbitrary boundary conditions and reduce solution times. </p></li>
<li><p>Multiscale Coupling for <a href="docsRefs.html#refSec2"><strong>closed loop boundary conditions.</strong></a> Coupling a three-dimensional finite element solver with a 0D lumped circulation model drastically improves the possibility of realistically simulate patient-specific hemodynamics and physiology.</p></li>
</ul>
<h3>About this guide</h3>
<p>This document will teach you:</p>
<ol>
<li>setting initial conditions and boundary conditions</li>
<li>setting mechanical properties for vessel walls (if deformable)</li>
<li>setting parameters for flowsolver</li>
<li>running the flow solver</li>
<li>converting and analyzing the simulation results </li>
</ol>
<p>In addition, this tutorial will show you a number of good practices that are important to observe during the simulation process. We will do this considering very simple geometry (a straight cylinder) to illustrate different points in a simple way.</p>
<h3>Theory and Implementation</h3>
<p>The theory and implementation details are not covered in this document. For more information about those details, please refer to our <a href="docsRefs.html">publications page</a>.</p>
</section>
<section id="overview" class="group"><h2>Overview</h2>
<h3>Process Flow of SimVascular Simulation</h3>
<p>The following figure contains a schematic representation of the processes involved in running a simulation using SimVascular.</p>
<figure>
<img class="svImg svImgLg" src="documentation/flowsolver/imgs/simulation_flowchart.png">
<figcaption class="svCaption" >Workflow for generating hemodynamic results of a cylindrical model starting from a stereolithography of its exterior surface</figcaption>
</figure>
<p>We start off with the files coming from the <a href="/docsMeshing.html">meshing</a> of the analysis: these files contain nodal and connectivity information for the finite element mesh, located in the the folder <em>mesh-complete/mesh-surfaces/</em>.</p>
<p><strong>svPre</strong> is the preprocessor for <strong>svSolver</strong>. The input data files to svPre contain a complete description of the discrete model: nodal coordinates, element connectivity, element adjacency information and connectivity of boundary nodes and elements. The <strong>svPre</strong> program can be called either from the command line (in terminal) or the Simulation tool (in GUI). The input data files for <strong>svPresolver</strong> are created from the mesh. They are organized as shown in the example below.</p>
<figure>
<img class="svImg svImgMd" src="documentation/flowsolver/imgs/meshfiles.png">
<figcaption class="svCaption" >Folder structure and file created after clicking on <b>Write Files</b></figcaption>
</figure>
<p>These files are:</p>
<p>in the <strong>mesh-complete/</strong> folder: </p>
<ul>
<li><strong>mesh-complete.mesh.vtu</strong>, vtu file containing the solid mesh generated with TetGen.</li>
<li><strong>mesh-complete.exterior.vtp</strong>, vtp file containing all the exterior elements of the mesh generated with TetGen.</li>
<li><strong>walls_combined.vtp</strong>, vtp file containing all surface elements assigned to the wall, possibly combined from various surfaces. </li>
</ul>
<p>in the <strong>mesh-complete/mesh-surfaces/</strong> folder:</p>
<ul>
<li><strong>inflow.vtp</strong>, vtp file containing the meshed inlet surface.</li>
<li><strong>outlet.vtp</strong>, vtp file containing the meshed outlet surface.</li>
<li><strong>wall.vtp</strong>, vtp file containing the meshed wall surface.</li>
</ul>
<p>SimVascular runs <strong>Presolver(svPre)</strong> using the *.svpre_ file. The *.svpre file contains the set of instructions that define the boundary conditions, initial conditions, and geometrical configuration of our problem. The output of <strong>svPre</strong> is a set of files (<strong>bct.dat, geombc.dat.1, restart.0.1, numstart.dat</strong>) that are ready to be processed by <strong>svSolver</strong> to run a blood flow analysis. Running svSolver also need <strong>solver.inp</strong>, which provide further info for flowsolver.</p>
<p>Once the analysis is finished, the solver outputs files that characterize the finite element solution over a defined time period, typically several cardiac cycles. These files are taken by <strong>svPost</strong> to generate visualization files (typically *.vtu and *.vtp files) that are used to post-process and analyze the desired hemodynamic results. </p>
<h3>Units in Simulation</h3>
<p><strong>svSolver</strong>, just like many other Finite Element Programs, does not enforce a consistent set of physical units in the analysis, but it is up to the analyst to make sure that input data are dimensionally consistent.</p>
<p>To have a consistent set of units, users are advised to either work in CGS, MGS, or SI units; see the following table. </p>
<table class="table table-bordered">
<thead>
<tr>
<th>Quantity</th>
<th>CGS Unit</th>
<th>MGS Unit</th>
<th>SI Unit</th>
</tr>
</thead>
<tr>
<td>Length</td>
<td>cm</td>
<td>mm</td>
<td>m</td>
</tr>
<tr>
<td>Mass</td>
<td>gr</td>
<td>gr</td>
<td>Kg</td>
</tr>
<tr>
<td>Time</td>
<td>s</td>
<td>s</td>
<td>s</td>
</tr>
</table>
<h3>Useful constants in Simulation</h3>
<p>The following table gathers several important physical constants of blood given in different unit
systems.</p>
<table class="table table-bordered">
<thead>
<tr>
<th>Property</th>
<th>CGS Unit</th>
<th>MGS Unit</th>
<th>SI Unit</th>
</tr>
</thead>
<tr>
<td>Dynamic viscosity $\mu$ [M · L<sup>-1</sup> · T<sup>-1</sup>]</td>
<td>0.04 poise [gr · cm<sup>-1</sup> · s<sup>-1</sup>]</td>
<td>0.004 [gr · mm<sup>-1</sup> · s<sup>-1</sup>]</td>
<td>0.004 [Kg · m<sup>-1</sup>· s<sup>-1</sup>]</td>
</tr>
<tr>
<td>Blood density $\rho$ [M · L<sup>-3</sup>]</td>
<td>1.06 [gr · cm<sup>-3</sup>]</td>
<td>0.00106 [gr · mm<sup>-3</sup>] </td>
<td>1060 [Kg · m<sup>-3</sup>]</td>
</tr>
</table>
</section>
<section id="bcphysics" class="group"><h2>Boundary Condition Specification: the Physical Side of the Problem</h2>
<p>Boundary conditions are crucial to obtaining high quality cardiovascular simulation results. It is essential that boundary conditions accurately capture the physiology of vascular networks outside of the 3D domain of the model. <strong>SimVascular</strong> provides several different options for boundary condition assignment at inlets and outlets that are described in this section. Typically, we begin with some physiologic information about our problem, for instance:</p>
<ul>
<li>Flow rate info coming from <strong>MRI</strong> or <strong>ultrasound</strong> measurements.</li>
<li>Pressure values in the model obtained with a <strong>catheter</strong> transducer or a pressure cuff.</li>
<li>Vessel wall elastic properties (if we are modeling the vessel walls as deformable).</li>
</ul>
<figure>
<img class="svImg svImgMd" src="documentation/flowsolver/imgs/Fig_15.png">
<figcaption class="svCaption" >Inflow, outflow and wall characterization in a simple cylindrical vessel</figcaption>
</figure>
<p>From a conceptual standpoint, no matter how geometrically complex a vascular model is (we’ll refer to this as $\Omega$), its boundaries can be classified into three groups (see figure above):</p>
<ul>
<li>An <strong>inflow</strong> boundary $\Gamma_g$. This is the set of face(s) of the model where we will prescribe a flow wave as obtained from a clinical measurement.</li>
<li>A vessel <strong>wall</strong> boundary $\Gamma_s$. This boundary represents the interface between the fluid domain and the vessel wall. In the physical world, this boundary is lined by a layer of endothelial cells, the treatment of which can be complex. Many blood flow simulations have traditionally used a <strong>rigid wall assumption</strong>. Under these circumstances, a zero velocity condition is applied on these surfaces. <strong>SimVascular</strong> also offers options for fluid structure interaction as discussed below.</li>
<li>An <strong>outflow</strong> boundary $\Gamma_h$. On this boundary, we will typically prescribe a pressure value that is uniform over the face (i.e. spatially not temporally constant) in a <strong>weak manner</strong>. A <strong>weakly applied</strong> pressure means that we are not prescribing nodal values of pressure at the nodes of the outlet face as Dirichlet boundary conditions. Instead, we apply this pressure by enforcing that the integral of the pressure field on that face must be a certain value.</li>
</ul>
<p>These boundaries have an absolutely critical impact on the numerical simulation results. The SimVascular package contains several options for boundary condition assignment. All of these use a weakly prescribed pressure formulation, with the purpose of accounting for effects of the downstream vasculature on the vascular model (see figure below). These boundary conditions include:</p>
<ul>
<li><p><strong>Resistance Boundary condition</strong>. Here, the condition prescribed on the face is a relationship between flow and pressure of the form
$p = p_0 + R\,Q$, where $R$ is the resistance parameter that characterizes the downstream vasculature, $p$ is the weakly prescribed pressure, $Q$ is the flow rate passing through the face and $p_0$ is a “flag” that sets the boundary as a “weakly-prescribed pressure boundary”. This flag has a “zero” numerical value, so the total value of the pressure on that face is simply given by $R\,Q$.</p></li>
<li><p><strong>Impedance Boundary condition</strong>. Here, the condition prescribed on the face is a relationship of the form:</p></li>
</ul>
<p>$$
p(t)=p_0 + \frac{1}{T}\,\int_{t-T}^{t} Z(t−\tau) \, Q(\tau) \, d\tau
$$</p>
<p>where $Z$ is the Inverse Fourier Transform of an impedance function that characterizes the downstream vasculature, $p$ is the weakly prescribed pressure, $Q$ is the flow rate passing through the face, and $T$ is the cardiac cycle.</p>
<figure>
<img class="svImg svImgLg" src="documentation/flowsolver/imgs/Fig_16.png">
<figcaption class="svCaption" >Cardiovascular model with various boundary conditions</figcaption>
</figure>
<figure>
<img class="svImg svImgLg" src="documentation/flowsolver/imgs/Fig_17.png">
<figcaption class="svCaption" >Frequency content of impedance from the literature for the left external iliac and a canine femoral artery</figcaption>
</figure>
<p>The mathematical definition of an impedance function is:</p>
<p>$$
Z(\omega)=P(\omega)\,Q(\omega),\,\omega=0,1,2,\dots
$$</p>
<p>That is, a relationship between pressure and flow modes for different frequencies. The figure above shows the typical shape of these impedances as a function of the frequency in the human iliac artery under rest and exercise conditions. Getting a good characterization of these impedance functions is once again critical to accurately represent the way blood flows in our computational domain.</p>
<ul>
<li><strong>RCR lumped parameters condition</strong>. In this boundary condition type, we use a <em>reduced-order</em> model of the downstream vasculature, considering an electric circuit analog. In this theory, the behavior of the vasculature is represented by three parameters: a proximal resistance $R_p$, a capacitance $C$, and a distal resistance $R_d$.</li>
</ul>
<figure>
<img class="svImg svImgMd" src="documentation/flowsolver/imgs/Fig_18.png">
<figcaption class="svCaption" >Circuit representation of RCR block</figcaption>
</figure>
<ul>
<li><p><strong>Coronary boundary conditions</strong>. These conditions simulate what happens at the coronary outlets. The implementation in the <strong>svSolver</strong> follows the derivations in <a href="docsRefs.html#refSec2">this paper</a>.</p></li>
<li><p><strong>Closed-loop boundary circulation model</strong>. The capability of coupling a 3D finite element model with a lumped parameter model is built into the <strong>svSolver</strong>. Documentation on this feature will be available with later releases of the code. </p></li>
</ul>
<h3>Boundary conditions considered in Example 1</h3>
<p>Before we move on, let us recap the type of <em>physical problem</em> (<strong>Example 1</strong>) we are solving: the geometry used in this problem consists of an idealized blood vessel, represented by a cylindrical segment with a radius $r=2$ cm and length $L=30$ cm. We prescribe an idealized constant inlet volumetric flow rate $Q$ of $100$ cc/sec to a parabolic profile at the inlet face of the model ($\Gamma_g$). The dynamic viscosity $\mu$ and density $\rho$ of the blood are 0.04 poise and 1.06 gr/cm$^3$, respectively. The lateral surface of the vessel ($\Gamma_{s}$) is considered to be rigid (therefore, we will apply a zero-velocity condition there). For the outlet boundary ($\Gamma_h$), a spatially-constant pressure boundary condition is weakly enforced via a resistance $R$.
In this problem, we will consider a resistance of $R = 1333.0$ dynes·s/cm$^5$. </p>
<p>This resistance will give a (weakly-applied) pressure at the outlet face of</p>
<p>$$
p=p_0 + R\,Q = 0.0 + 1333.0 \cdot 100.0=133300.00 \approx 100\,\text{mmHg}
$$</p>
<p>(recall that $1.0$ mmHg = $1333.2$ dyn/cm$^2$). For steady flow in a long tube with a circular cross section, the flow will develop a flow profile known as the <em>Poiseuille</em> flow profile assuming the flow remains laminar. The flow will remain laminar in a circular tube assuming that the non-dimensional parameter given by the <em>Reynolds</em> number $Re$ is $Re < 2100$.</p>
<p>The definition of the Reynolds number is given by:</p>
<p>$$
Re = \frac{\rho\,D\,V}{\mu}
$$</p>
<p>where $V$ is a representative velocity of the flow, $D$ is a characteristic dimension of the vessel where the flow is happening (in this case, the diameter), and $\mu$ and $\rho$ are the dynamic viscosity and density, respectively.</p>
<p>For this problem, the Reynolds number is about $884$, so it is well within the laminar flow regime. For a fully developed flow, the axisymmetric profile is parabolic and is given by: </p>
<p>$$
v_z(a) = v_z^{max}\left[1-\left(\frac{a}{r}\right)^2\right]
$$</p>
<p>where $v_z^{max}$ is the maximum velocity at the center of the vessel, a is the radial coordinate from center of the vessel $0\le a \le r$ . The expression for maximum velocity is given by:</p>
<p>$$
v_z^{max} = 2\frac{Q}{\pi\,r^2}
$$</p>
<p>where $Q$ is the volumetric flow rate. The wall shear stress $\tau$, is given by</p>
<p>$$
\tau = \frac{2\,\mu\,v_z^{max}}{r}
$$</p>
<p>For this example, the maximum velocity is $v_z^{max} = 15.92$ cm/s and the wall shear stress is $\tau$ = $0.64$ dynes/cm$^2$.</p>
</section>
<section id="creatingjob" class="group"><h2>Creating a Job for Simulation</h2>
<p>Let’s try Example 1. The files for Example 1 can be found from the link on the left “Cylinder Example”. Download and open the project. Now we assume you already have the model and mesh for it.</p>
<p><strong>To create a simulation job (empty):</strong></p>
<pre class="highlight plaintext"><code>Right click the data node "Simulations" in the SV project in Data Manager
Click "Create Simulation Job" in the popup menu
Select Model: cylinder
Job Name: steady
Click "OK"
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/flowsolver/imgs/createemptyjob.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<figure>
<img class="svImg svImgSm" src="documentation/flowsolver/imgs/createjobdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>Now a new data node “steady” for the job is created under the data node “Simulations” in Data Manager. Double click the data node “steady" and the tool “SV Simulation” automatically shows up. The new job is empty and has not created input and data files yet. </p>
</section>
<section id="basic" class="group"><h2>Basic Parameters</h2>
<p>Basic parameters include fluid material properties, and initial conditions, which are some basic information to be used for Presolver and Flowsolver. Here we use the default values (in CSG units). Initial pressure is “0”. Initial velocities (vx, vy, vz) is “0 0 0”.</p>
<figure>
<img class="svImg svImgXl" src="documentation/flowsolver/imgs/basic.png">
<figcaption class="svCaption" ></figcaption>
</figure>
</section>
<section id="inflowbc" class="subgroup"><h2>Inlet Boundary Condition Specification</h2>
<p>Let’s first create a simple file to provide inlet flow rates before setting inlet boundary condition. Your problem may have more that one inflow wave form file. In this case, we only have a single flow file (called steady.flow). We put the file in a sub-folder “flow-files” under the project folder in the disk.</p>
<p>The format of the <strong>steady.flow</strong> file is as follows:</p>
<pre class="highlight plaintext"><code># Time (sec) Flow (cc/sec)
0 -100.0
1 -100.0
</code></pre>
<p>The first line is a comment line that you don’t need to include, but it helps to remember what units you used in the analysis. Then, two columns of numbers follow. The first column contains time values, and the second column flow values.</p>
<p><strong>WARNING</strong>: please note that flow coming <strong>into</strong> the model (forward flow) will have a negative sign, (like in the example considered here), whereas flow coming <strong>out of</strong> the model (backflow) will be positive. A good way to remember that is that in the case of forward flow, the vector that gives you the direction of the flow and the normal to the face of the model point in opposite directions, and therefore their dot product will be negative.</p>
<figure>
<img class="svImg svImgMd" src="documentation/flowsolver/imgs/negativeflow.png">
<figcaption class="svCaption" >Cylinder with negative inflow</figcaption>
</figure>
<p>On the other hand, in a situation of back flow, the numerical value in the *.flow file with be positive. </p>
<figure>
<img class="svImg svImgMd" src="documentation/flowsolver/imgs/positiveflow.png">
<figcaption class="svCaption" >Cylinder with positive inflow</figcaption>
</figure>
<p>In this problem, since we are running a steady case, our physical time goes from 0.0 to 1.0 seconds, and the flow is constant with a value of 100.0 cc/sec.</p>
<p><strong>HINT</strong>: it is very important that you are absolutely sure about the physical dimensions of your model: every unit (length, time, flow, density, etc.) in your analysis must be dimensionally consistent. You can easily check the size of your model in <a href="http://www.paraview.org/">Paraview</a> before importing it into <strong>SimVascular</strong>.</p>
<p>In this case, our cylinder has a radius $r=2.0$ cm and length $L=30$ cm.</p>
<p>Let’s start setting inlet boundary condition.</p>
<pre class="highlight plaintext"><code>Go to "Inlet and Outlet BCs"
All the faces of type "cap" are already listed in the table
Double click the row for the face "inflow"
A dialog pops up and also the face is highlighted in the 3D-view window.
In the dialog:
BC Type: Prescribed Velocities
Analytic Shape: parabolic
Point Number: 2
Fourier Modes: 1
Click the tool button "..." to select the file "steady.flow" we just created as above
Period: (filled automatically based on the data from the file)
Click "OK"
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/flowsolver/imgs/inletbcdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>Help Hints:</strong> </font> Please make use you specify face types when you create the corresponding model;otherwise, the cap faces won’t appear.</p>
<ul>
<li><p><strong>Point Number</strong>: This is the number of <em>temporal</em> data points that you want to have in one cycle. This is not necessarily the number of time points in the *.flow file. In this case, they match (2 in both cases), but this is because this is a very simple example using steady flow and two time points is all we need to characterize a constant flow. In general, your *.flow file will have in the order of $20$ data points over the cardiac cycle (that’s about how many points you will be able to reconstruct using <strong>PC-MRI</strong>, for example), and your interpolated data from it will have on the order of $100$-$200$ points. Whatever is enough to have a smooth representation of the inflow wave mapping to velocity vectors at the inlet face.</p></li>
<li><p><strong>Fourier Modes</strong>: Fourier smoothing allows to smooth your inlet flow curve and to make sure that you have a periodic function in the specified interval. </p></li>
</ul>
<p><strong>WARNING</strong>: Be careful with this! <strong>SimVascular</strong> is doing a Fourier Series approximation of the data that you provide in the *.flow file. Since in this case, our data is constant flow, we only need one Fourier mode to capture this appropriately. For pulsatile flow problems, we will need more Fourier Modes to accurately represent the *.flow data (usually, $10$ Fourier modes is enough for a pulsatile problem).</p>
<figure>
<img class="svImg svImgLg" src="documentation/flowsolver/imgs/inflowbc.png">
<figcaption class="svCaption" > </figcaption>
</figure>
</section>
<section id="outletbc" class="subgroup"><h2>Outlet Boundary Condition Specification</h2>
<p>We are making the face <strong>outlet</strong> into a <strong>weakly-pressure</strong> face. This is mathematically expressed by the expressions we saw before:</p>
<p>$$
p = p_0 + R\,Q
$$</p>
<p>$$
p(t)=p_0 + \frac{1}{T}\,\int_{t-T}^{t} Z(t−\tau) \, Q(\tau) \, d\tau
$$</p>
<p>This expression sets $p_0 = 0$ for the face <strong>outlet</strong>. The total pressure set on that face will be the result of the flow-pressure operator considered (i.e., resistance, impedance, RCR, Coronary etc.).</p>
<p>Let’s start setting outlet boundary condition.</p>
<pre class="highlight plaintext"><code>Double click the row for the face "outlet"
A dialog pops up and also the face is highlighted in the 3D-view window.
In the dialog:
BC Type: Resistance
Resistance: 1333 (resistance value)
Distal Pressure: (0 by default)
Click "OK"
</code></pre>
<figure>
<img class="svImg svImgSm" src="documentation/flowsolver/imgs/outletbcdialog.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p><font color="red"><strong>Help Hints:</strong> </font> Please make use you specify face types when you create the corresponding model;otherwise, the cap faces won’t appear.</p>
<h3>Advanced Options for splitting BC</h3>
<p>In many clinical cases, we would like to split a total resistance or capacitance among a group of outlets, instead of explicitly assigning resistance or capacitance for each individual outlet.</p>
<p>To use this feature, first set up the group of outlets with initial zero resistance or capacitance.</p>
<p>For resistance BC:</p>
<pre class="highlight plaintext"><code>Select a group of outlets, right click
Click "Set BC"
BC Type: Resistance
Resistance: 0
Click "OK"
</code></pre>
<p>For RCR BC:</p>
<pre class="highlight plaintext"><code>Select a group of outlets, right click
Click "Set BC"
BC Type: RCR
Rp, C, Rd: 0 0 0
Click "OK"
</code></pre>
<p>For Coronary BC:</p>
<pre class="highlight plaintext"><code>Select a group of outlets, right click
Click "Set BC"
BC Type: Coronary BC
Rp, Ca, Ra-micro,Cim, RV: 0 0 0 0 0
Pim (from file): Click the button "..." to select file for Pim
Pim Period: filled automatically using the data from the file. You can change the period, SimVascular will automatically scale the time from the file
Pim Scaling: use this value to scale presure values from the file
Click "OK"
</code></pre>
<p>After you set up the group, let’s split the total resistance or capacitance.</p>
<p>To split total resistance:</p>
<pre class="highlight plaintext"><code>Select the group of outlets, right click
Click "Split Resistance"
Total Resistance: total resistance for the group of outlets
Murray's Law Coefficient: (2~3), 2 in general, 2.6 for coronary arteries, 2.3 for pulmonary arteries
Ratio of resistance for each outlet:
Rp:Rd (for RCR BC):
Ra:Ra-micro:Rv (for Coronary BC):
Click "OK"
</code></pre>
<p>To split total capacitance:</p>
<pre class="highlight plaintext"><code>Select the group of outlets, right click
Click "Split Capacitance"
Total Capacitance: total capacitance for the group of outlets
Ratio of capacitance for each outlet:
Ca:Cim (for Coronary BC):
Click "OK"
</code></pre>
</section>
<section id="wallproperties" class="subgroup"><h2>Wall Property Specification</h2>
<p>In Example 1, the wall is rigid and set no-slip boundary condition. </p>
<pre class="highlight plaintext"><code>Go to "Wall Properties"
Type: Rigid
</code></pre>
<p>SimVascular also has options like “Deformable(Constance)” and “Deformable(Variable)”. We will explain them in Examples 3 and 4.</p>
</section>
<section id="solverparameters" class="subgroup"><h2>Solver Parameters</h2>
<p>There are many parameters for flow solver, but you are only required to set explicitly a few of them. Advanced parameters are optional. To check out the meaning of all the parameters, refer to <a href="/docsFlowSolver.html#solverinp">appendix</a>.</p>
<pre class="highlight plaintext"><code>Number of Timesteps: 200
Time Step Size: 0.03
Number of Timesteps between Restarts: 10
Step Construction : 2 # standard two iterations, enough for constant problems.
</code></pre>
<figure>
<img class="svImg svImgMd" src="documentation/flowsolver/imgs/solverparameters.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<h3>Time Step Parameters Block</h3>
<p><strong>Number of Timesteps: 200</strong> and <strong>Time Step Size: 0.03</strong> - These two lines control the amount of physical time that you run your problem for. In this case,</p>
<p>$$
\text{Total physical time} = \text{N. time steps} \times \text{Time Step Size} = T = N \times \Delta t = 200 \times 0.03 = 6.0\,\text{sec}
$$</p>
<p>Note that this doesn’t match the <strong>period</strong> options we specified before. In this case, like we mentioned before, it does not really make sense to talk about a <em>cardiac cycle</em> (this is a steady flow), but if we wanted to run this analysis for <em>six</em> cardiac cycles, we would have to run the problem for $6.0$ seconds of physical time. If we kept our choice of time step size the same ( $\Delta t = 0.03$ sec), we will need a total number of time steps of $N = 200$.</p>
<p><strong>WARNING</strong>: Note that this $N$ is the total number of time steps you need in your numerical simulation to model a certain physical time, given a prescribed $\Delta t$. </p>
<p><strong>WARNING</strong>: Now the question is: how do you come up with a reasonable value for $\Delta t$? There is not a straightforward answer for this. $\Delta t$ is the parameter that controls your <strong>temporal discretization</strong>, which is something that works in a similar fashion to the <strong>spatial discretization</strong> given by your mesh: the finer, the more accurate the results, but also the bigger the size of the problem and the time to solve it! We don’t want to get into a lot of theoretical details now, so we will just provide you with a reasonable <strong>recipe</strong> to evaluate this parameter. The <strong>recipe</strong> to estimate a reasonable $\Delta t$ is based on a dimensionless parameter called the <strong>CFL</strong> number. The CFL number relates the velocities happening in the fluid domain ($v$), a temporal discretization parameter ($\Delta t$), and a mesh discretization parameter (i.e. mesh size) ($h$) as follows:</p>
<p>$$
\text{CFL} = \frac{v\,\Delta t}{h}
$$</p>
<p>We want this <strong>CFL</strong> number to be around $1.0$. This will mean that, for the velocities present in our fluid domain, the temporal and spatial discretizations are <em>balanced</em>. In our problem, it can be shown that the average expected velocity is about $v = 16.7$ cm/s; the spatial discretization parameter or finite element size is $h = 0.5$. Therefore, if we shoot for a CFL number close to one, we have:</p>
<p>$$
\Delta t = \frac{h}{v} = \frac{0.5}{16.7} = 0.03
$$</p>
<p>Of course, you can imagine that in a real-world problem things are way more complicated to evaluate: it will be much harder to estimate where your model will have the largest velocities, what the mesh element size will be there, etc. The time step size $\Delta t$ is a parameter that will have a very important impact on the performance of the linear solver of equations. The smaller you make it, the <em>easier</em> you will be for the solver to find a solution, but the longer it will take you to reach a certain point in time.</p>
<p><br></p>
<h3>Output Control Block</h3>
<p><strong>Number of Timesteps between Restarts: 10</strong> - This line tells the solver how often it should save solution files. In this problem, you are really calculating $200$ solutions to the problem at $200$ different time points, but in general you do not want to save a solution file for every single time step. Keep in mind that two consecutive solutions are only $\Delta t = 0.03$ seconds apart! In this line, we are asking the solver to save one in every $10$ files. Therefore, the output files of the solver will look like this: restart.0.*, restart.10.*, restart.20.*, restart.30.*, …., restart.190.*, restart.200.*</p>
<p><br></p>
<h3>Step Construction Block</h3>
<p>This line controls the non-linear iteration loop within the time step. The syntax of the line represents a two nonlinear iteration process for each time step. Each iteration tells the solver to make a solve and an update of the solution. </p>
<p><strong>WARNING</strong>: Deciding on the adequate number of non-linear iterations for a problem is also a non-trivial problem. In principle, we need to iterate until the residual (i.e., the <em>error</em>) of our numerical solution is small enough. But doing many non-linear iterations on each time step is very costly. In general, for steady flow problems, 1 or 2 non-linear iterations are enough. For pulsatile problems, at least three non-linear iterations are needed. For deformable wall problems, 4 or more non-linear iterations are required. This parameter, together with the time step size $\Delta t$ and the quality of the spatial discretization given by the finite element mesh, will completely determine the performance of the linear solver of equations. The better chosen these parameters are, the faster and more accurately our simulation will run. We will talk more about this later.</p>
<p>The set of instructions explained here constitute a very small sample of all the possible parameters the <strong>svSolver</strong> can take. A more detailed discussion can be found in <a href="#solverinp">this section</a>.</p>
</section>
<section id="creatingdata" class="subgroup"><h2>Creating Data Files for Simulation</h2>
<p>Before running simulation, you need to create some required data files for presolver and flowsolver.</p>
<p>For Presolver:</p>
<ul>
<li><strong>.svpre</strong>: script input file</li>
</ul>
<p>For Flowsolver:</p>
<ul>
<li><strong>geombc.dat.1</strong>: containing mesh info and boundary conditions specified in the problem, created by presolver</li>
<li><strong>restart.0.1</strong>: containing initial conditions for our problem, , created by presolver</li>
<li><strong>numstart.dat</strong>: contains a number <strong>0</strong>. This number is used by the solver to identify the restart file that should be used as initial condition.</li>
<li><strong>bct.dat</strong>: containing time-dependent velocity vectors at the inflow face of the model according to a prescribed flow wave coming from a *.flow file. See <a href="#bctfile">this section</a>.</li>
<li><strong>solver.inp</strong>: providing further info for flowsolver, specifying parameters such as time step size, number of time steps, number of nonlinear iterations, boundary condition control, etc. A detailed description is presented in <a href="#solverinp">this section</a>.</li>
</ul>
<p>These five files are the bare minimum we need to run an analysis. However, if we want to perform more complicated simulations, involving more complex boundary conditions, we will need more input files.</p>
<p><strong>Impedance Boundary Condition simulations:</strong></p>
<p>In addition to the five standard files (geombc.dat.1, restart.0.1, numstart.dat, bct.dat, solver.inp), we will need to provide impedance functions in the time domain for each impedance outlet, as well as a history of flow rates for each outlet. We will have therefore two additional ASCII files: <strong>impt.dat</strong> (containing the impedance functions for each of the outlets), and <strong>Qhistor.dat</strong> (containing the flow rate history). A detailed description is <a href="#impbcfile">here</a>.</p>
<p><strong>RCR Boundary Condition simulations:</strong></p>
<p>In addition to the five standard files (geombc.dat.1, restart.0.1, numstart.dat, bct.dat, solver.inp), we will need to provide the RCR parameters in a ASCII file that will set the relationship between flow and pressure on each outflow face. This is done by defining a file named <strong>rcrt.dat</strong> containing such parameters. A detailed description is <a href="#rcrtfile">here</a>.</p>
<p><strong>Coronary Boundary Condition simulations:</strong></p>
<p>In addition to the five standard files (geombc.dat.1, restart.0.1, numstart.dat, bct.dat, solver.inp), we will need to provide the coronary model parameters in a ASCII file that will set the relationship between flow and pressure on each outflow face. This is done by defining a file named <strong>cort.dat</strong> containing such parameters. A detailed description is <a href="#cortfile">here</a>.</p>
<p><strong>Closed-loop boundary conditions:</strong></p>
<p>This will required an executable that implements a lumped parameter network model for the patient circulation. This will be covered in a later version of this tutorial. Stay tuned!</p>
<p><br>
<strong>HINT</strong>: In both files geombc.data.1 and restart.0.1, the number “.1” refers to the <strong>partition number</strong> of the file. Remember <strong>svSolver</strong> has the ability of running a problem <em>in parallel</em> (i.e., using multiple processors or computing cores), using MPI (message-passing interface). When we run a job using multiple processors, the first thing that happens is the “splitting” of these two files into as many processors we are going to use in our analysis, so the calculations can be performed faster. For example, if we use $4$ processors later in svSolver, these files will be split as follows:</p>
<pre class="highlight plaintext"><code>geombc.dat.1 => geombc.dat.1 , geombc.dat.2 , geombc.dat.3 , geombc.dat.4
restart.0.1 => restart.0.1 , restart.0.2 , restart.0.3 , restart.0.4
</code></pre>
<p>Roughly speaking, each of the four files is $1⁄4$ of the size of the original un-split file. For a generic time step <strong>n</strong>, the solution will be given by the following files:</p>
<pre class="highlight plaintext"><code>restart.n.1 , restart.n.2 , restart.n.3 , restart.n.4 , ...
</code></pre>
<p><br></p>
<h3>Creating Data Files</h3>
<p>This step creates files inside the job folder in the SV project</p>
<pre class="highlight plaintext"><code>Choose Mesh: cylinder
Click the button "Create Data Files for Simulation"
</code></pre>
<p>A new directory using the job name “steady” is created under the folder “Simulations” and contains the following folder/files:</p>
<pre class="highlight plaintext"><code>For presolver:
mesh-complete (folder)
inflow.flow
steady.svpre
For flowsolver
geombc.dat.1
restart.0.1
bct.dat (and bct.vtp)
solver.inp
numstart.dat
rcrt.dat (if applicable)
cort.dat (if applicable)
</code></pre>
</section>
<section id="runningjob" class="subgroup"><h2>Running Simulation Jobs</h2>
<p>Before running simulation, you may need to click the button “Import Extra Files into Job” to add extra file into the simulation job. In this example, we don’t need important extra files</p>
<p><strong>To run a simulation job:</strong></p>
<pre class="highlight plaintext"><code>Number of Processes: 8 (select the maximum number in your case)
Starting Step Number: (be default, use 0 or the last time step from previous simulation)
Click the button "Run Job"
</code></pre>
<p>This will launch a eight-processor job in your computer. Therefore, the input file are split as follows: </p>
<pre class="highlight plaintext"><code>geombc.dat.1 => geombc.dat.1, geombc.dat.2, ..., geombc.dat.8
restart.0.1 => restart.0.1, restart.0.2, ..., restart.0.8
</code></pre>
<p>During the job running, the progress of simulation is shown at “Job Status” and the status bar at the the bottom of the main window:</p>
<figure>
<img class="svImg scImgMd" src="documentation/flowsolver/imgs/simulationstatus.png">
<figcaption class="svCaption" ></figcaption>
</figure>
<p>It shows the name of the running job, the percentage completed, and more info: [current time step] [time used(s)] [nonlinear residual] [logarithm of the residual change] …</p>
<p>During the job running, you can terminate it before it finishes. To stop the simulation:</p>
<pre class="highlight plaintext"><code>Right click the job data node "steady" at Data Manager
Click "Stop Simulation" in the popup menu
</code></pre>
<p>After the simulation is finished. A dialog pops up to inform that the job is done. You can click the button “Show Details…” to get more info about the simulation progress. You can also check the simulation progress by open the file “histor.dat” in the folder “steady”. It contains containing details that allows to evaluate how well your numerical simulation is doing. Here’s a brief description of what each of those columns means.</p>
<table class='table borderless' id="solverTable">
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
<th>e</th>
<th>f</th>
<th>g</th>
<th>h</th>
</tr>
</thead>
<tr>
<td> 1 </td>
<td> 1.30E+001 </td>
<td> 1.16E-002 </td>
<td> (0) </td>
<td> 2.10E+002 </td>
<td> 2.62E+028 </td>
<td> < -10474 1 | 15 > </td>
<td> [199-190] </td>
</tr>
<tr>
<td> 1 </td>
<td> 2.50E+001 </td>
<td> 7.35E-003 </td>
<td> (-1) </td>
<td> 2.93E-001 </td>
<td> 5.15E+000 </td>
<td> < -3237 1 | 13> </td>
<td> [117-200] </td>
</tr>
<tr>
<td> 2 </td>
<td> 2.80E+001 </td>
<td> 5.13E-001 </td>
<td> (-16) </td>
<td> 1.75E-001 </td>
<td> 1.69E-001 </td>
<td> < -1357 1 | 5> </td>
<td> [63-1] </td>
</tr>
<tr>
<td> 2 </td>
<td> 3.00E+001 </td>
<td> 2.05E-002 </td>
<td> (-2) </td>
<td> 8.07E-002 </td>
<td> 2.67E-002 </td>
<td> < -3286 1 | 11> </td>
<td> [21-13] </td>
</tr>
<tr>
<td> 3 </td>
<td> 3.20E+001 </td>
<td> 1.20E-001 </td>
<td> (-10) </td>
<td> 8.75E-002 </td>
<td> 2.44E-002 </td>
<td> < -2342 1 | 7> </td>
<td> [36-1] </td>
</tr>
<tr>
<td> 3 </td>
<td> 3.40E+001 </td>
<td> 5.18E-003 </td>
<td> (-3) </td>
<td> 2.13E-002 </td>
<td> 3.59E-003 </td>
<td> < -3277 1 | 10> </td>
<td> [6-6] </td>
</tr>
<tr>
<td> 4 </td>
<td> 3.60E+001 </td>
<td> 2.14E-002 </td>
<td> (-2) </td>
<td> 5.57E-002 </td>
<td> 6.13E-003 </td>
<td> < -3146 1 | 9> </td>
<td> [24-2] </td>
</tr>
<tr>
<td> 4 </td>
<td> 3.80E+001 </td>
<td> 2.18E-003 </td>
<td> (-7) </td>
<td> 7.33E-003 </td>
<td> 3.15E-004 </td>
<td> < -3233 1 | 11> </td>
<td> [9-5] </td>
</tr>
<tr>
<td> 5 </td>
<td> 4.00E+001 </td>
<td> 1.52E-002 </td>
<td> (-1) </td>
<td> 4.22E-002 </td>
<td> 3.45E-004 </td>
<td> < -3141 1 | 10> </td>
<td> [27-3] </td>
</tr>
<tr>
<td> 5 </td>
<td> 4.20E+001 </td>
<td> 1.11E-003 </td>
<td> (-10) </td>
<td> 3.57E-003 </td>
<td> 1.24E-004 </td>
<td> < -3237 1 | 12> </td>
<td> [7-5] </td>
</tr>
<tr>
<td> 6 </td>
<td> 4.40E+001 </td>
<td> 1.24E-002 </td>
<td> (0) </td>
<td> 3.31E-002 </td>
<td> 3.16E-004 </td>
<td> < -3024 1 | 10> </td>
<td> [16-2] </td>
</tr>
<tr>
<td> 6 </td>
<td> 4.60E+001 </td>
<td> 1.01E-003 </td>
<td> (-10) </td>
<td> 3.98E-003 </td>
<td> 3.30E-005 </td>
<td> < -3220 1 | 11> </td>
<td> [6-5] </td>
</tr>
<tr>
<td> 7 </td>
<td> 4.80E+001 </td>
<td> 1.05E-002 </td>
<td> (0) </td>
<td> 2.70E-002 </td>
<td> 1.87E-004 </td>
<td> < -3019 1 | 10> </td>
<td> [8-2] </td>
</tr>
<tr>
<td> 7 </td>
<td> 5.00E+001 </td>
<td> 8.74E-004 </td>
<td> (-11) </td>
<td> 3.50E-003 </td>
<td> 4.35E-005 </td>
<td> < -2993 1 | 11> </td>
<td> [5-5] </td>
</tr>
<tr>
<td> 8 </td>
<td> 5.20E+001 </td>
<td> 9.09E-003 </td>
<td> (-1) </td>
<td> 2.25E-002 </td>
<td> 1.16E-004 </td>
<td> < -2993 1 | 10> </td>
<td> [8-2] </td>
</tr>
<tr>
<td> 8 </td>