From 87459379cc58f5ef4f134506d23c1639b6e9501e Mon Sep 17 00:00:00 2001
From: "Documenter.jl"
Date: Mon, 13 Jan 2025 12:29:55 +0000
Subject: [PATCH] build based on 0b07dff
---
dev/.documenter-siteinfo.json | 2 +-
dev/index.html | 8 ++++----
dev/math/index.html | 2 +-
dev/search_index.js | 2 +-
dev/tuto/index.html | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json
index 2395046..9243052 100644
--- a/dev/.documenter-siteinfo.json
+++ b/dev/.documenter-siteinfo.json
@@ -1 +1 @@
-{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2025-01-13T12:26:28","documenter_version":"1.8.0"}}
\ No newline at end of file
+{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2025-01-13T12:29:50","documenter_version":"1.8.0"}}
\ No newline at end of file
diff --git a/dev/index.html b/dev/index.html
index 3fc8918..a741c53 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -12,18 +12,18 @@
R &= \sqrt{2A}
\end{aligned}\right.\]
Both models were designed to be used with Trixi.jl , a flexible and high-performance framework for solving systems of conservation laws using the Discontinuous Galerkin (DG) method.
1D and 2D models for arterial blood flow.Derived from the Navier-Stokes equations with appropriate assumptions for compliant arteries. To be used with Trixi.jl for DG-based numerical simulations. Support for curvilinear geometries and compliant wall dynamics. To install BloodFlowTrixi.jl , use the following commands in Julia:
julia> ]
pkg> add Trixi
-pkg> add https://github.com/your-repo/BloodFlowTrixi.jl
short term
Add second order 1D model. Design prim variables for 1D and 2D models. Add proper tests for 1D and 2D models. Add 3D representations of the solutions for 1D and 2D models. Design easy to use interfaces for users to define their own initial and boundary conditions and source terms. long term
Add 3D fluid-structure interaction models for complex arterial geometries. Design support for artery networks and simulate vascular networks using the 2D and 1D model. Autodiff support for 1D and 2D models for parameter optimization. This package is licensed under the MIT license.
This package was developed as part of my PhD research in applied mathematics, focusing on mathematical modeling and numerical simulation of blood flow in arteries. Special thanks to the developers of Trixi.jl , whose framework was invaluable in implementing and testing these models.
Package BloodFlowTrixi v0.0.1
This package implements 1D and 2D blood flow models for arterial circulation using Trixi.jl, enabling efficient numerical simulation and analysis.
Docs under https://yolhan83.github.io/BloodFlowTrixi.jl
source BloodFlowEquations1D(;h,rho=1.0,xi=0.25,nu=0.04)
Blood Flow equations in one space dimension. This model describes the dynamics of blood flow along a compliant artery using one-dimensional equations derived from the Navier-Stokes equations. The equations account for conservation of mass and momentum, incorporating the effect of arterial compliance and frictional losses.
The governing equations are given by
\[\left\{\begin{aligned}
+pkg> add https://github.com/your-repo/BloodFlowTrixi.jl
short term
Add second order 1D model. Design prim variables for 1D and 2D models. Add proper tests for 1D and 2D models. Add 3D representations of the solutions for 1D and 2D models. Design easy to use interfaces for users to define their own initial and boundary conditions and source terms. long term
Add 3D fluid-structure interaction models for complex arterial geometries. Design support for artery networks and simulate vascular networks using the 2D and 1D model. Autodiff support for 1D and 2D models for parameter optimization. This package is licensed under the MIT license.
This package was developed as part of my PhD research in applied mathematics, focusing on mathematical modeling and numerical simulation of blood flow in arteries. Special thanks to the developers of Trixi.jl , whose framework was invaluable in implementing and testing these models.
Package BloodFlowTrixi v0.0.1
This package implements 1D and 2D blood flow models for arterial circulation using Trixi.jl, enabling efficient numerical simulation and analysis.
Docs under https://yolhan83.github.io/BloodFlowTrixi.jl
source BloodFlowEquations1D(;h,rho=1.0,xi=0.25,nu=0.04)
Blood Flow equations in one space dimension. This model describes the dynamics of blood flow along a compliant artery using one-dimensional equations derived from the Navier-Stokes equations. The equations account for conservation of mass and momentum, incorporating the effect of arterial compliance and frictional losses.
The governing equations are given by
\[\left\{\begin{aligned}
\frac{\partial a}{\partial t} + \frac{\partial}{\partial x}(Q) &= 0 \\
\frac{\partial Q}{\partial t} + \frac{\partial}{\partial x}\left(\frac{Q^2}{A} + A P(a)\right) &= P(a) \frac{\partial A}{\partial x} - 2 \pi R k \frac Q {A}\\
P(a) &= P_{ext} + \frac{Eh\sqrt{\pi}}{1-\xi^2}\frac{\sqrt{A} - \sqrt{A_0}}{A_0} \\
R &= \sqrt{\frac{A}{\pi}}
-\end{aligned}\right.\]
source BloodFlowEquations2D(;h,rho=1.0,xi=0.25)
Defines the two-dimensional blood flow equations derived from the Navier-Stokes equations in curvilinear coordinates under the thin-artery assumption. This model describes the dynamics of blood flow along a compliant artery in two spatial dimensions (s, θ).
Parameters
h::T
: Wall thickness of the artery.rho::T
: Fluid density (default 1.0).xi::T
: Poisson's ratio (default 0.25).nu::T
: Viscosity coefficient.The governing equations account for conservation of mass and momentum, incorporating the effects of arterial compliance, curvature, and frictional losses.
\[\left\{\begin{aligned}
+\end{aligned}\right.\]
source BloodFlowEquations2D(;h,rho=1.0,xi=0.25)
Defines the two-dimensional blood flow equations derived from the Navier-Stokes equations in curvilinear coordinates under the thin-artery assumption. This model describes the dynamics of blood flow along a compliant artery in two spatial dimensions (s, θ).
Parameters
h::T
: Wall thickness of the artery.rho::T
: Fluid density (default 1.0).xi::T
: Poisson's ratio (default 0.25).nu::T
: Viscosity coefficient.The governing equations account for conservation of mass and momentum, incorporating the effects of arterial compliance, curvature, and frictional losses.
\[\left\{\begin{aligned}
\frac{\partial a}{\partial t} + \frac{\partial}{\partial \theta}\left( \frac{Q_{R\theta}}{A} \right) + \frac{\partial}{\partial s}(Q_s) &= 0 \\
\frac{\partial Q_{R\theta}}{\partial t} + \frac{\partial}{\partial \theta}\left(\frac{Q_{R\theta}^2}{2A^2} + A P(a)\right) + \frac{\partial}{\partial s}\left( \frac{Q_{R\theta}Q_s}{A} \right) &= P(a) \frac{\partial A}{\partial \theta} - 2 R k \frac{Q_{R\theta}}{A} + \frac{2R}{3} \mathcal{C}\sin \theta \frac{Q_s^2}{A} \\
\frac{\partial Q_{s}}{\partial t} + \frac{\partial}{\partial \theta}\left(\frac{Q_{R\theta} Q_s}{A^2} \right) + \frac{\partial}{\partial s}\left( \frac{Q_s^2}{A} - \frac{Q_{R\theta}^2}{2A^2} + A P(a) \right) &= P(a) \frac{\partial A}{\partial s} - R k \frac{Q_s}{A} - \frac{2R}{3} \mathcal{C}\sin \theta \frac{Q_s Q_{R\theta}}{A^2} \\
P(a) &= P_{ext} + \frac{Eh}{\sqrt{2}\left(1-\xi^2\right)}\frac{\sqrt{A} - \sqrt{A_0}}{A_0} \\
R &= \sqrt{2A}
-\end{aligned}\right.\]
source (dissipation::Trixi.DissipationLocalLaxFriedrichs)(u_ll, u_rr, orientation_or_normal_direction, eq::BloodFlowEquations1D)
Calculates the dissipation term using the Local Lax-Friedrichs method.
Parameters
u_ll
: Left state vector.u_rr
: Right state vector.orientation_or_normal_direction
: Orientation or normal direction.eq
: Instance of BloodFlowEquations1D
.Returns
Dissipation vector.
source boundary_condition_outflow(u_inner, orientation_or_normal, direction, x, t, surface_flux_function, eq::BloodFlowEquations1D)
Implements the outflow boundary condition, assuming that there is no reflection at the boundary.
Parameters
u_inner
: State vector inside the domain near the boundary.orientation_or_normal
: Normal orientation of the boundary.direction
: Integer indicating the direction of the boundary.x
: Position vector.t
: Time.surface_flux_function
: Function to compute flux at the boundary.eq
: Instance of BloodFlowEquations1D
.Returns
Computed boundary flux.
source boundary_condition_pressure_in(u_inner, orientation_or_normal, direction, x, t, surface_flux_function, eq::BloodFlowEquations1D)
Implements a pressure inflow boundary condition where the inflow pressure varies with time.
Parameters
u_inner
: State vector inside the domain near the boundary.orientation_or_normal
: Normal orientation of the boundary.direction
: Integer indicating the boundary direction.x
: Position vector.t
: Time scalar.surface_flux_function
: Function to compute flux at the boundary.eq
: Instance of BloodFlowEquations1D
.Returns
Computed boundary flux with inflow pressure specified by:
\[P_{in} = \begin{cases}
+\end{aligned}\right.\]
source (dissipation::Trixi.DissipationLocalLaxFriedrichs)(u_ll, u_rr, orientation_or_normal_direction, eq::BloodFlowEquations1D)
Calculates the dissipation term using the Local Lax-Friedrichs method.
Parameters
u_ll
: Left state vector.u_rr
: Right state vector.orientation_or_normal_direction
: Orientation or normal direction.eq
: Instance of BloodFlowEquations1D
.Returns
Dissipation vector.
source boundary_condition_outflow(u_inner, orientation_or_normal, direction, x, t, surface_flux_function, eq::BloodFlowEquations1D)
Implements the outflow boundary condition, assuming that there is no reflection at the boundary.
Parameters
u_inner
: State vector inside the domain near the boundary.orientation_or_normal
: Normal orientation of the boundary.direction
: Integer indicating the direction of the boundary.x
: Position vector.t
: Time.surface_flux_function
: Function to compute flux at the boundary.eq
: Instance of BloodFlowEquations1D
.Returns
Computed boundary flux.
source boundary_condition_pressure_in(u_inner, orientation_or_normal, direction, x, t, surface_flux_function, eq::BloodFlowEquations1D)
Implements a pressure inflow boundary condition where the inflow pressure varies with time.
Parameters
u_inner
: State vector inside the domain near the boundary.orientation_or_normal
: Normal orientation of the boundary.direction
: Integer indicating the boundary direction.x
: Position vector.t
: Time scalar.surface_flux_function
: Function to compute flux at the boundary.eq
: Instance of BloodFlowEquations1D
.Returns
Computed boundary flux with inflow pressure specified by:
\[P_{in} = \begin{cases}
2 \times 10^4 \sin^2(\pi t / 0.125) & \text{if } t < 0.125 \\
0 & \text{otherwise}
-\end{cases}\]
The corresponding inflow area A_{in}
is computed using the inverse pressure relation, and the boundary state is constructed accordingly.
source boundary_condition_slip_wall(u_inner, orientation_or_normal, direction, x, t, surface_flux_function, eq::BloodFlowEquations1D)
Implements a slip wall boundary condition where the normal component of velocity is reflected.
Parameters
u_inner
: State vector inside the domain near the boundary.orientation_or_normal
: Normal orientation of the boundary.direction
: Integer indicating the direction of the boundary.x
: Position vector.t
: Time.surface_flux_function
: Function to compute flux at the boundary.eq
: Instance of BloodFlowEquations1D
.Returns
Computed boundary flux at the slip wall.
source flux_nonconservative(u_ll, u_rr, orientation::Integer, eq::BloodFlowEquations1D)
Computes the non-conservative flux for the model, used for handling discontinuities in pressure.
Parameters
u_ll
: Left state vector.u_rr
: Right state vector.orientation::Integer
: Orientation index.eq
: Instance of BloodFlowEquations1D
.Returns
Non-conservative flux vector.
source friction(u, x, eq::BloodFlowEquations1D)
Calculates the friction term for the blood flow equations, which represents viscous resistance to flow along the artery wall.
Parameters
u
: State vector containing cross-sectional area and flow rate.x
: Position along the artery.eq::BloodFlowEquations1D
: Instance of the blood flow model.Returns
Friction coefficient as a scalar.
source initial_condition_simple(x, t, eq::BloodFlowEquations1D; R0=2.0)
Generates a simple initial condition with a specified initial radius R0
.
Parameters
x
: Position vector.t
: Time scalar.eq::BloodFlowEquations1D
: Instance of the blood flow model.R0
: Initial radius (default: 2.0
).Returns
State vector with zero initial area perturbation, zero flow rate, constant elasticity modulus, and reference area computed as A_0 = \pi R_0^2
.
This initial condition is suitable for basic tests without complex dynamics.
source inv_pressure(p, u, eq::BloodFlowEquations1D)
Computes the inverse relation of pressure to cross-sectional area.
Parameters
p
: Pressure.u
: State vector.eq
: Instance of BloodFlowEquations1D
.Returns
Cross-sectional area corresponding to the given pressure.
source pressure(u, eq::BloodFlowEquations1D)
Computes the pressure given the state vector based on the compliance of the artery.
Parameters
u
: State vector.eq
: Instance of BloodFlowEquations1D
.Returns
Pressure as a scalar.
source pressure_der(u, eq::BloodFlowEquations1D)
Computes the derivative of pressure with respect to cross-sectional area.
Parameters
u
: State vector.eq
: Instance of BloodFlowEquations1D
.Returns
Derivative of pressure.
source radius(u, eq::BloodFlowEquations1D)
Computes the radius of the artery based on the cross-sectional area.
Parameters
u
: State vector.eq
: Instance of BloodFlowEquations1D
.Returns
Radius as a scalar.
source source_term_simple(u, x, t, eq::BloodFlowEquations1D)
Computes a simple source term for the blood flow model, focusing on frictional effects.
Parameters
u
: State vector containing area perturbation, flow rate, elasticity modulus, and reference area.x
: Position vector.t
: Time scalar.eq::BloodFlowEquations1D
: Instance of the blood flow model.Returns
Source terms vector where:
s_1 = 0
(no source for area perturbation).s_2
represents the friction term given by s_2 = \frac{2 \pi k Q}{R A}
.Friction coefficient k
is computed using the friction
function, and the radius R
is obtained using the radius
function.
source Trixi.cons2prim(u, eq::BloodFlowEquations1D)
Converts the conserved variables to primitive variables.
Parameters
u
: State vector.eq
: Instance of BloodFlowEquations1D
.Returns
Primitive variable vector.
source Trixi.flux(u, orientation::Integer, eq::BloodFlowEquations1D)
Computes the flux vector for the conservation laws of the blood flow model.
Parameters
u
: State vector.orientation::Integer
: Orientation index for flux computation.eq
: Instance of BloodFlowEquations1D
.Returns
Flux vector as an SVector
.
source initial_condition_convergence_test(x, t, eq::BloodFlowEquations1D)
Generates a smooth initial condition for convergence tests of the blood flow equations.
Parameters
x
: Position vector.t
: Time scalar.eq::BloodFlowEquations1D
: Instance of the blood flow model.Returns
Initial condition state vector with zero initial area perturbation, sinusoidal flow rate, a constant elasticity modulus, and reference area.
Details
The returned initial condition has:
Zero perturbation in area (a = 0
). A sinusoidal flow rate given by Q = sin(\pi x t)
. A constant elasticity modulus E
. A reference cross-sectional area A_0 = \pi R_0^2
for R_0 = 1
. This initial condition can be used to verify the accuracy and stability of numerical solvers.
source Trixi.max_abs_speed_naive(u_ll, u_rr, orientation::Integer, eq::BloodFlowEquations1D)
Calculates the maximum absolute speed for wave propagation in the blood flow model using a naive approach.
Parameters
u_ll
: Left state vector.u_rr
: Right state vector.orientation::Integer
: Orientation index.eq
: Instance of BloodFlowEquations1D
.Returns
Maximum absolute speed.
source Trixi.prim2cons(u, eq::BloodFlowEquations1D)
Converts the primitive variables to conserved variables.
Parameters
u
: Primitive variable vector.eq
: Instance of BloodFlowEquations1D
.Returns
Conserved variable vector.
source source_terms_convergence_test(u, x, t, eq::BloodFlowEquations1D)
Computes the source terms for convergence tests of the blood flow equations.
Parameters
u
: State vector containing area perturbation, flow rate, elasticity modulus, and reference area.x
: Position vector.t
: Time scalar.eq::BloodFlowEquations1D
: Instance of the blood flow model.Returns
Source terms vector.
Details
The source terms are derived based on the smooth initial condition and friction effects:
s_1
represents the source term for area perturbation and is given by s_1 = \pi t \cos(\pi x t)
.s_2
represents the source term for the flow rate and includes contributions from spatial and temporal variations as well as friction effects.The radius R
is computed using the radius
function, and the friction coefficient k
is obtained using the friction
function.
This function is useful for evaluating the correctness of source term handling in numerical solvers.
source
Theme
Automatic (OS) documenter-light documenter-dark catppuccin-latte catppuccin-frappe catppuccin-macchiato catppuccin-mocha
This document was generated with Documenter.jl version 1.8.0 on Monday 13 January 2025 . Using Julia version 1.11.2.