-
Notifications
You must be signed in to change notification settings - Fork 100
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
MolarFlux quantity #319
Conversation
There was a problem hiding this 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
molar_energy::MolarEnergy, | ||
molar_heat_capacity::MolarHeatCapacity, | ||
molar_mass::MolarMass, | ||
molar_flux::MolarFlux, | ||
momentum::Momentum, |
There was a problem hiding this comment.
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.
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, |
9a45908
to
d337646
Compare
Fixed some more consistency with "square meter second" and squashed with new message. |
Perfect! Thanks so much for this PR. |
Adding new quantity: MolarFlux [amount of substance /(time * area)] with basic unit mole/m2/s.
Only basic unit of measurement implemented.