You will learn:
- The Basic Simulation Workflow in Onscale Designer
- How to import a 3D CAD model in step format
- How to assign loads and boundary conditions
- How to perform a static analysis
- How to get displacement and stress results
- How to modify the analyst script file to add additional type of calculated results
Problem Definition
Characteristics of the model:
Model: |
Pillow Box of Dimensions 200 mm x 200 mm x 250 mm |
Mesh Size: |
4 mm |
Simulation Iterations (Conjugate Gradient Method): |
1000 iterations |
Output Results: |
-Time History of X Displacement at [100,10,9.9] -Data Snapshot of X Displacement -Data Snapshot of Stress XX - Von Mises Stress (Calculated Property) |
Material Data:
Name | Mild Steel, Generic |
Code Name | steel |
Density | 7,900 kg.m-3 |
Bulk Velocity | 5,900 ms-1 |
Shear Velocity | 3,200 ms-1 |
Why This Simulation?
In real life, pillow boxes can be of huge size and undergo extremely high mechanical stresses. We want to make sure that the design of this pillow box will resist the current applied loading.
In this simulation we will apply a 40,000 N force to the flange around the hole of the pillow box while fixing the holes and applying a symmetry load to the XZ Plane.
Step by Step Tutorial in Video
Here's the tutorial recorded in video:
Note: The Designer interface has changed slightly since this video was recorded. The text that follows has been updated to reflect the interface changes.
The Simulation Process
Let's go through the step by step tutorial and see how to simulate this Simple Beam in OnScale!
Step 1 - Create a New Project
Note: From the Examples tab of the New Project window, you can select Static Project Example to create a project with everything already set up for you. Steps 1 through to 9 here detail how you would set up this model from scratch.
- Click New Project to open the New Project window.
- Name the project pillow box.
- If desired, change the save location and/or project file name by clicking … beside Project File.
- For Analysis, select Mechanical Static.
- Select the Advanced checkbox.
- For Distance, select mm.
- Click OK.
Note: You can click on the image to make it bigger if you can't read well the text inside it.
Step 2 - Import the CAD model
Note: As of OnScale 1.30.3, this step can now be performed from the New Project window. As such, you can perform steps 1 and 2 as a single step.
Download: Pillow Box CAD Model
- Click Import
- Click ... and open the bracket.step model file
- Enter the file scale factor 0.001
- Click Import
Important: The Scale Factor is important to scale all your model to the right dimensions. When you choose "mm" as the unit, it only sets up the OnScale environment to use this unit. The real dimensions of your model depend on the software that was used to create it. In this case for example, if you set the scale factor to 1, your model dimensions will be 1000 times too large!
Step 3 - Add the "Steel" Material from the Material Database
- Click on Project Materials
- Unfold the Menu Metal
- Select "Mild Steel, generic" with the code name "steel"
- Click on the right arrow
- Click on Done
Step 4 - Assign the Material to your Model
- Right click on your model
- Select Assign Material > steel
Note: You can also assign materials by clicking on the geometry in the Model Tree and then assigning the material into the geometry property window, it leads to the same result. Use whatever is best for you.
Step 5 - Review the Mesh
- Unfold the Mesh Menu in the Model Tree and select Configuration
- Review the mesh properties used
- Click on the Model Graphics tab
- Click Show Approx. Meshing
- The grid will appear on your model giving you an indication of the current grid size
- Follow the same procedure to hide the grid
Important: The size of the grid is absolutely critical to get accurate results. It is generally advised to do a "Mesh Convergence" analysis to select the most appropriate mesh size for your model. A mesh that is too coarse will give you bad results and a mesh that is too thin will take too long to calculate. Mesh Convergence analysis is done by changing the mesh size from coarse to small and observing the results at some specific location that interests you. You can then spot when the results start to converge to a stable "accurate" value.
Step 6 - Create the 40,000 Force Load
Create the static forcing function
- Unfold the Forcing Functions menu
- Click on the "+" at the right of the Static menu item
- Enter a 40,000 (N) in the amplitude property field
Important: Load unit has to be entered in Newtons here. Make sure that your unit is correct!
Create the load
- Unfold the Boundary Conditions Menu
- Click on the "+" at the right of the Loads menu item
- Select the surface of the model indicated in the image
- For Load Type, select Force.
- Under Scale, type -1 for X to define the direction of the force.
- Click Create Load.
Note: Static loads can be defined as Forces or Pressures. The main difference is that a Pressure is a Force divided by the surface it is applied to and pressures are generally normal to that surface while Forces may have more general orientation.
Step 7 - Create the Fixed BCs of the Holes
Create the boundary conditions (Fixed loads)
- Add a new load by clicking on the "+" button.
- Select the internal surface of the first hole.
- For Load Type, select Fixed.
- Click Create Load.
- Select the internal surface of the second hole.
- Click Create Load.
Note: Loads are also a type of boundary condition, and "Fixed" loads are in fact areas of the model where displacement is set up as "0".
Step 8 - Create the Symmetry BC on the YZ Plane
- Unfold the Domain Boundaries menu
- Click on Y minimum
- Select Symmetry as the boundary type
Step 9 - Assign the output_1
Note: In OnScale, you have to define beforehand which results you want to see out of this model. This is done mainly to decrease the amount of memory required to calculate results that you don't even need and also to decrease the amount of data to be downloaded every time from the cloud, so choose wisely what you want to get from your model!
Add a time history output for x displacement at (10,50,150) position
- Click on Outputs
- Click on the "+" sign
- Choose Time History as the output type
- Choose Displacement as the array type
- Enter 10,50,150 in the location for X,Y,Z respectively
Note: The Time History type of results gives you a way to monitor the results at a specific point of your model. It is useful to make sure that the solution converged and that the results are getting close to what you expect. Setting up such monitoring points also vastly simplifies the post-processing work you will have to do after you get the results! (No need to extract manually those results from the 3D model after each model solve; it is done automatically and can be automated with some simple script so no manual intervention is needed.)
Add a X displacement snapshot output
- Click on the "+" button at the right of Outputs
- Add a Data Snapshot
- Choose Displacement as the array type
- Select the X array component
Important: Snapshot results are the way in OnScale to obtain the full model data at every node or element. If you define some views and a number of frames in the "Runtime Graphics" Menu, you will get snapshots at each time such a frame is taken. Be careful because the more frames you define, the bigger the snapshot data file becomes. For Static Analysis, you are only interested in the final iteration result, so you don't need to define several "Frames". This could be useful for dynamic analysis though.
Add a XX Stress snapshot output
- Click on the "+" button at the right of outputs
- Add a Data Snapshot
- Choose Stress as the array type
- Select the XX array component
Note: We will see in a later part of the tutorial how to obtain more complex stress criteria such as "Von Mises".
Step 10 - Run on the Cloud and Download the Results
Run the model on the cloud
- Click Run on Cloud
- Click the Estimate button
- Choose 8 CPUs
- Click on run
Download the results
- Click on storage
- Click on the green refresh button
- Select the job you ran
- Click on the download button
- Select download all
Switch to Post processor
Note: The Post Processor of OnScale is where you can review and process the results calculated during the simulation.
Step 11 - Review the results
Visualize the X displacement Time History results
- Select the File Explorer tab
- Make sure you are in the right folder
- Double-click on the pillow_box.flxhst file
- Double-click on the X displacement result xdsp
Note: The results that can be opened are the ones displayed with a small OnScale Icon in gray. These are generally classed into 3 types: flxdato, flxhist and snapshots.
We observe that X displacement converges towards a certain value after around 500 steps
Visualize the X displacement results
- Double click on snapshot.flxdato
- Double click on X
Important: Models in OnScale are calculated using a "grid" Hexa Mesh. This is why the results looks like something you would see in "Minecraft". You get an accuracy equivalent to other software using Tetra element, and most of the time even better because OnScale uses Hexa elements which are more accurate. If you want nevertheless a better definition, you can get it by refining the grid size. 3D Tetra elements are for the moment only available in the Analyst Mode.
Visualize the displacement deformed shape
- Click on the Model Graphics tab
- Click on Deformed Grid Plot
Step 12 - Add the Von Mises Stress in the Analyst mode
Note: Currently Von Mises need to be defined in Analyst, but this functionality will be available in Designer soon. You can consider it now as a small exercise to understand how to calculate results using script.
Open the folder in which your analysis files are located and double click on “pillow_box.flxinp”
If you didn't follow the previous steps, you can download directly this file here:
Download: pillow_box.flxinp model file
Locate where calculated properties are defined and add the sj2p array
calc
disp /* calculate displacements
strs xx /* calculate stresses in the field
sj2p
end
Locate where the data snapshot output is defined and add the 2 lines of codes to calculate Vmises from the sj2p stress invariant
data
file out 'snapshot.flxdato'
math vmises = sqrt ( 3. ) * { sj2p }
out vmises
out xdsp
out sgxx
end
Note: The math command is useful to do some math operations over the results calculated by OnScale. Calculated arrays like sj2p here have to be defined into the calc command and then put inside accolades to be used after the data math command.
Run again your model on the cloud and download the results
- Click on Run on Cloud
- Click on Estimate
- Choose 8 CPUs
- Click on Run
Download the results
- Click on Storage
- Click on the green arrow refresh button
- Select the job you run
- Click on the download button
- Select Download All
Switch to Post processor and open the vmises results
- Select the File Explorer tab
- Double click on the snapshot.flxdato file
- Double click on the vmises result
Note: Make sure that the results that you open are the latest results issued from your last cloud computation by checking the folder name and comparing it with the job that you run on the cloud.
Important: Stress results in OnScale are extracted at the element center and without any kind of nodal averaging. If you compare those results with another software, make sure that you are looking at the same kind of stress. You can't compare chicken eggs with ostrich eggs ;-)
Try for Yourself
Now that we have introduced you to the tutorial, try have a play around with some of the settings, add some other outputs, or use this model as a starting point of your own.
If you have a problem that you do not know how to solve with the current tutorial, please post in the forum!