Skip to content

Commit 468c1ed

Browse files
committed
fix bc
1 parent 20c7e80 commit 468c1ed

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

src/1DModel/bc1d.jl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ function boundary_condition_outflow(u_inner, orientation_or_normal,
2222
eq::BloodFlowEquations1D)
2323
# calculate the boundary flux
2424
if iseven(direction) # u_inner is "left" of boundary, u_boundary is "right" of boundary
25-
flux = surface_flux_function(u_inner, u_inner, orientation_or_normal,
25+
flux1 = surface_flux_function[1](u_inner, u_inner, orientation_or_normal,
26+
eq)
27+
flux2 = surface_flux_function[2](u_inner, u_inner, orientation_or_normal,
2628
eq)
2729
else # u_inner is "left" of boundary, u_inner is "right" of boundary
28-
flux = surface_flux_function(u_inner, u_inner, orientation_or_normal,
30+
flux1 = surface_flux_function[1](u_inner, u_inner, orientation_or_normal,
31+
eq)
32+
flux2 = surface_flux_function[2](u_inner, u_inner, orientation_or_normal,
2933
eq)
3034
end
31-
return flux
35+
return flux1,flux2
3236
end
3337

3438
@doc raw"""
@@ -61,12 +65,16 @@ function boundary_condition_slip_wall(u_inner, orientation_or_normal,
6165

6266
# calculate the boundary flux
6367
if iseven(direction) # u_inner is "left" of boundary, u_boundary is "right" of boundary
64-
flux = surface_flux_function(u_inner, u_boundary, orientation_or_normal,
68+
flux1 = surface_flux_function[1](u_inner, u_boundary, orientation_or_normal,
69+
eq)
70+
flux2 = surface_flux_function[2](u_inner, u_boundary, orientation_or_normal,
6571
eq)
6672
else # u_boundary is "left" of boundary, u_inner is "right" of boundary
67-
flux = surface_flux_function(u_boundary, u_inner, orientation_or_normal,
73+
flux1 = surface_flux_function[1](u_boundary, u_inner, orientation_or_normal,
74+
eq)
75+
flux2 = surface_flux_function[2](u_boundary, u_inner, orientation_or_normal,
6876
eq)
6977
end
7078

71-
return flux
79+
return flux1,flux2
7280
end

src/2DModel/bc2d.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ Boundary flux as an `SVector`.
1717
"""
1818
function boundary_condition_outflow(u_inner, orientation_or_normal, direction, x, t, surface_flux_function, eq::BloodFlowEquations2D)
1919
# Calculate the boundary flux without reflection
20-
flux = surface_flux_function(u_inner, u_inner, orientation_or_normal, eq)
21-
return flux
20+
flux1 = surface_flux_function[1](u_inner, u_inner, orientation_or_normal, eq)
21+
flux2 = surface_flux_function[2](u_inner, u_inner, orientation_or_normal, eq)
22+
return flux1,flux2
2223
end
2324

2425

@@ -40,8 +41,9 @@ Boundary flux as an `SVector`.
4041
"""
4142
function boundary_condition_outflow(u_inner, orientation_or_normal, x, t, surface_flux_function, eq::BloodFlowEquations2D)
4243
# Calculate the boundary flux without reflection
43-
flux = surface_flux_function(u_inner, u_inner, orientation_or_normal, eq)
44-
return flux
44+
flux1 = surface_flux_function[1](u_inner, u_inner, orientation_or_normal, eq)
45+
flux2 = surface_flux_function[2](u_inner, u_inner, orientation_or_normal, eq)
46+
return flux1,flux2
4547
end
4648

4749

@@ -68,9 +70,11 @@ function boundary_condition_slip_wall(u_inner, orientation_or_normal, direction,
6870

6971
# Calculate the boundary flux based on direction
7072
if iseven(direction)
71-
flux = surface_flux_function(u_inner, u_boundary, orientation_or_normal, eq)
73+
flux1 = surface_flux_function[1](u_inner, u_boundary, orientation_or_normal, eq)
74+
flux2 = surface_flux_function[2](u_inner, u_boundary, orientation_or_normal, eq)
7275
else
73-
flux = surface_flux_function(u_boundary, u_inner, orientation_or_normal, eq)
76+
flux1 = surface_flux_function[1](u_boundary, u_inner, orientation_or_normal, eq)
77+
flux2 = surface_flux_function[2](u_boundary, u_inner, orientation_or_normal, eq)
7478
end
75-
return flux
79+
return flux1,flux2
7680
end

0 commit comments

Comments
 (0)