Project 1 : CFD Meshing for Tesla Cyber Truck
Aim
The project aims to pre-process the tesla cyber truck and mesh it. For the given model, check and solve all geometrical errors and assign appropriate PIDs. Perform meshing with the suitable Target length and element criteria.
Introduction:
ANSA is a Computer-aided engineering tool for Finite Element Analysis and CFD Analysis widely used in the automotive industry. It is developed by BETA CAE Systems. The software is distributed worldwide by several BETA CAE Systems subsidiaries and business agents.
ANSA maintains the association between CAD geometry and the FE mesh. This means that the FE meshes are better representations of their geometric parents. Also, it is easy to maintain and update any changes in the geometry by simply reworking the updated area instead of recreating the FE from scratch.
It carries several proprietary algorithms for meshing suitable for both CFD and structural models. ANSA was initially standing for 'Automatic net generation for structural analysis, but the software has gone beyond that very quickly. ANSA has broadly six menus that are used to do various activities those are: TOPO MESH, VMESH, DECK-SOLVER, MORPH, and H-BLOCK.
Different types of modules in ANSA:
TOPO - Set of tools for Geometry clean-up and for setting up of PIDs.
MESH - Tools to generate Surface Mesh or 2D Mesh.
VOLUME MESH - To generate solid or 3D Mesh.
SOLVER DECKS - Tools based on different solvers such as ABAQUS, RADIOSS, ANSYS, etc.
MORPH - Advanced tool to capture geometry more accurately while meshing.
Objective:
To identify & clean up all the topological errors in the given Tesla Cyber Truck Car model.
To assign appropriate PIDs.
To create a surface mesh, 2D meshing with different mesh lengths for different PIDs. and remove all the off-elements.
To Create a wind tunnel around Tesla Cyber Truck Car.
To create a volumetric mesh to perform an external flow CFD analysis simulation.
Steps:
For solving we follow the below steps,
Import the CAD model.
Identifying & cleanup of the topological / geometry errors .
Geometry check-up.
Setting up of relevant PIDs.
Defining the element size or length.
Setting the mesh parameters, selection of meshing type, and generating a surface mesh of the CAD model.
Resolving the errors in the surface mesh.
Creating the wind tunnel for external flow CFD analysis and surface mesh of wind tunnel.
Generating volumetric mesh.
Procedure:
Importing CAD the model
- To import the CAD model we follow the below steps,
Go to file -> open -> browse the location of the CAD model -> select it to click on open.
This is our raw geometry when we activated single cons we can see the model covered in single cons.

The geometry is filled with single cons to eliminate these we use the Topo option.

Here in the above image, we can see only single cons, let us do topo for the whole model, then we can get a clear idea of the model and actual single cons. In the below image you can see the model after performing topo.

Model after applying the TOPO tool.
All single cons are converted to double cons, and only a few are lefts.
Before performing any topo clean-up, you can observe that the resolution of components is not very good. So to have a better resolution let us first go to the mesh deck and decrease the mesh length by selecting the whole model and giving a 1mm mesh length. Now you can observe that in the below image the resolution of the car is good.

As we have seen that the given geometry has several topological errors, and missing faces which are indicated by single cons & triple cons, but for the CFD analysis only the double cons are preferred not even the triple cons are acceptable because it may lead to forming a local volume over there.
Here, the main aim is to create the whole car inside part as one volume, here tires are inserted into the body but not attached. Here we can go with two approaches either we can delete the common extra part and perform topo and make the whole car and tires as one volume or we can delete the common part and close the holes such that only the car forms one volume and as tires are not attached, then each of them forms one volume means 4 tires 4 volumes. Here we follow the second approach it will be much better. And with these 5 volumes, another volume forms between the car and wind tunnel, which is the volume we needed. So we delete all other volumes and keep the final volume as we are doing external flow analysis.

Initially, there were many errors, and each of them should be rectified systematically one after the other. The errors are corrected by selecting the individual features of the car like lights, wheels, windshield, body, etc., separately.
Here, also we are much concerned about the outside features of the car and not about inside features. We have to modify all the features such that we get the whole car inside part as one volume.

So to have the whole model as a single volume we should have only double cons and even with double cons we should not have a feature closed on all sides, it may lead to the form of a separate local volume over there.
Also when you find any small surface delete it and its neighbor surface and create a large surface such that we don't have any quality criteria error while meshing.

So we will delete the surfaces which are not necessary and cause an error or lead to cause a local volume.
If you are not clear about the selection always zoom in and select the right surface. Also, use wireframe mode for proper selection (Cntrl + shift or directly turn off shadow mode).
Here we always shift between PID and entity mode depending upon the suitability to solve a particular problem.
Here in all the cases, depending on the situation we use any one of the tools like a project, extend, cut, topo, new coons, etc.
Now we have to slice the geometry into two, in their symmetrical plane since they are symmetrical also. After completing all the procedures in one half of the model, we can make a copy of the component into the other easily at last.
Create cut-on geometry so that geometry could be divided in half.
Delete half geometry, Always delete the side where you see less work had to be done to fix geometry.
Patch open surfaces.
Delete overlapping and extra surfaces.
Convert triple cons to double cons.
Dividing Geometry after creating cuts in the middle.
Use the delete option to delete one-half of the model.
I have deleted the side on which more work is required to be done to fix problems. Now work on the half part, This is the best way to work on symmetric geometries.

In the below image you can see brown color cylindrical surface penetrating with body, that brown part is part of the wheel PID, and delete that part then patch holes appeared on the body and wheels seperately.


Deleting wheel PID part and then patching hole which appears in body and wheels separately.

You will often face very small sharp edges on geometry which can be seen only when we zoom in or when we do a geometry check.
we can directly delete those sharp edges. If we cannot directly delete them, create cuts and separate those edges from large PIDs and then delete them. Delete hot points which are not required.

Geometry check after Topo cleanup
By doing we check there are no unnecessary single cons present and we are good to go for symmetry.

Creating Symmetry
Go to transform tool and choose copy, a dialogue box will appear, choose an entity and drag your mouse doing right click to select whole geometry and do right click.
In the new dialogue box which appears choose symmetry and three points plane. Choose any three points to automatically fill required coordinates.


Click on apply and then click ok in the new dialogue box which appears. Don't make any changes.


Check for single cons as this common error after doing symmetry and solve them by using a patch tool or by creating a new surface. After cleaning up all the topological errors, the geometry is checked using geometry checks under the checks manager. Geometry Check is done. So we can conclude that all the errors have been corrected & the model is ready to mesh.
PID's Assigned
In this step we assign the PID for different parts and give a name and colour to differentiate between the components and ease up the working on the components individually. This is also done to specify names to different boundary conditions for various parts. We need to activate cross hatches before setting-up PIDs.
If you open properties manager at the top, you will have some default PIDs which are assigned. We have to create new PIDs to assign to our components. Inorder to create new PID, right click on properties manager -> click new -> then select pshell -> then again select pshell -> then give name in the popup box -> then ok. You can change the color by double clicking on the color box -> then ok. In a similar way create PID for all the components. Let us also add transparency for windows to be more realistic in the color box.
The next thing is to assign these PID's to the components of the geometry. To apply, we select /click on the PID to apply in the PID manager -> then right click on it -> then click on apply -> then in the geometry select the cross hatch of the surface you want to assign -> then middle click. In the similar way we have to apply PID's we have created. To give the PID we select the different types of selection available to select the exact surface needed.
Then after assigning the PID, delete the empty original PIDs which has no components assigned by using compress. In the below image you can see that list of PID's that we have assigned.
Now our model is ready to mesh.
2D MESHING
Defining the element size or length and setting the mesh parameters & creating the surface mesh & resolving the errors in the surface mesh:
Here we perform all three tasks, defining the element size or length and setting the mesh parameters, selecting of meshing type and generating the surface mesh of the CAD model, and resolving the errors in the surface mesh by selecting each PID one by one and perform above tasks. Before meshing we have to give quality criteria. Here we select openFoam solver deck,so that we get the quality criteria of that solver.
Here as we have different surfaces, we will use different quality criteria for different surfaces, we will change mesh length as per our surface complexity and surface size. If surface is small we have to use smallest target length, if larger we use it accordingly. We set the element lengths accordingly, as a fine mesh for every element would be time consuming & will be computationally Expensive. we give the below different quality criteria (min length & max length) for different components as shown in the figure.
Mesh length for different PIDs.
Rooftop - 3 mm
Lights - 2 mm
Tyres - 2 mm
Windows - 4 mm
Body - 5 mm
But before doing these tasks , we will follow following steps so that we don't have any off elements later in the meshing stage. We will try to remove small surfaces that are smaller than our min mesh length, we will directly remove the cut, which is unnecessary if found small. If that cut or feature line is necessary if we remove that cut it may lose shape, in that type of scenario me make a cut at another location and remove the original cut causing problem so that there is not much change in geometry. The new cut should also satisfy the minimum length criteria. If not able to cut or that feature line is very important to maintain the shape of geometry, then we will reduce the min length value so that, our element length would not fail. By following these steps we will evaluate all the PID's / components. By following these processes we start evaluating our model.
Lights meshing
Quality criteria and mesh parameters for light. The Mesh length is 5mm


After giving quality criterias, give length parameters and macros. select length parameters and choose PID by doing right click and dragging cursor over PID. Then do a middle click. A dialogue box will appear, give mesh length 2mm and click ok. Similar do for macros. Then select spot mesh and choose visible mesh, you can see mesh on PID. In order to check if geometry is failing on quality criteria go to hidden mode and go to entity mode while using hidden mode. you will off elements. select reconstruct option and choose visibly and execute reconstruct option. Reconstruct option will solve most of off elements and remaining off elements needs to be solved by findind why mesh is failing, mainly this happens due to formation of meshes smaller than specified criteria. Go to topo mode and use cut options to cut or recreate cons where mesh is failing. Use reconstruct option to automatically solve maximum errors, rest handle by yourself. use move tool to change dimension of mesh , this will solve most of off elements, especially those off elements which are due to min & max length.

Body meshing
Quality criteria and mesh parameters for the Body. The Mesh length is 20mm, use a high value of mesh because geometry has large dimensions.


After giving quality criteria, give length parameters and macros. select length parameters and choose PID by doing right click and dragging the cursor over PID. Then do the middle click. Dialogue box will appear, give mesh length 2mm and click ok. Similar do for macros. Then select spot mesh and choose visible mesh, you can see mesh on PID. In order to check if geometry is failing on quality criteria go to hidden mode and go to entity mode while using hidden mode. you will off elements. select reconstruct option and choose visible and execute reconstruct option. Reconstruct option will solve most of off elements and remaining off elements needs to be solved by findind why mesh is failing, mainly this happens due to formation of meshes smaller than specified criteria. Go to topo mode and use cut options to cut or recreate cons where the mesh is failing. Use reconstruct option to automatically solve maximum errors, rest handle by yourself. use move tool to change dimension of mesh , this will solve most of off elements, specailly those off elements which are due to min & max length. Using move tool will eventually solve 98% of off elements. To use the move tool identifies areas where the off element is and then drag meshes there to clear off elements.

Windows and rooftop meshing
Quality and mesh parameters for windows and rooftop. The Mesh length is 20mm, use a high value of mesh because geometry has large dimensions.



Tyre meshing



CREATING WIND TUNNEL:
We will create a wind tunnel around car.
Measurements for wind tunnels are:-
- Consider the length of the car as X.
- Keep the wind tunnel at a 75mm distance from the bottom of the car.
- The length of the wind tunnel from the front of the car should be 4X, the total length of the tunnel in front is the half length of the car added to 4X length.
- The length of the wind tunnel from the back of the car should be 6X, the total length of the tunnel from the rear side is half the length of the car added to 6X length.
- The height of the wind tunnel should be 3X.
Dimension of car
Length of the car - 5760
Distance from mid of car to front - 2570
Distance of mid of car to back - 3180
Steps Involved:
- Enable cons
- select the relative points option from the point tool and select a point in the middle of the car from the bottom side.
- A dialogue box will appear, see your coordinate axes, To create a point at bottom of the car I will give 700mm with a negative sign.
- With reference to that point create a point in front of the car at a distance of 25610mm in X direction & at 37740 in the back of the car.
- create side points at 5760 on the front and back sides.



3D Meshing
- Choose the define option available in the volumes tool and select wholedb (the whole database) and click on ok.
- Volumes created for 3D meshing will appear in a dialogue box.
- From the dialogue box select first volumes, this is the volume of the tunnel and this is what we require.
- All other volumes are car volumes that are not required to delete.
- The one PID with the blue color we will keep and delete others.
CONCLUSION:
- Working on the tesla model gave ideas about different meshing tools available in ANSA.
- Learned surface meshing and Geometry cleanup in a much more detailed manner. Challenges faced helped to understand tools better.
- Learned how to use curve tool, how to create win tunnel with help of points and curves.
- Learned about dimensions of a wind tunnel, like what dimensions to give based on model size
- Learned how to de meshing when there are different PIDs with different mesh lengths in contact with each other.
- learned the use of reconstructing and moving tools.
- worked on how to fix off elements.
- Advance topo-cleanup.
Tesla Model:
https://drive.google.com/file/d/18AllIk0WC_ClTNVxkck-ZCKQLEY_ZeBI/view?usp=sharing