Porosity correction to thermal conductivity based on analytical temperature solutions