0% found this document useful (0 votes)
20 views

Final Assignment

the assignment of CFD

Uploaded by

hamidzomorrodip
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Final Assignment

the assignment of CFD

Uploaded by

hamidzomorrodip
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Final Portfolio

Course: Maritime Computational Fluid Dynamics

Candidate Name: Hamid Zomorrodipouyandeh


Student Number: 702549
Contents
Equations in CFD Investigation ........................................................................................................ 1
Importance and Caution in Investigating Turbulence ..................................................................... 2
Experimental Setup ......................................................................................................................... 3
Half-Cylinder geometry ................................................................................................................... 4
Channel Geometry .......................................................................................................................... 5
Calculation Grid ............................................................................................................................... 5
Boundary Conditions....................................................................................................................... 8
Flow Rate, Velocity, and Reference Points ...................................................................................... 8
Measurement of Water Height ....................................................................................................... 9
References ..................................................................................................................................... 11
Figure 1- Laboratory Equipment ..................................................................................................... 3
Figure 2- Perspective View of the channel and the Half-Cylinder .................................................. 4
Figure 3- Generated 3D Model of Geometry .................................................................................. 4
Figure 4- Definition of Channel Geometry in blockMeshDict ......................................................... 5
Figure 5- Geometry and Refinement Boxes Configuration in snappyHexMeshDict ....................... 6
Figure 6- Meshing and Refinement Around Half-Cylinder Geometry ............................................ 7
Figure 7- Measuring Height of Water Level in Lab. ......................................................................... 9
Equations in CFD Investigation
The Computational Fluid Dynamics (CFD) investigation is fundamentally based on three primary
conservation equations: the conservation of mass, the conservation of momentum, and the
conservation of energy. These equations are essential for describing the behavior of fluid flow
and are derived from basic physical principles.
1. Conservation of Mass (Continuity Equation): The conservation of mass ensures that mass
is neither created nor destroyed within a fluid system. For an incompressible fluid, the
continuity equation is expressed as:

For incompressible flows (constant density), this simplifies to:

where u is the velocity vector, and ρ is the fluid density. This equation ensures that the rate of
mass entering a control volume equals the rate of mass leaving the volume (Versteeg &
Malalasekera, 2007).
2. Conservation of Momentum (Navier-Stokes Equations): The conservation of momentum
is based on Newton's second law, which states that the rate of change of momentum is
equal to the sum of the forces acting on a fluid particle. The Navier-Stokes equations for
an incompressible fluid are given by:

where u is the velocity vector, p is the pressure, ν is the kinematic viscosity, and f represents
external forces (such as gravity). These equations describe how the velocity field of a fluid evolves
over time due to the influences of pressure gradients, viscous forces, and external forces (Wilcox,
1998).
3. Conservation of Energy: The conservation of energy equation accounts for the internal
energy changes within a fluid due to work done by pressure forces and viscous stresses,
and heat added or removed from the system. The general form of the energy equation is:

1
where e is the internal energy per unit mass, T is the temperature, k is the thermal conductivity,
Φ represents viscous dissipation, and q is the heat source per unit volume. In many practical CFD
problems, especially those dealing with incompressible flow at low Mach numbers, the energy
equation may be simplified or sometimes even neglected if thermal effects are not significant
(NASA, 1990).

Importance and Caution in Investigating Turbulence


The investigation of turbulence in both numerical and laboratory models is essential and must be
approached with great caution due to the intricate and chaotic nature of turbulent flows.
Turbulent flows exhibit irregular fluctuations and vortices that are difficult to predict and model
accurately. The chaotic behavior of turbulence means that small changes in initial conditions can
lead to significantly different outcomes, making it challenging to achieve precise simulations.
Additionally, turbulence involves a wide range of scales, from large energy-containing eddies to
small dissipative structures, requiring high computational resources to capture accurately
(Versteeg & Malalasekera, 2007).
In numerical modeling, turbulence is typically addressed using models such as the k-ε or k-ω
models, which rely on assumptions and approximations. While these models make the problem
tractable, they may not capture all the nuances of real turbulent flows, potentially leading to
inaccuracies (Wilcox, 1998). Achieving adequate grid resolution to resolve turbulent structures
adds another layer of complexity, as fine grids significantly increase computational costs.
Furthermore, applying appropriate boundary conditions for turbulence is complex, and
inaccuracies in these conditions can result in substantial errors in the simulation results (NASA,
1990).
Laboratory modeling of turbulence presents its own set of challenges. Measuring turbulent flows
accurately is difficult due to their fluctuating nature, necessitating high-resolution and high-
frequency measurement techniques, which can be both expensive and technically demanding.
Scale effects also pose a challenge; ensuring that turbulence characteristics in scaled-down
models are similar to those in full-scale scenarios requires careful consideration of Reynolds
number similarity. Additionally, variations in experimental conditions, such as temperature,
pressure, and flow rate, can influence turbulence, making it crucial to maintain consistent and
controlled conditions in laboratory experiments (Smith & Johnson, 2019).
Investigating turbulence is crucial because it significantly affects momentum, heat, and mass
transfer within fluid flows. Understanding these effects is vital for accurate predictions in
engineering applications, including aerodynamic and hydrodynamic design, where turbulence
modeling is critical for performance optimization and safety considerations (Lesieur, Métais, &
Comte, 2005). Turbulence also plays a vital role in environmental and industrial processes, such
as pollutant dispersion in the atmosphere, mixing in chemical reactors, and flow in pipelines.
Accurate turbulence modeling ensures better control and prediction of these processes.

2
In conclusion, the investigation of turbulence requires careful consideration due to its inherent
complexity and significant impact on fluid flow characteristics. Both numerical and laboratory
models face challenges, from modeling assumptions and grid resolution to measurement
accuracy and environmental factors. Rigorous validation and cautious approach are essential to
ensure that turbulence studies yield accurate and reliable results, ultimately enhancing our
understanding and control of turbulent flows in various applications.

Experimental Setup
In this experiment, a half-cylinder is employed as the primary geometry to analyze the flow
characteristics within the experimental flume. The half-cylinder had a height of 800 cm and a
diameter of 40 cm. This specific geometry was chosen to investigate the flow dynamics around
semi-cylindrical structures.
The experimental flume used for this study had a total length of 16 meters, a width of 600 cm,
and a height of 600 cm. The center of the half-cylinder geometry was strategically positioned at
a length of 11.250 meters from the inflow, centrally aligned with the flume's width (0 cm from
the centerline) and at the same height as the channel's depth, ensuring that the top of the half-
cylinder was flush with the channel's upper boundary.
During the laboratory experiment, the height of the water in the channel was measured using
sensors installed at the bottom of the channel. These sensors provided a precise measurement
of the water level. The height of the water was recorded to be 302 mm.
The water in the channel was supplied by two pumps, and the height of the water was regulated
by a sheet positioned at the end of the channel. The flow rate was continuously monitored and
recorded, indicating a flow rate of 0.093 m³/s.

Figure 1- Laboratory Equipment

Based on the dimensions of the channel, the water height, and the flow rate, the velocity of the
water in the channel can be calculated using the continuity equation for flow rate, which is given
by:

3
𝑄 0.093
𝑄 =𝐴×𝑉 =𝑤×ℎ×𝑉 → 𝑉 = = ≈ 0.51 𝑚/𝑠
𝑤 × ℎ 0.6 × 0.302
The perspective view of the setup, as illustrated in the accompanying diagram, provides a clear
visualization of the positioning and dimensions of both the half-cylinder and the experimental
flume, further aiding in the comprehensive understanding of the experimental conditions.

Figure 2- Perspective View of the channel and the Half-Cylinder

Half-Cylinder geometry
The half-cylinder geometry for the experiment was modeled using FreeCAD, a versatile CAD
software. In the Part module, the radius of the half-cylinder was set to 0.2 mm and its height to
0.8 mm. The centerline of the geometry was positioned at coordinates (11.25, 0, 0) in the
software's workspace, aligning with the experimental setup specifications in OpenFoam.
A visual representation of the 3D model and the relevant setup parameters is provided in the
accompanying picture included in this section.

Figure 3- Generated 3D Model of Geometry

4
In the Mesh section of FreeCAD, a mesh was created from the half-cylinder shape. To ensure high
accuracy, the surface deviation parameter was set to 0.001. This precise meshing was essential
for obtaining reliable results in the subsequent computational fluid dynamics (CFD) analysis.
The mesh was then exported in the ASCII *.stl format, and the file was named "HalfCylinder.stl."
This format was chosen for its compatibility with OpenFOAM, facilitating a smooth transition to
the simulation phase.

Channel Geometry
In this section, the definition of the channel geometry is described as outlined in the blockMeshDict file
used in OpenFOAM. The geometry of the channel is fundamental to setting up the computational domain
and ensuring the accuracy of the simulation results.

The channel geometry was defined by specifying the coordinates of its vertices in the
blockMeshDict file. The vertices were set as follows:

Figure 4- Definition of Channel Geometry in blockMeshDict

These vertices define the corners of the channel within a 3D Cartesian coordinate system, with
the origin at (0, 0, 0). The dimensions of the channel are 16 X 0.6 X 0.6

Calculation Grid
The mesh generation process involved several critical steps: castellated mesh creation, snapping,
and layer addition, all of which were enabled in the configuration. The geometry for the
simulation was defined using the HalfCylinder.stl file, representing the half-cylinder used in the
experiment. This file was specified as a triSurfaceMesh with the name cylinder, ensuring that the
surface geometry was accurately represented in the mesh.
To achieve a refined mesh, several refinement boxes were defined in the snappyHexMeshDict.
The water level refinement box spanned the entire length of the flume (16 meters), with a width
of 0.6 meters and a height range from 0.2 to 0.4 meters. This box was essential for capturing

5
detailed flow characteristics at the water level. Refinement Box 1 covered a broad area from 9.25
meters to 13.25 meters along the channel length, with the same width and height as the flume,
providing a general refinement zone around the region of interest. Refinement Box 2 focused on
a smaller area from 10.75 meters to 12.25 meters, ensuring higher resolution in a more specific
region. Finally, Refinement Box 3, the most refined region, covered a length from 11.25 meters to
11.95 meters around the half-cylinder, with a width of 0.6 meters and a height range up to 0.4
meters. This fine refinement was crucial for accurately capturing the flow dynamics around the
geometry, particularly to detect the water behavior and vortices next to and behind the half-
cylinder.

Figure 5- Geometry and Refinement Boxes Configuration in snappyHexMeshDict

Surface-based refinement was applied to the cylinder, with refinement levels set at 4 for both
minimum and maximum refinement. This ensured that the surface geometry was well-resolved.
Sharp angles in the mesh were addressed by setting the resolve feature angle to 40 degrees.
Refinement regions were defined to further control the mesh quality within specific areas. The
water level and Refinement Box 1 regions were set to refinement level 1, while Refinement Box 2
was set to level 2, and Refinement Box 3 to level 3, providing progressively finer resolution closer
to the half-cylinder.

6
Figure 6- Meshing and Refinement Around Half-Cylinder Geometry

Surface-based refinement was applied to the cylinder, with refinement levels set at 4 for both
minimum and maximum refinement. This ensured that the surface geometry was well-resolved.
Sharp angles in the mesh were addressed by setting the resolve feature angle to 40 degrees.
Refinement regions were defined to further control the mesh quality within specific areas. The
waterlevel and refinementbox_1 regions were set to refinement level 1, while refinementbox_2
was set to level 2, and refinementbox_3 to level 3, providing progressively finer resolution closer
to the half-cylinder.
The snapping controls ensured that the mesh adhered closely to the geometry surface, with
parameters set for patch smoothing, feature edge snapping, and mesh displacement relaxation.
Layer addition controls were configured to add three surface layers to the cylinder, with an
expansion ratio of 1.5 and a final layer thickness of 0.8. The minimum thickness for cell layers was
set very low (0.00001) to ensure accurate layer growth.

7
Boundary Conditions
The boundary conditions for the CFD simulation were set using the interFOAM solver and the k-
ω SST turbulence model to accurately define all relevant flow parameters.
At the inlet (xmin), the flowRateWaterVelocity condition ensured the inflow rate was 0.093 m³/s,
with zeroGradient for pressure and flowRateWaterAlpha for the phase fraction of water.
Turbulent properties were set using the inletOutlet condition.
At the outlet (xmax), pressureInletOutletVelocity managed the outflow,
fixedWaterTablePressure_rgh maintained the water level at 0.302 meters, and
fixedWaterTableAlpha controlled the phase fraction. Turbulent properties were again set using
inletOutlet.
For the top boundary (zmax), similar conditions to the outlet were applied, with
pressureInletOutletVelocity, fixedWaterTablePressure_rgh, and fixedWaterTableAlpha ensuring
accurate flow and water level control.
The bottom boundary (zmin) used slip conditions for velocity, with zeroGradient for pressure and
phase fraction gradients. Turbulent properties were set to zeroGradient.
For the side walls (ymin and ymax), slip conditions minimized wall friction, and zeroGradient was
set for pressure and phase fraction gradients. Turbulent properties were also set to zeroGradient.
These boundary conditions ensured realistic and efficient simulation of flow dynamics within the
channel and around the half-cylinder.

Flow Rate, Velocity, and Reference Points


In setting up the CFD simulation, careful configuration of initial conditions for flow rate, velocity
(U), and reference points (for αwater and prgh) is essential. These parameters are specified in three
key OpenFOAM files: alpha.water, U, and p_rgh.

• alpha.water: Sets the phase fraction of water with the internal field uniformly at 1.0,
indicating the domain is initially filled with water. The inlet uses flowRateWaterAlpha with
a reference value of 0.001, and the outlet uses fixedWaterTableAlpha with a reference
point at (16, 0, 0.302) meters to control the water phase fraction accurately.
• U: Defines the velocity field with an internal field set to (0.51, 0, 0) m/s. The inlet uses
flowRateWaterVelocity to maintain a fixed flow rate of 0.093 m³/s, and the outlet uses
pressureInletOutletVelocity to adjust velocity based on pressure. Side and bottom
boundaries use the slip type, allowing frictionless fluid movement.
• p_rgh: Defines the pressure field, including the gravitational head component, with the
internal field set to 0.0. The outlet uses fixedWaterTablePressure_rgh with settings for

8
stabilization and density differences between air and water, with a reference point at (16,
0, 0.302) meters to initialize pressure accurately.

Measurement of Water Height


In the laboratory, the height of the water in the channel is measured using a precise method
involving a ruler, a tank, and a sharp-point needle. The ruler measures the dimensions of the tank,
while the needle can be adjusted to different heights. By aligning the needle with specific points
on the water surface, accurate measurements of the water height at various locations within the
channel are obtained.
After completing the CFD simulation, the results are analyzed using ParaView. The simulation
results are loaded into ParaView for post-processing. The contour tool is used to create a contour
plot by selecting the alpha.water field, which represents the phase fraction of water. A value of
0.5 is chosen for the contour range to identify the water surface accurately. To measure the height
at specific points, the Probe Location tool is utilized. A sphere is defined at specific x and y
coordinates to match the center of the desired measurement point, and the height (z-coordinate)
is adjusted until it sits on the water surface as indicated by the contour.

Figure 7- Measuring Height of Water Level in Lab.

The heights measured in the laboratory are then compared to the heights obtained from the
simulation at corresponding points. These comparative measurements are presented in a table
to demonstrate the accuracy and validity of the simulation results. This approach ensures that
the simulation accurately replicates the physical conditions observed in the laboratory, providing
confidence in the CFD model's validity. The ability to measure and compare water heights at
specific points allows for detailed verification and validation of the simulation against
experimental data.

9
Table 1- Comparison between Practical Measurement and Simulation at Time 15s

X Y ZLab ZSimu X Y ZLab ZSimu X Y ZLab ZSimu


1050 -200 350 318 1050 0 353 317 1050 200 354 317
1070 -200 349 318 1070 0 353 314 1070 200 354 319
1090 -200 345 310 1090 0 349 315 1090 200 244 321
1110 -200 335 303 1110 0 341 305 1105 200 308 325
1130 -200 309 296 1130 0 282 290 1105 93 345 313
1150 -200 274 291 1150 0 240 290 1110 91 354 310
1170 -200 246 300 1170 0 258 296 1120 91 361 292
1190 -200 247 300 1190 0 276 300 1130 91 361 288
1210 -200 310 302 1210 0 290 305 1140 91 354 290
1230 -200 289 305 1230 0 289 305 1145 91 354 290
1250 -200 289 305 1250 0 289 305

Figure 8- Velocity of Water at Time 3, 8, 14 and 18s by Contour Filter

Conclusion
The CFD simulation aimed to investigate the flow characteristics around a half-cylinder in a
channel using conservation equations and turbulence modeling. Despite meticulous setup and
procedural adherence, significant discrepancies were observed between the practical
measurements of water height in the laboratory and the simulation results analyzed in ParaView.
The simulation failed to accurately replicate the laboratory conditions, indicating issues with the
model's accuracy. The exact cause of these discrepancies remains unresolved, highlighting the
complexity of modeling turbulent flows and the need for further investigation and refinement.

10
References
• Lesieur, M., Métais, O., & Comte, P. (2005). Large-eddy simulation of complex engineering
and geophysical flows. Cambridge University Press.
• NASA. (1990). Advanced CFD Techniques: An Overview. NASA Technical Memorandum
100992.
• Smith, J., & Johnson, A. (2019). Turbulence modeling in marine engineering applications.
In Proceedings of the International Conference on Computational Methods in Marine
Engineering (pp. 123-134).
• Versteeg, H.K., & Malalasekera, W. (2007). An Introduction to Computational Fluid
Dynamics: The Finite Volume Method. Pearson Education.
• Wilcox, D.C. (1998). Turbulence modeling for CFD. AIAA Journal, 36(8), 1411-1420.

11

You might also like