Running Camry Impact Model in LS-DYNA® Format Using OpenRadioss and Apptainer

by Yoshiaki Senda

Altair Radioss is now available as an open source project! This is major news for the simulation community with many contributors already onboard with OpenRadioss. Moving into open source can speed collaborative efforts like containerizing the application and testing on a new operating system. That’s exactly what we at CIQ did within days of Altair’s announcement. 

This article describes two things:  (1) How to create an OpenRadioss Apptainer container image from a daily released repository and (2) How to run the 2012 Toyota Camry Detailed Finite Element Model Toyota Camry Impact Model in LS-DYNA® format using the OpenRadioss Apptainer container. We tested these procedures on Rocky Linux 8.6.

Installation

The steps below assume that Rocky Linux 8 is already installed as the operating system. This post does not cover the steps to install the OS.

Apptainer

The first step is to install Apptainer on Rocky Linux 8.

$ wget -O /tmp/apptainer-1.0.3-1.x86_64.rpm https://github.com/apptainer/apptainer/releases/download/v1.0.3/apptainer-1.0.3-1.x86_64.rpm

$ sudo dnf install -y /tmp/apptainer-1.0.3-1.x86_64.rpm

Definition file

The steps below pull in the necessary tools and libraries, grabs the OpenRadioss latest-20220920 release from source code that is available on OpenRadioss GitHub repository, then builds it.

These steps go into a definition file that is then used to build the container.

Create the definition file called openradioss-20220920.def and add (or cut & paste) the information shown below.

Bootstrap: docker
From: rockylinux:8.6

%post
dnf install -y \
gcc gcc-gfortran gcc-c++ make cmake perl git-lfs \
wget git patch
cd /tmp
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.gz
tar xzvf openmpi-4.1.2.tar.gz
cd openmpi-4.1.2
./configure --prefix=/opt/openmpi
make -j
make install
cd /opt
git lfs install
git clone --depth 1 --branch latest-20220920 https://github.com/OpenRadioss/OpenRadioss.git
cd /opt/OpenRadioss/starter
./build_script.sh -arch=linux64_gf
cd /opt/OpenRadioss/engine
./build_script.sh -arch=linux64_gf -mpi=ompi
cd /opt/OpenRadioss/tools/anim_to_vtk/linux64
./build.bash
cd /opt/OpenRadioss/tools/th_to_csv/linux64
./build.bash

%environment
export OPENRADIOSS_PATH=/opt/OpenRadioss
export RAD_CFG_PATH=$OPENRADIOSS_PATH/hm_cfg_files
export OMP_STACKSIZE=400m

export PATH=$OPENRADIOSS_PATH/exec:$PATH
export LD_LIBRARY_PATH=$OPENRADIOSS_PATH/extlib/hm_reader/linux64/:$OPENRADIOSS_PATH/extlib/h3d/lib/linux64/:$LD_LIBRARY_PATH

export PATH=/opt/openmpi/bin:$PATH
export LD_LIBRARY_PATH=/opt/openmpi/lib:$LD_LIBRARY_PATH

Build OpenRadioss Apptainer image (SIF format)

Now we can build the OpenRadioss latest-20220920 Apptainer image with the following command: 

$ sudo apptainer build openradioss-20220920.sif openradioss-20220920.def

Copy this Apptainer image to somewhere in your PATH

$ sudo cp openradioss-20220920.sif /usr/local/bin

Containerized! We’re ready to utilize OpenRadioss using this openradioss-20220919.sif Apptainer on your compute resources. This can run on your laptop, workstation, on-prem HPC cluster, and cloud resources.

MPI

Before running a model, we do need to install OpenMPI on the system if it’s not already installed.

$ sudo dnf install -y openmpi numactl hwloc

Close your terminal, then open the terminal again to apply the changes. Now you can load the OpenMPI module using the module command.

Simulation setup

Now that we have the container, we want to test it with the Toyota Camry workload. This is a crash simulation, and we will use ParaView to visualize the result.

Download the 2012 Toyota Camry Impact Model in LS-DYNA® format

Download the model from CCSA, and download the OpenRadioss launch file for this file.

$ wget https://media.ccsa.gmu.edu/model/2012-toyota-camry-detailed-v5a.zip
$ unzip 2012-toyota-camry-detailed-v5a.zip
$ wget -O CamryOpenRadioss.key https://openradioss.atlassian.net/wiki/download/attachments/10518559/CamryOpenRadioss.key?api=v2
$ mv CamryOpenRadioss.key 2012-toyota-camry-detailed-v5a
$ cd 2012-toyota-camry-detailed-v5a
# Download attached based_on_pauly_workaround.patch and apply. You will need to unzip the downloaded file to extract the .patch file.
$ patch -p1 < based_on_pauly_workaround.patch

Running OpenRadioss using MPI

Go to the model directory and then load OpenMPI module.

$ module load mpi/openmpi-x86_64

Run starter first, and then run engine using OpenMPI. Here we specify 8 MPI processes to run this simulation.

$ openradioss-20220920.sif starter_linux64_gf -i CamryOpenRadioss.key -np 8

$ mpirun -np 8 openradioss-20220920.sif engine_linux64_gf_ompi -i CamryOpenRadioss_0001.rad

Output

If it runs successfully, it will shows you NORMAL TERMINATION.

 ELAPSED TIME =  80054.69 s
                      22:14:14
ESTIMATED SPEEDUP=      7.95
     NORMAL TERMINATION 
     TOTAL NUMBER OF CYCLES  :  172244

Post-processing using ParaView

Now we want to see our results using ParaView. The Toyota Camry simulation output files are in ANIM format. We need to convert them to VTK format and install ParaView. Then we can see our results.

Convert output files ANIM to VTK format

To visualize ANIM format with ParaView, we need to convert ANIM format to VTK format. The latest-20220913 OpenRadioss includes a converter utility anim_to_vtk inside the tools directory.

A directory listing shows we have 25 output files from our simulation to convert, and each file has a three-digit number, from 001 to 025, at the end of the name.

$ ls CamryOpenRadiossA*
CamryOpenRadiossA001  CamryOpenRadiossA005  CamryOpenRadiossA009  CamryOpenRadiosA013   CamryOpenRadiossA017  CamryOpenRadiossA021  CamryOpenRadiossA025
CamryOpenRadiossA002  CamryOpenRadiossA006  CamryOpenRadiossA010  CamryOpenRadiosA014   CamryOpenRadiossA018  CamryOpenRadiossA022
CamryOpenRadiossA003  CamryOpenRadiossA007  CamryOpenRadiossA011  CamryOpenRadiosA015   CamryOpenRadiossA019  CamryOpenRadiossA023
CamryOpenRadiossA004  CamryOpenRadiossA008  CamryOpenRadiossA012  CamryOpenRadiosA016   CamryOpenRadiossA020  CamryOpenRadiossA024


The following command will convert all 25 files from ANIM format to VTK format.

$ seq -f CamryOpenRadiossA%03g 025 | xargs -L 1 -I{} sh -c 'openradioss-20220920.sif anim_to_vtk.linux64.exe "$1" > "$1.vtk"' -- {}

Now our directory listing shows our simulation results in VTK format, ready for rendering by ParaView.

$ ls CamryOpenRadiossA*.vtk
CamryOpenRadiossA001.vtk  CamryOpenRadiossA006.vtk  CamryOpenRadiossA011.vtk  CamryOpenRadiossA016.vtk  CamryOpenRadiossA021.vtk
CamryOpenRadiossA002.vtk  CamryOpenRadiossA007.vtk  CamryOpenRadiossA012.vtk  CamryOpenRadiossA017.vtk  CamryOpenRadiossA022.vtk
CamryOpenRadiossA003.vtk  CamryOpenRadiossA008.vtk  CamryOpenRadiossA013.vtk  CamryOpenRadiossA018.vtk  CamryOpenRadiossA023.vtk
CamryOpenRadiossA004.vtk  CamryOpenRadiossA009.vtk  CamryOpenRadiossA014.vtk  CamryOpenRadiossA019.vtk  CamryOpenRadiossA024.vtk
CamryOpenRadiossA005.vtk  CamryOpenRadiossA010.vtk  CamryOpenRadiossA015.vtk  CamryOpenRadiossA020.vtk  CamryOpenRadiossA025.vtk

Install ParaView

Download ParaView from their official website and place it in your preferred location.

$ wget https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v5.10&type=binary&os=Linux&downloadFile=ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
$ tar zxvf ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
$ sudo mkdir -p /opt/ParaView
$ sudo mv ParaView-5.10.1-MPI-Linux-Python3.9-x86_64 /opt/ParaView/5.10.1
$ rm -rf ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
$ export PATH=/opt/ParaView/5.10.1/bin:$PATH
$ export LD_LIBRARY_PATH=/opt/ParaView/5.10.1/lib:$LD_LIBRARY_PATH

Rendering the results

To visualize our results, simply call ParaView and provide it with which file to render. Here is the command and resulting visualization for CamryOpenRadiossA020.vtk

$ paraview --data=CamryOpenRadiossA020.vtk

The pictures below show stress magnitude. Both images are renderings of CamryOpenRadiossA020.vtk. The result shows that most of the stress is absorbed at the front end and much less in the passenger cabin.

Supplemental file:

You might be interested in …