Class TransientWallHeatTransfer

java.lang.Object
neqsim.process.util.fire.TransientWallHeatTransfer

public class TransientWallHeatTransfer extends Object
Transient 1-D heat conduction through vessel walls.

This class implements a finite difference solution for transient heat conduction through single or composite (multi-layer) vessel walls. It is designed for modeling Type III/IV hydrogen storage vessels with low thermal conductivity liners, but is applicable to any cylindrical vessel wall.

The model solves the 1-D heat equation:

rho * Cp * dT/dt = k * d2T/dx2
using an explicit finite difference scheme with configurable boundary conditions.

Reference: Andreasen, A. (2021). HydDown: A Python package for calculation of hydrogen (or other gas) pressure vessel filling and discharge. Journal of Open Source Software, 6(66), 3695.

Author:
ESOL
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double[]
    Density at each node [kg/m^3].
    private final double
    Node spacing [m].
    private final double[]
    Heat capacity at each node [J/(kg*K)].
    private final int
    Number of nodes in the spatial discretization.
    private double[]
    Temperature profile across wall [K].
    private final double[]
    Thermal conductivity at each node [W/(m*K)].
    private final double[]
    Thermal diffusivity at each node [m^2/s].
    private final double
    Total wall thickness [m].
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransientWallHeatTransfer(double linerThickness, double linerK, double linerDensity, double linerCp, double shellThickness, double shellK, double shellDensity, double shellCp, double initialTemperatureK, int numNodes)
    Creates a transient wall heat transfer model for a composite (two-layer) wall.
    TransientWallHeatTransfer(double thickness, double thermalConductivity, double density, double heatCapacity, double initialTemperatureK, int numNodes)
    Creates a transient wall heat transfer model for a single-layer wall.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    advanceTimeStep(double dt, double innerFluidTemperatureK, double innerFilmCoefficientWPerM2K, double outerAmbientTemperatureK, double outerFilmCoefficientWPerM2K)
    Advances the temperature profile by one time step using explicit finite differences.
    private void
    advanceTimeStepInternal(double dt, double innerFluidTemperatureK, double innerFilmCoefficientWPerM2K, double outerAmbientTemperatureK, double outerFilmCoefficientWPerM2K)
    Internal time step advancement (assumes stability is already checked).
    double
    getHeatAbsorbed(double wallAreaM2, double previousMeanTemperatureK)
    Calculates the heat absorbed by the wall during a time step.
    double
    Calculates the heat flux through the wall at steady state.
    double
    Gets the current inner wall surface temperature (x = 0).
    double
    Calculates the maximum stable time step for the explicit scheme.
    double
    Gets the mean wall temperature (volume-averaged).
    double
    Gets the node spacing.
    int
    Gets the number of spatial nodes.
    double
    Gets the current outer wall surface temperature (x = L).
    double[]
    Gets the position array for the temperature profile.
    double[]
    Gets the complete temperature profile across the wall.
    double
    Gets the total wall thickness.
    void
    resetTemperature(double temperatureK)
    Resets the temperature profile to a uniform value.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • numNodes

      private final int numNodes
      Number of nodes in the spatial discretization.
    • dx

      private final double dx
      Node spacing [m].
    • totalThickness

      private final double totalThickness
      Total wall thickness [m].
    • temperatureProfile

      private double[] temperatureProfile
      Temperature profile across wall [K].
    • thermalConductivity

      private final double[] thermalConductivity
      Thermal conductivity at each node [W/(m*K)].
    • density

      private final double[] density
      Density at each node [kg/m^3].
    • heatCapacity

      private final double[] heatCapacity
      Heat capacity at each node [J/(kg*K)].
    • thermalDiffusivity

      private final double[] thermalDiffusivity
      Thermal diffusivity at each node [m^2/s].
  • Constructor Details

    • TransientWallHeatTransfer

      public TransientWallHeatTransfer(double thickness, double thermalConductivity, double density, double heatCapacity, double initialTemperatureK, int numNodes)
      Creates a transient wall heat transfer model for a single-layer wall.
      Parameters:
      thickness - Wall thickness [m]
      thermalConductivity - Thermal conductivity [W/(m*K)]
      density - Material density [kg/m^3]
      heatCapacity - Specific heat capacity [J/(kg*K)]
      initialTemperatureK - Initial uniform temperature [K]
      numNodes - Number of spatial nodes (minimum 3)
    • TransientWallHeatTransfer

      public TransientWallHeatTransfer(double linerThickness, double linerK, double linerDensity, double linerCp, double shellThickness, double shellK, double shellDensity, double shellCp, double initialTemperatureK, int numNodes)
      Creates a transient wall heat transfer model for a composite (two-layer) wall.

      This is typical for Type III/IV hydrogen vessels with an inner liner and outer shell.

      Parameters:
      linerThickness - Inner liner thickness [m]
      linerK - Liner thermal conductivity [W/(m*K)]
      linerDensity - Liner density [kg/m^3]
      linerCp - Liner heat capacity [J/(kg*K)]
      shellThickness - Outer shell thickness [m]
      shellK - Shell thermal conductivity [W/(m*K)]
      shellDensity - Shell density [kg/m^3]
      shellCp - Shell heat capacity [J/(kg*K)]
      initialTemperatureK - Initial uniform temperature [K]
      numNodes - Total number of spatial nodes (minimum 5)
  • Method Details

    • advanceTimeStep

      public void advanceTimeStep(double dt, double innerFluidTemperatureK, double innerFilmCoefficientWPerM2K, double outerAmbientTemperatureK, double outerFilmCoefficientWPerM2K)
      Advances the temperature profile by one time step using explicit finite differences.

      Uses convective (Robin) boundary conditions at both surfaces:

      -k * dT/dx = h_inner * (T_inner - T_fluid_inner) at x = 0
      -k * dT/dx = h_outer * (T_outer - T_ambient) at x = L
      
      Parameters:
      dt - Time step [s]
      innerFluidTemperatureK - Process fluid temperature [K]
      innerFilmCoefficientWPerM2K - Internal film coefficient [W/(m^2*K)]
      outerAmbientTemperatureK - Ambient/fire temperature [K]
      outerFilmCoefficientWPerM2K - External film coefficient [W/(m^2*K)]
    • advanceTimeStepInternal

      private void advanceTimeStepInternal(double dt, double innerFluidTemperatureK, double innerFilmCoefficientWPerM2K, double outerAmbientTemperatureK, double outerFilmCoefficientWPerM2K)
      Internal time step advancement (assumes stability is already checked).
    • getInnerWallTemperature

      public double getInnerWallTemperature()
      Gets the current inner wall surface temperature (x = 0).
      Returns:
      Inner wall temperature [K]
    • getOuterWallTemperature

      public double getOuterWallTemperature()
      Gets the current outer wall surface temperature (x = L).
      Returns:
      Outer wall temperature [K]
    • getMeanWallTemperature

      public double getMeanWallTemperature()
      Gets the mean wall temperature (volume-averaged).
      Returns:
      Mean wall temperature [K]
    • getTemperatureProfile

      public double[] getTemperatureProfile()
      Gets the complete temperature profile across the wall.
      Returns:
      Array of temperatures at each node [K]
    • getPositionArray

      public double[] getPositionArray()
      Gets the position array for the temperature profile.
      Returns:
      Array of positions [m] from inner wall (x=0) to outer wall (x=thickness)
    • getHeatFlux

      public double getHeatFlux()
      Calculates the heat flux through the wall at steady state.

      This is an approximation based on the current temperature gradient at the boundaries.

      Returns:
      Heat flux [W/m^2] (positive = heat flowing from outer to inner)
    • getHeatAbsorbed

      public double getHeatAbsorbed(double wallAreaM2, double previousMeanTemperatureK)
      Calculates the heat absorbed by the wall during a time step.
      Parameters:
      wallAreaM2 - Wall surface area [m^2]
      previousMeanTemperatureK - Previous mean temperature [K]
      Returns:
      Heat absorbed [J]
    • resetTemperature

      public void resetTemperature(double temperatureK)
      Resets the temperature profile to a uniform value.
      Parameters:
      temperatureK - Uniform temperature [K]
    • getNumNodes

      public int getNumNodes()
      Gets the number of spatial nodes.
      Returns:
      Number of nodes
    • getTotalThickness

      public double getTotalThickness()
      Gets the total wall thickness.
      Returns:
      Total thickness [m]
    • getNodeSpacing

      public double getNodeSpacing()
      Gets the node spacing.
      Returns:
      Node spacing [m]
    • getMaxStableTimeStep

      public double getMaxStableTimeStep()
      Calculates the maximum stable time step for the explicit scheme.
      Returns:
      Maximum stable time step [s]