resistance_utils

Compute hydraulic resistances for vessels and the capillary equivalent elements. The module contains functions implementing simple Poiseuille resistance for non-capillary vessels and a more detailed analytical equivalent for capillary trees (the “analytical2015” model used by the project).

Main functions

calculate_resistance(G, viscosity_model=’constant’, mu=…, capillary_model=’analytical2015’, capillary_parameters=None)

Iterate over graph edges and set the resistance attribute on each edge. For non-capillary edges the code uses the Poiseuille formula 8 mu L / (pi r^4). For capillary edges an equivalent resistance is computed using calculate_capillary_equivalent_resistance().

calculate_viscosity_factor_from_radius(radius, hematocrit=0.45)

Helper implementing a Pries-inspired empirical viscosity factor as a function of vessel radius and hematocrit.

calculate_capillary_equivalent_resistance(…)

Compute the equivalent resistance of a tree/convolute capillary network given artery/vein inlet radii and capillary model parameters. This routine contains the analytical model used in the project and documents the expected parameters in capillary_parameters.

Notes

  • The capillary model exposes many tunable parameters (number of series/parallel branches, convolute radius, lengths etc.). Default values are provided and validated by the calling code in pressure_flow_utils.

API reference

Function arguments

calculate_resistance
Gnetworkx.DiGraph

Graph whose edges will have their resistance attribute set.

viscosity_modelstr, optional

One of 'constant', 'pries_network', 'pries_vessel' or 'flow_dependent'. Controls how viscosity is handled for capillary and small vessels.

mufloat, optional

Base dynamic viscosity (Pa.s) used for Poiseuille calculations.

capillary_modelstr, optional

Capillary equivalent model identifier (e.g. 'analytical2015').

capillary_parametersdict, optional

Parameters used by the capillary model. Keys include numbers of series/parallel convolutes, segment lengths, convolute radius, hematocrit and others. If omitted defaults are used.

networkx.DiGraph

The modified graph with updated resistance attributes.

calculate_viscosity_factor_from_radius
radiusfloat

Vessel radius in metres.

hematocritfloat, optional

Local hematocrit used by the empirical formula. Default 0.45.

float

Empirical viscosity multiplication factor (dimensionless).

calculate_capillary_equivalent_resistance
radius_in_artery, radius_in_veinfloat

Radii (m) at the artery/vein sides used as boundary radii for the capillary equivalent calculation.

viscosity_model, mu, capillary_model, capillary_parameters : see above

float

Equivalent resistance (Pa s / m^3) of the capillary tree attached between the given arterial and venous radii.

Examples

# Apply resistance calculation to a graph G
G = calculate_resistance(G, viscosity_model='constant', mu=0.336e-2)

Cross references

  • The capillary parameter dictionary used by calculate_capillary_equivalent_resistance() is assembled and validated in FetoFlow.pressure_flow_utils.pressures_and_flows().

    >>> G = calculate_resistance(G, viscosity_model='constant')
    

    FetoFlow.geometry_utils.create_anastomosis(), FetoFlow.pressure_flow_utils.pressures_and_flows()