Hmm, let's see. I think it's more like this, (ML^-1T^-2 * L^-1) * � ML^-3 * (ML^-1T^-2 * L^-1)^-1 = L^-1T^-2, Pressure Gradient divided by Fluid (or Mass) Density.<br><br>�I think I follow; doing my home work, one bar being a kilopascal (kPa), or (10e3 * NL^-2), or (10e3 * MLT^-2), so we have (10e3 * MLT^-2 * L^-1).<br> <br>Okay, then yes we divide by mass density of ML^-3, or multiply by (ML^-3)^-1 if you prefer.<br><br>So we have (10e3 * MLT^-2 * L^-1) * (ML^-3)^-1.<br><br>Hope my rusty dimensional analysis skills are showing... :-)<br> <br>Okay, so we can do some reductions I think, (10e3 * L^3 * T^-2). Am I reading this correctly? Is this the rate at which a volume transfers? Something along these lines. Really not up on my dimensional analysis like I should be; but I WILL be.<br> <br>However it reduced, please verify I am reducing correctly, I don't think the units are supposed to make sense; we're arriving at an intermediate conversion factor I believe. At least that's how it is explained to me.<br> <br><div class="gmail_quote">On Thu, Jul 21, 2011 at 5:23 PM, Noah Roberts <span dir="ltr"><<a href="mailto:roberts.noah@gmail.com">roberts.noah@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div class="im">On 7/21/2011 3:16 PM, Michael Powell wrote:<br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> Okay, here's what we need to get at, for starters. And maybe an<br> illustration or three and a little exchange will go a long way towards<br> helping my better comprehend units.<br> <br> I'm starting with a set of SI calculations for oil and gas constants<br> calculations. Eventually we will need to accommodate US units as well.<br> But not quite yet.<br> <br> We need to get at a calculation involving Pressure Gradient, which ends<br> up being metric::bar/si::meter (bars over meters) in specific units, or<br> I suppose si::pressure/si::length might also work.<br> <br> Then we need to get after Fluid Density, which ends up being<br> si::kilogram/si:meter^3 (kilograms over cubic meters) in specific units,<br> or I suppose si::mass/si::meter^3 (I don't know what this looks like in<br> terms of boost::units, maybe one of the volumes?), or perhaps make use<br> of mass_density?<br> </blockquote> <br></div> Yes, it's mass_density.<div class="im"><br> <br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <br> We take all that and divide Pressure Gradient by Fluid Density to arrive<br> at what we hope will be the the conversion factor: 0.0000981. Which we<br> could specify that as a constant, but I like proving it through the<br> software first (plausibly once) when we ask for it.<br> </blockquote> <br></div> So, by your description:<br> <br> ML^-3 * (ML^-1T^-2 * L^-1)^-1 = L^-1T^-2.<br> <br> This latter part is the dimension your factor is in.<br> <br> using namespace boost::units;<br> <br> typedef derived_dimension<length_base_<u></u>dimension, -1, time_base_dimension, -2>::type funky_factor_dimension<br> <br> typedef unit<funky_factor_dimension, si::system> funky_factor;<br> <br> quantity<funky_factor> factor(quantity<si::pressure> p, quantity<si::length> l, quantity<si::mass_density> d)<br> {<br> �return (p / l) / d;<br> }<br> <br> Alternatively:<br> <br> template < typename System ><br> quantity<unit<funky_factor_<u></u>dimension, System>><br> �factor( quantity<unit<pressure_<u></u>dimension,System>> p<br> � � � �, quantity<unit<length_<u></u>dimension,System>> l<br> � � � �, quantity<unit<mass_density_<u></u>dimension,System>> d )<br> {<br> �return (p / l) / d;<div class="im"><br> }<br> <br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <br> Similar type calculations would follow for US units involving gallons,<br> cubic inches, inches, and inches per foot, along these lines.<br> </blockquote> <br></div> As long as you use a coherent system, the template version above should work (assuming I got all the types correct).<br> <br> ______________________________<u></u>_________________<br> Boost-users mailing list<br> <a href="mailto:Boost-users@lists.boost.org" target="_blank">Boost-users@lists.boost.org</a><br> <a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users" target="_blank">http://lists.boost.org/<u></u>mailman/listinfo.cgi/boost-<u></u>users</a><br> </blockquote></div><br>