Twisted bar problem
Rigid bodies are often very convenient when modeling stiff structures (e.g. bones or medical devices) since they can significantly reduce the model size and computation time. Therefore, it’s important to learn how to create and use rigid bodies in FEBio. This tutorial will illustrate how to create a rigid body, apply rigid constraints to a rigid body, and connect the rigid body to a deformable part.
If you are new to FEBio Studio, it might be useful to do the Intro to FEBio Studio tutorials first to familiarize yourself with basic concepts and how to navigate the UI.
To start the tutorial, first open FEBio Studio and start a new model. Select the Structural Mechanics option from the New Model dialog box. Then, follow the steps below.
The completed model for this tutorial can be found here.
Step 1: Creating the geometry
The geometry consists of two boxes: one for the deformable mesh and the other for the rigid body. We will create the deformable mesh first. Activate the Create panel and create a box located at the origin (0,0,0) with parameters width = 4, height = 1, depth = 1. Next, create a second box located at (2.5, 0, 0) and with parameters width = 1, height = 1, depth = 1. This will place the second box right next to the first one. Your model should now look something like this.
To attach the deformable mesh to the rigid body we need to select which face we wish to attach. To facilitate the selection, we’ll first hide the second, smaller box. You can hide an object by locating it in the Model Viewer and right-clicking on it. From the popup menu select hide. You’ll notice that the name of the box is now grayed out in the Model Viewer. Now, with only the first box showing select the right face, that is, the face that is touching the second box (before you hid it). In order to refer to this selection later, we will name the selection using the Edit/Name Selection menu. You can enter a name for this selection or simply accept the default. The selection will now show up under the Named Selection item in the Model Viewer. Note that you can also name selections of parts, edges, and points. Named selections are convenient ways to refer to parts of your model easily. When you select a named selection in the Model Viewer, you will see that it has a selection box, which allows you to edit the named selection.
As a side note, in FEBio Studio you do not need to make named selections first. When you create a boundary condition or load, FEBio Studio will automatically take the current selection, create a named selection from it, and assigns it to the boundary condition or load automatically for you. However, sometimes it may be important to do the steps manually, and therefore for the purpose of illustrating, we follow that approach here for the rigid interface.
Before you continue, make sure you unhide the second box. To unhide it, locate it in the Model Viewer, right-click on it and select the Unhide option from the popup menu.
Step 2: Setting up the boundary conditions
Select the face on the left end of the first box. This side will remain fixed. To apply the proper boundary condition, use the menu Physics/Add Nodal BC and select the zero displacement boundary condition. After you click the OK button, the new boundary condition will appear in the model tree. In the properties pane, check all three degrees of freedom. Next, we will attach the named selection that we created in the previous section to a rigid body. Before we can do that, we need to add a rigid body to our model. In FEBio, parts are made rigid by assigning a rigid body material to it. So, we first need to add a rigid body material to the model. Use the menu Physics/Add Material to open the Material Browser. Select the rigid body from the list and click the OK button to add the material to the model. The creation of a rigid material also implicitly creates a rigid body. An icon will show up in the Graphics View to indicate where the rigid body is located in space. Note that the rigid body does not have any geometry yet, but we’ll deal with that later. The rigid body is initially placed at the origin. The location of the rigid body also defines its center of rotation. We would like to place this center of rotation in the center of the second box. To do this, select the rigid body material in the Model Viewer. In the properties list below the Model Viewer first check the “override COM” option, which allows you to explicitly define the center of mass. (If unchecked, FEBio will calculate the center of mass from the geometry.) Set the center of mass parameter to 2.5,0,0.5. This places the rigid body in the correct spot.
Next, we’ll create a rigid interface that connects a deformable body to a rigid body. First, make sure you do not have any surfaces or other selections active, by clicking with the left mouse button on an empty part of the Graphics View. Then, select the Physics/Add Nodal BC menu and select rigid from the dialog box that appears. Click the OK button. A rigid interface only requires one parameter, namely the rigid body material. Select the rigid body you created earlier from the drop-down list of the rigid body (rb) parameter.
We still need to define to which part of the deformable box this rigid interface will be applied. In the Selection pane, below the Properties pane, click the button […] next to the Name field. In the dialog box that appears, find the surface you defined earlier as a named selection and click OK. That’s it! Your deformable mesh is now connected to the rigid body.
Next, we define the rigid body kinematics. A rigid body has six degrees of freedom: three translation and three rotational. In this tutorial, we’ll make the rigid body rotate around the x-axis, and keep all other degrees of freedom fixed. Go to the Physics/Add Rigid Constraint menu. In the dialog box that shows up select the rigid material and select the Rigid fixed option. After you click OK, the constraint is selected in the Model Viewer. In the properties list check the all the boxes except the x-rotation box.
To apply the second constraint, select the Physics/Add Rigid Constraint menu item again. This time select the Rigid Rotation option from the list. In the properties list select the rigid body to apply the constraint to and select the x-rotation degree of freedom. Enter the value 3.14 in the value parameter. Note that value parameter has a green, lit icon next to it. This indicates that this parameter is controlled via a load controller. For many parameters of boundary conditions or loads, FEBio Studio will automatically assign a load curve. The default load curve is a linear ramp from zero to one. The effective value that is used during the FEBio solver is the value entered, multiplied by the value of the load curve at the corresponding simulation time.
Step 3: Setting up the materials
We already have created one material, namely the material for the rigid body. We now create the second material that we will assign to the deformable mesh. Open the Material Browser from the Physics/Add Material menu. Select a Mooney-Rivlin material and click the OK button to add it to the model. Set the following material parameters:
- density = 1
- c1 = 1
- c2 = 0
- bulk modulus = 100
Note that the rigid material also has material parameters. However, most of these are ignored by FEBio in most situations and can be ignored.
Now select the first, larger box in the Graphics View (make sure the second box is not selected and that you are at the object level) and assign the Mooney-Rivlin material to this box by clicking on the + button in the material’s selection box with the box selected in the graphics view. Now, select the second box and assign the rigid body material (Material 1) to this box.
Step 4: Creating the mesh
Next, we will create the mesh for the objects in the model. Select the deformable box first (the one you created first and the larger of the two) and activate the Mesh panel. Enter the following values for the box meshing parameters:
- Nx = 20
- Ny = 5
- Nz = 5
Leave other parameters at their default value and click the Apply button. Repeat this for the second mesh (the rigid box) and set the parameters as follows:
- Nx = 1
- Ny = 1
- Nz = 1
Note that this effectively creates a single element mesh for the rigid body. The completed model should now look something like the picture below.
It is also of some importance to point out that the rigid interface allows you to connect a rigid body to a non-conforming deformable mesh. This means that the nodes of the rigid surface do not necessarily coincide with the nodes of the deformable surface. This is convenient since this allows you to mesh the two objects independently without being concerned about continuity at the interface.
Step 5: Defining the analysis step
Finally, an analysis step needs to be defined. Select the Physics/Add Analysis Step menu. This will add a new step to the model. The analysis step contains all the parameters that are needed by the solver to solve the model. This includes parameters that control the time stepping, set the convergence tolerances for the nonlinear iterations, decide the algorithms that will be used, etc. There are quite a few parameters here, but for the most part, you can just use the default values, which is what we’ll do here. In some more advanced tutorials, we’ll dig deeper into these parameters. Here, we’ll just draw your attention to a few important ones.
The Analysis parameter instructs FEBio what type of analysis that you wish to solve. For structural mechanics models, the two options are static and dynamic. The former option performs a quasi-static analysis, ignoring inertial effects. The latter option performs a full dynamic analysis that includes inertial effects.
The Time Stepping parameters define the number of time steps and the step size that FEBio will take when solving the analysis. Even though we are doing a static analysis, it is common practice to divide the analysis in multiple steps. For large loads or deformations, it is usually not possible to solve the model in a single step. For this reason, FEBio Studio uses default values of 10 and 0.1 for the time steps and step size parameters, respectively. The simulation time is then the product of these two. Thus, by default, the simulation will run from (simulation) time 0 to 1.
The auto-time stepper is automatically set by default. This option allows FEBio to change the number of time steps and time step size according to how the simulation is progressing. For example, if a time step fails (e.g. a negative jacobian occurred), then the auto-time stepper will dial back the step size and then try to re-solve the time step.
Step 6: Running the model
At this point you may proceed to running the model. To run the model, make sure you first save the model to a file. Then, use the menu FEBio\Run FEBio to open the Run dialog box. If you wish, you may choose the job’s name and the working directory, or just accept the defaults and click Run. If you are unfamiliar with the Run dialog, please take a look at the tutorial Running your first simulation in FEBio Studio.
If all went well, the job should complete with a normal termination message. The final time step should then look like the figure below. This concludes the tutorial.