All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Abstract:- The work is focused on performing a 2D Gear Sloshing simulation using a pressure-based transient solver for two different gearboxes having a clearance of 20% & 30% both filled with two phases of fluid. We will be running 4 different simulations each having a different percentage of immersions & materials…
Pratik Ghosh
updated on 19 Jan 2021
Abstract:- The work is focused on performing a 2D Gear Sloshing simulation using a pressure-based transient solver for two different gearboxes having a clearance of 20% & 30% both filled with two phases of fluid. We will be running 4 different simulations each having a different percentage of immersions & materials (phases). Through this project, we will be able to understand & implement Dynamic Meshing for moving bodies such as gears. Further, we will be making use of a User Defined Function (UDF) which would allow us to define the motion of the gears in a synchronized fashion. The 4 different simulation cases that we are interested in are:-
Case 1: Phase 1 will be occupied with 80% air (lighter fluid) & Phase 2 will comprise 20% of Engine-oil (lubricate).
Case 2: Phase 1 will be occupied with 70% air (lighter fluid) & Phase 2 will comprise 30% of Engine-oil (lubricate).
Case 3: Phase 1 will be occupied with 80% air (lighter fluid) & Phase 2 will comprise 20% of Fluid n-heptane (c7h16).
Case 4: Phase 1 will be occupied with 70% air (lighter fluid) & Phase 2 will comprise 30% of Fluid n-heptane (c7h16).
Fluid sloshing is the motion of a free-surface liquid in a partially filled vessel, experienced in the marine, automotive, rail, and aerospace industries. During sloshing, the liquid exerts a dynamic force on the surrounding vessel, which may cause leakage or damage to the vessel or its supporting structure. The sloshing motion is a highly nonlinear and random process depending on vessel motion, liquid depth, liquid properties, and vessel geometry. Multiphase CFD (computational fluid dynamics) methods (such as the volume of fluid or phase field) are used to predict liquid sloshing and its effect on the deformation and stresses in the vessel. Dynamic analysis of a tank containing liquid is a complex problem involving fluid-structure interaction. The tank-liquid system is simplified by an equivalent model in which the total liquid mass is divided into two zones – impulsive and convective. The behavior of the free liquid surface (the convective portion of liquid) subjected to the dynamic loading which may result in liquid spilling or tank wall damage. Therefore, sufficient freeboard must be required to design.
In most CFD projects, we design geometry, create a static mesh for this geometry, and simulate this by fix mesh. But sometimes we want to move some boundary or we have deforming shape during times, such as in our project where we will have 2 gears moving at a constant velocity which would lead to mesh deformation i.e. the mesh needs to copy the movement pattern of the gears. Here we must use the dynamic mesh method. For example, in most aerodynamic problems we use fix mesh for our simulation but you can imagine there are two airplanes that are getting closer and you want to know the effect of fluid flow behavior around airplanes and determine the interaction between them during the time. So the relative position them are changing during time and should be modeled using dynamic mesh method. By using this method, mesh size and shape will be changed. If we use the re-meshing or layering method, the number of elements also will be changed. Dynamic mesh method is entirely different from moving and sliding mesh also moving reference frame. In moving mesh whole zone rotates or translates in some direction but in the dynamic mesh method, the boundary starts to translate or transform. We can apply a predefined velocity by UDF or profile for boundaries or velocity of an object can be predicted based on fluid flow and gravity force balance. If we want to know the velocity of an object based on this balance we should use the SIX DOF dynamic mesh method. Mesh quality during change should be conserved. ANSYS fluent has three different methods for changing mesh, smoothing, re-meshing, and layering. The dynamic mesh operation can be used in various CFD project:-
Generally, the dynamic mesh technique is used when simulating models that require a moving mesh area. In fact, this model enables the spatial variation of the defined areas for fluid flow and allows the mesh of the region at the same time as the spatial location of the points and boundaries of the region changes compatibility with the place at the present moment. The dynamic mesh technique composed of three steps, including determining dynamic mesh methods, specifying specific modes with dynamic mesh options, and defining the dynamic mesh zone.
A UDF is basically a C program or a C function that can be dynamically loaded with ANSYS FLUENT to enhance its standard features. The features of a typical UDF are as follows :
UDF can be used for a number of applications like :
UDFs are implemented in FLUENT code as macros. The general format for defining macros is the macro name that is defined followed by an underscore with the udf name in parenthesis followed by a coma and then mentioning the variables that are to be passed, as shown in examples below.
The definitions for DEFINE macros are contained in the udf.h header file, hence it is not possible to have something else defined in the UDF that is outside the udf.h header file.
The udf.h header file contains the following :
A UDF should begin with #include followed with "udf.h" followed by whichever macro to be used can be defined, shown below.
Compiling & Interpreting UDFs :
Now let us understand how a UDF is compiled or interpreted i.e. how a UDF is exactly included in the FLUENT software. The file containing the UDF can be either interpreted or compiled in FLUENT. The way in which the source code is compiled and the code that results from the compilation process is different for both cases. In compiled UDFs, the UDFs are built in the same way as that the ANSYS FLUENT software itself is built, whereas in the interpreted UDFs the source code is compiled into a machine code that executes on an internal emulator whenever the UDF is invoked.
Let us now understand how UDFs are compiled. Basically, they are compiled either by graphical user interphase (GUI) or the text user interphase (TUI). In the case of GUI, it is a two-step process i.e. a window called compiled UDF flashes on the screen whenever we try to compile. The input it requires are :
So to summarize we create a library file from our UDF C program, later we load the library file into FLUENT as if it is a part of FLUENT.
Now let us see how interpreted UDF differs from compiled ones. This is a single-step process, occurring at runtime only, and involves the use of an interpreted UDFs dialog box.
Basically what happens when we interpret a UDF, is that the source code is compiled into an intermediate architecture machine code using a preprocessor. Now this machine code is executed on an internal emulator, or interpreter when the UDF is invoked. As an additional function is to be called during execution, it, therefore, incurs a reduction in performance.
Types of UDF :
As per the requirement, the basic/ general practice goes as :
Hooking UDFs into a problem setup :
We can either interpret or compile the UDF source file. Now the function contained in the interpreted code or shared library will appear in the dropdown list in dialogue boxes. We may choose this function to activate or "hook" our UDF in the CFD model.
We start by converting the unit system to "m" & then import the pre-modeled design of the Gear Box geometry to Spaceclaim, where we will be editing our geometry according to our simulation requirements. Our geometry is made up of two volumes, the solid volume & the fluid volume. We start by extracting the fluid region viz the space that's occupied by the gear & the fluid medium. The next step requires us to extract the 2D geometry model from the 3d geometry. We do this to reduce the need for excessive computational power. The process to extract the 2D geometry requires us to create a plane along the axis such that it cuts the geometry into two halves & use the 'split-body' tool to cut the geometry. We copy the surface information from the split body & paste it into a new file. This creates our desired 2D geometry model. Pictorial representation of the steps involved in the workflow has been shown below.
Fig 1.1: Original geometry of the Gear Box with the Gears housed inside the solid geometry box
Fig 1.2: Locating the "Center of Volume" for both the gears
Fig 1.3: Workflow to extract the required 2D geometry from the original geometry
The process of discretizing our domain of interest i.e. the 2D geometry into smaller pieces is called meshing. Ansys Fluent uses a technique called the "bounding box" method to generate a body-fitted mesh. This is done by creating the smallest size hypothetical box possible that can be used to fit the entire geometry into it. We will be running a total of 4 case setups & each will have similar mesh properties. In the meshing module interface, we start by assigning names to our geometry. For our case, we have the left gear & the right gear. Next, we assign the user-defined parameters like element order, element size, method, proximity min size & no. of cells across the gap.
Fig 2.1: Mesh details & name selection
→ Solver Type = Pressure Based, Time State = Transient
→Gravity = -9.81(ms2) along y-axis
→Viscous/Turbulence Model = Viscous K-epsilon (Realizable) with enhanced Wall function
→Model = Multiphase model with Volume of Fluid (VoF)
→Formulation Method = Implicit
→Phases = Air & Engine oil or Air & n-heptane
→Dynamic Mesh = Left_gear - left motion (0,0) & Right_gear - right motion (0.115,0)
→Immersion Region =
→Time Step Size = 1e-5, No.of Time Step = 2500
#User-Defined Function (UDF) For Gear Motion
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#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]*/
}
The User Defined Function (UDF) can be added to ANSYS fluent as a function to assign motion, define terms, customize boundary conditions or material properties. In general, it is used IN ANSYS to improve the already existing standard features. The above UDF function defines the angular velocity (omega,ω) along the z-axis for the 2 gears as 200rad/sec.
Fig 3.1: Fluid elements (materials) present in each phase for Case 1 & Case 2
Fig 3.2: Fluid elements (materials) present in each phase for Case 3 & Case 4
Fig 3.3: Domain with 20% Lubricant for Case 1 & 3 Fig 3.4: Domain with 30% Lubricant for Case 2 & 4
Fig 3.5: Initial Domain with just one phase (air) Fig 3.6: Initial Domain with both phases (air & lubricant)
Case 1: Phase 1 will be occupied with 80% air (lighter fluid) & Phase 2 will comprise 20% of Engine-oil (lubricate).
Case 2: Phase 1 will be occupied with 70% air (lighter fluid) & Phase 2 will comprise 30% of Engine-oil (lubricate).
Case 3: Phase 1 will be occupied with 80% air (lighter fluid) & Phase 2 will comprise 20% of Fluid n-heptane (lubricate).
Case 4: Phase 1 will be occupied with 70% air (lighter fluid) & Phase 2 will comprise 30% of Fluid n-heptane (lubricate).
The simulation results obtained are highly inaccurate & cannot be used in any engineering project or industry. This is due to the fact that the gear was able to spin only 1 revolution due to limited computing power. In industry scaled projects the minimum number of revolutions that gear should obtain is roughly around 5-7, to get to reasonable solution results.
'Negative cell volume detected' error = This message means that the element has a big distortion. Big enough to do some vertex, or edges, to penetrate an opposite face resulting in a negative volume, once it is calculated based on the metrics and the local coordinate system of the element that represents the volume of control. Quality, and determinants 2x2 and 3x3 will also be given a negative value due to this distortion. A negative volume will generate the unphysical behavior of equations. The time step probably is large when compared with the displacement of your mesh. To resolve this problem we need to check the mesh quality & maintain the skewness (should be under 8) & aspect ratio under the appropriate range. A bad mesh can lead to floating-point errors, need to use conformal mesh.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Visualize 2D Flow Simulation Through A Backward Facing Step For 3 Distinct Mesh Grid Size Using openFOAM & ParaView
Abstract:- The work is focused on simulating fluid flow through a backward-facing step channel that would be subjected to a sudden increase in the cross-sectional area, this would result in flow separation & reattachment zones. The geometry will be designed by creating vertices & then joining them to form blocks.…
19 Jan 2021 06:26 AM IST
Week 12 - Symmetry vs Wedge vs HP equation
Objective:- The work is focused on performing a CFD simulation for a flow through a cylindrical pipe with reference to Hagen Poiseuille's principle that refers to the laminar flow formation inside a smooth cylindrical tube. Since the computation will be carried out on a laptop, we will not be able to consider the entire…
19 Jan 2021 06:26 AM IST
Writing A MATLAB/Octave Code To Perform A 1D Super-Sonic Nozzle Flow Simulation Using Macormack Method.
Abstract:- The work is focused on writing a MATLAB/Octave code to simulate the isentropic flow through a quasi 1D supersonic nozzle using both the conservation and non-conservation forms of the governing equations and solving them using MacCormack's technique and compare their solutions by performing a grid dependency…
19 Jan 2021 06:24 AM IST
Writing A MATLAB/Octave Program To Solve the 2D Heat Conduction Equation For Both Steady & Transient State Using Jacobi, Gauss-Seidel & Successive Over Relaxation (SOR) Schemes.
Problem Statement:- 1. Steady-state analysis & Transient State Analysis Solve the 2D heat conduction equation by using the point iterative techniques that were taught in the class. The Boundary conditions for the problem are as follows; Top Boundary = 600 K Bottom Boundary = 900 K Left Boundary = 400 K Right Boundary…
19 Jan 2021 06:23 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.