Return the Reynolds Number for a pipe.
766300
def re_pipe(FlowRate, Diam, Nu):
    """"""
    #Checking input validity
    ut.check_range([FlowRate, ">0", "Flow rate"], [Diam, ">0", "Diameter"],
                   [Nu, ">0", "Nu"])
    return (4 * FlowRate) / (np.pi * Diam * Nu)
480117
def _R2deriv(self,R,phi=0.,t=0.):
        
        return self._Pot.R2deriv(R,0.,phi=phi,t=t,use_physical=False)
148823
def diam_pipemajor(FlowRate, HeadLossFric, Length, Nu, PipeRough):
    
    #Inputs do not need to be checked here because they are checked by
    #functions this function calls.
    DiamLaminar = diam_hagen(FlowRate, HeadLossFric, Length, Nu).magnitude
    if re_pipe(FlowRate, DiamLaminar, Nu) <= RE_TRANSITION_PIPE:
        return DiamLaminar
    else:
        return diam_swamee(FlowRate, HeadLossFric, Length,
                           Nu, PipeRough).magnitude
1267479
def v(self):
        
        v = np.zeros(self.N, dtype=np.uint8)
        v[self.indices] = 1
        return v
30433
def area_orifice(Height, RatioVCOrifice, FlowRate):
    """"""
    #Checking input validity
    ut.check_range([Height, ">0", "Height"], [FlowRate, ">0", "Flow rate"],
                   [RatioVCOrifice, "0-1, >0", "VC orifice ratio"])
    return FlowRate / (RatioVCOrifice * np.sqrt(2 * gravity.magnitude * Height))
680465
def A(self):
        
        """
        if self._A is None:
            self._A = self.W > 0
        return self._A
154391
def pdf(self, phi):
        

        """
        if self._n is None:
            pdf = np.empty_like(phi)
            pdf.fill(.5/np.pi)
            return pdf

        phi = np.asarray(phi)

        pdf = self._pdf(phi)
        pdf /= 2.*np.pi

        return pdf
164791
def fetch(self):
    """"""
    length = np.random.randint(1, self._curr_length + 1)
    nesting = np.random.randint(1, self._curr_nesting + 1)
    return length, nesting
393075
def __getBarFC(pressure):
    """"""
    if pressure is None:
        return 0
    press = __to_float1(pressure)
    if press < 974:
        return 1
    if press < 990:
        return 2
    if press < 1002:
        return 3
    if press < 1010:
        return 4
    if press < 1022:
        return 5
    if press < 1035:
        return 6
    return 7
1262983
def numberp(v):
    """"""
    return (not(isinstance(v, bool)) and
            (isinstance(v, int) or isinstance(v, float)))
72
def flow_pipeminor(Diam, HeadLossExpans, KMinor):
    
    #Checking input validity - inputs not checked here are checked by
    #functions this function calls.
    ut.check_range([HeadLossExpans, ">=0", "Headloss due to expansion"],
                   [KMinor, ">0", "K minor"])
    return (area_circle(Diam).magnitude * np.sqrt(2 * gravity.magnitude
                                                  * HeadLossExpans
                                                  / KMinor)
            )
1243325
def fric_general(Area, PerimWetted, Vel, Nu, PipeRough):
    """"""
    #Checking input validity - inputs not checked here are checked by
    #functions this function calls.
    ut.check_range([PipeRough, "0-1", "Pipe roughness"])
    if re_general(Vel, Area, PerimWetted, Nu) >= RE_TRANSITION_PIPE:
        #Swamee-Jain friction factor adapted for any cross-section.
        #Diam = 4*R*h
        f= (0.25 /
            (np.log10((PipeRough
                       / (3.7 * 4
                          * radius_hydraulic_general(Area, PerimWetted).magnitude
                          )
                       )
                      + (5.74
                         / re_general(Vel, Area, PerimWetted, Nu) ** 0.9
                         )
                      )
             ) ** 2
            )
    else:
        f = 64 / re_general(Vel, Area, PerimWetted, Nu)
    return f
615567
function getVelocity(delta_time, delta_x, delta_y) {
    return {
      x: Math.abs(delta_x / delta_time) || 0,
      y: Math.abs(delta_y / delta_time) || 0
    };
  }
483651
def depipe(s):
    """"""
    n = 0
    for i in reversed(s.split('|')):
        n = n / 60.0 + float(i)
    return n
335852
def length(self):
        """"""
        return np.sqrt(np.sum(self**2, axis=1)).view(np.ndarray)
749653
def number(self):
        
        return int(math.ceil(self.total_size / float(self.size)))
331616
def width_rect_weir(FlowRate, Height):
    """"""
    #Checking input validity
    ut.check_range([FlowRate, ">0", "Flow rate"], [Height, ">0", "Height"])
    return ((3 / 2) * FlowRate
            / (con.VC_ORIFICE_RATIO * np.sqrt(2 * gravity.magnitude) * Height ** (3 / 2))
            )