From 2f737ce09edfee071591ae250d831c85d217e643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20L=C3=BCbke?= Date: Tue, 5 Mar 2024 10:26:15 +0100 Subject: [PATCH] Fix alpha intercell calculation --- include/tug/Core/BTCS.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; }