RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
    • Linear static analysis
    • Steady heat transfer
    • Modal analysis
    • Mesh refinement
    • Thermal stress
    • First static study
    • Reusable parameterized model
    • Transient study with generated inputs
    • Modal response-spectrum study
    • Run and plot a sweep
    • Scale from local to cluster
    • Publish and read large results
Docs/FEA/Guides

Finite-element analysis

Thermal stress

Find the stress and support force in a clamped steel bar heated by 80 K, from the restrained-bar formula and a thermomechanical finite-element solution in RunMat.

A part that cannot expand freely when its temperature changes develops thermal stress. Pipes between anchors, rails, bolted flanges and electronics on a stiff board all carry it. This page works one example in full: the thermal strain and restrained-bar theory of a strength-of-materials course, the finite-element formulation that carries a temperature field into a structural solve, and the solution in RunMat.

Example 1: A clamped steel bar heated by 80 K

A steel bar is built in between two rigid walls at room temperature, 20 °C. In service it heats uniformly to 100 °C. The walls do not move. The bar must stay elastic, below its 250 MPa yield strength, and the walls must be designed for the force the bar exerts on them.

Given

QuantityValue
LengthL = 1 m, along x
Cross-sectionsquare, 100 mm × 100 mm (A = 0.01 m²)
Materialsteel, E = 200 GPa, ν = 0.3, α = 12 × 10⁻⁶ K⁻¹
Reference temperatureT_ref = 293.15 K (20 °C), stress-free
Service temperatureT = 373.15 K (100 °C), uniform: ΔT = 80 K
Supportsboth end faces fixed in all directions
Yield strength250 MPa

Find

  1. The axial stress in the bar.
  2. The force each wall carries.
  3. Whether the bar stays below yield, and what the result means for the design.

Thermal expansion of a restrained bar

Thermal strain

A material heated by ΔT from a stress-free state expands equally in every direction. The thermal strain is

εth=α ΔT,\varepsilon_{th} = \alpha\,\Delta T ,εth​=αΔT,

and stress arises only from the part of the strain that differs from it. In one dimension, Hooke's law becomes

σ=E (ε−α ΔT).\sigma = E\,(\varepsilon - \alpha\,\Delta T) .σ=E(ε−αΔT).

Free and restrained bars

A bar free to expand has no stress: ε=αΔT\varepsilon = \alpha\Delta Tε=αΔT, and its length grows by δ=α ΔT L\delta = \alpha\,\Delta T\,Lδ=αΔTL. Between rigid walls the total strain is zero, so the stress and the axial force are

σ=−E α ΔT,N=σA=−EA α ΔT.\sigma = -E\,\alpha\,\Delta T, \qquad N = \sigma A = -E A\,\alpha\,\Delta T .σ=−EαΔT,N=σA=−EAαΔT.

The stress is compressive and depends on neither the length nor the section: a long rail and a short pin heated by the same amount carry the same stress. For this bar, a free bar would grow by 0.96 mm, and the restrained bar carries σ = −192 MPa and N = −1,920 kN.

Three dimensions

In a solid, the thermal strain is a uniform expansion, εth=α ΔT I\boldsymbol\varepsilon_{th} = \alpha\,\Delta T\,\mathbf Iεth​=αΔTI, and the stress follows from the elastic part of the strain:

σ=C:(ε−εth).\boldsymbol\sigma = \mathsf C : (\boldsymbol\varepsilon - \boldsymbol\varepsilon_{th}) .σ=C:(ε−εth​).

Away from the walls the restrained bar is in uniaxial compression, and its free sides grow sideways by the thermal strain plus the Poisson expansion under the compressive stress, εy=αΔT+ν ∣σ∣/E=α ΔT (1+ν)\varepsilon_y = \alpha\Delta T + \nu\,|\sigma|/E = \alpha\,\Delta T\,(1 + \nu)εy​=αΔT+ν∣σ∣/E=αΔT(1+ν). At the walls, the clamped faces also hold the section's width and depth fixed. The material there is restrained in three directions, which the one-dimensional formula does not see.

Finite-element formulation

Weak form. Substituting the thermoelastic stress into the principle of virtual work moves the thermal strain to the right-hand side:

∫Ωε(w):C:ε(u) dΩ=∫Ωε(w):C:εth dΩfor every admissible w.\int_\Omega \boldsymbol\varepsilon(\mathbf w) : \mathsf C : \boldsymbol\varepsilon(\mathbf u)\, d\Omega = \int_\Omega \boldsymbol\varepsilon(\mathbf w) : \mathsf C : \boldsymbol\varepsilon_{th}\, d\Omega \quad \text{for every admissible } \mathbf w .∫Ω​ε(w):C:ε(u)dΩ=∫Ω​ε(w):C:εth​dΩfor every admissible w.

The temperature acts as a load. No force is applied anywhere, yet the bar is loaded by its own restrained expansion.

Discretization. With ten-node tetrahedra and quadratic shape functions, uh=∑aNaua\mathbf u^h = \sum_a N_a \mathbf u_auh=∑a​Na​ua​ and ε=Beue\boldsymbol\varepsilon = \mathbf B_e \mathbf u_eε=Be​ue​, as in the linear static example. The left side gives the usual element stiffness, and the right side gives a thermal load vector:

Ke=∫ΩeBeTD Be dΩ,fth,e=∫ΩeBeTD εth dΩ.\mathbf K_e = \int_{\Omega_e} \mathbf B_e^{\mathsf T}\mathbf D\,\mathbf B_e\, d\Omega, \qquad \mathbf f_{th,e} = \int_{\Omega_e} \mathbf B_e^{\mathsf T}\mathbf D\,\boldsymbol\varepsilon_{th}\, d\Omega .Ke​=∫Ωe​​BeT​DBe​dΩ,fth,e​=∫Ωe​​BeT​Dεth​dΩ.

Assembly and supports. Assembling gives K u=fth\mathbf K\,\mathbf u = \mathbf f_{th}Ku=fth​. The clamped faces prescribe zero displacement, and the reactions there are the wall forces, as in a static analysis. Stress is recovered from the elastic strain only, σ=D (Beue−εth)\boldsymbol\sigma = \mathbf D\,(\mathbf B_e\mathbf u_e - \boldsymbol\varepsilon_{th})σ=D(Be​ue​−εth​).

Here the temperature is prescribed as a uniform field. When it comes from a heat-conduction solution instead, the same thermal load vector carries the computed temperature into the structural solve; the thermomechanical physics reference covers that coupling.

Solution

Each block below is an excerpt of thermal-stress-static.fea.

Geometry

The bar is imported from a STEP file. Its two end faces carry CAD names, so the study can clamp them by name.

geometry bar {
    file = "./geometry/bar.step"
    units = mm
    region body : solid { select name "Bar"; expect exactly_one }
    region end_a : face { select name "End A"; expect exactly_one }
    region end_b : face { select name "End B"; expect exactly_one }
}

Mesh

Quadratic tetrahedra at a 50 mm target size give 2,692 elements and 4,679 nodes. The stress in the middle of the bar is uniform, but near the clamps it varies across the section, and quadratic elements follow that variation.

mesh bar on geometry.bar {
    tetrahedra {
        order = quadratic
        target_size = 0.05 m
        maximum_deviation = 0.001 m
    }
}

Material

A thermal stress analysis needs the elastic constants and the expansion coefficient. The reference_temperature is the stress-free temperature, and modulus_temperature_coefficient = 0 K^-1 keeps E constant over the 80 K rise. The conductivity and specific heat serve heat-conduction steps and are unused when the temperature is prescribed.

material steel {
    mass_density = 7850 kg/m^3
    elastic {
        youngs_modulus = 200 GPa
        poisson_ratio = 0.3
    }
    thermal {
        reference_temperature = 293.15 K
        modulus_temperature_coefficient = 0 K^-1
        conductivity = 45 W/m/K
        specific_heat = 500 J/kg/K
        expansion_coefficient = 0.000012 K^-1
    }
}

Supports and temperature

Both end faces are fixed: the rigid walls of the problem statement. The temperature is applied as a temperature_field load on the whole body, 373.15 K against the 293.15 K reference, which is the ΔT\Delta TΔT in εth\boldsymbol\varepsilon_{th}εth​.

model clamped_bar {
    thermal { reference_temperature = 293.15 K }
    thermomechanical { reference_temperature = 293.15 K }
    assign material.steel to geometry.bar.region.body
    constraint clamp_a {
        structural.fixed { target = geometry.bar.region.end_a }
    }
    constraint clamp_b {
        structural.fixed { target = geometry.bar.region.end_b }
    }
    load operating_temperature {
        temperature_field on geometry.bar.region.body = 373.15 K
    }
    load_case operating { include load.operating_temperature }
}

Study and outputs

The thermomechanical steady procedure assembles Ku=fth\mathbf K\mathbf u = \mathbf f_{th}Ku=fth​ and solves it. The outputs publish the displacement and stress fields, the von Mises stress at the center of the bar, the reaction on one wall, and the largest displacement.

study heated_static {
    geometry = geometry.bar
    mesh = mesh.bar
    model = model.clamped_bar
    analysis coupled { thermomechanical steady {} }
    output displacement = analysis.coupled.field.node.displacement
    output stress = analysis.coupled.field.element.stress
    output von_mises = analysis.coupled.field.element.von_mises_stress
    output mid_von_mises = interpolate(analysis.coupled.field.node.von_mises_stress, at = [500 mm, 50 mm, 50 mm])
    output clamp_reaction = resultant(analysis.coupled.field.node.reaction_force, over = geometry.bar.region.end_a)
    output largest_displacement = max(magnitude(analysis.coupled.field.node.displacement), over = geometry.bar.region.body)
}

Run

From the command line, in the example folder:

runmat check thermal-stress-static.fea
runmat run thermal-stress-static.fea

Wall force

The reaction on the wall at x = 0 is 1,975.84 kN, pointing in +x: the bar pushes on the wall and the wall pushes back. The other wall carries the same force in the opposite direction, so the bar as a whole is in equilibrium with no applied load. The force is 2.9 % above the 1,920 kN of the one-dimensional formula. The clamped faces also stop the section from growing sideways near the walls, which makes the bar stiffer there; holding the stiffer bar to zero total length takes more force.

Stress

At the center of the bar the von Mises stress is 197.584 MPa. In uniaxial compression the von Mises stress equals the magnitude of the axial stress, and dividing the wall force by the area gives the same 197.6 MPa: the axial force is the same at every section, and at mid-length it is carried uniformly.

Deformation

The largest displacement is 0.0905 mm, at the corners of the sections away from the walls. The bar cannot lengthen, so this is the sideways growth of the section. The lateral strain α ΔT (1+ν)=1.25×10−3\alpha\,\Delta T\,(1 + \nu) = 1.25 \times 10^{-3}αΔT(1+ν)=1.25×10−3 moves a corner 50 mm from the axis by about 0.062 mm in each of two directions, or 0.088 mm in all.

Answers

  1. The axial stress is about 197.584 MPa in compression in the body of the bar, against 192 MPa from EαΔTE\alpha\Delta TEαΔT.
  2. Each wall carries 1,975.84 kN.
  3. The stress is 79 % of the 250 MPa yield strength. The bar stays elastic, but with little margin for a modest temperature rise.

Discussion

Design meaning. An 80 K rise uses almost four-fifths of the yield strength of a fully restrained steel bar, whatever its size, and a wall must resist about 2 MN. Restraint, not load, is the problem, so the usual design response removes restraint: a sliding support, an expansion joint or a flexible loop lets the part grow, and the thermal stress falls toward zero. Where restraint cannot be avoided, a material with lower EαE\alphaEα reduces the stress in proportion.

Model limits. The walls are perfectly rigid. Real supports deflect and slip, so the computed force is an upper bound. The temperature is uniform and α and E are constant; a temperature gradient through the section adds bending, which a conduction solve feeding this study would capture. The analysis is linear and assumes the bar stays straight. Compression in a long, slender member can buckle it before it yields. For this stocky bar the fixed–fixed Euler load, 4π2EI/L2≈664\pi^2 EI/L^2 \approx 664π2EI/L2≈66 MN, needs a temperature rise of over 2,700 K, so buckling is not a concern; for a rail or a thin pipe it often governs.

Refinement. The stress in the body of the bar is uniform and settles on a coarse mesh. The stress near the clamped edges does not: where the clamped face meets the free sides, the restraint produces a singular point, like the clamped edge of the linear static example. Judge the design on the stress in the body, or model the real support.

Try a change

Problem 1.1. Remove clamp_b so the bar can grow from the wall at x = 0. Predict the stress and the movement of the free end before running.

Answer. The bar expands freely: away from the wall the stress is essentially zero, the wall force vanishes, and the free end moves by α ΔT L=0.96\alpha\,\Delta T\,L = 0.96αΔTL=0.96 mm.

Problem 1.2. Change the material to aluminum (E = 68.9 GPa, α = 23 × 10⁻⁶ K⁻¹). Predict the restrained stress.

Answer. EαΔT=68.9 GPa×23×10−6×80≈127E\alpha\Delta T = 68.9\ \text{GPa} \times 23 \times 10^{-6} \times 80 \approx 127EαΔT=68.9 GPa×23×10−6×80≈127 MPa: lower than steel, because aluminum's lower modulus outweighs its larger expansion.

Problem 1.3. Heat the bar to 150 °C instead (temperature_field ... = 423.15 K). Is it still elastic? At what temperature rise does the body of the bar reach yield?

Next

  • Linear static analysis: the structural analysis this example builds on.
  • Thermomechanical physics reference: coupling a heat-conduction solve to a structural one.
  • Thermomechanical validation: this bar against the restrained-bar formula.

Continue learning

  • Thermomechanical validation
  • Linear static analysis
On this page
  • Overview
  • Example 1: A clamped steel bar heated by 80 K
  • Thermal expansion of a restrained bar
  • Solution
  • Discussion
  • Try a change
  • Next
  • Continue learning