From 97a21fdfaeb5a1672a57d5dbb4261145bb195566 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 16 Aug 2024 21:49:02 -0700 Subject: [PATCH] evolve_pressure: Important fix to P boundary Must clear P parallel slices or Grad_par will use them. Alternatively, setBoundaryTo should clear the parallel slices if they are not set in the argument. --- src/electron_force_balance.cxx | 4 +--- src/evolve_pressure.cxx | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/electron_force_balance.cxx b/src/electron_force_balance.cxx index fa4552da..e464ac7e 100644 --- a/src/electron_force_balance.cxx +++ b/src/electron_force_balance.cxx @@ -14,9 +14,7 @@ void ElectronForceBalance::transform(Options &state) { throw BoutException("Cannot calculate potential and use electron force balance\n"); } - // Get the electron pressure - // Note: The pressure boundary can be set in sheath boundary condition - // which depends on the electron velocity being set here first. + // Get the electron pressure, with boundary condition applied Options& electrons = state["species"]["e"]; Field3D Pe = GET_VALUE(Field3D, electrons["pressure"]); Field3D Ne = GET_NOBOUNDARY(Field3D, electrons["density"]); diff --git a/src/evolve_pressure.cxx b/src/evolve_pressure.cxx index 6ff9de02..d6a854da 100644 --- a/src/evolve_pressure.cxx +++ b/src/evolve_pressure.cxx @@ -226,6 +226,7 @@ void EvolvePressure::finally(const Options& state) { // Get updated pressure and temperature with boundary conditions // Note: Retain pressures which fall below zero + P.clearParallelSlices(); P.setBoundaryTo(get(species["pressure"])); Field3D Pfloor = floor(P, 0.0); // Restricted to never go below zero