Skip to content

Tutorial: bumper beam

A real crash case from start to finish: OpenRadioss runs of a bumper beam that hits a rigid pole, from the download of the raw data through the dataset and the training of MGN-T to the prediction of runs the model has never seen. It reproduces the bumper beam results.

Needs the installation with lasso-python and pyvista, and huggingface_hub for the download (pip install huggingface_hub); about 10 GB of disk space and a GPU. The GPU times on this page were measured on an NVIDIA RTX A4000 (16 GB).

Early stage of development

The processing of OpenRadioss runs is at an early stage of development; it is verified on this example (verification status).

The data

BumperBeamCrashExample on Hugging Face, generated with OpenRadioss2PhysicsNemo. The decks of the runs carry the notice "Copyright Altair Engineering, CC BY-NC 4.0". CrashDefNet does not ship the data; the first step downloads them from their source.

1. Raw data

hf download AIRBORNEPANDA/BumperBeamCrashExample --repo-type dataset \
    --include "*.d3plot*" --include "*_0000.rad" \
    --local-dir datasets/BumperBeamCrashExample

131 runs (3.9 GB): a bumper beam with two crash boxes, mounted on a rigid body of 500 kg, hits a rigid pole at 5 m/s. The runs differ in the thickness of the beam (1.21 to 2.0 mm) and in the position of the pole across the beam (−480 to 492 mm); each holds 11 states at 10 ms and 13,882 nodes. The two patterns take only what the export reads:

datasets/BumperBeamCrashExample/RAW_DATA/
  TRAINING_DATA/Run100/Bumper_Beam_AP_meshed.d3plot, .d3plot01 ...   deformation and results
  TRAINING_DATA/Run100/Bumper_Beam_AP_meshed_0000.rad                starter deck
  ...                                                                124 runs
  VALIDATION_DATA/Run224/ ... Run230/                                7 runs

The d3plot files are converted from the OpenRadioss animation files and hold the mesh, the node coordinates of every state and the element stress. The model definition comes from the starter deck next to them: shell thickness, rigid bodies, the pole as an analytic cylinder, ties (OpenRadioss runs).

2. Mesh the pole

python utils/remesh_pole.py --out-dir datasets/BumperBeamCrashExample_remeshed/RAW_DATA

The solver computes the impact against the analytic cylinder of the deck; the d3plot shows the pole only as two rings of nodes about a metre above and below the beam. So that the pole acts on the structure through contact edges, as every other contact, the script replaces this display by a meshed cylinder surface at the same place: 10 mm edge length like the structure, 2,320 nodes, over the height the structure reaches. It writes a second raw dataset (~50 s, 4.5 GB), reads every run back and compares it with the original: all other nodes and results stay identical (options).

3. Dataset

The export config examples/bumper_beam/export.toml defines the dataset. The names of the parts of a run:

python -m dataset_preprocessor.export --config examples/bumper_beam/export.toml --list-parts

[components] gives each part its role; a part that is not listed is left out:

Parts Role
crash_box_*, BumperBeam_*, CONNECTION_SPOTWELD* deformable the structure, with its spot welds
Body_in_White free_rigid the rigid body behind the crash boxes: the model predicts its motion, the rollout keeps it rigid (free rigid parts)
RWALL actuator the meshed pole, standing still
New SECT 1 (not listed) left out shells that only display a section of the output and carry no stress

The other settings:

  • Splits: 110 runs of TRAINING_DATA for training, the next 14 for validation, the 7 runs of VALIDATION_DATA for the test.
  • States: all 11, with the previous velocity and result fields as inputs (history = 1); at the first state the previous velocity comes from the initial velocity of the deck (/INIVEL).
  • Units: mm and GPa, as in the decks.
  • Result fields: besides the von Mises stress the effective plastic strain and the membrane mean stress and bending stress of the shells (LS-DYNA runs).
  • Contact: a radius of 30 mm; every contact edge also carries the distance from the shell surface of the sender and the clearance between the shell surfaces (gap). Next to the contact edges to the meshed pole, the cylinder of the deck gives every node its distance to the pole as a node feature (use_deck_walls).
  • Static features: shell thickness and yield stress from the starter deck at the nodes, and the same of the elements next to every mesh edge (edges).
python -m dataset_preprocessor.export --config examples/bumper_beam/export.toml

The export (~4 min, ~920 MB) writes data/bumper_beam_remeshed/ with 16,152 nodes per run. Nodes without a shell, the ends of the spot welds and the main node of the rigid body, have no thickness or yield stress, and the pole has no result fields: such a value is missing, not 0, and a missing result counts in neither loss nor metrics.

4. Train

python train/train.py --config examples/bumper_beam/train.toml

examples/bumper_beam/train.toml trains MGN-T in the size of its paper (0.51 M parameters) for 80 epochs at batch 4, in about 3 h 20 min with 7.3 GB of GPU memory. Its settings for this case:

  • From 10 ms ([data] start_frame = 1): the training leaves out the step from the undeformed state at 0 ms to the first deformed state (why); the statistics of the inputs and targets are fitted on the frames it uses (choose the frames).
  • The change, not the state (residual_target): the beam moves mainly by inertia, so the model predicts how velocity and result fields change from one state to the next.
  • Contact edges (self_contact_aware): between the structure and the pole and where the structure folds onto itself, rebuilt from the predicted geometry at every step; the transformer of MGN-T works on the structure only (transformer_nodes = "structure").
  • Noise in mm: 0.3 mm on the positions and 0.01 GPa on the stress. The motion across the beam is only about 0.5 mm per state, so the 3 mm of deforming_plate would cover it.
  • Loss terms on the structure: besides the targets, the length change of the mesh edges in a step and the velocity of the rigid body, each against the simulation (loss).
  • Scheduled sampling: a growing share of the nodes takes its previous velocity and result fields from the model's own prediction of the step before, as in the rollout, up to 70 % after 40 of the 80 epochs (training).
  • Model selection: every 4 epochs the model rolls out the 14 validation runs; the lowest position error over the rollout and at its last step gives best_model.pt. From epoch 41 on, the training stops after 5 evaluations without a new low (model selection).

5. Predict and evaluate

python predict/rollout.py --config examples/bumper_beam/rollout.toml

examples/bumper_beam/rollout.toml predicts the 7 test runs from the state at 10 ms, the first frame of the training, over 9 steps to 100 ms, each step from its own previous prediction. In the same call it evaluates the run and renders the test run at the median of the position error (a few minutes on a CPU):

  • rollouts/<time>_bumper_beam_mgn_t_best_model_ep<epoch>_test/: the metrics per run and a .vtu per state, from the initial one, with prediction, ground truth, error and the pole, for ParaView
  • evaluations/<time>_bumper_beam_mgn_t_evaluation/evaluation.md: training, single step and rollout, with figures (evaluate a run)
  • evaluations/<time>_animation/: the animation

The results show what this run gives. A new training comes close to them, not to the last digit, as training on a GPU is not bit for bit reproducible.

Next steps