From bf3dba7f99961d245fd6cac88cadd49759d17fe5 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 7 Dec 2020 09:29:49 -0800 Subject: [PATCH] CurrentLoop reports the current *per cross-section* (i.e. the actual current) --- src/geom/mod.rs | 4 ++++ src/meas.rs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/geom/mod.rs b/src/geom/mod.rs index bb1671d..a5daa26 100644 --- a/src/geom/mod.rs +++ b/src/geom/mod.rs @@ -250,6 +250,10 @@ impl Torus { pub fn axis(&self) -> Meters { self.normal } + pub fn cross_section(&self) -> Flt { + use crate::consts::PI; + (self.minor_rad * self.minor_rad * PI).into() + } } #[typetag::serde] diff --git a/src/meas.rs b/src/meas.rs index 8529a15..0061555 100644 --- a/src/meas.rs +++ b/src/meas.rs @@ -135,7 +135,9 @@ impl AbstractMeasurement for CurrentLoop { CurrentSample(1, directed_current, current) }); let mean_directed_current = directed_current / (volume as Flt); - format!("I({}): {:.2e}", self.name, mean_directed_current) + let cross_section = self.region.cross_section() / (state.feature_size() * state.feature_size()); + let cross_sectional_current = mean_directed_current * cross_section; + format!("I({}): {:.2e}", self.name, cross_sectional_current) } }