1+ struct BloodFlowEquations1DOrd2{T <: Real ,E} <: Trixi.AbstractEquationsParabolic{1, 4, GradientVariablesConservative}
2+ nu :: T
3+ model1d :: E
4+ end
5+ Trixi. varnames (mapin,eq:: BloodFlowTrixi.BloodFlowEquations1DOrd2 ) = Trixi. varnames (mapin,eq. model1d)
6+
7+ function Trixi. flux (u,gradients,orientation:: Int ,eq_parab :: BloodFlowEquations1DOrd2 )
8+ dudx = gradients
9+ a,Q,_,A0 = u
10+ A = a+ A0
11+ val = 3 * eq_parab. nu * (- (dudx[1 ] + dudx[4 ])* Q/ A + dudx[2 ])
12+ return SVector (0.0 ,val,0 ,0 )
13+ end
14+
15+ function source_term_simple (u, x, t, eq:: BloodFlowEquations1DOrd2 )
16+ res = source_term_simple (u, x, t, eq. model1d)
17+ k = friction (u,x,eq. model1d)
18+ R = radius (u,eq. model1d)
19+ return SVector (res[1 ],res[2 ]/ (1 - R* k/ (4 * eq. nu)),res[3 ],res[4 ])
20+ end
21+
22+ @inline function boundary_condition_pressure_in (flux_inner, u_inner,
23+ orientation_or_normal,direction,
24+ x, t,
25+ operator_type:: Trixi.Gradient ,
26+ equations_parabolic:: BloodFlowEquations1DOrd2 )
27+ return boundary_condition_pressure_in (u_inner,orientation_or_normal,direction,x,t,flux_lax_friedrichs,equations_parabolic. model1d)
28+ end
29+ @inline function boundary_condition_pressure_in (flux_inner, u_inner,
30+ orientation_or_normal,direction,
31+ x, t,
32+ operator_type:: Trixi.Divergence ,
33+ equations_parabolic:: BloodFlowEquations1DOrd2 )
34+ return flux_inner
35+ end
36+ # Dirichlet and Neumann boundary conditions for use with parabolic solvers in weak form.
37+ # Note that these are general, so they apply to LaplaceDiffusion in any spatial dimension.
38+ @inline function (boundary_condition:: Trixi.BoundaryConditionDirichlet )(flux_inner, u_inner,
39+ normal:: AbstractVector ,
40+ x, t,
41+ operator_type:: Trixi.Gradient ,
42+ equations_parabolic:: BloodFlowEquations1DOrd2 )
43+ return boundary_condition. boundary_value_function (x, t, equations_parabolic)
44+ end
45+
46+ @inline function (boundary_condition:: Trixi.BoundaryConditionDirichlet )(flux_inner, u_inner,
47+ normal:: AbstractVector ,
48+ x, t,
49+ operator_type:: Trixi.Divergence ,
50+ equations_parabolic:: BloodFlowEquations1DOrd2 )
51+ return flux_inner
52+ end
53+
54+ @inline function (boundary_condition:: Trixi.BoundaryConditionNeumann )(flux_inner, u_inner,
55+ normal:: AbstractVector ,
56+ x, t,
57+ operator_type:: Trixi.Divergence ,
58+ equations_parabolic:: BloodFlowEquations1DOrd2 )
59+ return boundary_condition. boundary_normal_flux_function (x, t, equations_parabolic)
60+ end
61+
62+ @inline function (boundary_condition:: Trixi.BoundaryConditionNeumann )(flux_inner, u_inner,
63+ normal:: AbstractVector ,
64+ x, t,
65+ operator_type:: Trixi.Gradient ,
66+ equations_parabolic:: BloodFlowEquations1DOrd2 )
67+ return flux_inner
68+ end
0 commit comments