diff --git a/include/tug/Core/BTCS.hpp b/include/tug/Core/BTCS.hpp index 4ee01ed..73a312b 100644 --- a/include/tug/Core/BTCS.hpp +++ b/include/tug/Core/BTCS.hpp @@ -138,10 +138,9 @@ template constexpr T calcExplicitConcentrationsBoundaryConstant(T conc_center, T conc_bc, T alpha_center, T alpha_neighbor, T sy) { - return sy * calcAlphaIntercell(alpha_center, alpha_neighbor) * conc_center + - (1 - sy * (calcAlphaIntercell(alpha_center, alpha_center) + - alpha_center)) * - conc_center + + const T inter_cell = calcAlphaIntercell(alpha_center, alpha_neighbor); + return sy * inter_cell * conc_center + + (1 - sy * (inter_cell + alpha_center)) * conc_center + sy * alpha_center * conc_bc; }