Example 9822: Solution of Navier-Stokes equations (including gravity) through a simple, symmetric pulmonary arterial network

This example models blood flow in a simple, symmetric pulmonary arterial network by solving the Navier-Stokes flow equations, including the effects of gravity. The main arterial trunk vessels are read in and 4 generations of symmetric branching are created from these end points. The reduced Navier-Stokes equations are solved using a Lax-Wendroff numerical technique, the solution procedure used is detailed in Smith (2002) .

Created by Kelly Burrowes, 08/2004.

Orthogonal views of the solution, pressure solution (kPa) shown on the left; velocity solution (mm/s) shown on the right. Spectrums extend from minimum values (dark blue) to maximum values (red).

To create an image in order to visualise the results of the simulation, use CMGUI with the file draw.com.

The comfile run by this example is as follows:

# Example 9822

# If the example path is not set, default to current directory
if (! defined $example) {
    $example = "./";
# Drop off the trailing / in the example path
$chopped = chop $example;
if ($chopped ne "/") {
    $example .= $chopped;

fem define param;r;$example/flow;

fem define coord;r;$example/flow;
fem define base;r;$example/flow;

fem de node;r;$example/trunk as parent;
fem de elem;r;$example/trunk as parent;

#evaluate ordering of parent vessels before creating symmetric mesh
fem evaluate order; 
#Now set up a symmetric mesh 
fem de mesh;c lung symmetric num_generation 4 branch_angle 40 elem parent;

fem define mesh;c lung field only_radius; 
#only sets up radius field

fem evaluate order;
#fem update mesh geometry radius_field 1 anatomical Arteries;

fem update mesh geometry radius_field 1 element 1 constant 12;
fem update mesh geometry radius_field 1 Rd_strahler ratio_diameter 1.5997;

fem de elem;w;test;
fem de elem;r;test; #sets up NLL - element length array

#adds two more fields to store the pressure and velocity fields, adds 0 as default value
fem define;add field;d;$example/arteries field_variables 2;
#fem define field;w;test;
fem define element;d;$example/arteries field;

fem define grid;r;$example/flow coronary;
# Defines grid points with coronary option to discretise the spatial computational domain. 
fem update grid geometry;
fem define equation;r;$example/flow;       # Defines equations                          
fem define material;r;$example/flow;       # Reads in physical & mechanical properties
fem update material field material 4 no_field 1;
fem define time;r;$example/step;        
fem define initial;r;$example/flow;        # Defines initial conditions
fem define solve;r;$example/flow;          # Defines solution parameters

$time_initial=0.00;                       # Sets the initial time
$time_final=1.5;                         # Sets the final time
$time_step=0.001;                        # Sets the time step time
$write_out_period=0.1;                 # Sets the results write out period

fem export points;$time_initial grid as vessel offset 0;   
fem export grid;vessel as vessel offset_node 0 elastic_tube; 

# Results output loop

for ($time=$time_initial;$time<$time_final;$time=$time+$write_out_period)
fem solve restart to $write_out_period delta_t $time_step;
fem export points;$time+$write_out_period grid as vessel offset 0

Additional testing commands:

fem list nodes

Files used by this example are:

Name              Modified     Size

example_9822.com 22-Jan-2007 2.4k draw.com 26-Aug-2004 1.4k flow.ipbase 26-Aug-2004 893 flow.ipcoor 26-Aug-2004 572 flow.ipequa 22-Nov-2005 1.3k flow.ipgrid 26-Aug-2004 216 flow.ipinit 01-Dec-2005 907 flow.ipmate 26-Aug-2004 6.7k flow.ippara 23-Jun-2005 5.9k flow.ipsolv 26-Aug-2004 759 step.iptime 26-Aug-2004 1.5k test.com 22-Jan-2007 2.5k test.ipelem 26-Aug-2004 40k test_output.com 26-Aug-2004 15 trunk.ipelem 26-Aug-2004 2.8k trunk.ipnode 26-Aug-2004 2.4k vessel.exelem 26-Aug-2004 62k

Download the entire example:

Name                           Modified     Size

examples_9_98_982_9822.tar.gz 23-Jan-2007 59k

Testing status by version:

StatusTestedReal time (s)
cmFailureSun Mar 6 00:19:30 20165
last breakSun Aug 23 02:15:00 200916
last successSun Aug 16 01:20:00 200910
cm-debugFailureSun Mar 6 00:05:12 20160
last breakFri Jun 5 00:18:00 20150
last successFri Aug 21 00:40:00 200916
cmSuccessSun Aug 19 01:52:09 200722
cm-debugSuccessWed Aug 15 02:10:41 2007108
cm-debug-clear-mallocSuccessSat Aug 18 02:29:24 2007114
cm-debug-clear-malloc7SuccessMon Aug 20 02:23:39 2007121
cm64SuccessSun Aug 19 01:52:58 200723
cm64-debugSuccessTue Aug 21 02:11:39 2007111
cmSuccessWed Mar 4 01:09:44 20094
cm-debugSuccessMon Mar 2 01:16:24 200926
cm64SuccessWed Mar 4 01:10:52 20094
cm64-debugSuccessTue Mar 3 01:19:52 200925
cmFailureSun Mar 6 00:11:54 2016207
last breakSun Sep 6 01:32:00 2009942
last successSun Aug 16 02:33:00 2009941
cm-debugFailureSun Mar 6 00:01:25 20160
last breakFri Jun 5 00:11:00 20151
last successFri Aug 21 01:38:00 20091162

Testing status by file:

Html last generated: Sun Mar 6 05:50:36 2016

Input last modified: Mon Jan 22 13:53:33 2007

CMISS Help / Examples / 9 / 98 / 982 / 9822