Plane

class grheat.plane_source.Plane(zp, tp=0, diffusivity=1.4557999999999998e-07, capacity=4184000.0, boundary='infinite')[source]

Bases: object

Green’s Function Heat Transfer Solutions for xy-Planar Source in Infinite Media.

This class encapsulates the Green’s function solutions for an xy-planar heat source in an infinite medium. It provides methods for calculating the temperature rise at a specified depth z and time t due to different behaviors of the heat source: instantaneous, continuous, or pulsed.

The Plane object should be initialized with the depth of the xy-planar source zp, and optionally, the time of source impulse tp, thermal diffusivity, volumetric heat capacity, and boundary condition can also be specified.

zp

Depth of the xy-planar source [meters].

Type:

scalar or array

tp

Time of source impulse [seconds]. Default is 0.

Type:

scalar or array

diffusivity

Thermal diffusivity [m**2/s].

Type:

scalar

capacity

Volumetric heat capacity [J/degree/m**3].

Type:

scalar

boundary

Boundary condition, one of ‘infinite’, ‘adiabatic’, or ‘zero’.

Type:

str

Methods Summary

continuous(z, t)

Calculate the temperature rise due to a continuous 1W/m² xy-planar heat source.

instantaneous(z, t)

Calculate the temperature rise due to a 1 J/m² instant xy-planar source.

pulsed(z, t, t_pulse)

Calculate the temperature rise due to a 1 J/m² pulsed xy-planar heat source.

Methods Documentation

continuous(z, t)[source]

Calculate the temperature rise due to a continuous 1W/m² xy-planar heat source.

The heat source, situated at a depth of zp, initiates at t=0 and persists continuously until the specified time t. This method serves as a wrapper for the _continuous method, facilitating handling of scalar or array input for time t.

Parameters:
  • z (scalar or array) – Depth(s) at which the temperature is desired [meters].

  • t (scalar or array) – Time(s) at which the temperature is evaluated [seconds].

Returns:

scalar or array – The temperature increase(s) at the specified depth(s) and time(s) in degrees Celsius. The return type matches the input type (scalar for scalar input, array for array input).

Example

import grheat
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 500, 100) / 1000   # seconds
z = 0                                 # meters
zp = 0.001                            # meters

plane = grheat.Plane(zp=zp)
T = plane.continuous(z, t)

plt.plot(t * 1000, T, color='blue')
plt.xlabel("Time (ms)")
plt.ylabel("Temperature Increase (°C) at z=0")
plt.title("Continuous 1W/m² source 1mm deep")
plt.show()
instantaneous(z, t)[source]

Calculate the temperature rise due to a 1 J/m² instant xy-planar source.

This method calculates the temperature increase at a specified depth z at time(s) t due to an instantaneous planar heat source of 1 J/m². The source plane is parallel to the surface and passes through depth zp, as specified during the initialization of the Plane object. The formulation is based on Carslaw and Jaeger (page 259, equation 10.3(4)).

This method handles scalar and array input for time t. When t is a scalar, a single scalar representing the temperature increase is returned. When t is array, a NumPy array of temperature increases corresponding to each time value is returned.

Parameters:
  • z (scalar or array) – Depth(s) for desired temperature in meters.

  • t (scalar or array) – Time(s) of desired temperature in seconds.

Raises:

ValueError – If both t and tp are arrays. One of them must be a scalar.

Returns:

scalar or array – Temp increase in degrees Celsius at the depth(s) and time(s).

Example:

import grheat
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 500, 100) / 1000   # seconds
z = 0                                 # meters
zp = 0.001                            # meters

plane = grheat.Plane(zp)
T = plane.instantaneous(z, t)

plt.plot(t * 1000, T, color='blue')
plt.xlabel("Time (ms)")
plt.ylabel("Temperature Increase (°C)")
plt.title("Temperature Rise due to 1 J/m² Instant Planar Source")
plt.show()
pulsed(z, t, t_pulse)[source]

Calculate the temperature rise due to a 1 J/m² pulsed xy-planar heat source.

The xy-planar source, situated at depth(s) zp, emits a pulse of 1 J/m² from time t=tp to tp+t_pulse.

Parameters:
  • z (scalar or array) – Depth(s) at which the temperature is desired [meters].

  • t (scalar or array) – Time(s) at which the temperature is evaluated [seconds].

  • t_pulse (scalar) – Duration of the heat pulse [seconds].

Returns:

scalar or array – The temperature increase(s) at the specified depth(s) and time(s) in degrees Celsius. The return type matches the input type (scalar for scalar input, array for array input).

Example

import grheat
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 500, 100) / 1000   # seconds
z = 0                                 # meters
zp = 0.001                            # meters
t_pulse = 0.100                       # seconds

plane = grheat.Plane(zp=zp)
T = plane.pulsed(z, t, t_pulse)

plt.plot(t * 1000, T, color='blue')
plt.xlabel("Time (ms)")
plt.ylabel("Temperature Increase at z=0 (°C)")
plt.title("1J pulse lasting %.0f ms" % t_pulse)
plt.show()