From 2c01c276d26ee7e994baaeb2aa621c0a7aae8039 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Tue, 24 Sep 2024 19:00:30 -0700 Subject: [PATCH] Update spacecraft charging script --- .../inputs_test_rz_spacecraft_charging_picmi.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py b/Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py index e3bc888f600..9ce8bb8433c 100644 --- a/Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py +++ b/Examples/Physics_applications/spacecraft_charging/inputs_test_rz_spacecraft_charging_picmi.py @@ -121,13 +121,13 @@ def compute_virtual_charge_on_spacecraft(): # Compute integral of rho over volume of the domain # (i.e. total charge of the plasma particles) rho_integral = ( - (rho[1 : nr - 1, 1 : nz - 1] * r[1 : nr - 1, np.newaxis]).sum() * dr * dz + (rho[1 : nr - 1, 1 : nz - 1] * r[1 : nr - 1, np.newaxis]).sum() + * 2 + * np.pi + * dr + * dz ) - # Due to an oddity in WarpX (which will probably be solved later) - # we need to multiply `rho` by `-epsilon_0` to get the correct charge - rho_integral *= 2 * np.pi * -scc.epsilon_0 # does this oddity still exist? - # Compute charge of the spacecraft, based on Gauss theorem q_spacecraft = -rho_integral - scc.epsilon_0 * grad_phi_integral print("Virtual charge on the spacecraft: %e" % q_spacecraft)