Skip to content

Commit a776b8c

Browse files
committed
FV:Div_par_fvv make sheath fluxes symmetric
If not fixing boundary flux, the method used was different for upper and lower boundaries. Using the method that was at the upper boundary.
1 parent 19cdbb7 commit a776b8c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

include/div_ops.hxx

+5-4
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ namespace FV {
154154
// Use mid-point to be consistent with boundary conditions
155155
flux = bndryval * vpar * vpar;
156156
} else {
157-
// Handle pathological case of diverging flows
158-
flux = bndryval * vpar * BOUTMIN(vpar, BOUTMAX(v(i, j, k), 0.0));
157+
// Add flux due to difference in boundary values
158+
flux = s.R * vpar * sv.R + wave_speed(i, j, k) * (s.R * sv.R - bndryval * vpar);
159159
}
160+
160161
} else {
161-
162+
162163
// Maximum wave speed in the two cells
163164
BoutReal amax = BOUTMAX(wave_speed(i, j, k), wave_speed(i, j + 1, k));
164165

@@ -173,7 +174,7 @@ namespace FV {
173174
flux = s.R * 0.5 * (vpar + amax) * sv.R;
174175
}
175176
}
176-
177+
177178
result(i, j, k) += flux * flux_factor_rc;
178179
result(i, j + 1, k) -= flux * flux_factor_rp;
179180

0 commit comments

Comments
 (0)