temperature_stencil(grid, k, cp, rho, dt, dl, heat_source=0, solid_index=None, substrate_T=294, flat=False, add=0)[source]#

Calculates diffusion term for the surface cells using stencil operator

Nevertheless, ‘solid_index’ is an optional argument, it is highly recommended to handle index from the caller function.

  • grid – 3D temperature array

  • k – thermal conductivity, [W/K/m]

  • cp – heat capacity, [J/kg/K]

  • rho – density, [g/cm^3]

  • dt – time interval over which diffusion term is calculated, s

  • dl – grid spacing (cell size), nm

  • heat_source – 3D volumetric heating source array, [W/nm^3]

  • solid_index – indexes of solid cells

  • substrate_T – temperature of the substrate

  • flat – if True, returns a flat array of surface cells. Otherwise, returns a 3d array with the same shape as grid.

  • add


3d or 1d ndarray