code: def cube(target, pore_diameter='pore.diameter', throat_area='throat.area'):
      r
      network = target.project.network
      D = target[pore_diameter]
      Tn = network.find_neighbor_throats(pores=target.Ps, flatten=False)
      Tsurf = _np.array([_np.sum(network[throat_area][Ts]) for Ts in Tn])
      value = 6*D**2 - Tsurf
      return value
docs: r"""
      Calculates internal surface area of pore bodies assuming they are cubes
      then subtracts the area of the neighboring throats.
  
      Parameters
      ----------
      target : OpenPNM Object
          The object for which these values are being calculated.  This
          controls the length of the calculated array, and also provides
          access to other necessary thermofluid properties.
  
      pore_diameter : string
          The dictionary key to the pore diameter array.
  
      throat_area : string
          The dictioanry key to the throat area array.  Throat areas are needed
          since their insection with the pore are removed from the computation.