Coronary Netlists Guide¶
Components¶
In order to create a pulsatile model of coronary flow with custom elastance, the following components need to be created using the netlist editor:
-
Heart model
- netlist_surfaces.dat
- elastanceLV.dat
- elastanceController.py
- ventricularPressureObserver.py
-
Coronary model
- netlist_surfaces.dat
- ventricularPressureReceiver.py
Custom elastance is required when simulating flow in either the right or left coronary. If simulating the aortic root and entire coronary tree, the built-in LV Elastance controller can be used.
Method¶
Generate Elastance files¶
A custom elastance waveform (elastanceLV.dat
) can be generated using lv_elastance_generator_two_hill.m
.
Adjust the scaling factor as needed to change the proportion of the cardiac output entering the coronaries.
Create Heart Model¶
-
In the CRIMSON GUI, create a Netlist boundary condition.
-
On the right hand panel, select
Heart Model: True
and use theSelect faces
button to choose the correct inflow face. -
Select
Launch Editor
to open the CRIMSON Boundary Condition Toolbox -
In the CRIMSON Boundary condition editor, click on
File > New
to open a blank workspace in the editor.-
Build the following circuit for the heart model by selecting the
Components
tab and double clicking the appropriate component to select it. Single click in the editor to place the component in the circuit. Right click to rotate the component. From right to left:- 3D interface node
- AV inductor: Aortic Valve Inductance
- AV diode: Aortic Valve
- LV Volume-Tracking Pressure chamber: Left ventricle
- Prescribed Pressure Node
- MV inductor: Mitral valve inertance
- MV diode: Mitral valve
- LA Prescribed Pressure Node: Left atrial pressure
-
-
In the
Properties
tab, enter the following values for each component:- Prescribed Pressure Node (LA)
- Prescribed Pressure:
665
- Prescribed Pressure:
- Prescribed Pressure Node (Zero-Pressure)
- Prescribed Pressure:
0
- Node control type:
Custom Python script
- Additional input data filename:
ventricularPressureObserver.py
- Prescribed Pressure:
- Inductor (AV)
- Parameter value:
1e-5
- Parameter value:
- Inductor (MV)
- Parameter value:
6e-5
- Parameter value:
- Diode (AV)
- Parameter value:
1e-5
- Parameter value:
- Diode (MV)
- Parameter value:
1.1e-5
- Parameter value:
- Volume-Tracking Pressure Chamber (LV)
- Parameter value:
0.0041
(elastance) - Initial Volume:
100000
(mm3) - Component control type:
Custom Python script
- Additional Input data filename:
elastanceController.py
- Parameter value:
- Prescribed Pressure Node (LA)
-
Click on the
Assign Nodes
button in the toolbar at the top of the screen. All the nodes should now be numbered. Take note of the node above the LV pressure chamber. -
Under
Initial Node Pressures
at the bottom of theProperties
tab, assign the following pressures to the nodes on either side of the AV inductor:- Initial Pressure at Node 1: 13332
- Initial Pressure at Node 2: 13332
Note: Node numbering may not be the same as what is presented here. Double check that you are assigning values to nodes on either side of the AV inductor.
-
Click on the
Write Simulation Files
button on the toolbar at the top of the screen. Select the folder to save the heart model files. This will generatenetlist_surfaces.dat
and the default versions of the component control python scripts. -
Close the Boundary Condition Toolbox and return to the CRIMSON GUI.
- In the Heart model netlist Boundary Condition window, select
Circuit
and upload thenetlist_surfaces.dat
file generated by the Boundary Condition Toolbox. - Click on
Data File
and uploadelastanceLV.dat
from MATLAB. -
Click on
Adjustment Scripts
to uploadelastanceController.py
andventricularPressureObserver.py
- Before uploading the python adjustment scripts, ensure that the following changes have been made:
-
ventricularPressureObserver.py
:Update
__init__
to includeself.controllerPriority
and updateself.heartPeriod
to the desired length of one cardiac cycle in seconds:
def __init__(self, baseNameOfThisScriptAndOfRelatedFlowOrPressureDatFile, MPIRank): abstractParameterController.__init__(self,baseNameOfThisScriptAndOfRelatedFlowOrPressureDatFile, MPIRank) self.periodicTime = 0.0 self.heartPeriod = 0.75 self.time = 0.0 self.controllerPriority = -2
Add the following line to
updateControl
, afternewValueOfTargetParameter
:self.addBroadcastVariable("lvPressure", dictionaryOfPressuresByComponentIndex[3]) # index should match node number above LV in heart model netlist xml
elastanceController.py
Update
__init__
to includeand ensureself.controllerPriority = -3
self.heartPeriod
is consistent withventricularPressureObserver.py
. - In the Heart model netlist Boundary Condition window, select
The heart model is now complete.
Create Coronary Netlist Model¶
- As before, create a new Netlist boundary condition in the CRIMSON GUI. Select
Heart Model = False
and click onSelect faces
to choose the appropriate outlet faces. - Open the CRIMSON Boundary Condition Toolbox by clicking on
Launch Editor
. -
Click on
File > New
to open a blank workspace. Double click on the circuit elements from theComponents
tab and single click to place them in the following circuit: -
In the
Properties
tab, enter the following values for each component:- R1: Epicardial Vessel Resistance
- Parameter Value:
0.37
- Parameter Value:
- R2: Intramyocardial Resistance
- Parameter Value:
0.37
- Parameter Value:
- R3: Distal Intramyocardial Resistance
- Parameter Value:
1.92
- Parameter Value:
- C1: Epicardial vessel compliance
- Parameter Value:
0.1
- Parameter Value:
- C2: Intramyocardial vessel compliance
- Parameter Value:
0.8
- Parameter Value:
- RA Pressure: Right atrial Pressure
- Prescribed Pressure
0
- Prescribed Pressure
- LV Pressure: Left ventricular pressure
- Prescribed Pressure:
0
- Node Control Type:
Custom Python Script
- Input Data Filename:
ventricularPressureReceiver.py
- Prescribed Pressure:
- Zero Pressure
- Prescribed Pressure:
0
- Prescribed Pressure:
- R1: Epicardial Vessel Resistance
-
Click on
Assign nodes
in the toolbar and set the initial pressures:- Initial Pressure at Node 1 (closest to 3D interface):
13332
- Initial Pressure at Node 2 (between R1 and R2):
10000
- Initial Pressure at Node 3 (between R2 and R3):
13332
Note: Node numbering may not be the same as what is presented here. Double check that you are assigning values to nodes in the correct location.
- Initial Pressure at Node 1 (closest to 3D interface):
-
Click on the
Write Simulation Files
button to create thenetlist_surfaces.dat
file for the coronary circuit. -
Returning to the CRIMSON GUI Netlist boundary condition editor, upload the following files:
- Select
Circuit
and upload thenetlist_surfaces.dat
file generated by the Boundary Condition Toolbox. -
Click on
Adjustment Scripts
to uploadventricularPressureReceiver.py
- Before uploading the python adjustment script, ensure that the following changes have been made:
ventricularPressureReceiver.py
:- Replace
newValueofTargetParameter
with the following line:
1. Update thenewValueOfTargetParameter = self.getRecievedBroadcastValue('ventricularPressureObserver', 'lvPressure')
__init__
function to have the sameself.heartPeriod
asventricularPressureObserver.py
from the heart model. Addself.controllerPriority = -1
:def __init__(self, baseNameOfThisScriptAndOfRelatedFlowOrPressureDatFile, MPIRank): abstractParameterController.__init__(self,baseNameOfThisScriptAndOfRelatedFlowOrPressureDatFile, MPIRank) self.periodicTime = 0.0 self.heartPeriod = 0.75 self.time = 0.0 self.controllerPriority = -1
- Select