svZeroDSolver
Loading...
Searching...
No Matches
ChamberSphere Class Reference

Spherical heart chamber model. More...

#include <ChamberSphere.h>

Inheritance diagram for ChamberSphere:
[legend]

Public Types

enum  ParamId {
  rho = 0 ,
  thick0 = 1 ,
  radius0 = 2 ,
  eta = 3 ,
  sigma_max = 4 ,
  alpha_max = 5 ,
  alpha_min = 6
}
 Local IDs of the parameters. More...

Public Member Functions

 ChamberSphere (int id, Model *model)
 Construct a new ChamberSphere object.
void setup_dofs (DOFHandler &dofhandler) override
 Set up the degrees of freedom (DOF) of the block.
void update_constant (SparseSystem &system, std::vector< double > &parameters) override
 Update the constant contributions of the element in a sparse system.
void update_time (SparseSystem &system, std::vector< double > &parameters) override
 Update the time-dependent contributions of the element in a sparse system.
void update_solution (SparseSystem &system, std::vector< double > &parameters, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &y, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &dy) override
 Update the solution-dependent contributions of the element in a sparse system.
void get_elastance_values (std::vector< double > &parameters)
 Update the elastance functions which depend on time.
void set_activation_function (std::unique_ptr< ActivationFunction > af) override
 Set activation function (for chamber blocks that use one).
void set_material (std::unique_ptr< SphereMaterial > m) override
 Set wall material (for ChamberSphere blocks).
Public Member Functions inherited from Block
 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.
 ~Block ()
 Destroy the Block object.
 Block (const Block &)=delete
 Copy the Block object.
std::string get_name ()
 Get the name of the block.
void update_vessel_type (VesselType type)
 Update vessel type of the block.
void setup_params_ (const std::vector< int > &param_ids)
 Setup parameter IDs for the block.
void setup_dofs_ (DOFHandler &dofhandler, int num_equations, const std::list< std::string > &internal_var_names)
 Set up the degrees of freedom (DOF) of the block.
virtual void setup_model_dependent_params ()
 Setup parameters that depend on the model.
virtual void setup_initial_state_dependent_params (State initial_state, std::vector< double > &parameters)
 Setup parameters that depend on the initial state.
virtual void post_solve (Eigen::Matrix< double, Eigen::Dynamic, 1 > &y)
 Modify the solution after solving it.
virtual void update_gradient (Eigen::SparseMatrix< double > &jacobian, Eigen::Matrix< double, Eigen::Dynamic, 1 > &alpha, std::vector< double > &y, std::vector< double > &dy)
 Set the gradient of the block residual with respect to the parameters.
virtual TripletsContributions get_num_triplets ()
 Get number of triplets of element.

Additional Inherited Members

Public Attributes inherited from Block
const int id
 Global ID of the block.
const Model * model
 The model to which the block belongs.
const BlockType block_type
 Type of this block.
const BlockClass block_class
 Class of this block.
VesselType vessel_type = VesselType::neither
 Vessel type of this block.
const std::vector< std::pair< std::string, InputParameter > > input_params
 Map from name to input parameter.
std::vector< Node * > inlet_nodes
 Inlet nodes.
std::vector< Node * > outlet_nodes
 Outlet nodes.
bool steady = false
 Toggle steady behavior.
bool input_params_list = false
 Are input parameters given as a list?
std::vector< int > global_param_ids
 Global IDs for the block parameters.
std::vector< int > global_var_ids
 Global variable indices of the local element contributions.
std::vector< int > global_eqn_ids
 Global equation indices of the local element contributions.
TripletsContributions num_triplets
 Number of triplets of element.

Detailed Description

Spherical heart chamber model.

Models the mechanical behavior of a spherical heart chamber with active contraction. For reference, see [1] Equations (13a-b) for continuum mechanics (without length-dependent contraction valves, vessels) and [6] Equations (12-16) for the simplified active contraction model.

Helper Functions

Cauchy-Green deformation tensor and time derivative:

\‍[  C = \left(1 + \frac{r}{r_0} \right)^2
\‍]

\‍[  \dot{C} = 2 \left(1 + \frac{r}{r_0} \right) \frac{\dot{r}}{r_0}
\‍]

Governing equations

  1. Balance of linear momentum:

    \‍[  \rho d_0 \dot{v} + \frac{d_0}{r_0} \left(1 + \frac{r}{r_0} \right) S -
P_\text{out} C = 0
\‍]

  2. Spherical stress:

    \‍[  -S + \tau + S_\text{el}(r, r_0) + \eta \dot{C}
  (1 + 2 C^{-6}) = 0
\‍]

    where $S_\text{el}$ is the elastic stress term supplied by the chamber's SphereMaterial.
  3. Volume change:

    \‍[  4 \pi r_0^2 Cv - \dot{V} = 0
\‍]

  4. Active stress:

    \‍[  \dot{\tau} + a \tau - \sigma_\text{max} a_+ = 0, \quad a_+ = \max(a, 0),
\quad a = f\alpha_\text{max} + (1 - f)\alpha_\text{min}
\‍]

    where $f \in [0, 1]$ is the activation function, evaluated by a separate ActivationFunction object (e.g. two_hill, half_cosine, piecewise_cosine) selected in the JSON configuration.
  5. Acceleration:

    \‍[  \dot{r} - v = 0
\‍]

  6. Conservation of mass:

    \‍[  Q_\text{in} - Q_\text{out} - \dot{V} = 0
\‍]

  7. Pressure equality:

    \‍[  P_\text{in} - P_\text{out} = 0
\‍]

Parameters

Parameter sequence for constructing this block:

  • rho - Density $\rho$
  • thick0 - Wall thickness $d_0$
  • radius0 - Reference radius $r_0$
  • eta - Viscosity parameter $\eta$
  • sigma_max - Maximum active stress $\sigma_\text{max}$
  • alpha_max - Maximum activation parameter $\alpha_\text{max}$
  • alpha_min - Minimum activation parameter $\alpha_\text{min}$

An activation_function object is also required alongside zero_d_element_values to select and parameterize the activation function $f(t)$ (see ActivationFunction, e.g. two_hill, half_cosine, piecewise_cosine, wrapping_cosine, fourier, double_tanh).

Furthermore, a material object is required to select and parameterize the material model for the elastic stress term $S_\text{el}(r, r_0)$ (see SphereMaterial, e.g. exponential, mooney_rivlin).

Usage in json configuration file

"chambers": [
   {
       "type": "ChamberSphere",
       "name": "ventricle",
       "values": {
           "rho" : 1e3,
           "thick0" : 0.01,
           "radius0" : 0.05,
           "eta" : 10.0,
           "sigma_max" : 185e3,
           "alpha_max": 30.0,
           "alpha_min": -30.0
       },
       "activation_function": {},
       "material": {}
   }
]

A chamber is connected to the rest of the circuit via valve blocks (see ValveTanh, PiecewiseValve) referencing its name as their upstream_block/downstream_block.

Internal variables

Names of internal variables in this block's output:

  • radius - Chamber radius $r$
  • velo - Chamber velocity $\dot{r}$
  • stress - Spherical stress $S$
  • tau - Active stress $\tau$
  • volume - Chamber volume $V$

Member Enumeration Documentation

◆ ParamId

Local IDs of the parameters.

Constructor & Destructor Documentation

◆ ChamberSphere()

ChamberSphere::ChamberSphere ( int id,
Model * model )
inline

Construct a new ChamberSphere object.

Parameters
idGlobal ID of the block
modelThe model to which the block belongs

Member Function Documentation

◆ get_elastance_values()

void ChamberSphere::get_elastance_values ( std::vector< double > & parameters)

Update the elastance functions which depend on time.

Parameters
parametersParameters of the model

◆ set_activation_function()

void ChamberSphere::set_activation_function ( std::unique_ptr< ActivationFunction > af)
overridevirtual

Set activation function (for chamber blocks that use one).

Default no-op. Overridden by ChamberElastanceInductor and LinearElastanceChamber to take ownership of the activation function.

Parameters
afUnique pointer to the activation function (caller transfers ownership)

Reimplemented from Block.

◆ set_material()

void ChamberSphere::set_material ( std::unique_ptr< SphereMaterial > m)
overridevirtual

Set wall material (for ChamberSphere blocks).

Default no-op. Overridden by ChamberSphere to take ownership of the material.

Parameters
mUnique pointer to the material (caller transfers ownership)

Reimplemented from Block.

◆ setup_dofs()

void ChamberSphere::setup_dofs ( DOFHandler & dofhandler)
overridevirtual

Set up the degrees of freedom (DOF) of the block.

Set global_var_ids and global_eqn_ids of the element based on the number of equations and the number of internal variables of the element.

Parameters
dofhandlerDegree-of-freedom handler to register variables and equations at

Reimplemented from Block.

◆ update_constant()

void ChamberSphere::update_constant ( SparseSystem & system,
std::vector< double > & parameters )
overridevirtual

Update the constant contributions of the element in a sparse system.

Parameters
systemSystem to update contributions at
parametersParameters of the model

Reimplemented from Block.

◆ update_solution()

void ChamberSphere::update_solution ( SparseSystem & system,
std::vector< double > & parameters,
const Eigen::Matrix< double, Eigen::Dynamic, 1 > & y,
const Eigen::Matrix< double, Eigen::Dynamic, 1 > & dy )
overridevirtual

Update the solution-dependent contributions of the element in a sparse system.

Parameters
systemSystem to update contributions at
parametersParameters of the model
yCurrent solution
dyCurrent derivate of the solution

Reimplemented from Block.

◆ update_time()

void ChamberSphere::update_time ( SparseSystem & system,
std::vector< double > & parameters )
overridevirtual

Update the time-dependent contributions of the element in a sparse system.

Parameters
systemSystem to update contributions at
parametersParameters of the model

Reimplemented from Block.


The documentation for this class was generated from the following files: