mwpowellhtx / units

Boost.org units module
http://boost.org/libs/units
0 stars 0 forks source link

Add specific gas constant physical dimension and units #2

Open mwpowellhtx opened 9 years ago

mwpowellhtx commented 9 years ago

At first glance, one would expect that to be E M^-1 Theta^-1, where Theta represents Temperature. In other words:

equation

With typical units represented:

equation

However, it is not so simple to derive a dimension from an already-derived dimension. Therefore, after some dimensional analysis and reduction of terms, the following should work: L^2 Theta^-1 T^-2. At least the terms work out, initially, at first, although it would be nice to incorporate the derived Energy. So far this has been proven out in alpha compilation:

equation

May go back to the drawing board on this one and see if we couldn't use energy after all. Especially since the dimensional and units terms are so non-standard.

mwpowellhtx commented 9 years ago

I am really dissatisfied to leave this here like this. I'm not sure of a better way to handle it yet without diving much deeper into the Units library.

The most natural dimensions, and therefore units, would be this:

typedef derived_dimension<energy_dimension, 1,
                          mass_base_dimension, -1,
                          temperature_base_dimension, -1>::type specific_gas_constant_dimension2;

However, because of at least a handful of compiler errors ...

Error   6   error C2039: 'type' : is not a member of 'boost::mpl::apply_wrap1<boost::mpl::numeric_cast<Tag1,Tag2>,N1>'  I:\Source\Boost.org\boost_1_58_0\installed\x64\include\boost-1_58\boost\mpl\aux_\numeric_cast_utils.hpp 34  1   Kingdom.Physics.Calculators

... I must resort to something like this:

typedef derived_dimension<length_base_dimension,2,
                          temperature_base_dimension,-1,
                          time_base_dimension,-2>::type specific_gas_constant_dimension;