This example simulates mixing of sulphur-hexafloride with nitrogen in a model of the airways. The model uses a symmetric conducting airway system, based on Weibel's model A, down to generation 16. Because the model is symmetric, only a single pathway needs to be considered. Attached to the end of the terminal conducting airway is a multi-branching point model (see modeling work by Paiva et al. for a description) of a single pulmonary acinus, with geometry based on the morphological study of Haefeli- Bleuer and Weibel. The figures below show the respiratory portion of the model at end inspiration and end expiration, with the gas concentration field coloured.
Created by Merryn Howatson Tawhai.
![]() |
![]() |
Concentrations at end of inspiration |
Concentrations at end of expiration |
Sulphur-hexafloride is washed in (red). The concentration front can clearly be seen at the end of inspiration. At the end of expiration there are only small concentration differences in the acinus model.
# 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; } $filename = "scamba"; $RADIUS = 1; $INSPIRATION = 1; $EXPIRATION = 2; $dt = 0.05; $T_insp = 1.0; $T_expn = 1.0; $NUM_EXPORTS=1; $time = 0.0; $flow_in = 0.5; #litres $flow_out = -0.5; #litres $v_t = $flow_in * $T_insp; #in litres $FIXED_NODE = 1; $FLUX_NODE = 1; $initial = 0.0; $concentration = 1.0; $material = "o2n2"; $NUM_BREATHS = 10; $N=0; fem de param;r;"$example/$filename"; #set up parameters for array dimensioning fem de coor;r;"$example/$filename"; #3d rectangular cartesian fem de base;r;"$example/$filename"; #linear basis function with 4 gauss points fem de mesh;r;"$example/$filename" as conducting field; fem de;add mesh;c airway multi_hbw basis_function 1 as respiratory field radius_field 1 alveolar_field 2; fem update mesh geometry elem conducting radius_field 1 anatomical weibel; fem update mesh geometry elem respiratory radius_field 1 anatomical hbw; fem group node in element respiratory as respiratory; #DEFINE THE PROBLEM SETUP FOR INSPIRATION fem de equa;r;"$example/$filename" class $INSPIRATION; fem de mate;r;"$example/$material" class $INSPIRATION; fem de moti;c lung elem respiratory uniform flow_field 3 inlet_flow $flow_in class $INSPIRATION; fem de init;c lung fixed node $FIXED_NODE conc $concentration initial $initial class $INSPIRATION; fem de solve;r;"$example/${filename}_insp" name $material; #DEFINE THE PROBLEM SETUP FOR EXPIRATION fem de equa;r;"$example/$filename" class $EXPIRATION; fem de mate;r;"$example/$material" class $EXPIRATION; fem de moti;c lung elem respiratory uniform flow_field 3 inlet_flow $flow_out class $EXPIRATION; fem de init;c lung flux node $FLUX_NODE class $EXPIRATION; fem de solve;r;"$example/${filename}_expn" class $EXPIRATION name $material; $restart = ""; $time_end = 0.0; for (my $j = 0; $j < $NUM_BREATHS; $j++){ for (my $i = 0; $i < $NUM_EXPORTS; $i++){ $time_end = $time_end + $T_insp/$NUM_EXPORTS; print "FEM solve $restart to $time_end delta_t $dt class $INSPIRATION\n"; fem solve $restart to $time_end delta_t $dt class $INSPIRATION; $N++; $restart = "restart"; } fem update solution class $EXPIRATION substitute solution class $INSPIRATION; for (my $i = 0; $i < $NUM_EXPORTS; $i++){ $time_end = $time_end + $T_expn/$NUM_EXPORTS; print "FEM solve $restart to $time_end delta_t $dt class $EXPIRATION\n"; fem solve $restart to $time_end delta_t $dt class $EXPIRATION; $N++; } fem update solution class $INSPIRATION substitute solution class $EXPIRATION; fem update solution class $INSPIRATION nodes $FIXED_NODE substitute constant $concentration; } #fem evaluate pulmonary Sn for $NUM_BREATHS ev_start 0.75 ev_end 0.95 vt $v_t;
FEM list node solution class $INSPIRATION; FEM list node solution class $EXPIRATION;
Name Modified Size
example_91.com 07-Jul-2004 2.9k o2n2.ipmate 07-Jul-2004 296 scamba.ipbase 10-Apr-2000 893 scamba.ipcoor 10-Apr-2000 688 scamba.ipequa 11-Sep-2007 1.7k scamba.ipmesh 31-Mar-2004 2.4k scamba.ippara 01-Dec-2006 5.8k scamba.ipsolv 13-Apr-2007 2.3k scamba_expn.ipsolv 13-Apr-2007 2.3k scamba_insp.ipsolv 13-Apr-2007 2.3k test_output.com 07-Jul-2004 88
Name Modified Size
examples_9_91.tar.gz 12-Sep-2007 155k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Failure | Sun Mar 6 00:05:10 2016 | 1 |
last break | Thu Sep 10 00:11:00 2009 | 1 | |
last success | Sun Aug 16 01:27:00 2009 | 23 | |
cm-debug | Failure | Sun Mar 6 00:05:10 2016 | 0 |
last break | Thu Sep 10 00:11:00 2009 | 1 | |
last success | Fri Aug 21 00:57:00 2009 | 38 | |
mips-irix | |||
cm | Success | Sun Aug 19 03:34:53 2007 | 137 |
cm-debug | Failure | Mon Jun 26 08:52:21 2006 | 454249 |
last break | Wed Jun 21 02:41:00 2006 | 454249 | |
last success | Wed May 31 03:21:00 2006 | 311 | |
cm-debug-clear-malloc | Failure | Mon Mar 27 09:33:10 2006 | 189106 |
last break | Sat Mar 25 05:01:00 2006 | 189106 | |
last success | Sat Mar 11 05:42:00 2006 | 313 | |
cm-debug-clear-malloc7 | Failure | Thu Mar 23 13:22:30 2006 | 213882 |
last break | Thu Mar 23 02:20:00 2006 | 39603 | |
last success | Mon Mar 13 05:05:00 2006 | 315 | |
cm64 | Success | Sun Aug 19 03:29:37 2007 | 124 |
cm64-debug | Failure | Thu Jun 8 12:42:56 2006 | 200531 |
last break | Tue Jun 6 05:00:00 2006 | 200531 | |
last success | Tue May 30 04:26:00 2006 | 321 | |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:15:47 2009 | 12 |
cm-debug | Success | Mon Mar 2 01:17:22 2009 | 55 |
cm64 | Success | Wed Mar 4 01:14:55 2009 | 13 |
cm64-debug | Success | Tue Mar 3 01:25:31 2009 | 53 |
x86_64-linux | |||
cm | Failure | Sun Mar 6 00:01:24 2016 | 1 |
last break | Thu Sep 10 00:10:00 2009 | 1 | |
last success | Sun Aug 16 01:07:00 2009 | 11 | |
cm-debug | Failure | Sun Mar 6 00:01:24 2016 | 0 |
last break | Thu Sep 10 00:10:00 2009 | 3 | |
last success | Fri Aug 21 00:29:00 2009 | 25 |
mips-irix | |||
SIGTERM | cm-debug: | exit due to SIGTERM signal. | |
SIGTERM | cm-debug-clear-malloc: | exit due to SIGTERM signal. | |
SIGTERM | cm-debug-clear-malloc7: | exit due to SIGTERM signal. | |
SIGTERM | cm64-debug: | exit due to SIGTERM signal. |
i686-linux | |||
1 | cm: | error exit status 1. | |
1 | cm-debug: | error exit status 1. | |
x86_64-linux | |||
1 | cm: | error exit status 1. | |
1 | cm-debug: | error exit status 1. |
i686-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
mips-irix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc7: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
rs6000-aix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
x86_64-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. |
i686-linux | |||
Missing | cm: | output file not generated for ndiff; generic answer. | |
Missing | cm-debug: | output file not generated for ndiff; generic answer. | |
mips-irix | |||
Success | cm: | ndiff test: no significant differences with irix answer. | |
Missing | cm-debug: | output file not generated for ndiff; irix answer. | |
Missing | cm-debug-clear-malloc: | output file not generated for ndiff; irix answer. | |
Missing | cm-debug-clear-malloc7: | output file not generated for ndiff; irix answer. | |
Success | cm64: | ndiff test: no significant differences with irix answer. | |
Missing | cm64-debug: | output file not generated for ndiff; irix answer. | |
rs6000-aix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
x86_64-linux | |||
Missing | cm: | output file not generated for ndiff; generic answer. | |
Missing | cm-debug: | output file not generated for ndiff; generic answer. |
Html last generated: Sun Mar 6 05:50:34 2016
Input last modified: Tue Sep 11 10:52:24 2007