OFFSET shells and beams with a temperature gradient get wrong expanded-node temperatures: wrong thermal expansion, and beams bend (1 + 2·OFFSET) times as much

Summary

The manual, *TEMPERATURE (section 7.132 of the 2.23 manual): “For shell elements a temperature gradient can be defined in addition to a temperature. The temperature applies to nodes in the reference surface, the gradient acts in normal direction. For beam elements two gradients can be defined: one in 1-direction and one in 2-direction.” With *SHELL SECTION, OFFSET=e or *BEAM SECTION, OFFSET1=e1, OFFSET2=e2 the reference surface (line) is not the mid-surface (axis). The expanded element’s nodes are placed accordingly, but gen3dtemp.f does not give them the matching temperatures. Exit 0, no warning.

Shells. The middle expanded nodes lie at a distance e t from the reference surface. gen3dtemp.f gives them the reference-surface temperature T, instead of T - g e t. The outer nodes are right. The temperature through the thickness is then no longer linear, and its mean is off by (2/3) g e t. So the in-plane thermal strain is off by (2/3) alpha g e t, for any T. The curvature is right. For T = 0 the expansion is 1/3 of the correct value, for other T the ratio differs.

Beams (SECTION=RECT checked). gen3dtemp.f uses the factor (0.5 + offset) on both sides of the section and leaves the offset out at the middle nodes. The expanded nodes on the positive side, and the middle nodes, get wrong temperatures. The temperature at the centroid becomes T instead of T - g b e (b the thickness in that direction), and the gradient becomes (1 + 2 e) g: twice the input for e = 0.5, zero for e = -0.5.

Test: pairs of decks that describe the same solid with the same temperature field. One uses the offset; its twin has the nodes at the mid-surface (centroid line) and gives the temperature there. The pairs should give the same displacements:

  • S8R plate, OFFSET=0.5, T = 0, gradient 100: in-plane U1 = -3.333E-03, twin -1.000E-02. With T = 10: 1.667E-02, twin 1.000E-02. Both errors are (2/3) alpha g e t x = 6.667E-03. The bending (-0.1) is right.
  • B32 cantilever, OFFSET2=0.5, T = 10, gradient 100 in the 2-direction: tip deflection -0.1000006, twin -0.05000029; axial 1.0E-02, twin 5.0E-03. With OFFSET2=-0.5 the beam does not bend at all.

Version

ccx 2.23 (macOS arm64). Source: master 9ba5d76 (16 Oct 2026).

Already reported or fixed?

Not reported: I found no matching GitHub issue (open or closed) or pull request in Dhondtguido/CalculiX, and no calculix.discourse.group topic (searched 21 Oct 2026). Not fixed: gen3dtemp.f is unchanged on master (9ba5d76).

Minimal input

offset_gradient.inp: a flat 2 x 1 plate of two S8R elements (thickness 0.1, OFFSET=0.5, E 1000, nu 0, alpha 1E-3), supported statically determinate; T = 0 and gradient 100.

*NODE, NSET=NALL
1, 0, 0, 0.
2, 0.5, 0, 0.
3, 1, 0, 0.
4, 1.5, 0, 0.
5, 2, 0, 0.
6, 0, 0.5, 0.
7, 1, 0.5, 0.
8, 2, 0.5, 0.
9, 0, 1, 0.
10, 0.5, 1, 0.
11, 1, 1, 0.
12, 1.5, 1, 0.
13, 2, 1, 0.
*ELEMENT, TYPE=S8R, ELSET=EALL
1, 1, 3, 11, 9, 2, 7, 10, 6
2, 3, 5, 13, 11, 4, 8, 12, 7
*MATERIAL, NAME=M
*ELASTIC
1000., 0.
*EXPANSION
1.E-3
*SHELL SECTION, ELSET=EALL, MATERIAL=M, OFFSET=0.5
0.1
*BOUNDARY
1, 1, 3
3, 2, 3
9, 3, 3
*INITIAL CONDITIONS, TYPE=TEMPERATURE
NALL, 0.
*STEP
*STATIC
*TEMPERATURE
NALL, 0., 100.
*NODE PRINT, NSET=NALL
U
*END STEP

midsurface_twin.inp: the same solid without offset. The nodes move to mid-thickness, and the temperature line gives the mid-surface temperature T - g e t = -5:

--- offset_gradient.inp
+++ midsurface_twin.inp
@@ (all 13 nodes)
-1, 0, 0, 0.
+1, 0, 0, -0.05
 ...
-13, 2, 1, 0.
+13, 2, 1, -0.05
@@
-*SHELL SECTION, ELSET=EALL, MATERIAL=M, OFFSET=0.5
+*SHELL SECTION, ELSET=EALL, MATERIAL=M
@@
-NALL, 0., 100.
+NALL, -5., 100.

Both expand into the same C3D20R solid between z = -0.1 and z = 0, with T(z) = 100 z. The T = 10 pair uses NALL, 10., 100. and NALL, 5., 100..

beam_offset_gradient.inp: a B32 cantilever along z (length 1, RECT 0.1 x 0.1, n1 = x, so n2 = y), clamped at z = 0, OFFSET2=0.5 (the reference line is the +y face), T = 10, gradient 100 in the 2-direction.

beam_offset_gradient.inp and its twin
*NODE, NSET=NALL
1, 0., 0., 0
2, 0., 0., 0.25
3, 0., 0., 0.5
4, 0., 0., 0.75
5, 0., 0., 1
*ELEMENT, TYPE=B32, ELSET=EALL
1, 1, 2, 3
2, 3, 4, 5
*MATERIAL, NAME=M
*ELASTIC
1000., 0.
*EXPANSION
1.E-3
*BEAM SECTION, ELSET=EALL, MATERIAL=M, SECTION=RECT, OFFSET2=0.5
0.1, 0.1
1., 0., 0.
*BOUNDARY
1, 1, 6
*INITIAL CONDITIONS, TYPE=TEMPERATURE
NALL, 0.
*STEP
*STATIC
*TEMPERATURE
NALL, 10., 100., 0.
*NODE PRINT, NSET=NALL
U
*END STEP

beam_centroid_twin.inp: the nodes on the centroid line (y = -0.05), no offset, and the centroid temperature T - g b e = 5:

--- beam_offset_gradient.inp
+++ beam_centroid_twin.inp
@@ (all 5 nodes)
-1, 0., 0., 0
+1, 0., -0.05, 0
 ...
@@
-*BEAM SECTION, ELSET=EALL, MATERIAL=M, SECTION=RECT, OFFSET2=0.5
+*BEAM SECTION, ELSET=EALL, MATERIAL=M, SECTION=RECT
@@
-NALL, 10., 100., 0.
+NALL, 5., 100., 0.

Variants: OFFSET1=0.5 with the gradient in the 1-direction (NALL, 10., 0., 100.; twin at x = -0.05, NALL, 5., 0., 100.), and OFFSET2=-0.5 (twin at y = +0.05, NALL, 15., 100., 0.).

How to run

ccx offset_gradient
ccx midsurface_twin
ccx beam_offset_gradient
ccx beam_centroid_twin

Expected

The same displacements in each pair. Shell twin: the mid-surface temperature T_mid = T - g e t gives the in-plane strain alpha T_mid and the curvature alpha g = 0.1, so U1 = alpha T_mid x and U3 = -0.1 at node 5 (x = 2, y = 0). Beam twin: curvature alpha g = 0.1, tip deflection alpha g L²/2 = 0.05, axial alpha (T - g b e) L = 5.0E-03. Both decks of a pair print the reference nodes as the average of the same expanded nodes, so the printed values must match too.

Actual

Exit 0, no warning, in every run.

Shells, node 5 (x = 2), g = 100, t = 0.1:

OFFSET e T U1 ccx U1 expected (alpha T_mid x) U1 error (2/3) alpha g e t x U3
0.5 (offset_gradient) 0 -3.333333E-03 -1.000000E-02 (twin) +6.667E-03 6.667E-03 -1.000000E-01
0.5 10 1.666667E-02 1.000000E-02 (twin) +6.667E-03 6.667E-03 -1.000000E-01
0.25 0 -1.666667E-03 -5.0E-03 +3.333E-03 3.333E-03 -1.000000E-01
0.25 10 1.833333E-02 1.5E-02 +3.333E-03 3.333E-03 -1.000000E-01
-0.5 0 3.333333E-03 1.0E-02 -6.667E-03 -6.667E-03 -1.000000E-01
0 0 4.8E-16 0 0 0 -1.000000E-01

offset_gradient.inp with S8 instead of S8R: the same (-3.333334E-03). With a uniform temperature (NALL, 100.) and OFFSET=0.5, U1 is 0.2 = alpha T x, as expected.

Beams, tip node 5, T = 10, g = 100, b = 0.1:

deck bending deflection twin axial U3 twin
OFFSET2=0.5, gradient in 2-direction (beam_offset_gradient) U2 = -1.000006E-01 -5.000029E-02 1.000000E-02 5.000000E-03
OFFSET1=0.5, gradient in 1-direction U1 = -1.000006E-01 -5.000029E-02 1.000000E-02 5.000000E-03
OFFSET2=-0.5, gradient in 2-direction U2 = 6.5E-15 -5.000029E-02 1.000000E-02 1.500000E-02

Without offset the same beam gives -5.000029E-02 and 1.000000E-02, as expected. With OFFSET2=0.5 and a uniform temperature (NALL, 10.) the axial displacement is 1.000000E-02 = alpha T L, as expected.

Where it goes wrong

Shells: gen3dfrom2d.f places the middle expanded node of a shell node at co(j,nodes(2,k))=co(j,nodel(k))-thicks(k)*xnors(j,k)*offset(1,i) (lines 183-184), i.e. at -e t from the reference surface. gen3dtemp.f gives the three expanded nodes:

              node=knor(indexk+1)
              t1(node)=t1(i)
     &             -t1g(1,i)*thicke(1,indexe+j)*(0.5d0+offset(1,ielem))
              ...
              node=knor(indexk+2)
              t1(node)=t1(i)
              ...
              node=knor(indexk+3)
              t1(node)=t1(i)
     &             +t1g(1,i)*thicke(1,indexe+j)*(0.5d0-offset(1,ielem))

(lines 215-224; the same for initial temperatures in lines 70-91). The outer nodes are right. The middle node gets the reference temperature t1(i), without the term -t1g(1,i)*thicke(1,indexe+j)*offset(1,ielem). With OFFSET=0.5 and T = 0 the middle nodes get 0 instead of -5. Through the thickness the element then sees bottom T_mid - g t/2, middle T_mid + g e t, top T_mid + g t/2; the quadratic interpolation through these has the mean T_mid + (2/3) g e t.

Beams: gen3dfrom1d.f places the expanded nodes between -(0.5 + e1) t1 and +(0.5 - e1) t1 along n1 (and the same along n2), with the middle nodes at -e t (lines 80-227). For example, expanded node 4 lies at +thickb(1,1)*xnorb(j,1)*(.5d0-offset(1,i)) +thickb(2,1)*xnorb(j+3,1)*(.5d0-offset(2,i)) (lines 104-109). gen3dtemp.f gives it

              node=knor(indexk+4)
              t1(node)=t1(i)
     &             +t1g(2,i)*thicke(1,indexe+j)*(0.5d0+offset(1,ielem))
     &             +t1g(1,i)*thicke(2,indexe+j)*(0.5d0+offset(2,ielem))

(lines 242-245). The whole beam branch (lines 226-262, and 99-184 for initial temperatures) uses (0.5 + offset) on both sides of the section and has no offset term for the middle nodes. Across the section that gives T - g b (0.5 + e), T, T + g b (0.5 + e) at the bottom, middle and top: mean T, gradient (1 + 2 e) g.

Fix

In gen3dtemp.f, give each expanded node the temperature at its actual position, as placed by gen3dfrom2d.f and gen3dfrom1d.f:

  • shells: the middle node t1(i)-t1g(1,i)*thicke(1,indexe+j)*offset(1,ielem) (and the same with t0, t0g for the initial values);
  • beams: (0.5 - offset) instead of (0.5 + offset) for the nodes on the positive side, and -offset for the middle nodes, in both directions. For example node 4: t1(i)+t1g(2,i)*thicke(1,indexe+j)*(0.5d0-offset(1,ielem))+t1g(1,i)*thicke(2,indexe+j)*(0.5d0-offset(2,ielem)).

Workaround: no offset where a temperature gradient is given (place the nodes on the mid-surface or centroid line and give the temperature there).

Confirmed using official build of ccx 2.23 on Windows, needs a GitHub ticket.

offset_gradient.dat:

5 -3.333333E-03 2.774961E-15 -1.000000E-01

compared with:

1 Like

Posted: OFFSET shells and beams with a temperature gradient get wrong expanded-node temperatures: wrong thermal expansion, and beams bend (1 + 2·OFFSET) times as much · Issue #261 · Dhondtguido/CalculiX · GitHub

1 Like