Boost::units users,<br><br>I am trying to perform a flow rate through an orifice calculation (Volume per Time or L^3T^-1) using the following dimensional analysis:<br><br>Q = Cf * A * sqrt( 2 * abs(P1-P2) )<br><br>On paper the dimensional analysis works out correctly. I know we should be receiving a L^3T^-1 consequent to the calculation.<br>
<br>If I just take this on one line, it seems to compile:<br><br>�__C_flow * __a_orifice * boost::units::sqrt(__two * __p_diff / __d);<br><br>Where __a_orifice is the area of the orifice, __p_diff is the pressure differential (absolute value), and __d is the mass density. __C_flow (coefficient of flow through orifice) and __two (2.0) are both dimensionless.<br>
<br>In terms of units quantities, these are all defined as quantity&lt;si::area&gt;, quantity&lt;si::pressure&gt;, quantity&lt;si::mass_density&gt;, and quantity&lt;si::dimensionless&gt;, to start with.<br><br>I think my flow-rate dimension and/or unit must be incorrect, but I am failing to see why in order to know what to do to correct the error.<br>
<br>�typedef boost::units::derived_dimension&lt;boost::units::length_base_dimension,3<br>�� � � � � � �� ��� �������������������������������������� ,boost::units::time_base_dimension,-1&gt;::type flow_rate_dimension;<br><br>
�typedef boost::units::unit&lt;cs::units::flow_rate_dimension,boost::units::si::system&gt; flow_rate;<br><br>When I take:<br><br> si::flow_rate __fr = __C_flow * __a_orifice * boost::units::sqrt(__two * __p_diff / __d);<br>
<br>I am receiving the following compiler error as my clue...<br><br>Error��� 1��� error C2440: &#39;initializing&#39; : cannot convert from &#39;boost::units::quantity&lt;Unit,Y&gt;&#39; to &#39;boost::units::quantity&lt;Unit,Y&gt;&#39;��� c:\Source\Simulations\CS.Calculations.Managed\Calculators\Calculator.cpp��� 461��� CS.Calculations.Managed<br>
<br>I&#39;d like to set this up in as base a dimension as possible because later on we&#39;ll be introducing unit views, converting from base units to a view unit, or unit system, along these lines, but if we have to specify this in specific unit terms, so be it. We&#39;ll worry about unit conversions later on.<br>
<br>Best regards,<br><br>Michael Powell<br>