From 259cd30a57f24871d011208c674484fe7e263f14 Mon Sep 17 00:00:00 2001 From: Mike Kryjak Date: Tue, 30 Jul 2024 18:38:13 +0100 Subject: [PATCH] Correct volume calculation --- src/sheath_boundary_simple.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sheath_boundary_simple.cxx b/src/sheath_boundary_simple.cxx index 1470d33d..0d90359d 100644 --- a/src/sheath_boundary_simple.cxx +++ b/src/sheath_boundary_simple.cxx @@ -403,7 +403,7 @@ void SheathBoundarySimple::transform(Options& state) { / (sqrt(coord->g_22[i]) + sqrt(coord->g_22[ip])); // This omits dx*dz because we divide by dx*dz next // Divide by volume of cell to get energy loss rate (> 0) - BoutReal power = heatflow / (coord->dy[i] * coord->J[i]); + BoutReal power = heatflow / (coord->dx[i] * coord->dy[i] * coord->dz[i] * coord->J[i]); hflux_e[i] -= power; electron_energy_source[i] -= power; @@ -548,7 +548,7 @@ void SheathBoundarySimple::transform(Options& state) { / (sqrt(coord->g_22[i]) + sqrt(coord->g_22[im])); // This omits dx*dz because we divide by dx*dz next // Divide by volume of cell to get energy loss rate (< 0) - BoutReal power = heatflow / (coord->dy[i] * coord->J[i]); + BoutReal power = heatflow / (coord->dx[i] * coord->dy[i] * coord->dz[i] * coord->J[i]); hflux_i[i] += power; energy_source[i] += power;