

def rate(self, pores=None, network=None, conductance=None, X_value=None, mode='group'):
    "\n        Send a list of pores and receive the net rate\n        of material moving into them.\n\n        Parameters\n        ----------\n        pores : array_like\n            The pores where the net rate will be calculated\n        network : OpenPNM Network Object\n            The network object to which this algorithm will apply.\n            If no network is sent, the rate will apply to the network which is\n            attached to the algorithm.\n        conductance : array_like\n            The conductance which this algorithm will use to calculate the\n            rate.\n            If no conductance is sent, the rate will use the\n            'throat.conductance' which is attached to the algorithm.\n        X_value : array_like\n            The values of the quantity (temperature, mole_fraction,\n            voltage, ...), which this algorithm will use to calculate the rate.\n            If no X_value is sent, the rate will look at the '_quantity',\n            which is attached to the algorithm.\n        mode : string, optional\n            Controls how to return the rate.  Options are:\n            - 'group'(default): It returns the cumulative rate moving into them\n            - 'single': It calculates the rate for each pore individually.\n        "
    if (network is None):
        network = self._net
    if (conductance is None):
        conductance = self['throat.conductance']
    if (X_value is None):
        X_value = self[self._quantity]
    pores = sp.array(pores, ndmin=1)
    R = []
    if (mode == 'group'):
        t = network.find_neighbor_throats(pores, flatten=True, mode='not_intersection')
        throat_group_num = 1
    elif (mode == 'single'):
        t = network.find_neighbor_throats(pores, flatten=False, mode='not_intersection')
        throat_group_num = sp.size(t)
    for i in sp.r_[0:throat_group_num]:
        if (mode == 'group'):
            throats = t
            P = pores
        elif (mode == 'single'):
            throats = t[i]
            P = pores[i]
        p1 = network.find_connected_pores(throats)[:, 0]
        p2 = network.find_connected_pores(throats)[:, 1]
        pores1 = sp.copy(p1)
        pores2 = sp.copy(p2)
        pores1[(~ sp.in1d(p1, P))] = p2[(~ sp.in1d(p1, P))]
        pores2[(~ sp.in1d(p1, P))] = p1[(~ sp.in1d(p1, P))]
        X1 = X_value[pores1]
        X2 = p1[pores2]
        g = conductance[throats]
        R.append(sp.sum(sp.multiply(g, (X2 - X1))))
    return sp.array(R, ndmin=1)

dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Algorithms/__GenericLinearTransport__.py GenericLinearTransport.rate/VarMisuse@340/859 `X_value`->`p1`