CFD Simulations for Water Evaporation and Airflow Movement in Swimming Baths 2
Lung4Cer CFD version: Lung4CerCFD - BIGLOBElung4cer/Lung4cerCFD_manualE.pdf · Lung4Cer CFD...
Transcript of Lung4Cer CFD version: Lung4CerCFD - BIGLOBElung4cer/Lung4cerCFD_manualE.pdf · Lung4Cer CFD...
Lung4Cer CFD version: Lung4CerCFD
Lung4CerCFD is a free software for generating 4D finite element models for computing
intra-pulmonary airflow by computational fluid dynamics (CFD), an advanced version of Lung4Cer,
a 4D modeler of the normal human lung. Ventilation within the lung is air shift generated by
displacements of intra-pulmonary structures according to the thoracic wall motion. Therefore, a 4D
lung model enables us to simulate airflow in the lung during breathing by solving Navier-Stokes
equation under moving boundary conditions. It is necessary for CFD to convert a model from merely
geometric one into FE (Finite Element) mesh. Lung4CerCFD generates a mesh file set for a CFD
solver (AcuSolve, Altair Engineering Co., USA). File conversions will be required for another CFD
solver.
Lung4CerCFD has been developed by the author with VC++ by Microsoft Inc. Expected personal
computers for executing the application are Win64 Xp. Vista, and 7 with memory beyond 4GB. Free
application software, ParaView, easily obtained through internet, is expected to use for visualizing
lung models. In this manual, the operation for generating a CFD-mesh set of a 4D lung model and
for executing AcuSolve will be explained. The basic explanations of the lung model and visualization
method are written in Manual for Lung4Cer.
Lung4CerCFD is under evolution. Please inform the author of your comments so as to evolve it
May 16, 2012
Hiroko Kitaoka, PhD, MD
1
Index
1. Let’s make a simple airway tree model ・・・・・・・・2
2. Let’s compute intra-airway airflow ・・・・・・・・・6
3. Let’s observe computed results by ParaView ・・・・・・9
4. Parameters for generating lung models ・・・・・・・・・・15
5. Airflow simulation with a whole lobar model ・・・・ 19
2
Chapter 1:Let’s make a simple airway tree model
1. Make a working directory before generating a model. Here, make a folder named CFD (red
circle), and put the executive file” Lung4CerCFD_E”. In addition, generate a folder named
“MESH.DIR” in which a file set for CFD will be stored.
2. Double-click on the icon , a white window appears.
3
3. Click a tab “Model Generation” > “Model Type”, and a dialog-box “Model Generation” opens
in which parameters for model generation are asked.
4. Here, just click “OK” button in the dialog-box. Immediately, pictures of an airway tree down to
segment bronchi at TLC (total lung capacity) are drawn on the window. There are explanations
about respiratory mode at the right side of the window. If the window does not have enough
length, drag the right edge of the window so as to see the full description.
4
5.Next, click a tab “File Output” > “File Type”, and a dialog-box “File Type” opens.
6. Click “OK” button in the dialog-box, too. Then, another dialog-box opens for “Save As” in which
file name is asked. Write the file name “lobeTree” in “Name box” (N) and click “Save button” (S).
Immediately, the file name and the number of generated branches appear on the window. In the
present case, 5 branches including the trachea have been modeled. The filename on the window is
the full name in your PC.
5
Let‘s make sure what files are generated in MESH.DIR. There are many files in it. All are for
CFD. Details of the generated model are written in “ReadMe.txt.
In “My Documents”, there are two files named lobeTree000.vtk and lobeTree008.vtk. The
extension “vtk” is a standard format of VTK (Visualization Tool Kit), one of the most popular open
sources for image processing. Two periods before “vtk” indicate a set of time serial VTK files.
Lung4CerCFD expects users to use a free visualization software “ParaView “, which has been
developed based on VTK.
7.If you wish to quit the application, click “File” > “Exit”. Although a dialog-box asks you
something, click the button “No”.
The above is the basic process of model generation by Lung4CerCFD. You can make plenty of
models with various combinations of bronchi, parenchyma, respiratory modes, and body postures.
Details will be explained in Chapter 5.
6
Chapter 1:Let’s compute intra-airway airflow
The method of airflow computation is explained here using a file set in MESH.DIR generated by
Lung4CerCFD. The expected CFD solver is AcuSolve by Altair Engineering, USA, a finite element
method solver. For the purpose of academic research and education in universities, AcuSolve can be
freely used. The following explanation presumes that AcuSolve has been already installed. If you
would use another CFD solver, file conversion of the lung model is needed.
1.Double-click on the icon for AcuConsole (AcuSolve Console).
2. Click “File” > “Open”,and select C¥Acusim¥WIN64¥V1.8a¥example¥Pipe¥pipe.acs. Then, the
image of pipe appears. “.acs” means a database file for computation.
7
3. Click “File” > “Save As” (red circle), and save the database for “Pipe” in the folder named “CFD”
(green circle) which was generated in the former chapter. Here, change the file name from “pipe.acs”
into “lung.acs” (blue circle). Then, click “Save”, and the title of AcuConsole, written in the right
upper corner of AcuConsole, changes from “pipe.acs” into “lung.acs”.
4.Copy an input file “lung.inp” , provided by the developer of Lung4Cer , in the folder “CFD”.
Then, click the icon of red arrow (red circle) , and a window named “Launch AcuSolve” appears.
Make sure the problem name in the uppermost frame is “lung”. Set “Off” for “Generate
AcuSolve input files” (green circle). Then click “OK”. Computation begins and finishes
immediately.
8
5. Let’s see the computed results by ParaView. Click on the icon (red circle), and a widow
named “Launch ParaView” appears. Click OK, and ParaView starts. How to use ParaView will be
explained in the next chapter.
Notions:
1. “Generate AcuSolve input files” in “Launch AcuSolve” should be always “off”. Otherwise, the
input file will be changed by AcuConsole. Please save the original file of “lung. inp”.
2. The method explained here is not general but only for the lung models generated by
Lung4CerCFD.
9
Chapter 3: Let’s observe computed results by ParaView
ParaView is a free application software for visualization developed in the US. You can easily
download it by internet and visualize various data from a simple graph to complex mechanical
simulation data.
In order to see computed results by AcuSolve, ParaView should be started from “Launch
ParaView” in AcuConsole. In this chapter, visualization methods of distributions of velocity and
pressure computed by AcuSolve will be explained using the airway tree model generated in the
previous chapter. Basic methods for 4D observation are written in the manual for Lung4Cer.
1.Read file
Click ”File” > “Open”, and select “lung.1.Log”.
2.Pressure distribution
(1) Visualization of the Model
Click “Apply” in ”Object Inspector” (red circle), and the tree model appears. The color indicates
pressure (green circle) in this view. Click “+Y” (blue circle), and the model posture becomes upright.
10
(2) Color scale
Click the color scale icon(red circle), and a window named “Color Scale Editor” appears.
The pressure at the upper end of the trachea is zero, and decreases downwards. During inspiration
phase, the airway is enlarged and incompressive air movement is generated. The pressure difference
is the viscous pressure drop of the air. Since ends of lobar bronchi are closed and there are no lung
lobes, the volume change of the airway is very small, and the pressure difference is also very small.
In addition, meshes in this model are very coarse and have no quantitative accuracy. However, the
tendency of pressure distribution is properly reproduced. For the accurate computation, mesh size
should be assigned at 3 or 4.
11
(3) Animation
Click the triangle icon (red circle), and the model moves. If the color scale is set “Automatically
Rescale”, the whole airway becomes red in the expiratory phase. So, click “Rescale Range”, and
assign Minimum at -0.05 and Maximum at 0.0. Then, you can see the pressure gradient changes
between inspiratory and expiratory phases.
3.Computation and visualization of relative air velocity
(1) Computation of relative air velocity
Since computed velocity contains the displacement velocity of mesh nodes, relative velocity of air
to the airway wall is obtained by subtracting the displacement velocity from the absolute air
velocity.
Click “Calculator” (red circle), and a keyboard appears. in the object inspector.
Click “Vectors”(green circle), and four vectors are indicated. Select at first “velocity”, and the
word of velocity appears in an empty frame (blue circle). Then click ”-“ in the keyboard, click
“Vectors” again, and select “mesh_velocity”. Then click “Apply”. Newly made “Result”
(orange circle) is the relative air velocity.
12
(2) Visualization of velocity by glyphs
Since the relative air velocity at the wall is zero, color mapping of the velocity by surface
rendering is useless as shown in the above image. In such a case, , visualization by glyph is useful.
Click the sphere icon (red circle) and “Apply”. The, you will see an arrow head on the top of the
trachea. Click the eye icon on the left side of “ Calculator” (green circle), and the airway shape
disappears and many arrows appear.
13
(3) Simultaneous visualization of pressure and velocity
If the airway shape is translucent, we can see the pressure distribution and air velocity distribution
at the same time.
Click any character of “Caliculator” (red circle), and, the background becomes blue. It means that
“Calculator” is now activated. Open the eye of “Calculator”, and set the variable “pressure”.
(green circle). Then, Open “Object Inspector” > “Display” (blue circle), scroll down the browser,
and change “Opacity” from 1 to 0.2 (brown circle).
Next, Click any character of “Glyph”, and set the variable “Result”. Finally, you can see how the
velocity vector changes according to pressure distribution.
14
Are computed results by CFD reliable? If the question means reproducibility in the human body, it
is very difficult to answer. If the question means reproducibility in a certain machine which has the
same structure and motion as the model used for CFD, the answer is “Yes”, as long as the mesh size
and time step are properly assigned.
Accurate computation is performed with mesh size parameter of 3 (right model in the upper figure)
in this shape model. Computed pressure drop in the trachea is exactly consistent to Hagen-Poisuille
flow. Accuracy check is performed with an accessory application of AcuSolve, AcuProbe.
15
Chapter 4:Parameters for model generation
Lung4CerCFD can generate various types of human lung model by combining several parameters
which assign element, composition, location, breathing mode, and body postures.
(A) Model Type
1: generate an airway tree down to respiratory bronchioles without parenchymal elements.
To which level, and in which region, are assigned by parameters in (B) and (C),
respectively.
2: generate an airway tree with air-supplied parenchymal regions. Terminal branches in the tree
have respective parenchymal regions to which they supply air. Each parenchymal region
is expressed as a set of cubes whose side lengths are equal to the diameter of the terminal
branch. There is an approximate relationship between the diameter of a branch (D) and the
volume of parenchymal region to which the branch supplies air (V): V ≃ 1,000 x D3.
3: generate an air pathway from the trachea to one single subacinus consisting of space-filling
alveolar ducts and sacs. The subacinus is defined as a part of the pulmonary acinus to
which one last respiratory bronchiole supplies air.
4: generate one last bronchiole and its supplying subacinus. Since Model Type 3 is multi-scale
from 10 cm length of the trachea to 10 micron meter thickness of the alveolar wall, it is
impossible to observe the model at a glance. It is necessary to generate only the
subacinar region in order to observe precisely the subacinar structure, to ,
5: generate only the alveolar system with various geometric shape independent from the whole
lung structure.
6: generate an air pathway from the trachea to one single subacinus with respective
air-supplying regions. Alveoli are generated only in the subacinus. Simultaneous airflow
computation in the trachea and alveoli can realize with this type.
For Types 1,2,3, and 6, tracheal diameter can change. Although only homothetic
deformation is designed in this version, various deformations not only for te trachea but also
intra-pulmonary airways are now preparing.
16
(B) Branch number in the airway tree
There is an a relationship between the number of the human airway tree and the anatomical
property of the terminal branches such as follows: .
Lobar bronchi ≃ 10 (= 9)
Segmental bronchi ≃ 40
Miller’s lobular bronchi = 1,000 – 5,000
Reid’s lobular bronchioles = 5,000 – 30,000
Respiratory bronchioles ≃ 20,000 – 500,000
Approximate total number in the airway tree is used in order to assign the anatomical property
of the terminal branches. In this version, at most 3,000 branches can be for Model Type 1.
On the other hand at most 400 branches can be generated for Model Type 2, because it needs a
lot of computational costs for generating parenchymal regions. There is a simple relationship
between the total number of branches in a tree (B) and the number of terminal branches (T) as
follows: B = 2T +1, as long as branching is always dichotomy (trichotomy can be
interpreted as double dichotomies with a very short interval). Therefore, at most 200 regions
can be generated for Model Type 2.
For Model type 3 4, or 6, it is necessary to assign the number at 60,000 (at least 20,000),
because at least one respiratory bronchiole should be generated. However, when Region of
Interest, which will be explained next, is assigned adequately, the number of really generated
branches is reduced drastically.
Note that the number of branches in a generated model is not the same as the input number.
The real number in the model is written on the window of Lung4CerCFD.
(C) Region of Interest: ROI
0: the whole lung
1: right upper lobe, 2: right middle lobe, 3: right lower lobe
4. left upper lobe, 5. left lower lobe
Lung segment in the right lung = 100 + segment number
Lung segment in the left lung = 200 + segment number
The model generation is performed only within the assigned region. If you wish to make a
whole-lobe model, assign Model Type at 2, Branch Number at 10, and ROI at 0. If you wish
to make a whole-segment model, assign Model Type at 2, Branch Number at 40, and ROI at 0.
If you wish to make a one whole-lobular model in one segment, assign Model Type at 2,
17
Branch Number at 1000, and ROI beyond 100.
If you wish to make a subacinar model, assign Model Type at 3, 4 or 6, Branch Number at
60000, and ROI beyond 100. If you assign a ROI number without corresponding lung
segments, a subacinus in the nearest segment in number is generated.
(D) Composition of the alveolar system Lung4CerCFD generates an alveolar system model by connecting a lot of alveolar duct unit
so as to mimic an air pathway in the pulmonary subacinus (See Reference 2 and 3). The
alveolar duct unit is a basically cubic but bumpy deformed duct with eight alveoli inside.
The following parameters assign how many units are how arranged. If you assign Model
Type at 1 or 2, you do not have to consider them.
The present version of Lung4CerCFD can connect at most 180 units, which realize an
average size of the human pulmonary subacinus. The smaller number is the better for
precisely observing 4D structure of the alveolar duct. Note that the number of units in a
generated model is not always the same as the input number. The real number in the model
is written on the window of Lung4CerCFD.
Four types of the subacinar shape are provided as follows:
0. space-filling: fills a given space (cubic for Model Type 5 )
1. pyramid: pyramidal subacinus whose apex is the end of its-supplying bronchiole
2. sheet: square sheet in which duct units are arranged in 2D
3. bar: straight duct in which duct units are arranged in 1D
For Model Type s 4 and 5, there are many candidate respiratory bronchioles for model
generation. In order to identify those candidates, ID number is allocated to every generated
respiratory bronchiole according to generated order. When the shape is assigned at 0, there are
several respiratory bronchioles which fail to connect to their own air-supplying regions due to
shortcomings of the algorithms. In such a case, try another ID number.
For Model Type 5, it is possible to select whether the last respiratory bronchiole is added (0)
or not (1). The last bronchiole is necessary for airflow simulation but unnecessary for
structural simulation.
(E) Breathing mode
There are four parameters to assign breathing mode, the lung capacities at the beginning and
the end of inspiration, I/E ratio, and the body posture.
18
In general, the lung capacity (LC) is expressed by an equation as follows:
LC = RV + f‧VC,
where RV is the residual volume、VC is the vital capacity, and f is the volume fraction of VC. LC is
equal to RV when f = 0, , and is equal to the total lung capacity (TLC) when f = 1. In the present
model, the functional residual volume (FRC) is assigned at f = 0.35, and the inspiratory lung
capacity at rest is assigned at f = 0.5. Since the lung parenchymal volume is dependent on the
parenchymal position and body posture, the value of f should be regarded as an approximated
value. As a default condition, FRC to TLC with I/E ratio of 2 : 3 under upright posture is assigned. If
you wish to make a model for the full vital capacity, lung capacity at the beginning of inspiration
should be changed into 0. Although it is known that there is hysteresis in respiratory cycle, no
hysteresis are included in this version for the sake of simplicity.
For the purpose of quantitative analysis, inspiration and expiration should be computed
respectively by assigning I/E ratio at 1 in this version. Time step and total time can be changed as
mentioned in Chapter 3.
19
Chapter 5: Airflow simulation with a whole lobar model
In this chapter, several examples of airflow computation are demonstrated. It took about three
minutes for model generation and flow computation for each case, respectively.
Model Parameter:
Model Type = 2, Branch number = 10, ROI = 0
Breathing mode:
(1) inspiration at rest: beginning = 0.35, end-inspiration = 0.55,
average flow rate 0.2 L/s, 2.0 seconds
(2) expiration at rest: beginning = 0.55, end-inspiration = 0.35,
average flow rate 0.2 L/s, 2.0 seconds
(3) expiration from TLC: beginning 1.0, end-expiration 0.35
average flow rate 1.7 L/s, 1.0 second
Mesh size = 4
20
21
References:
1.Kitaoka H, Takaki R, and Suki B. A three-dimensional model of the human airway tree. J. Appl. Physiol. 87: 2207-2217, 1999.
2. Kitaoka H, Tamura S, and Takaki R. A three-dimensional model of the human pulmonary acinus.
J. Appl. Phsiol. 88: 2260-2268, 2000.
3.Kitaoka H, Nieman GF, Fujino Y, Carney D, DiRocco J, Kawase I. A 4-dimensional model of the
alveolar structure. J Physiol. Sci. 57: 175-185, 2007.
5. Kitaoka H, Kawase I. A novel interpretation of closing volume based on single-breath nitrogen
washout curve simulation. J Physiol. Sci. 57: 367-376, 2007.
6. Kitaoka H., Hoyos CAM, Takaki R. Origami model for breathing alveoli. Adv. Exp. Med. Biol .
669: 49-52, 2010.
7. Kitaoka H. The origin of frequency dependence of respiratory resistance: An airflow simulation
study using a 4D pulmonary lobule model. Respirology 16: 517-522, 2011.
8. Kitaoka H, A 4D model generator of the human lung. Forma 26: 19-24, 2011.
9. Kitaoka H. Construction of the human lung and air flow analysis. Forma (in press).