Boost Users :
Subject: [Boost-users] [starting to get OT] Re: boost::units primer explained / conversion factors required
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2011-07-22 13:17:54
On 7/22/2011 9:43 AM, Michael Powell wrote:
> With this approach, we're getting a compilation error. Not sure what
> we're doing wrong.
> #include <boost/units/systems/si.hpp>
> using namespace boost::units;
> using boost::units::si::mass;
> using boost::units::si::pressure;
> using boost::units::si::length;
> using boost::units::si::mass_density;
> using boost::units::si::pascals;
> using boost::units::si::meter;
> using boost::units::si::kilograms_per_cubic_meter;
> typedef derived_dimension<length_base_dimension, 1,
> time_base_dimension, -2>::type si_hsp_conversion_constant_factor;
Are you doing "HSP" as in hydrostatic pressure (head)? If so, it's a
unit of length.
If not, but this factor is related to head, which it looks like it could
be the head/distance, then you're missing an important element to your
formula: acceleration due to gravity. This value would indeed be
dimensionless because head is length.
Engineers leave this value out in some of the formulas they use. The
reason they can do this is that they actually use units such that a 1 in
units mass is equal to 1 in units weight (a force). For example, 1 lbm
= 1 lbf. Thus they feed mass into the equation (from the fluid) but use
it as if it were force. This indeed works because the definition of lbf
is such that it includes g in it and the g cancels out.
When working in SI though this is not possible. In SI you really need
to include the g constant: 9.80665 m/s^2. Your formula might then be
"press / (den * g) / len"? That would be the rate of head loss per unit
length, a dimensionless quantity.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net