units icon indicating copy to clipboard operation
units copied to clipboard

defining and using kmol units

Open a-jp opened this issue 5 years ago • 3 comments

Hi, I would like to use your library in combination with Cantera. Cantera is SI but uses kmol as the mass-based unit rather than mol. Can I ask for a short stub of code to show how to set up define and use kmol units?

A standard use case would be a value returned from Cantera in J/kmol and a value returned in kg/kmol dividing the former by the latter to get a mass-specific quantity in J/kg. I'm not asking for an example using Cantera, just new to the library and don't know how to work with and define kg/kmol and kmol units for use as per the above.

Thanks, Andy

a-jp avatar Jul 23 '19 10:07 a-jp

Hi,

I've noticed a huge increase in activity on this repo which is great. I really like it. I'd been keen to still get some help with the issue posted here. Any thoughts?

Thanks Andy

a-jp avatar Nov 06 '20 08:11 a-jp

Check out https://github.com/nholthaus/units#defining-new-units. Probably something like using kmol = units::unit<std::ratio<1000>, units::substance::mol>

cb-therm avatar Nov 06 '20 14:11 cb-therm

This will get first class support in 3.0

nholthaus avatar Nov 06 '20 17:11 nholthaus