Skip to content

Metal forming

A square steel tube, 20 mm across with walls 3.3 mm thick, is twisted one and a half turns between two grips, bent into an arc, and let go by one grip. The tube is a plastic solid, so it keeps the twist and the arc. The colour is the plastic strain, from steel grey where the tube never yielded, inside the grips, to amber.

python examples/fem/square_tube_twist.py

Each grip is a compliant pin with moving targets on the 35 mm of tube it holds. The world steps with time_stepping="quasi_static", so the tube follows the grips without swinging:

def build_scene(backend: str) -> Scene:
    world = trusty.World(backend=backend, gravity=(0.0, 0.0, 0.0), time_stepping="quasi_static")
    steel = trusty.HenckyVonMises(youngs_modulus=E, poisson_ratio=NU, yield_stress=YIELD,
                                  isotropic_hardening=HARDENING, kinematic_hardening=0.0)
    # Quadratic hexes: each wall is one element thick and has to bend.
    tube = trusty.fem.add_hex_solid(world, tube_mesh(), steel, density=7850.0,
                                    order=trusty.fem.ElementOrder.QuadraticSerendipity)
    rest = np.asarray(trusty.fem.positions(world, tube))
    grips = []
    for side in (-1, 1):
        nodes = np.flatnonzero(side * rest[:, 0] > LENGTH / 2.0 - GRIP)
        # N/m per node: ten times the held length's axial stiffness, shared by its nodes
        stiffness = 10.0 * E * 4.0 * WIDTH * (WIDTH / CELLS) / GRIP / len(nodes)
        pin = trusty.constraints.add_pin(world, tube, nodes.tolist(), targets=rest[nodes],
                                         stiffness=stiffness)
        grips.append(Grip(pin, nodes, rest[nodes], side))
    return Scene(world, tube, grips)

The grips move rigidly. Each turns about the tube's axis, then swings to the end of an arc whose length is the tube's between the grips. Every step sets the pins' targets to the grips' new pose. Plastic flow depends on the path taken and not only on where it ends, so the twist and the bend are ramped over 60 steps each rather than applied at once. To let go, the right grip's pin is destroyed:

def grip_motion(side: int, twist: float, bend: float) -> tuple[np.ndarray, np.ndarray]:
    """(R, t) taking a grip's rest points p to R p + t: turned about the tube's axis,
    then swung to the end of an arc as long as the tube between the grips."""
    half = LENGTH / 2.0 - GRIP
    end = np.array([side * half, 0.0, 0.0])
    if bend > 0.0:
        r = half / bend
        arc_end = np.array([side * r * np.sin(bend), 0.0, r * (1.0 - np.cos(bend))])
    else:
        arc_end = end
    R = rotation(1, -side * bend) @ rotation(0, side * twist)
    return R, arc_end - R @ end


def advance(s: Scene, step: int) -> None:
    twist, bend, released = schedule(step)
    right = s.grips[1]
    if released and s.world.alive(right.pin):
        s.world.destroy(right.pin)
    for grip in s.grips:
        if s.world.alive(grip.pin):
            R, t = grip_motion(grip.side, twist, bend)
            trusty.constraints.set_pin_targets(s.world, grip.pin, grip.rest @ R.T + t)
    s.world.step()

When the right grip lets go, its end of the tube springs back a little and the tube keeps the rest of its shape. In the video the jaws and spindles are drawn to show where each grip holds the tube and how it moves. They have no physics of their own: the pins hold the tube.

Stamping a cup

A punch lifted out of a steel blank it has pressed into a cup through a die, cut in half

A 1.5 mm steel blank lies over a die with a 12 mm hole and is pinned at its rim. A round-nosed punch presses it 8 mm down through the hole and is then lifted clear. The blank wraps the punch's nose and the die's rounded edge, and keeps a cup. The picture is cut in half through the cup, coloured by plastic strain: highest where the blank bent around the punch's nose.

python examples/fem/plate_stamp_plastic.py

The blank is a plastic solid with friction, in contact with the die (a wall) and with the punch:

steel = trusty.HenckyVonMises(youngs_modulus=E, poisson_ratio=NU,
                              yield_stress=YIELD,
                              isotropic_hardening=HARDENING,
                              kinematic_hardening=HARDENING)
# Quadratic hexes: forming is bending through the thickness, where linear hexes lock.
blank = trusty.fem.add_hex_solid(world, blank_mesh(GAP), steel, density=7850.0,
                                 order=trusty.fem.ElementOrder.QuadraticSerendipity,
                                 friction_mu=MU)
rest = np.asarray(trusty.fem.positions(world, blank))
rim = np.flatnonzero((np.abs(np.abs(rest[:, 0]) - BLANK_SIZE[0] / 2.0) < 1e-9)
                     | (np.abs(np.abs(rest[:, 1]) - BLANK_SIZE[1] / 2.0) < 1e-9))
trusty.constraints.add_pin(world, blank, rim.tolist())

The punch is an elastic solid driven by a stiff pin with moving targets:

def advance(s: Scene, step: int) -> None:
    targets = s.punch_rest.copy()
    targets[:, 2] -= GAP + punch_depth(step)
    trusty.constraints.set_pin_targets(s.world, s.punch_pin, targets)
    s.world.step()

With --no-viewer the script prints the punch's force and the cup's depth at every step, and the springback once the punch is lifted.