svZeroDSolver
Loading...
Searching...
No Matches
BloodVesselRC.h
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the
2// University of California, and others. SPDX-License-Identifier: BSD-3-Clause
3#ifndef SVZERODSOLVER_MODEL_BLOODVESSELRC_HPP_
4#define SVZERODSOLVER_MODEL_BLOODVESSELRC_HPP_
5
6#include "Block.h"
7#include "SparseSystem.h"
8
9/**
10 * @brief Flow-through RC windkessel for pulmonary circulation.
11 *
12 * Models a resistance-capacitance windkessel where the inlet and outlet
13 * flows are equal (Q_in = Q_out). The capacitor stores pressure but does
14 * not store blood volume. This matches the pulmonary model in
15 * \cite sankaran2012patient (equation X6' = X4 - X7).
16 *
17 * ### Governing equations
18 *
19 * \f[
20 * C_p \, \dot{P}_{in} + \frac{P_{in} - P_{out}}{R_{pd}} - Q_{in} = 0
21 * \f]
22 * \f[
23 * Q_{in} - Q_{out} = 0
24 * \f]
25 *
26 * ### Parameters
27 *
28 * * `Rpd` — Pulmonary resistance
29 * * `Cp` — Pulmonary capacitance
30 */
31class BloodVesselRC : public Block {
32 public:
33 /**
34 * @brief Construct a new BloodVesselRC object
35 *
36 * @param id Global ID of the block
37 * @param model The model to which the block belongs
38 */
40 : Block(id, model, BlockType::blood_vessel_rc, BlockClass::vessel,
41 {{"Rpd", InputParameter()}, {"Cp", InputParameter()}}) {}
42
43 /// @brief Local IDs of the parameters
44 enum ParamId { RPD = 0, CP = 1 };
45
46 void setup_dofs(DOFHandler& dofhandler);
47 void update_constant(SparseSystem& system, std::vector<double>& parameters);
48
49 /// @brief Number of triplets of element
51};
52
53#endif // SVZERODSOLVER_MODEL_BLOODVESSELRC_HPP_
model::Block source file
BlockType
The types of blocks supported by the solver.
Definition BlockType.h:15
BlockClass
The classes/categories of blocks supported. Some classes require special handling (e....
Definition BlockType.h:44
SparseSystem source file.
Block(int id, Model *model, BlockType block_type, BlockClass block_class, std::vector< std::pair< std::string, InputParameter > > input_params)
Construct a new Block object.
Definition Block.h:101
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
void setup_dofs(DOFHandler &dofhandler)
Set up the degrees of freedom (DOF) of the block.
Definition BloodVesselRC.cpp:5
void update_constant(SparseSystem &system, std::vector< double > &parameters)
Update the constant contributions of the element in a sparse system.
Definition BloodVesselRC.cpp:9
ParamId
Local IDs of the parameters.
Definition BloodVesselRC.h:44
BloodVesselRC(int id, Model *model)
Construct a new BloodVesselRC object.
Definition BloodVesselRC.h:39
TripletsContributions num_triplets
Number of triplets of element.
Definition BloodVesselRC.h:50
Degree-of-freedom handler.
Definition DOFHandler.h:21
Model of 0D elements.
Definition Model.h:55
Sparse system.
Definition SparseSystem.h:30
Handles the properties of input parameters.
Definition Parameter.h:100
The number of triplets that the element contributes to the global system.
Definition Block.h:27