code: def apply_flow(self, flowrate):
          r
          net = self.project.network
          P12 = net['throat.conns']
          aa = self['throat.invasion_sequence']
          bb = sp.argsort(self['throat.invasion_sequence'])
          P12_inv = self['pore.invasion_sequence'][P12]
          # Find if the connected pores were invaded with or before each throat
          P1_inv = P12_inv[:, 0] <= aa
          P2_inv = P12_inv[:, 1] <= aa
          cc = sp.column_stack((P1_inv, P2_inv))
          # List of Pores invaded with each throat
          dd = sp.sum(cc, axis=1, dtype=bool)
          # Find volume of these pores
          P12_vol = sp.sum(net['pore.volume'][P12]*cc, axis=1)*dd
          # Add invaded throat volume to pore volume (if invaded)
          T_vol = P12_vol + net['throat.volume']
          # Cumulative sum on the sorted throats gives cumulated inject volume
          ee = sp.cumsum(T_vol[bb] / flowrate)
          t = sp.zeros((self.Nt,))
          t[bb] = ee  # Convert back to original order
          phase = self.project.find_phase(self)
          phase['throat.invasion_time'] = t
docs: r"""
          Convert the invaded sequence into an invaded time for a given flow rate
          considering the volume of invaded pores and throats.
  
          Parameters
          ----------
          flowrate : float
              The flow rate of the injected fluid
  
          Returns
          -------
          Creates a throat array called 'invasion_time' in the Algorithm
          dictionary