How to estimate/calculate pressure on the edges of a metal rod as it is heated up and tries to expand? Imagine we have placed a metal rod between two face-to-face walls so that the rod is just perpendicular to the surface of both walls and the edges of the rod touches each wall. So the length of the rod is initially just the distance between the walls. If I heat up the rod, it will try to expand and exert a force to walls. How can I calculate this force and the pressure exerted by the rod as a function of temperature assuming that the rod will not bend? I guess there must be a linear region where pressure linearly increases with the heat (until the rod deforms severely or melts down or its thickness starts to increase noticeably). What is the size of this linear region? Is it really the exact same case if the rod would be instead a pipe filled with a heated gas or liquid instead of the metal material inside the rod?
 A: This module out of the University of Connecticut School of Engineering asks precisely "What are the thermal stresses resulting from an elevated temperature on a round beam fixed at both ends?" They use ANSI 1030, a low carbon steel, as an example material for the beam. Below is the setup (the steel beam fits snugly between two walls and then is heated up from room temperature):


Image source: University of Connecticut School of Engineering 

The module gives the following equation for the thermal stress in the x-direction, $\sigma_x$:
$$\sigma_x = \alpha E \left(T - T_{ref}\right)$$
Using the values of $\alpha$, $E$, and $\left(T - T_{ref}\right)$ stated in the problem description, for this example $\sigma_x = 359.7\ MPa$. This is below the yield strength of ANSI 1030 steel, $441\ MPa$, so at this temperature it has not left the linear region of temperature vs. pressure.
Applying this to your own example: you will need to look up the $\alpha$ and $E$ for the specific metal, as these are material dependant constants. Those coupled with the final temperature of the rod vs. what it was before heating $\left(T - T_{ref}\right)$ will allow you to calculate the $\sigma_x$. As long as the $\sigma_x$ is below the yield strength of the material, it will remain in the linear region where the stress/pressure will depend linearly on the temperature of the bar. 
