svZeroDSolver
Loading...
Searching...
No Matches
OpenLoopCoronaryVarResBC.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the
2// University of California, and others. SPDX-License-Identifier: BSD-3-Clause
3/**
4 * @file OpenLoopCoronaryVarResBC.h
5 * @brief model::OpenLoopCoronaryVarResBC source file
6 */
7#ifndef SVZERODSOLVER_MODEL_OPENLOOPCORONARYVARRESBC_HPP_
8#define SVZERODSOLVER_MODEL_OPENLOOPCORONARYVARRESBC_HPP_
9
10#include "Block.h"
11#include "OpenLoopCoronaryBC.h"
12#include "Parameter.h"
13
14/**
15 * @brief Open loop coronary boundary condition with time-varying microvascular
16 * resistance based on \cite yong25.
17 *
18 * This model extends the standard open loop coronary BC (\cite kim_coronary)
19 * by allowing the microvascular resistance \f$R_{am}\f$ to vary with time
20 * according to:
21 *
22 * \f[
23 * R_{am}(t) = \left[ \left( \sqrt{R_{am,max}} - \sqrt{R_{am,min}} \right)
24 * e(t) + \sqrt{R_{am,min}} \right]^2
25 * \f]
26 *
27 * where \f$e(t)\f$ is a time-dependent function:
28 *
29 * \f[
30 * e(t) =
31 * \begin{cases}
32 * \dfrac{1}{2}\left[ 1 - \cos\left( \pi \dfrac{t_{cycle}}{T_{vc}} \right)
33 * \right], & 0 \le t_{cycle} \le T_{vc}, \\
34 * \dfrac{1}{2}\left[ 1 + \cos\left( \pi \dfrac{t_{cycle} - T_{vc}}{T_{vr}}
35 * \right) \right], & T_{vc} < t_{cycle} \le T_{vc} + T_{vr}, \\
36 * 0, & t_{cycle} > T_{vc} + T_{vr}
37 * \end{cases}
38 * \f]
39 *
40 * where \f$t_{cycle}\f$ is the time within the current cardiac cycle.
41 *
42 * \f[
43 * \begin{circuitikz} \draw
44 * node[left] {$Q_{in}$} [-latex] (0,0) -- (0.8,0);
45 * \draw (1,0) node[anchor=south]{$P_{in}$}
46 * to [R, l=$R_a$, *-*] (3,0)
47 * to [R, l=$R_{am}(t)$, -] (5,0)
48 * node[anchor=south]{$P_{cim}$}
49 * to [R, l=$R_v$, *-*] (7,0)
50 * node[anchor=south]{$P_{v}$}
51 * (5,0) to [C, l=$C_{im} \;V_{im}$, -*] (5,-1.5)
52 * node[left]{$P_{im}$}
53 * (3,0) to [C, l=$C_a$, -*] (3,-1.5)
54 * node[left]{$P_a$};
55 * \end{circuitikz}
56 * \f]
57 *
58 * ### Governing equations
59 *
60 * Same as OpenLoopCoronaryBC, but with \f$R_{am}\f$ replaced by
61 * \f$R_{am}(t)\f$.
62 *
63 * ### Parameters
64 *
65 * Parameter sequence for constructing this block
66 *
67 * * `0` Ra: Small artery resistance
68 * * `1` Rv: Venous resistance
69 * * `2` Ca: Small artery capacitance
70 * * `3` Cim: Intramyocardial capacitance
71 * * `4` Pim: Intramyocardial pressure (time-dependent)
72 * * `5` Pv: Venous pressure
73 * * `6` Ram_min: Minimum microvascular resistance
74 * * `7` Ram_max: Maximum microvascular resistance
75 * * `8` T_vc: Contraction time
76 * * `9` T_vr: Relaxation time
77 *
78 * ### Usage in json configuration file
79 *
80 * "boundary_conditions": [
81 * {
82 * "bc_name": "OUT",
83 * "bc_type": "CORONARY_VAR_RES",
84 * "bc_values": {
85 * "Ca": 0.0001,
86 * "Cc": 0.0001,
87 * "Pim": [
88 * 1000.0,
89 * 1000.0
90 * ],
91 * "P_v": 0.0,
92 * "Ra1": 100.0,
93 * "Ra2_min": 50.0,
94 * "Ra2_max": 200.0,
95 * "Rv1": 100.0,
96 * "T_vc": 0.2,
97 * "T_vr": 0.3,
98 * "t": [
99 * 0.0,
100 * 1.0
101 * ]
102 * }
103 * }
104 * ]
105 *
106 * ### Internal variables
107 *
108 * Names of internal variables in this block's output:
109 *
110 * * `volume_im`: Intramyocardial volume
111 *
112 */
114 public:
115 /**
116 * @brief Construct a new OpenLoopCoronaryVarResBC object
117 *
118 * @param id Global ID of the block
119 * @param model The model to which the block belongs
120 */
123 id, model, BlockType::open_loop_coronary_var_res_bc,
124 {{"Ra1", InputParameter()},
125 {"Rv1", InputParameter()},
126 {"Ca", InputParameter()},
127 {"Cc", InputParameter()},
128 {"t", InputParameter(false, true)},
129 {"Pim", InputParameter(false, true)},
130 {"P_v", InputParameter()},
131 {"Ra2_min", InputParameter()},
132 {"Ra2_max", InputParameter()},
133 {"T_vc", InputParameter()},
134 {"T_vr", InputParameter()},
135 {"closed_loop_outlet", InputParameter(true, false, false)}}) {}
136
137 protected:
138 /**
139 * @brief Get time-varying microvascular resistance
140 *
141 * Overrides base class to provide time-varying resistance based on
142 * cardiac cycle phase.
143 *
144 * @param parameters Parameters of the model
145 * @param time Current simulation time
146 * @return Time-varying resistance Ram(t)
147 */
148 double get_Ram(std::vector<double>& parameters, double time) const override;
149};
150
151#endif // SVZERODSOLVER_MODEL_OPENLOOPCORONARYVARRESBC_HPP_
model::Block source file
BlockType
The types of blocks supported by the solver.
Definition BlockType.h:15
model::OpenLoopCoronaryBC source file
model::Parameter source file
const int id
Global ID of the block.
Definition Block.h:78
const Model * model
The model to which the block belongs.
Definition Block.h:79
Model of 0D elements.
Definition Model.h:53
OpenLoopCoronaryBC(int id, Model *model)
Construct a new OpenLoopCoronaryBC object.
Definition OpenLoopCoronaryBC.h:123
double get_Ram(std::vector< double > &parameters, double time) const override
Get time-varying microvascular resistance.
Definition OpenLoopCoronaryVarResBC.cpp:9
OpenLoopCoronaryVarResBC(int id, Model *model)
Construct a new OpenLoopCoronaryVarResBC object.
Definition OpenLoopCoronaryVarResBC.h:121
Handles the properties of input parameters.
Definition Parameter.h:100