Skip to main content

Green's functions for point, line, and planar heat sources.

Project description

by Scott Prahl

pypi github conda zenodo

License testing docs Downloads

Try JupyterLite

Green’s Functions for the Heat Equation

grheat implements analytic Green’s function solutions of the heat equation:

ρ c ∂T/∂t = k ∇²T + q

or:

∂T/∂t = 𝛼 ∇² T + q/(ρ c)

for a semi-infinite medium. It is a library of closed-form temperature-rise solutions, not a grid-based PDE solver.

Green’s functions are especially useful for heat-transfer problems because they make the structure of the solution explicit:

  • the source geometry is encoded analytically

  • time dependence can often be handled by convolution or finite pulse differences

  • boundary conditions can be enforced exactly with image sources

  • results are fast to evaluate and easy to compare against numerical simulations

That is the role of grheat: it provides reusable implementations of these analytic solutions so you can work directly with the physics of the heat equation instead of re-deriving the formulas each time.

What The Package Implements

The core classes correspond to canonical Green’s-function source geometries:

  • Point: a point heat source at (xp, yp, zp) inside the medium

  • Line: an infinite x-directed line source passing through (yp, zp)

  • Plane: an infinite xy-planar source at depth zp

  • ExponentialVolumeSource: exponentially decaying volumetric heating caused by uniform surface illumination

  • ExponentialColumnSource: exponentially decaying volumetric heating caused by point illumination on the surface

Each class provides methods for common temporal source profiles:

  • instantaneous(...) for impulsive deposition

  • continuous(...) for sources that turn on and remain on

  • pulsed(...) for finite-duration deposition

The medium occupies the half-space below the surface z = 0 and surface boundary conditions are handled analytically with the method of images. The supported boundary conditions are:

  • infinite: no surface constraint

  • adiabatic: no heat flow across the surface, dT/dz = 0

  • zero: the surface is held at T = 0

All methods return temperature rise, not absolute temperature.

The analytic solutions in grheat assume:

  • a homogeneous, isotropic medium

  • constant thermal properties

  • a semi-infinite geometry

  • idealized source geometries with exact Green’s-function solutions

If you need spatially varying properties, finite geometries, or arbitrary boundaries, you will generally want a numerical PDE solver instead.

Quick Start

The example below computes the surface temperature rise caused by uniform illumination that creates an exponentially decaying volume source. The ExponentialVolumeSource class is an analytic Green’s-function solution for volumetric heating proportional to mu_a exp(-mu_a z).

import grheat
import numpy as np

mu_a = 0.25 * 1000            # absorption coefficient [1/m]
z = 0                         # depth [m]
t = np.linspace(0, 0.5, 100)  # time [s]

medium = grheat.ExponentialVolumeSource(mu_a, boundary="adiabatic")

# Temperature rise for unit irradiance; scale by your actual irradiance as needed.
dT = medium.continuous(z, t)

A point-source example looks like this:

import grheat
import numpy as np

source = grheat.Point(0, 0, 1e-3, boundary="zero")
t = np.linspace(1e-3, 0.1, 200)

# Temperature rise from a unit instantaneous point source
dT = source.instantaneous(0, 0, 0, t)

Full documentation, API reference, and example notebooks are available at grheat.readthedocs.io:

docs

Installation

Install with pip:

pip install grheat

Or with conda:

conda install -c conda-forge grheat

If you want to run the notebooks in the browser with no local installation, use the JupyterLite deployment on GitHub Pages:

Try JupyterLite

Documentation and Examples

The full documentation, API reference, and example notebooks are available at grheat.readthedocs.io:

docs

If you want to run the notebooks in the browser with no local installation, use the JupyterLite deployment on GitHub Pages:

Try JupyterLite

Citation

If you use grheat in academic, instructional, or applied technical work, please cite:

Prahl, S. (2026). grheat: a python module for heat transfer Green’s functions (Version 0.5.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.10030670

BibTeX:

@software{prahl_grheat_2026,
  author  = {Scott Prahl},
  title   = {{grheat}: a python module for heat transfer {G}reen's functions},
  url     = {https://github.com/scottprahl/grheat},
  doi     = {10.5281/zenodo.10030670},
  year    = {2026},
  version = {0.5.0},
  publisher = {Zenodo}
}

References

The implementations are based on standard heat-conduction results, especially:

  • Carslaw, H. S., and Jaeger, J. C., Conduction of Heat in Solids, (1959).

  • Prahl, Scott A., “Charts to rapidly estimate temperature following laser irradiation,” Proc. SPIE 2391 (1995)

License

grheat is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grheat-0.5.1.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grheat-0.5.1-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file grheat-0.5.1.tar.gz.

File metadata

  • Download URL: grheat-0.5.1.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for grheat-0.5.1.tar.gz
Algorithm Hash digest
SHA256 43a881c3cc1076957324a2e3ee0b1a659cc48992ca4bbcce3e6c4934695bc1ef
MD5 5505f518e5f089d47a9bb76e6c6258ca
BLAKE2b-256 1dde0f40dccb34ac082f274a34b78443feda0d56bcd5a691208be48a87fdefbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for grheat-0.5.1.tar.gz:

Publisher: pypi.yaml on scottprahl/grheat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grheat-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: grheat-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for grheat-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7964f83ee4668b200c773f17da6496478154d7b1d7d1d04dc9c0c706e4558d1d
MD5 7d0f203f399149801ed3c924636ffa32
BLAKE2b-256 ff985a3a64b354fd92d8100c1ecde463e9878b4606188f93a74c2fda0133e279

See more details on using hashes here.

Provenance

The following attestation bundles were made for grheat-0.5.1-py3-none-any.whl:

Publisher: pypi.yaml on scottprahl/grheat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page