Tutorials for Simulations
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Theory behind simulations, the verification/validation process, conceptual explanation of processes behind general simulation methods.
The steps involved in designing and running a simulation are as follows:
Translate a physical problem to a mathematical model
Go through some procedure to find a numerical solution
Post-processing (such as interpolation) to generate output
Compare output to back-of-the-envelope estimate and/or experimental data
Not all of these have to be done manually, and simulation interfaces such as ANSYS will not show that all of this is happening. But users should be aware that this is what the program is doing, as well as roughly what the mathematical model consists of for each major mode of analysis (CFD, FEA and so on).
This step essentially converts the physical problem (e.g. calculating a certain quantity, such as stress at a set of points due to some load, or drag force due to some specified airflow model) to the mathematical problem of solving a differential equation for each of those points. Completely solving these differential equations can be difficult or impossible in practice, but fortunately, making accurate numerical estimates at specific points is computationally possible. A future update will explain how this process works; for now, check out the example in week 1 of the Cornell EdX class, "A Hands-On Guide to Engineering Simulations", for an explanation.
Solving a differential equation for a continuous body is impossible in general, given both the potential complexity of the equations (look at the Navier-Stokes equations for an example) and the arbitrary nature of the input geometry. Meshing is a process by which the arbitrary continuous input geometry is discretized. This means any valid CAD model can be converted to a mesh: a set of nodes with edges connecting them. Solving the equations for each of these nodes then makes the problem doable, and for a large enough mesh the difference between the exact solution and the discretized version is negligible.
Meshes work by representing each surface as a network of polygons, usually of 4 to 6 sides (but the examples shown use triangles). Here's an example of a mesh you might work with:
And here's an example of a mesh you almost definitely won't work with, but that shows how the procedure functions more clearly:
The simplest (but potentially less accurate) mesh generation uses triangles as the basic unit. This is simple because polygons of N sides can always be converted to triangles by connecting non-collinear sets of three points repeatedly (image)
This is a valid mesh, but not a very good one. All the triangles are long and thin, so nodes connected by a long edge may interpolate where doing so would not be accurate. (Linear approximations work well on small scales, but not on larger ones).
To solve this, we can introduce new nodes in the center of the shape. In order to avoid long and thin mesh elements that do not provide an accurate approximation, a minimum angle is set: all angles in each mesh surface element must exceed some threshold for quality (I've seen 20.9 degrees but citation needed). When an angle is lower than this threshold, the edges causing this small angle are replaced by edges with admissible angles.
The Delaunay algorithm (link) describes how to do this. Ruppert's algorithm is similar, with the introduction of the midpoint of each triangle. Its time complexity is greater, which may or may not be worth the extra accuracy depending on the case.
Boundary conditions are how you specify what happens to an object (as represented by a mesh). Since the underlying geometry does not contain information about the environment in which the part exists, we apply boundary conditions to simulate the external environment, such as airflow or an applied force.
FEA simulations involve the numerical solving of partial differential equations that rule our known world. The simulation software takes in a geometry and then creates a mesh out of it. A mesh is your geometry broken into a large, but finite number of elements. Each of these elements, whether they be cubes, tetrahedrons, pyramids, etc. can then have a PDE applied over it. The specific PDE applied depends on the type of simulation you are running. For instance, for an electric simulation Maxwell’s equations will be applied, and for thermal simulations the heat equation will be applied. Once your geometry is separated into a number of finite elements, you can then apply boundary conditions to the entire geometry. These boundary conditions include but are not limited to an applied force, an applied pressure, heat applied, and a voltage. The software then takes the boundary conditions coupled with your mesh and continuity equations in order to produce the results you are asking for. These results could be deformation, stress, strain, resultant force, etc. The main softwares you will use to complete simulations are FEA within Solidworks, ANSYS’ FEA simulations, COMSOL, and/or simscale. We highly recommend ANSYS as it is highly accurate and we have access to free licenses.
To begin using Ansys, open the Workbench application. Select the static structural icon on the left menu to begin working on a static structural project. The project window will contain several items that you must fulfill in order to run the simulation.
Engineering Data
The Engineering Data item is where you select the material that the component is made out of. You can choose from an extensive list of preloaded materials that Ansys offers, or you can create your own material with its own properties. This might be helpful for asymmetric materials or extremely unique materials, but we will generally be able to get good results from preloaded materials.
Geometry
The Geometry item is where you will be importing or creating the 3D part you will be running the analysis on. While it is possible to create the part in Ansys, we strongly recommend using SolidWorks or some other 3D modeling software to create and save the part, and then import that part into Ansys. To do this, simply select Import Geometry, and Browse to look for the file.
Model
Selecting Model will bring you to a new window (after a significant loading period) where you will be completing the rest of the items. Here, you will be assigning the material to the body, creating the mesh, and specifying the conditions and settings of the FEA.
To assign a material, click on Materials in the directory on the left of the window, and insert your material with Material Assignment. Then, select the whole body, reselect Material Assignment, and click apply
You can select different things on the body, like surfaces, vertexes, etc. using the boxes above the model window
Now we must create the mesh. This is creating the finite elements in the finite element analysis. To start, you can simply click on the Mesh tab and generate mesh to see what Ansys will give you. Usually, we want a more fine mesh for more accurate results. To do that, select mesh, go to insert, and select sizing. From there, you will select the geometry just as you did for material assignment. You will now be able to customize the mesh size once you select generate mesh! A word of caution, too fine of a mesh will cause very long loading times, so don’t go crazy.
Next, we must assign boundary conditions. To do this, go into Static Structural, go into Insert, and you will be given a long list of different boundary conditions to use. We went simple with just a force and a fixed support, but you are certainly welcome to play around with some of them to see how they actually operate. Just select the faces and/or lines that you want these conditions to be applied to using the geometry selecting tools above the model. Again, be careful, because too many tasks for the program to control will lead to very large loading times.
To actually get the results of the simulation we plan to run, we must enter the solutions we want the program to solve for. To do this, select Solution, select Insert, and you will be given a list of the different solutions that you would like the program to solve for. Make sure to apply the solution type to the geometry otherwise you will get no results. From there, if you have completed all of these steps correctly, you are ready to select Solve!
To understand the results, go into your solution on the left hand menu, once it has finished solving. Here you will be able to see contours of the questions you asked the software to solve. For instance, if you are running a static structural analysis, you should have asked the software to tell you deformation. Feel free to click through each of your asked solutions. While doing this go through mental checks to make sure that what the computer has solved fits what should have happened. Does the part deform the right way? Does the temperature distribution look right? If the answer to any of your mental checks doesn’t fit what should have happened then go back through your setup to ensure everything is correct. ANSYS does a great job of solving what you give it, but it doesn’t know what is “supposed” to happen; it just solves from what you enter.
Once you have gone through your mental checks and confirmed that it is following expectations, feel free to tentatively trust the results. To stress again, while ANSYS is great at simulating, at the end of the day, all it does is simulate what would happen as accurately as it can. Always use simulating in conjunction with hand calculations, scale model tests, etc.
Definitions/basic examples of FEA and CFD, plus any other general methods
Finite Element Analysis (FEA)
At the time of writing CONVERGE is hosted on a server administered by Aled Cuda, the current Sims Lead. In order to access converge you must contact him for the information necessary to VNC into said server. Although it is possible to install converge on your computer, this can be a highly involved process, and I guarantee you this server is plenty powerful.
When you receive your username you will receive a message that looks like this
Example, actual parameters may differ
Using these values and the vnc client of your choice vnc to gw.ld-cd.net, you should be greeted with a desktop like this:
Center right you can see the icons for converge studio, and a terminal appropriately configured for use with converge.
Although converge does support running jobs in serial from converge studio, any reasonable job will take ridiculous amounts of time to execute. In order to execute a job in parallel, open a converge terminal and do the following:
The server has two Intel X5690 processors for a total of 12 physical and 24 logical cores, so adjust the number of jobs (-n 24) as you see fit.
A tutorial on how to set up and run a 3D CFD simulation in SimScale
The SimScale interface steps are mostly self-explanatory, but there are some subtleties to running a simulation that won't be apparent from just clicking through. Most of these will carry over to ANSYS, so it's definitely useful to gain experience on this easier platform!
At the start, this is what you'll see. Upload geometry (which can be Solidworks, STL, parasolid, etc.), and you'll see the model on the right side. At this point, depending on the model, it might help to define a "topological entity set" (a set of faces on which the same operation can be defined). The model being used for this demonstration isn't too complicated, but with more intricate models like full rockets, it will help to define these.
Now, click on "Meshes", and assign the model you just uploaded as base geometry, then save. You can now start a mesh operation. You'll see multiple types of meshes you can make:
Tet-dominant
Hex-dominant automatic
Hex-dominant parametric
Hex-dominant automatic "wind-tunnel/external flow"
Hex-dominant (beta preview)
You can hover over each of these for an explanation. To estimate drag using CFD, hex-dominant automatic "wind-tunnel/external flow" is a good option if specific control is not required, and hex-dominant parametric allows for additional customization. Apart from the beta preview, all the hex-dominant modes are exclusively for CFD; SimScale will throw an error if you set up an FEA simulation using one of these meshes.
Fineness is on a scale of 1-5; usually, any setting greater than 3 risks timing out (but not always). "Inflate boundary layer" should be left on if turbulent flow is being simulated. The number of computing cores can be set to a maximum of 16 on the free version. It's important in the meshing stage to set the wind tunnel dimensions; by default, it will only be big enough to include the geometry and will not give space for the airflow. The dimensions of the wind tunnel box should be adjusted on the axis along which the geometry has axial symmetry.
Although symmetry boundary conditions can be set in the simulation designer, it is also possible to reduce effort at the meshing stage due to symmetry. This can be done by adjusting the bounding box as well. For rockets, this will usually include only one of the fins. In this case, a 2D simulation would also suffice (of just a small slice of surface area, which can be extrapolated around the whole 3D surface due to radial symmetry) but for the demonstration, 1/4 of the object will be taken.
After a while, the mesh will finish (you can read the Meshing Log to see how far along it is, while you're waiting!) and you'll see something like this:
Note that here the wind tunnel is hidden. You can make it visible in the tree to the top-right, but making it visible usually makes the viewer look weird.
Once you've got a finished mesh, you can move to the Simulation Designer. Click on "Simulations", then "New" and select Incompressible or Compressible (for this case, Incompressible, but if the speed of the flow is greater than Mach 0.3 it should be Compressible). The turbulence model can be set to Laminar if turbulent effects are not desired (if you didn't select "Inflate boundary layer" in the mesh designer). The difference turbulence models will be tested and written about in a future update.
Select the mesh you just made as the Domain, and add Air (from the material library) as the material for the bounding box, unless you're making a submarine. Set 1atm (101325 Pa) as the initial condition.
The most important part of this setup is the boundary conditions; a simulation is almost completely determined by its governing equations (set by the simulation mode, such as CFD incompressible), its geometry (set by the mesh) and the boundary conditions, so it's important to set these correctly. Boundary conditions have to be set for every face (which is why it's useful to have topological entity sets, from the mesh creator); if in doubt, set any surface's boundary condition to "Wall -> Slip" (not no slip, which is the default, if it's part of the mesh as opposed to part of the boundary). Adding a symmetry boundary condition along the faces with axial symmetry will make computation easier.
The essential boundary conditions to add are a velocity inlet at the front of the wind tunnel box (the velocity can be set as a constant, or as a function of any of x, y, z, t) and a pressure outlet at the back along the axis of symmetry. You can set the velocity based on whatever seems reasonable, and the pressure outlet should also be at 1atm.
(This mesh should actually be a bit wider on the sides, will update when I can)
The last set of relevant parameters is under Simulation Control. For a steady-state simulation (time-independent), the specific time values do not matter, but the (end time value - start time value)/time step length is the number of iterations that will be run. SimScale caps the maximum runtime so that you don't run through all your core hours doing way too many iterations of one simulation, but you can adjust this so that more iterations can be run. The default is 1000 iterations; it's 200 here for the sake of runtime, although the quality may be reduced because of this.
To see the quality of results, SimScale will provide a convergence plot, which is a graph of different parameters in the simulation. The closer to flat this graph gets, the better.
The runtime bar is slightly nonlinear; it may not make any progress for the first 15 minutes. That's okay! If it increases to 0.1% after that and doesn't move for another 15 minutes, that may not be okay; consider redoing your setup at that point. You can also read the solver log if you're curious about what it's doing.
SimScale will send you an email once your simulation is done, so you can check the results using the post-processor or download them.
In the post-processor, select "Results" then the variable to be shown. (Haven't really looked into this too much yet but here's what you'll get - to be updated later).
General tip
The latest ANSYS (19) contains 2 CFD modules: Fluent & CFX. While CFX is easier to set up, it yields few useful data - not even the drag force. Therefore, we usually use Fluent. Everything below will be about Fluent.
(with all due respect to our Testing sub-subteam)
This is one of the best tutorial videos of Fluent we have found. Follow through it and you will be able to do all that the team needs now.
The CAD model quality is crucial. It doesn't necessarily need to be very detailed, but here are some qualities that will ease the simulation tasks:
Air-tight. It should be a single continuous entity because what we will simulate is not its interior, but a block of fluid with a rocket-shaped hole cut from it. Do not let air inside the rocket.
Aligned. If it is radially symmetric (which is usually the case for a rocket), please make sure the main axis coincides (not just parallel) with one axis (ie. the z-axis) so that the rocket sits on the origin of e.g. the x-y plane. A radially symmetric body is probably also axially symmetric. Make sure the CAD is symmetric about the x-z plane (or y-z plane) so that if you slice it along the plane (see tip 6), it will fall into two identical parts.
Empty. CFD is about the airframe only and does not need the interior like the pretty avionics, as long as the center of mass is set right. You can save 'only the outer parts' when you export an Assembly to a Part in Solidworks. You can also save only the outer surfaces, but we have not figured out how to meld the 2-D surfaces into a body that can be processed in ANSYS - it only takes 3-D bodies.
Blunt (optional). Non-differentiable sharp points such as the nose cone tip may or may not yield errors in meshing. Still, you want some accuracy in the nose cone shape. Slice an infinitesimal amount off the tip, for example.
No overlap. It may sound silly, but redundant parts may arise when different teams build separate CADs and piece them together. The overlap will become physical nonsense in ANSYS.
No surface, only solid bodies. A tutorial for fix surfaces in ANSYS DesignModeller is below
If the full CAD does not work even after repaired with the tricks described later, to make a 'wind-tunnel model' from scratch that has nothing except what is needed in CAD. Particularly, make one single body that has the body, fins, boat tail, etc. all in one piece. Made properly, the wind-tunnel model should look boringly monochromatic in SolidWorks.
How to improve the CAD after it is done? With built-in CAD tools in ANSYS, specifically Design Modeller (DM, round green icon) & SpaceClaim (SC, square blue icon). SC is the default and is newer, prettier, and more intuitive at first glance, but it is hard to be precise in SC. Therefore, we usually use DM. Select DM from the right-click menu and do NOT double-click - that will pull up the default SC (unless you have changed the options), which can freeze the program for long. Still, it is easiest to make a good CAD in Solidworks in the beginning. DM is for CFD-specific polishes, which are often unavoidable.
You may have realized that our usual SolidWorks .SLDPRT is not a valid CAD format for ANSYS, because SolidWorks is a licensed software not willing to work with ANSYS. Furthermore, SolidWorks' own CFD software less capable than ANSYS. The solution is to convert the CAD file into something compatible, .x_t or .step for example. Usually .x_t is the best because it conserves certain parameters and is well-compressed.
The Repair & Merge tools in DM's Tools menu & Body Operation - simplify in Create are very useful in simplifying the model for CFD - detail is trivial. Try them one by one on your CAD. Pls be aware that Merge can take very long on over 500 entities & cannot be paused or stopped, so save everything and ensure power supply beforehand.
Cylindrical enclousres are more useful for our radially symmetric rockets.
Make a moderately-sized enclosure to ease computations with the 'Details' options in the lower-left corner. The diameter of the cylinder is usually 3 times that of the rocket (fins included). Leave much more space on the hind than on the front
Slice axially symmetric models into halves/thirds/quarters because they would yield the same results anyway. It also helps you to see the interiors and check whether there are leaks. Remember to multiply back certain results like drag in the end.
Name surfaces in the right-click menu before you close DM - not only the inlet etc, but also where you want to take data (e.g. you may want to know the drag on the sides of the fins). Use Ctrl to select multiple surfaces and name them into a same Named Selection.
If meshing fails, slice different sections to debug, just as you would comment out sections of buggy code. However, it is better to go back to Tips 5 & 8 and simplify the model first. (We are trying to develop custom meshing code as a last resort)
Try parallel processing if you can, even locally. CFD is a computationally intensive tasks.
Explore models for solution and their options. We usually try Transient SST because we heard it is an eclecticism between k-omega and k-epsilon. The Help button below the Edit... button lists their pros, cons, and underlying science.
Average over iterations for Monitors, e.g. over 5 iterations. This is averaging not over time, but over calculations.
We usually need around 500 iterations for mere convergence. Yes, convergence of quantities is key (and the primary pain) in CFD. We usually decide whether it has converged by looking at the plot by eye.
Try double precision in the options when you start up Solving if the result does not converge or look realistic. U do not usu. need it tho
Animating too many pathlines may freeze the frail old computers in the CAD lab. Be cautious when you set the default setting for step size/number.
Like @Turbulent CFD Memes for Aerodynamic Teens on FB. Most of the memes on this page are from there.
2D surfaces break the process of enclosing the model with a fluid domain. They can be identified in DM by the Surface ('flag') icon in the Bodies tree
To fix them:
Create new part and make a Named Selection for every cluster of surfaces that can make a solid
Tools > Merge. First the edges, then the faces
Tools > Surface patch to fill gaps in surface body
Use Create > Body Operation & select Sew in the options to convert the surface body to a solid body. Be sure to turn on Create Solid
Supress original surfaces. Select them from yr Named Selection, so that only the solid remains
Body Operation & select Simplify to make the solid sim-friendly
Velocity inlet boundary conditions are used to define the velocity and scalar properties of the flow at inlet boundaries.
Pressure inlet boundary conditions are used to define the total pressure and other scalar quantities at flow inlets.
Mass flow inlet boundary conditions are used in compressible flows to prescribe a mass flow rate at an inlet. It is not necessary to use mass flow inlets in incompressible flows because when density is constant, velocity inlet boundary conditions will fix the mass flow.
Pressure outlet boundary conditions are used to define the static pressure at flow outlets (and also other scalar variables, in case of back-flow). The use of a pressure outlet boundary condition instead of an outflow condition often results in a better rate of convergence when back-flow occurs during iteration.
Pressure far-field boundary conditions are used to model a free-stream compressible flow at infinity, with free-stream Mach number and static conditions specified. This boundary type is available only for compressible flows.
Outflow boundary conditions are used to model flow exits where the details of the flow velocity and pressure are not known prior to solution of the flow problem. They are appropriate where the exit flow is close to a fully developed condition, as the outflow boundary condition assumes a zero normal gradient for all flow variables except pressure. They are not appropriate for compressible flow calculations.
Inlet vent boundary conditions are used to model an inlet vent with a specified loss coefficient, flow direction, and ambient (inlet) total pressure and temperature.
Intake fan boundary conditions are used to model an external intake fan with a specified pressure jump, flow direction, and ambient (intake) total pressure and temperature.
Outlet vent boundary conditions are used to model an outlet vent with a specified loss coefficient and ambient (discharge) static pressure and temperature.
Exhaust fan boundary conditions are used to model an external exhaust fan with a specified pressure jump and ambient (discharge) static pressure.
After creating an account, you can view tutorials for FEA, CFD, and Thermal analysis at
Public Sample Projects
Sample projects on Sim Scale's Public Projects are one of the most useful ways to begin familiarizing with SimScale and the general mechanics of a computer simulation. Pay special attention to the mathematical models used and the different kinds of meshing algorithms. SimScale usually provides a brief explanation for the mathematical model or the meshing algorithm if you hover your mouse above it. The explanation usually includes remarks on what type of simulation the particular model or algorithm is suited for. If you encounter difficulties in setting up the initial mesh, a quick way to get around is to look for similar projects on SimScale's forum and reference their setups. Two links for CFD simulation will be provided below for initial references.
2D Tutorial
Instructions:
ISOs:
This tutorial introduces the general ANSYS CFD workflow which can be summarized in four steps:
Geometry (SolidWorks)
Mesh (ANSYS Meshing)
Setup/Solve (Fluent)
Results (CFD-Post)
While geometry creation is possible in ANSYS with the Design Modeler module, we will primarily be using SolidWorks to create our geometries.
For 2D simulations, our geometry consists of a surface that represents our fluid domain. This means that you will cut out the area of any objects (ex. Airfoils, Fin Profiles) from the whole domain. The picture below shows the example model that that we’ve already prepared for this tutorial (2D_Test_v2.SLDPRT).
Download the SLDPRT file to your computer first before going to your Start Menu and running Workbench 17.1/19.2, which looks like this by default:
Workbench is the digital “workbench” where you set up simulations to run. The blank slate under “Project Schematic” is where you layout the different system blocks available to you in your Toolbox on the left.
Begin by dragging and dropping a Geometry block into the Project Schematic workspace. You may have to click the + next to Component Systems to expand the list.
Right click the cell of the Geometry block with the “?” and import the SolidWorks part.
The next step is meshing, which is the process of discretizing our fluid domain into elements and nodes. A high level view of how CFD works is that the solver takes your mesh and solves a set of fluid equations for each individual element.
Element size can be considered the ”resolution” of the mesh. In general, we want more elements (aka smaller elements) in areas that we expect to see high changes in pressure and/or velocity. For example, we try to use inflation layers in areas where we expect a boundary layer to form. Areas further away from our interest areas are allowed to have larger element sizes because there will be less change within an element in those areas.
Click and drag a Mesh block over the Geometry block you just created. A new Mesh block will appear, with a line connecting it to the Geometry block. This indicates that it is pulling geometry information from the Geometry block.
Double click the Mesh cell to open up ANSYS Meshing in a new window.
In ANSYS Meshing, you will first need to make named selections. These will mainly be used in Fluent later to create boundary conditions.To create named selections, Ctrl+ left click to select all the edges you want to be grouped together. Then right click and select ”Create Named Selection.” If you’re unable to select edges, press Ctrl+E to switch to edge selection mode, or go to the top of the window and select the icon.
You may also find it useful to switch to Box Selection mode when selecting multiple edges at a time.
Create named selections for the wings (WINGS), ground (GROUND), left edge (VELOCITY-INLET), right edge (PRESSURE-OUTLET), and top surface (SYMMETRY). Then switch to surface selection mode, select the entire surface, and name it FLUID.
Now we’ll specify our meshing settings. To enable meshing options, select ”Mesh” from the outline on the left. In the Details panel in the bottom left of your screen, expand the sizing options. Set the following settings:
1. Size Function: ”Proximity and Curvature”
2. Relevance Center: Fine
3. Smoothing: High
4. Span Angle Center: Fine
5. Num Cells Across Gap: 10
6. Min Size: 0.001m
7. Proximity Min Size: 0.001m
Then use the Mesh Control menu to set local mesh parameters.
First select Sizing. Select the edges of the wing, then click ”Geometry” in the Details panel. Select the ”Apply” button to set the selection. Then set the element size to 0.0005m. After that, select Refinement from the Mesh Control menu. Select the surface for the geometry selection. Set the refinement to 1. After this is done, right click “Mesh” in the Project tree and select “Generate Mesh”. Once the mesh generates, you should be able to the outline of how the program divided the surface into individual elements. Save the project and close the ANSYS Meshing window.
Now that we have our mesh, it’s time to read it into our solver. Click and drag the Fluent block over the Mesh block to add and connect. Double click Setup, and when the Fluent Launcher window opens up choose Parallel processing and input the number of processors your computer has under processes. You can find this by going to the Performance tab of Task Manager and seeing how many “Logical processors” your computer has. If your computer has graphics cards, you can enter them under GPGPUs.
Once Fluent loads the mesh, go to the Tree on the left side and:
Select Models. Select “Viscous” and click “Edit”. Under Models, select “Reynolds Stress (5 eqns)”. Keep everything at default values and press OK.
Select Boundary Conditions on the left Menu. If you did the named selections correctly, you should have named selections for the ground, interior-fluid, pressure-outlet, symmetry, velocity-inlet, outlet, and wings. Select velocity-inlet and make sure the type is also “velocity-inlet” (you should now be able to see why we named the selections the way we did). Click Edit and change Velocity Magnitude to 20 m/s. Then, select the ground, make sure the type is “wall”, and click Edit. Change the wall type to moving wall and change the speed to 20 m/s. Make sure the direction of the movement is in line with the inlet velocity (should be in the X direction). Then select the pressure-outlet and make sure the type is ’pressure-outlet.’ Click edit and make sure the pressure is 0 gauge pressure. For symmetry, make sure the type is “symmetry”.
Select Solution Methods from the Tree. Change the scheme to “Coupled”, and the Turbulent Kinetic Energy, Turbulent Dissipation Rate, and Reynolds Stresses all to “Second Order Upwind”. Then check the box for “Pseudo Transient”.
Select Solution Controls from the Tree. Change the following values: Pressure to 0.5, Momentum to 0.5, Turbulent Kinetic Energy to 0.75, Turbulent Dissipation Rate to 0.75, and Reynolds Stresses to 0.75.
Select Monitors. Click “Residuals” and select “Edit”. Change Convergence Criterion to ’none.’ Click OK. Then, under ’Residuals, Statistic and Force Monitors,’ select lift from the create menu. Check the boxes for “Print to Console” and select wing as the wall zone. Make sure the force vector is the right direction (should be Y). This will create a plot of the coefficient of lift per iteration while running the simulation.
Select Solution Initialization from the Left Menu. Select Hybrid initialization and click initialize.
After the Console tells you that initialization is done, click Run Calculation on the Left Menu. Put in 50 iterations in the number of iterations and click calculate. Watch the convergence plot. Make sure the residuals and/or the CL is converging. For the residuals, this means that they are below 1e-02 times smaller than they were in the beginning. For the CL, it means that the plot ends up at approximately one value over many iterations. Continue calculating in 50 iteration sets until the simulation converges.
Once done with the simulation, click Reports from the left menu. Select “Forces” and click Set Up. Select the wings as the wall zone and specify the direction vector such that lift is shown. Press Print and the amount of downforce will be reported in the console.
While we can pull downforce numbers from Fluent quite easily as you just saw for yourself, in many cases we want to be able to visually see our flow to determine how the flow is actually behaving. Close the Fluent window and add a Results block to the Project Schematic. Double click the new block to open up CFD-Post.
First, let’s add a Contour to see what our velocity and pressure distributions look like. Click the Contour icon at the top of the screen.
Then for Locations, choose symmetry 1. For # of contours, select 20. Press Apply to generate the plot. Play around with # of Contours to see how the visualization of the pressure distribution changes. Then, add another Contour but select Velocity as the variable instead.
Next, let’s add a Streamline to see flow behavior. Click the Streamline icon to the right of the Contour icon. Specify the streamlines to start from velocity inlet, and change the # of points to 50. Click Apply to generate the plot.
--from
Instructions: https://docs.google.com/document/d/1l5zS3rDZNhere1akOaFCs_O0VW4Dil8Atkec5RnhjSo/edit
ISOs: https://drive.google.com/drive/u/1/folders/1grdEHUKfftCNnkoH3mhTrcDQaJvqN3aE
3D Meshing & Fluent Guide v2
DesignModeler
Notes:
After pretty much every step, you will need to update your geometry by clicking “Generate”. For the sake of clarity, it’s not included in this guide.
SAVE OFTEN
Ansys defaults to metric, so all dimensions following this will be metric unless otherwise stated.
If DM gives you errors/issues about your geometry, try Boolean uniting your imported CAD into one solid piece
DM allows you to hide individual faces by right clicking on them and selecting “hide face”. This is useful for editing your model after it’s been subtracted from the fluid body.
Import your STP or SW file: File -> Import External Geometry File
Create the fluid body: Create -> Primitive -> Box
Tip: using the “two points” box type is generally much much easier than 1 point and a diagonal
Again, this is possible in SolidWorks, this way is just less buggy.
Create a box that contains everything you want to simulate and then some. For half car sims, we’ve generally been using the two points method with (-8,-3,0) and (15,0,4).
You should see that this creates a box surrounding the car with one wall going down the centerline of the car.
Boolean out your imported CAD model from your box: Create -> Boolean
Set Operation to “Subtract”
Target Body -> Fluid
Tool Bodies -> CAD model (could potentially be multiple bodies)
At the base of anything protruding from the box, you should see rectangular-ish holes
Put a fillet on the edge of this hole traditionally (While not necessary, it can reduce errors). Create -> Fixed Radius Blend
Before:
After:
Create your named selections: Tools -> Named Selections or right click on a face -> Named Selection
Coloring by named selection will make this process way easier and prettier looking: View -> Graphics Options -> Face Coloring -> By Named Selection
Note: Colors will only display on one side of a face, so this can look a little confusing at times.
Fillets will (unfortunately) create tons of little faces. Make sure you select all of them!
You do not have to get every face in one pass. Right clicking on a named selection allows you to edit the selections
Toggling visibility on a named selection also makes it extremely apparent if you’ve forgotten to select a part of it.
ICEM
Tips:
ICEM is very unforgiving, so be careful not to screw up
no pressure
For whatever reason, most of the icons aren’t named and instead you must solely rely on the little pictures. I’ve included names of what the icon looks like to try and make up for this.
Selections are made by left-clicking and confirmed by middle mouse
Right click deselects them in the reverse order of selection (ie, newest to oldest)
Setting your background to all black makes it easier to view your geometry: Settings -> Background Style
SAVE OFTEN
After importing your model, immediately repair your geometry: Geometry -> Cube and wrench icon -> Enter
If you see any yellow lines/surfaces, those are suspected to cause holes in your mesh, a fatal error. Go back to your model in SW and clean up/thicken the areas where you saw them.
Toggle the display of points and surfaces: Model Tree (on left side of screen) -> Check off points and surfaces
Deselecting curves can help declutter your screen
Create fluid body: Geometry -> Cube and pencil
Change part name to fluid
Select two opposite corners of your bounding box by clicking on them
Set your mesh parameters:
Mesh -> Cube and two globes -> Set Global element seed size -> max element to 1 m
Within the same dialog on the lower left, click on the orange triangular icon with the gears
Scroll all the way to the bottom and click on “Advanced Prism Meshing Parameters”
Select “Do checks’ and “Do not allow sticking” and apply
Set your part mesh parameters: Mesh -> Cone, cylinder, and sphere
See here for the settings.
Notes:
Increasing number of layers and decreasing maximum size causes computing time to increase dramatically. Halving your maximum size will lead to far greater than two-fold increase in time. Make sure that you are only being as accurate as you need to be.
Example pic:
Create points for your mesh densities: Geometry -> Three black dots and pencil
You can place points using the following tools:
Computer screen with dot places points wherever you click (Quick, but inaccurate)
Circle with 3 dots allows you to place points at the center of a circle (useful for wheels)
Two black dots and blue dot allows you to place points halfway between two other points
Blue arrow allows you to put point a certain distance away from a known location
Place points at the places specified in the settings doc.
Create mesh densities: Mesh -> Cube with rho
See settings doc again.
Notes:
To create a cylindrical density zone (the ones that are specified as “connected” on the settings doc), select both points before hitting apply.
Be very careful of accidentally creating nested mesh densities; they will make a bajillion elements and take forever
Large widths with small sizes will also take forever and make a bajillion elements
You can edit/delete densities by right-clicking on densities in the
left panel
Doublecheck all your mesh settings
If you’re simulating rolling wheels, copy down the locations of the centers of the wheels, you’ll need it during Fluent
Left panel -> Geometry -> Left click on points -> show point info
Copy down the output from the console to a txt file or something
It doesn’t matter where the point is, as long as it’s on the axis of rotation of your tire
Now you’re ready to mesh! Don’t run this on a laptop. It will take a very long time and probably fail. Archive your wbpj (in Workbench, click File -> Archive) and transfer it over Chrome Remote Desktop to one of the sim comps
Unarchive it. Open Workbench -> File -> Restore Archive
Open ICEM back up
Go into Settings → General and make sure you put the appropriate number of processors (32 for SC1 and SC2)
Now it’s time to actually mesh. Mesh -> Blue icon with colored arrows on it (on the far right)
Select create prism layers
Click compute!
Wait for meshing to finish
NOTE: A prompt may pop up asking you if you want to save the geometry. This typically indicates that the initial meshing has finished and ICEM is about to move onto prisms meshing. Select “No”.
After meshing has finished, scroll up in the console and ensure that ICEM has properly meshed prisms. You should be able to see lines of blue text that the prism mesher outputs.
Check your mesh: Edit Mesh -> Cube with red check mark. Hit apply.
Multi-face errors will crash fluent on orientation
This is different from multiple edge errors - Fluent seems to be fine with those.
If fix is an option for the error message, choose that. If it’s not, choose subset.
If your geometry has a hole in it, gg
Smooth your mesh: Edit Mesh -> Iron with multicolored background (not the iron with brown background)
Freeze Tetra 4, Penta 6, and Pyra 5
Set iterations to 20 and quality to 0.5 and smooth
Set everything to smooth
Lower quality to .2 and smooth
Repeat step o to check mesh one more time.
Fluent
Notes:
Error troubleshooting
Crashes before 1st iteration - remesh
Segmentation error - remesh
Floating point error - remesh
Use as many cores as you again (for most of our desktops, try 8). Don’t use double precision unless single precision gives you convergence issues and you don’t want to remesh
Models -> Reynolds Stress (7 eqn)
Boundary Conditions
Set inlet velocity and ground to 20 m/s (process is identical to 2D)
If using wheels:
Wall motion -> Moving Wall
Motion -> Rotational
Set xyz coordinates to whatever you copied down from ICEM
If you used the standard origin and orientation, you should be able to use the points on the settings doc.
Rotation axis direction should be (0,1,0), unless you made your model funny.
Speed: -87.5 rad/s
Alternatively, you can set this to positive and flip the direction of your rotation axis
Example:
Double check remaining zones (symmetry, chassis, etc)
Solutions Method
Scheme -> Coupled
Set Momentum, Turbulent Kinetic Energy, Turbulent Dissipation Rate, and Reynolds Stresses to 2nd order
Note: If you have convergence issue, try running the first 50 iterations with 1st order, then switching to 2nd order after 50 iterations
Enable Pseudo-transient
Solution Controls
Pressure: 0.65
Momentum: 0.35
Turbulent Kinetic Energy: 0.5
Turbulent Dissipation Rate: 0.5
Reynolds Stresses: 0.5
Monitors
Create lift and drag plots for whatever you’re modeling:
For Ansys 19.2 Top menu: Solving → Reports → Definitions → New → Force Report → Drag/Lift
Ansys 17 options are still in Monitors
Select residuals -> edit -> disable convergence criterion
Initialization -> Initialize
Initialization might fail. If it does, go to more settings -> set number of iterations to 15 or 20
Run calculation: Try starting off with 200-300 iterations