MolarFlux quantity#319
Merged
iliekturtles merged 1 commit intoAug 2, 2022
Merged
Conversation
iliekturtles
reviewed
Aug 2, 2022
iliekturtles
left a comment
Owner
There was a problem hiding this comment.
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())));
}
}
}
Comment on lines
86
to
90
| molar_energy::MolarEnergy, | ||
| molar_heat_capacity::MolarHeatCapacity, | ||
| molar_mass::MolarMass, | ||
| molar_flux::MolarFlux, | ||
| momentum::Momentum, |
Owner
There was a problem hiding this comment.
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, |
9a45908 to
d337646
Compare
Contributor
Author
|
Fixed some more consistency with "square meter second" and squashed with new message. |
Owner
|
Perfect! Thanks so much for this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding new quantity: MolarFlux [amount of substance /(time * area)] with basic unit mole/m2/s.
Only basic unit of measurement implemented.