From 63c1102b75a0b25e7ad2689b7e8e5a472f342d85 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Sun, 12 Jan 2025 17:32:49 +0000 Subject: [PATCH] build based on 07e7e25 --- dev/.documenter-siteinfo.json | 2 +- dev/index.html | 8 ++++---- dev/tuto/index.html | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 71f7806..1dff7fd 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2025-01-12T15:56:58","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.2","generation_timestamp":"2025-01-12T17:32:45","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 5cf39a1..6b9b885 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.

Features

Installation

To install BloodFlowTrixi.jl, use the following commands in Julia:

julia> ]
 pkg> add Trixi
-pkg> add https://github.com/your-repo/BloodFlowTrixi.jl

Future Plans

short term

long term

License

This package is licensed under the MIT license.

Acknowledgments

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.

BloodFlowTrixi.BloodFlowTrixiModule
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
BloodFlowTrixi.BloodFlowEquations1DType
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

Future Plans

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.

License

This package is licensed under the MIT license.

Acknowledgments

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.

BloodFlowTrixi.BloodFlowTrixiModule
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
BloodFlowTrixi.BloodFlowEquations1DType
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
BloodFlowTrixi.BloodFlowEquations2DType
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
BloodFlowTrixi.BloodFlowEquations2DType
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
Trixi.DissipationLocalLaxFriedrichsMethod
(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
BloodFlowTrixi.boundary_condition_outflowMethod
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
BloodFlowTrixi.boundary_condition_pressure_inMethod
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
Trixi.DissipationLocalLaxFriedrichsMethod
(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
BloodFlowTrixi.boundary_condition_outflowMethod
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
BloodFlowTrixi.boundary_condition_pressure_inMethod
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
BloodFlowTrixi.boundary_condition_slip_wallMethod
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
BloodFlowTrixi.flux_nonconservativeMethod
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
BloodFlowTrixi.frictionMethod
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
BloodFlowTrixi.initial_condition_simpleMethod
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
BloodFlowTrixi.inv_pressureMethod
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
BloodFlowTrixi.pressureMethod
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
BloodFlowTrixi.pressure_derMethod
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
BloodFlowTrixi.radiusMethod
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
BloodFlowTrixi.source_term_simpleMethod
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.cons2primMethod
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.fluxMethod
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
Trixi.initial_condition_convergence_testMethod
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_naiveMethod
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.prim2consMethod
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
Trixi.source_terms_convergence_testMethod
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
+\end{cases}\]

The corresponding inflow area A_{in} is computed using the inverse pressure relation, and the boundary state is constructed accordingly.

source
BloodFlowTrixi.boundary_condition_slip_wallMethod
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
BloodFlowTrixi.flux_nonconservativeMethod
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
BloodFlowTrixi.frictionMethod
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
BloodFlowTrixi.initial_condition_simpleMethod
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
BloodFlowTrixi.inv_pressureMethod
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
BloodFlowTrixi.pressureMethod
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
BloodFlowTrixi.pressure_derMethod
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
BloodFlowTrixi.radiusMethod
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
BloodFlowTrixi.source_term_simpleMethod
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.cons2primMethod
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.fluxMethod
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
Trixi.initial_condition_convergence_testMethod
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_naiveMethod
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.prim2consMethod
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
Trixi.source_terms_convergence_testMethod
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
diff --git a/dev/tuto/index.html b/dev/tuto/index.html index f104157..6266d31 100644 --- a/dev/tuto/index.html +++ b/dev/tuto/index.html @@ -152,4 +152,4 @@ plt3 = Plots.plot(pd["ws"],aspect_ratio=0.2) plt4 = Plots.plot(pd["P"],aspect_ratio=0.2) plot(plt1,plt2,plt3,plt4,layout=(2,2)) -end

Alt Text

+end

Alt Text