Example 961: Ventilation distribution within a simple airway tree

This example predicts ventilation distribution in a simple airway model geometry. Solution is based on a modified Poiseuille based solution technique, including a turbulence correction factor at the bifurcations and a pressure-radius relationship in the airway branches.

Created by Kelly Burrowes on behalf of Kerry Hedges, 07/2009.

Figure displays the pressure solution (Pa) and the pressure spectrum used to display this.

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 961

# 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;
}

#Airway element fields
$eflow=1;
$resistance=2;
$strtrad=3
$num_elem_fields=3;

#Airway node fields
$radius=1;
$press=2;

fem de param;r;$example/match3d;
fem de coor 3,1;
fem de base;r;$example/single;

fem de node;r;$example/TestStructure;
fem de elem;r;$example/TestStructure 1d;

fem de mesh;c airway as conducting_airways field radius_field 1 only_radius_field;
fem evaluate ordering;

#Read in upper airway radii and then update mesh from there
fem de field;r;$example/TestStructure_radii values field 1;
fem de elem;d field tree 1d;

fem update mesh geometry radius_field 1 anatomical;

#Set up pressure field to write out pressure results
fem de;add field;d field_variable 1;
fem de elem;d field tree 1d;

fem group node 1 as inlet_node;
fem group elem 1 as inlet_elem;

fem group elem conducting_airways by terminal as terminal;
fem group node elem terminal xi1=1 as terminal_nodes;

#Set up element fields
fem de field;d elements field_variables $num_elem_fields flow_field $eflow resistance_field $resistance radius $strtrad;
fem de elem;d field;

fem de field;w;test_elem_field elements;

fem update field $strtrad elements from radius;

fem de equ;r;$example/single compliance none turbulence pedley;
fem de mat;r;$example/static;

#Set initial condtions
#$bcs='FLOW'   #constant terminal flow boundary conditions
$bcs='PRESS'  #constant terminal pressure boundary conditions
#$bcs='cmH2O'  #1 cm H20 drop down airways
if($bcs =~/FLOW/){
    $output = "Flow"
    fem de init;c lung node inlet_node fixed pressure transpulmonary 8;
    fem update init node inlet_node constant 0.0;
    fem de;add init;c lung elem terminal fixed flow;
    fem update init elem terminal constant 16.15;
}
if($bcs=~/PRESS/){
    $output = "Press"
    fem de init;c lung elem inlet_elem fixed flow transpulmonary 8;
    fem update init elem inlet_elem constant 231940;
    fem de;add init;c lung node terminal_nodes fixed pressure;
    fem update init node terminal_nodes constant 0.0;
}
if($bcs=~/cmH2O/){
    $output="cmH2O"
    fem de init;c lung node inlet_node fixed pressure transpulmonary 8;
    fem update init node inlet_node constant 13.0;
    fem de;add init;c lung node terminal_nodes fixed pressure;
    fem update init node terminal_nodes constant 98.06;
}

fem de solve;r;$example/static;
fem solve from 0 to 1 delta_t 1.0;
fem export node;left as left;
fem export elem;left as left;

fem export node;${output}_solved as solved field name pressure;
fem export elem;${output}_solved as solved field name pressure;

fem update field $eflow elements from solution;
fem de field;w;${output}_flow elements;
fem export properties;flow_results as results field index $eflow;

fem update field to $press from solution;
fem de field;w;${output}_press;

Additional testing commands:

fem list nodes
fem list elem field

Files used by this example are:

Name                        Modified     Size

example_961.com 12-Aug-2008 2.9k Press_flow.ipfiel 30-Jul-2008 2.4k Press_press.ipfiel 30-Jul-2008 3.7k Press_solved.exelem 30-Jul-2008 1.9k Press_solved.exnode 30-Jul-2008 713 TestStructure.ipelem 30-Jul-2008 3.4k TestStructure.ipnode 30-Jul-2008 4.3k TestStructure.out 30-Jul-2008 226 TestStructure_radii.ipfiel 30-Jul-2008 2.6k cmiss_test.out 30-Jul-2008 20k deform.snhist 30-Jul-2008 0 draw.com 30-Jul-2008 1.5k draw_spect.com 30-Jul-2008 1.2k flow_results.exelem 30-Jul-2008 1.0k left.exelem 30-Jul-2008 16k left.exnode 30-Jul-2008 4.5k match3d.ippara 30-Jul-2008 5.9k single.ipbase 30-Jul-2008 1.1k single.ipequa 30-Jul-2008 1.5k static.ipmate 30-Jul-2008 319 static.ipsolv 30-Jul-2008 1.8k test.com 30-Jul-2008 3.2k test_output.com 30-Jul-2008 35

Download the entire example:

Name                      Modified     Size

examples_9_96_961.tar.gz 12-Aug-2008 33k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmFailureSun Mar 6 00:05:46 20160
last breakThu Aug 21 00:08:00 20082
cm-debugFailureSun Mar 6 00:05:11 20160
last breakFri Jun 5 00:02:00 20150
rs6000-aix
cmFailureWed Mar 4 01:13:34 20091
last breakThu Aug 21 01:17:00 20081
cm-debugFailureWed Mar 4 01:17:45 20091
last breakThu Aug 21 01:18:00 20081
cm64FailureWed Mar 4 01:12:26 20091
last breakThu Aug 21 01:18:00 20081
cm64-debugFailureWed Mar 4 01:10:12 20094
last breakThu Aug 21 01:18:00 20081
x86_64-linux
cmFailureSun Mar 6 00:01:24 20160
last breakThu Aug 21 00:07:00 20081
cm-debugFailureSun Mar 6 00:01:25 20161
last breakFri Jun 5 00:01:00 20151

Testing status by file:


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

Input last modified: Tue Aug 12 02:30:13 2008


CMISS Help / Examples / 9 / 96 / 961