Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MolarFlux quantity #319

Conversation

crystal-growth
Copy link
Contributor

Adding new quantity: MolarFlux [amount of substance /(time * area)] with basic unit mole/m2/s.
Only basic unit of measurement implemented.

@crystal-growth crystal-growth changed the title MolarFlux quantity: initial commit MolarFlux quantity Jul 29, 2022
Copy link
Owner

@iliekturtles iliekturtles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly formatting / consistency changes again. Diff below or you can use crystal-growth/uom@add_molar_flow_rate_quantity...iliekturtles:uom:add_molar_flow_rate_quantity

Once changes are applied please squash and add a commit message!

diff --git a/src/si/mod.rs b/src/si/mod.rs
index 22502c5..989b072 100644
--- a/src/si/mod.rs
+++ b/src/si/mod.rs
@@ -84,9 +84,9 @@ system! {
         mass_rate::MassRate,
         molar_concentration::MolarConcentration,
         molar_energy::MolarEnergy,
+        molar_flux::MolarFlux,
         molar_heat_capacity::MolarHeatCapacity,
         molar_mass::MolarMass,
-        molar_flux::MolarFlux,
         momentum::Momentum,
         power::Power,
         pressure::Pressure,
diff --git a/src/si/molar_flux.rs b/src/si/molar_flux.rs
index 80cec5c..7d788fb 100644
--- a/src/si/molar_flux.rs
+++ b/src/si/molar_flux.rs
@@ -1,9 +1,9 @@
-//! Molar flux (base unit mole per second suqare meter, mol · s⁻¹ · m⁻²).
+//! Molar flux (base unit mole per square meter second, m⁻² · s⁻¹ · mol).
 
 quantity! {
-    /// Molar flux (base unit mole per second suqare meter, mol · s⁻¹ · m⁻²).
+    /// Molar flux (base unit mole per square meter second, m⁻² · s⁻¹ · mol).
     quantity: MolarFlux; "molar flux";
-    /// Dimension of molar flux, NT⁻¹L⁻² (base unit mole per second square meter, mol · s⁻¹ · m⁻²).
+    /// Dimension of molar flux, L⁻²T⁻¹N (base unit mole per square meter second, m⁻² · s⁻¹ · mol).
     dimension: ISQ<
         N2,     // length
         Z0,     // mass
@@ -13,8 +13,8 @@ quantity! {
         P1,     // amount of substance
         Z0>;    // luminous intensity
     units {
-        @mole_per_second_square_meter: prefix!(none); "mol/(s ┬╖ m┬▓)", "mole per second square meter", "moles per second square meter";
-
+        @mole_per_second_square_meter: prefix!(none); "mol/(s ┬╖ m┬▓)",
+            "mole per second square meter", "moles per second square meter";
     }
 }
 
@@ -27,7 +27,6 @@ mod test {
         use crate::si::quantities::*;
         use crate::si::time as t;
         use crate::si::area as area;
-
         use crate::tests::Test;
 
         #[test]
@@ -41,13 +40,11 @@ mod test {
         fn check_units() {
             test::<aos::mole, t::second, area::square_meter, mf::mole_per_second_square_meter>();
 
-
             fn test<N: aos::Conversion<V>, T: t::Conversion<V>, A: area::Conversion<V>, R: mf::Conversion<V>>() {
                 Test::assert_approx_eq(&MolarFlux::new::<R>(V::one()),
-                    &(AmountOfSubstance::new::<N>(V::one()) /
-                     Time::new::<T>(V::one()) /
-                    Area::new::<A>(V::one())
-                    ));
+                    &(AmountOfSubstance::new::<N>(V::one())
+                        / Time::new::<T>(V::one())
+                        / Area::new::<A>(V::one())));
             }
         }
     }

src/si/mod.rs Outdated
Comment on lines 86 to 90
molar_energy::MolarEnergy,
molar_heat_capacity::MolarHeatCapacity,
molar_mass::MolarMass,
molar_flux::MolarFlux,
momentum::Momentum,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order. I see that a few others are out of order and will take care of them separately.

Suggested change
molar_energy::MolarEnergy,
molar_heat_capacity::MolarHeatCapacity,
molar_mass::MolarMass,
molar_flux::MolarFlux,
momentum::Momentum,
molar_energy::MolarEnergy,
molar_flux::MolarFlux,
molar_heat_capacity::MolarHeatCapacity,
molar_mass::MolarMass,
momentum::Momentum,

@crystal-growth crystal-growth force-pushed the add_molar_flow_rate_quantity branch from 9a45908 to d337646 Compare August 2, 2022 14:19
@crystal-growth
Copy link
Contributor Author

Fixed some more consistency with "square meter second" and squashed with new message.

@iliekturtles iliekturtles merged commit 2809d31 into iliekturtles:master Aug 2, 2022
@iliekturtles
Copy link
Owner

Perfect! Thanks so much for this PR.

@crystal-growth crystal-growth deleted the add_molar_flow_rate_quantity branch September 3, 2022 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants