Point

class grheat.point_source.Point(xp, yp, zp, tp=0, diffusivity=1.4557999999999998e-07, capacity=4184000.0, boundary='infinite')[source]

Bases: object

Green’s function heat transfer solutions for point source in semi-infinite media.

The Point class represents a point heat source located at a specified position (xp, yp, zp) in the medium. It provides methods to calculate the temperature rise at any given location (x, y, z) at a specified time t due to different types of heat source behavior: instantaneous, continuous, or pulsed.

In addition, three types of boundary conditions are supported: infinite, adiabatic (for z=0), and zero (again for z=0).

Methods Summary

continuous(x, y, z, t)

Calculate the temperature rise due to a 1W continuous point source at specified time(s).

instantaneous(x, y, z, t)

Calculate the temperature rise due to a 1J instant point source at specified time(s).

pulsed(x, y, z, t, t_pulse)

Calculate temperature rise due to a 1J pulsed point source at time(s) t.

Methods Documentation

continuous(x, y, z, t)[source]

Calculate the temperature rise due to a 1W continuous point source at specified time(s).

This method computes the temperature rise at given location(s) (x, y, z) at time(s) t due to a 1W continuous point source located at (xp, yp, zp) that was turned on at time t=0, following the formula from Carslaw and Jaeger (page 261, 10.4(2)).

Parameters:
  • x (scalar or array) – x-coord(s) of desired temperature [meters].

  • y (scalar or array) – y-coord(s) of desired temperature [meters].

  • z (scalar or array) – z-coord(s) of desired temperature [meters].

  • t (scalar or array) – Time(s) for temperature to be computed [seconds].

Returns:

scalar or array – Temperature increase (°C) at the specified location(s) and time(s).

Example

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

# Define time, source, and observation points
t = np.linspace(0, 500, 100) / 1000   # seconds
x, y, z = 0, 0, 0                     # meters
xp, yp, zp = 0, 0, 0.001              # meters

# Create a Point object representing the heat source
point = grheat.Point(xp, yp, zp)

# Calculate the temperature rise due to a pulsed heat source
T = point.continuous(x, y, z, t)

# Plot the temperature rise over time
plt.plot(t * 1000, T, color='blue')
plt.xlabel("Time (ms)")
plt.ylabel("Temperature Increase (°C)")
plt.title("1J pulse lasting %.0f ms" % t_pulse)
plt.show()
instantaneous(x, y, z, t)[source]

Calculate the temperature rise due to a 1J instant point source at specified time(s).

This method computes the temperature rise at given location(s) (x, y, z) at time(s) t due to a 1J instantaneous point source located at (xp, yp, zp) occurring at time(s) tp, following the formula from Carslaw and Jaeger (page 256, 10.2(2)). Either t or tp should be a scalar while the other can be an array.

Parameters:
  • x (scalar or array) – x-coord(s) of desired temperature [meters].

  • y (scalar or array) – y-coord(s) of desired temperature [meters].

  • z (scalar or array) – z-coord(s) of desired temperature [meters].

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

Returns:

scalar or array – Temperature increase in °C at the specified location(s) and time(s).

Example:

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

# Define time, source, and observation points
t = np.linspace(10, 500, 100) / 1000  # seconds
x, y, z = 0, 0, 0                     # meters
xp, yp, zp = 0, 0, 0.001              # meters
t_p = 0                               # seconds

# Create a Point object representing the heat source
point = grheat.Point(xp, yp, zp, tp)

# Calculate the temperature rise due to a pulsed heat source
T = point.instantaneous(x, y, z, t)

# Plot the temperature rise over time
plt.plot(t * 1000, T, color='blue')
plt.xlabel("Time (ms)")
plt.ylabel("Temperature Increase (°C)")
plt.title("1J pulse lasting %.0f ms" % t_pulse)
plt.show()
pulsed(x, y, z, t, t_pulse)[source]

Calculate temperature rise due to a 1J pulsed point source at time(s) t.

This method computes the temperature rise at given location(s) (x, y, z) at time(s) t due to a 1J pulsed point source located at (xp, yp, zp). The point source deposits heat from time t=self.tp to t=self.tp+t_pulse.

Parameters:
  • x (scalar or array) – x-coord(s) of desired temperature [meters].

  • y (scalar or array) – y-coord(s) of desired temperature [meters].

  • z (scalar or array) – z-coord(s) of desired temperature [meters].

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

  • t_pulse (scalar) – Duration of the pulse during which heat is deposited [seconds].

Returns:

scalar or array – Temperature increase (°C) at the location(s) and time(s).

Example

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

# Define time, source, and observation points
t = np.linspace(0, 500, 100) / 1000   # seconds
x, y, z = 0, 0, 0                     # meters
xp, yp, zp = 0, 0, 0.001              # meters
t_pulse = 0.100                       # seconds

# Create a Point object representing the heat source
medium = grheat.Point(xp, yp, zp)

# Calculate the temperature rise due to a pulsed heat source
T = medium.pulsed(x, y, z, t, t_pulse)

# Plot the temperature rise over time
plt.plot(t * 1000, T, color='blue')
plt.xlabel("Time (ms)")
plt.ylabel("Temperature Increase (°C)")
plt.title("1J pulse lasting %.0f ms" % t_pulse)
plt.show()