thermesh - 1-D Transient Heat Conduction
The thermesh module provides 1-D transient heat conduction modeling for vessel walls
using the finite element method. This is particularly important for Type III/IV vessels
with low thermal conductivity composite materials.
1-D transient heat conduction solver using finite element method.
This module provides a finite element solver for transient heat conduction problems in 1-D domains. It is particularly useful for calculating temperature distributions through vessel walls with composite materials or low thermal conductivity.
The code is adapted from the thermesh library (https://github.com/wjbg/thermesh) and implements: - Linear and quadratic finite elements - Theta-method time integration (explicit, implicit, Crank-Nicolson) - Temperature-dependent material properties - Dirichlet and Neumann boundary conditions - Multi-layer/composite material domains
Key classes: - Domain: Represents the computational domain with mesh, material model, and BCs - Mesh: 1-D finite element mesh with elements and nodes - Element: Abstract base class for finite elements - LinearElement: 2-node linear finite element - QuadraticElement: 3-node quadratic finite element
Typical usage: 1. Create Mesh with nodes and elements 2. Define material model (isothermal_model or piecewise_linear_model) 3. Create Domain with mesh, material, initial temperature, and BCs 4. Solve using solve_ht() with time step and end time
The solver uses the theta-method for time integration: - theta = 0: Forward Euler (explicit, conditionally stable) - theta = 0.5: Crank-Nicolson (implicit, unconditionally stable, 2nd order) - theta = 1: Backward Euler (implicit, unconditionally stable, 1st order)
- hyddown.thermesh.solve_ht(domain, solver)[source]
Solves heat transfer problem.
- class hyddown.thermesh.Domain(mesh, constitutive_model, bc={})[source]
Bases:
objectClass to represent a domain.
- bc
The boundary conditions are provided in a two-item list of dictionaries. The first dictionary (or zeroth item in the list) applies to the start or left side of the domain, while the second item applies to the end or right side of the domain. The dictionaries can have the keys: “T” OR ( (“h” and “T_inf”) AND/OR “q” ), with “T” an applied temperature, “h” and “T_inf” the convective heat transfer coefficient and far field temperature, respectively, while “q” represents a direct flux on the surface which is directed inwards.
- Type:
two-item list of dicts
- constitutive_model
Functions that takes temperature as an input and provides a dictionary with the following keys: k, cp, rho. The list has a length equal to the number of subdomains in the mesh. The i-th function in the list belongs to the i-th subdomain.
- Type:
list[function]
- T
Temperature at time t.
- Type:
nd.array(dim=1, len=mesh.nn)
- q
Heat flux at time t.
- Type:
nd.array(dim=1, len=mesh.nn)
- set_T(T)[source]
Set temperature.
Parameter
- Tfloat OR np.ndarray(dim=1, dtype=float, len=nn)
Temperature at nodes.
- hyddown.thermesh.isothermal_model(k, rho, cp)[source]
Returns a function that represents an isothermal material model.
Parameter
- kfloat
Thermal conductivity.
- rhofloat
Density
- cpfloat
Specific heat.
- returns:
model – Function that returns a dictionary with the provided constitutive properties.
- rtype:
Callable
- hyddown.thermesh.piecewise_linear_model(k, rho, cp)[source]
Returns a function that represents an isothermal material model.
Parameter
- knp.ndarray(dim=2, dtype=float)
Temperature vs. thermal conductivity.
- rhonp.ndarray(dim=2, dtype=float)
Temperature vs. density
- cpnp.ndarray(dim=2, dtype=float)
Temperature vs. specific heat.
- returns:
model – Function that returns a dictionary with the provided constitutive properties.
- rtype:
Callable
- class hyddown.thermesh.Mesh(z, element)[source]
Bases:
objectClass to represent a mesh.
- nodes
Node locations.
- Type:
nd.array()
- subdomain
Number that indicates the subdomain in the mesh. Correlates with the constitutive model that will be used for the analysis.
- class hyddown.thermesh.Element(nodes)[source]
Bases:
objectClass to represent an element.
- dim = 1
- order = 0
- class hyddown.thermesh.LinearElement(nodes)[source]
Bases:
ElementClass to represent a linear element (order = 1).
- order = 1
- class hyddown.thermesh.QuadraticElement(nodes)[source]
Bases:
ElementClass to represent a linear element (order = 2).
- order = 2
Overview
The module is adapted from https://github.com/wjbg/thermesh and implements finite element analysis for transient heat conduction through vessel walls.
Key Features
Finite element method for accurate temperature distribution
Support for composite materials (multi-layer walls)
Time-dependent boundary conditions
Integration with fire heat load calculations
Separate models for wetted/unwetted regions in two-phase flow
Applications
The detailed heat conduction model is essential for:
Type III/IV composite pressure vessels
Materials with low thermal conductivity
Accurate wall temperature prediction during fire scenarios
Two-phase systems with different heat transfer in gas/liquid contact regions
Wall Heat Conduction Modes
HydDown supports two modes:
Simple: Uniform wall temperature (lumped capacitance) - fast but approximate
Detailed: 1-D transient conduction via
thermesh- slower but accurate
The detailed mode is activated by setting appropriate parameters in the heat_transfer
section of the input file.
Composite Materials
For multi-layer walls (e.g., Type III vessels with liner, composite overwrap, and outer layer):
Define material properties for each layer
Specify layer thicknesses
The solver handles interfaces automatically
Two-Phase Modeling
For two-phase systems, the module solves separate heat conduction problems for:
Wetted region (liquid-contact) - typically higher heat transfer
Unwetted region (gas-contact) - typically lower heat transfer
The boundary between regions is determined by the liquid level in the vessel.