Challenge 7 – Simulating Fluid Sloshing effect inside a Gear-box
Aim – To observe the fluid sloshing effect inside a Gearbox by iterating with 2 fluids mainly engine oil and n heptane, and thereby analyse the lubricating efficiency (by varying immersion percentage)
Introduction to Gearbox and fluid sloshing phenomenon –
- A gearbox is a component which is placed between the engine and driveshaft.
- It is mainly used for power transmission by increasing or decreasing the torque and rotational velocity of the driveshaft
- The gear ratio is defined as the ratio of number of teeth of the secondary gear to the number of teeth of the primary gear.
- In this particular case, the gear ratio is equal to one and both the gears are of the same size.
- Generally, in automobiles, the gearbox is filled with a gear oil which acts as a lubricant.
- This is highly required since the teeth come in contact with each other at high speeds which may cause damage.
- This simulation works on analysing the fluid sloshing effect inside a gearbox and checking which fluid and immersion percentage value yields uniform lubrication of all teeth on the gears
- Density, Viscosity, and Volume fraction of gear oil contours were observed in this project and inferences were made.
Solving and Modelling Approach –
- First and foremost, the step file of the entire gearbox consisting of the housing and gears was imported into Ansys Spaceclaim.
- The fluid volume was then extracted using the volume extract option in the prepare tab.
- This gives us a solid 3D domain where the fluid flows.
- Next, 3 orthogonal planes were selected by choosing the origin.
- The split body command was applied and the fluid domain was split into half using the front plane.
- After that, the front surface was selected, copied and pasted into a new design file.
- This surface represents the 2D cross section of the fluid domain of the gearbox.
- Since, the 3D analysis requires a strong system RAM and a large mesh count, 2D analysis was done.
- The previous model was deleted and the 2D cross section was imported once again into Ansys Spaceclaim.
- The model was then proceeded for meshing
GEARBOX ASSEMBLY
_1618570620.png)
GEARS
_1618570636.png)
HOUSING
_1618570649.png)
FLUID DOMAIN
_1618570664.png)
SECTION OF GEARBOX ASSEMBLY USING SPLIT BODY
_1618570675.png)
2D PROFILE FOR SIMULATION
_1618570692.png)
IMMERSION HEIGHT CALCULAITONS
_1618570717.png)
Meshing –
- Since the fluid domain consists of many curves and not straight-line geometries, it is best to use a tetrahedral mesh instead of hexahedral mesh (which may lead to inaccurate results).
- Hence, an “All triangles” method was applied to the 2D fluid domain.
- The element size was kept as 30mm for all iterations.
- Furthermore, the “Capture proximity” option was turned on and the number of cells across gap was set to 1.
- This allows us to capture small gaps within the geometry which makes the mesh more accurate.
- The mesh was then generated and the cell count came to be 15,995.



Setting up the case in Ansys Setup –
- In this problem, the max velocity attained by the gear oil is very less as compared to the speed of sound.
- Hence, the Mach number is <<< 0.3. Hence, a pressure-based solver was used since density-based solvers are generally used for simulations with Mach no > 0.3.
- Moreover, this simulation requires dynamic meshing, and hence it is compulsory to use a transient solver rather than a steady-state solver.
- This is so because, dynamic meshing allows the meshed geometry to change its position as per the time steps.
- Since in a steady-state solver time steps are not present, dynamic meshing is not possible.
- Also, through a transient simulation, we can observe the fluid sloshing effect at any rotation of the gears.
- Furthermore, a gravity value of 9.81 m/s^2 was added in the -ve Y direction.
- The Volume of Fluid multiphase model was chosen and implicit formulation was chosen accordingly.
- The fluids engine oil and n heptane were copied and imported from the fluent database.
- The phases were mainly chosen as
- Primary phase – air
- Secondary phase – engine oil/n-heptane
- After that, the k-epsilon realizable turbulence model with enhance wall treatment was chosen.
- Since this particular problem does not involve analysing and inferring near wall effects, the k-omega SST model was hence not used.
- Then the user defined function (UDF) for the two gears was imported.
- The C++ file was added in the source files section and built accordingly.
UDF CODE-
#include "udf.h"
DEFINE_CG_MOTION(right_motion, dt, vel, omega, time, dtime)
{
vel[0] = 0.0;
vel[1] = 0.0;
vel[2] = 0.0;
omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = 2.0e2; /* [rad/s]*/
}
DEFINE_CG_MOTION(left_motion, dt, vel, omega, time, dtime)
{
vel[0] = 0.0;
vel[1] = 0.0;
vel[2] = 0.0;
omega[0] = 0.0;
omega[1] = 0.0;
omega[2] = -2.0e2; /* [rad/s]*/
}
- After that, it was loaded into Ansys setup
- Then dynamic mesh zones were created in the dynamic meshing tab.
- For the left and right gear, the motion was set according to the UDF
- The type of zone name was given as rigid for both gears.
- Subsequently, the centre of gravity location was set for the left and right gear.
- Left gear – x = 0m
- Right gear – x =0.115m
- The display and preview mesh motion were selected to analyse the motion of the gear meshes and correct the geometry if there are any flaws
- Then, the mesh method settings were altered
- Minimum length scale = 0.0001
- Maximum length scale = 0.002
- Maximum cell skewness = 0.7
- Remeshing interval = 5-time steps
- Smoothing was kept to “diffusion”
- Afterwards, the cell registers were managed and a new region adaption was created.
- This was mainly done to introduce a zone where the fluid volume will initially rest.
- For 20% immersion, the max Y value was chosen as -0.0405m and for 30% immersion, the max Y value was chosen as -0.027m.
- After the region was created, the problem was then initialised using hybrid initialisation.
- After that, the domain was patched wherein the created region was given a volume fraction of gear oil as 1.
SOLVER SETTINGS
_1618570950.png)
SELECTING MULTIPHASE MODEL - VOF
_1618570961.png)
SELECTING PRIMARY AND SECONDARY PHASES
_1618570976.png)
SELECTING VISCOUS TURBULENCE MODEL - K EPSILON REALISABLE - ENHANCED WALL FUNCTIONS
_1618570989.png)
DYNAMIC MESHING
_1618571017.png)
DYNAMIC MESH ZONES - LEFT GEAR
_1618571032.png)
DYNAMIC MESH ZONES - RIGHT GEAR
_1618571055.png)
PREVIEWING DYNAMIC MESH MOTION
_1618571073.png)
MESH METHOD SETTTINGS - SMOOTHING, LAYERING, REMESHING
_1618571093.png)
BUILDING AND COMPILING USER DEFINED FUNCTION
_1618571136.png)
CREATING REGION FOR PATCHING
_1618571150.png)
PATCHING AFTER HYBRID INITIALISATION
_1618571162.png)
SOLUTION METHODS
_1618571181.png)
RUN CALCULATIONS AND TRANSIENT SETTINGS -
_1618571193.png)
Rotational motion calculations –
Angular velocity = 2 pi N/60
200 = 2 x 3.14 N/60
N = 31.8 – this indicates that the gears rotate 31.8 times every second.
Hence, the time taken for one rotation of the gears is 1/31.8 = 0.031secs
For simulation purposes it is enough to calculate up to 2-3 rotations of the gears
- Accordingly, the following parameters were set for the calculations
- Number of time steps = 1000
- Time step size = 0.0001
- Number of iterations per time step = 20
- Total time = Number of time steps x Time step size = 1000 x 0.0001 = 0.1 secs
- Hence total number of rotations will be = 0.1/0.031 = 3.22 rotations
Results and findings –
1. 20% Immersion, Fluid - Engine oil.




2. 20% Immersion, Fluid-n-heptane (c7h16).




3. 30% Immersion, Fluid- Engine oil.




4. 30% Immersion, Fluid-n-heptane (c7h16).




Conclusions and inferences –
- It is clear from the volume fraction contours that engine oil is a far better lubricant as compared to n heptane.
- First of all, if we observe each and every tooth for the engine oil iteration, the volume fraction of engine oil is fairly uniform and shows a light blue colour everywhere.
- The simulation with n heptane as a lubricant on the other hand does not show a uniform colour (volume fraction of n heptane) distribution for all teeth.
- In some areas, light blue and green are the major colours and even in specific teethes, the volume fraction of n heptane is coming out to be very close to one.
- This indicates that the n heptane oil is getting stuck on specific teethes, thus not lubricating all teeth in a uniform fashion
- Hence, its concluded that engine oil is a better lubricant than n heptane.
- After analysing immersion rates, it was observed that higher immersion meant more fluid thus leading to better lubrication
- Hence, 30% immersion showed better and uniform results as compared to a 20% immersion of engine oil.
Questions to be analysed -
1. What is Dynamic meshing? Give some other examples where dynamic meshing can be used.
- Dynamic meshing is generally used to analyse problems where in several components are moving and not stationary
- Dynamic meshing capability is used to simulate problems with boundary motion, such as check valves and store separations.
- The building blocks for dynamic mesh capabilities in Ansys Fluent are three dynamic mesh schemes, namely, smoothing, layering, and remeshing.
- A combination of these three schemes is used to tackle the most challenging dynamic mesh problems.
- For simple dynamic mesh problems involving linear boundary motion, the layering scheme is often sufficient.
- For example, flow around a check valve can be simulated using only the layering scheme.
- Another example of dynamic meshing can be while simulating the CFD of a fan.
- In this case, the fan has a rotational motion, and the user defined function is defined accordingly.
- Examples –
- Turbine fan
- Fluid sloshing in gearbox simulation
- CFD Analysis of Needle Free Liquid Jet Injectors
- CFD Analysis of a Diaphragm-less Shock Tube
2. What is the fluid Sloshing effect? Discuss whether the sloshing effect is good or bad? Explain.
- Fluid sloshing refers to the movement of liquid inside another object (which is, typically, also undergoing motion).
- Strictly speaking, the liquid must have a free surface to constitute a slosh dynamics problem, where the dynamics of the liquid can interact with the container to alter the system dynamics significantly.
- Important examples include propellent slosh in spacecrafts, tanks and rockets (especially upper stages), and the free surface effect (cargo slosh) in ships and trucks transporting liquids (for example oil and gasoline).
- Such motion is characterized by "inertial waves" and can be an important effect in spinning spacecraft dynamics.
- Extensive mathematical and empirical relationships have been derived to describe liquid slosh.
- These types of analyses are typically undertaken using computational fluid dynamics and finite element methods to solve the fluid structure interaction problem, especially if the solid container is flexible.
- Relevant fluid dynamics non-dimensional parameters include the bond number, the Webber number, and the Reynolds number.
- In essence, fluid sloshing effect is good in some cases, and bad in other cases. It basically depends on the situation or problem statement.
- In this particular case, fluid sloshing is beneficial to allow proper and uniform lubrication of all the teeth.
3. What is the use of UDF?
- User-defined functions allow programmers to create their own routines and procedures that the computer can follow.
- It is the basic building block of any program and also very important for modularity and code reuse since a programmer could create a user-defined function which does a specific process and simply call it every time it is needed.
- A user-defined function, or UDF, is a function that you program that can be dynamically loaded with the Ansys fluent solver to enhance the standard features of the code. For example, you can use a UDF to define your own boundary conditions, material properties, and source terms for your flow regime, as well as specify customized model parameters (e.g., DPM, multiphase models), initialize a solution, or enhance postprocessing.
- UDFs are written in the C programming language using any text editor and the source code file is saved with a .c
4. Discuss the common errors that occurred in the simulation. A] 'Dynamic mesh failed' error. B] 'Negative cell volume detected' error.
- The dynamic mesh failed error and negative cell volume detected error are the most common issues faced while running simulations with dynamic meshes.
- The first reason, one of these issues may arise is due to a bad mesh quality.
- Both for the unstructured and structured mesh types, if the quality of majority of the cells is not high, it may result in computation errors thus causing the simulation residuals to crash.
- Also, it is advisable to check the volume of the smallest mesh cell.
- A very small motion of the boundary can lead to the collapse of the cell thus leading to this particular error.
- Another factor is to make sure that all the boundaries of each gear are selected and not a single curve is left out.
- In this case, if we fail to select even a small curve, then that particular curve will be stationary and the other boundaries will collapse into it thus resulting in a negative cell volume error.
- Also, the time step size should be considerably small to allow each and every movement to be captured.
- A high time step size may result in this error