Showing posts from April, 2026 ← All Posts

Modeling a Numerical Wave Tank in ANSYS Fluent using UDF | Open Channel Flow

Simulating wave propagation in a controlled environment is a fundamental challenge in offshore and marine engineering. A Numerical Wave Tank (NWT) allows us to study how waves interact with structures without the cost of physical testing. However, generating stable, physical waves requires precise boundary conditions often handled through custom scripts.

In this tutorial, we walk through the complete setup of a Numerical Wave Tank in ANSYS Fluent, utilizing a User Defined Function (UDF) to generate gravity waves via the Volume of Fluid (VOF) model and Open Channel Flow settings.


Project Workflow

1. Geometry & Domain Design

The tank is modeled as a 3D rectangular domain to capture the longitudinal propagation of waves.

  • Length: 25 meters (to allow space for wave development).
  • Cross-Section: 3m x 1.5m.
  • Method: Created as a 2D sketch in the XY plane and extruded in the Z-direction.

2. Meshing Strategy

To capture the free-surface interface accurately, a structured or high-quality semi-structured mesh is required.

  • Method: Multi-zone meshing with adaptive sizing.
  • Resolution: Seven-level resolution to ensure the interface between air and water remains sharp during propagation.
  • Cell Count: Approximately 124,000 cells for this specific 3D domain.

3. Solver Setup & VOF Model

The simulation relies on the Volume of Fluid (VOF) multiphase model.

  • Physics: Gravity enabled in the Y-direction (-9.81 m/s²).
  • Phases: Air (Primary) and Water (Secondary) with a surface tension coefficient of 75.
  • Options: Open Channel Flow enabled to provide the necessary framework for surface gravity waves.
  • Turbulence: K-Epsilon RNG with standard wall functions.

Wave Generation via UDF

The core of the wave generation is the User Defined Function (UDF). It defines the velocity components at the inlet boundary as a function of time and position to mimic the kinematics of a physical wave maker.

Note: Ensure you compile and build the UDF within the Fluent environment before assigning it to the Velocity Inlet.

4. Initialization & Patching

Before starting the transient run, we must define the initial water level in the tank:

  • Step 1: Standard initialization.
  • Step 2: Create a "Marked Region" up to the desired initial water height.
  • Step 3: Patch the Phase 2 (Water) volume fraction as 1 in that region.

Results & Visualization

To visualize the waves, we use ISO-Surfaces in CFD-Post. By selecting the Volume Fraction of water at a value of 0.99, we can clearly see the wave profile as it moves from the inlet to the outlet.

Transient animations help verify the wave height, wavelength, and phase velocity against theoretical values, ensuring the UDF is correctly modeling the target sea state.

Download the UDF & Project Files

The source code for the wave generation UDF and the full simulation walkthrough are available on the YouTube channel.

▶ Subscribe to ANSYS Tutor

Velocity vs Time Plot in ANSYS Fluent | Transient CFD Post-Processing Tutorial

If you have ever completed a Transient CFD Simulation in ANSYS Fluent and found yourself struggling to plot a variable like velocity against time, you are not alone. While steady-state results are straightforward, transient post-processing requires a bit more setup to extract meaningful time-history data.

In this tutorial, we break down three distinct methods to obtain transient plots. Whether you want a quick Excel chart or a professional XY transient chart directly inside CFD-Post, this guide has you covered.


PRO TIP: Before running your simulation, ensure you have enabled Autosave for your data files (.dat) at the required time step intervals. Without these files, CFD-Post cannot reconstruct the time history.

Method 1: Fluent Report Monitors & Excel

This is the easiest and most reliable method for beginners. It involves creating a report monitor before you click calculate.

  • Setup: Go to Report Plots and create a new Surface Report (e.g., Area-Weighted Average).
  • Variable: Select Velocity (or your desired parameter) at the Outlet.
  • Output: Fluent saves this data as a .out or .dat file in your project folder.
  • Processing: Open the file in Excel, use "Text to Columns" (delimited by space), and you have an instant dataset ready for plotting.

Method 2: Point Location in CFD-Post

Sometimes you need the velocity at a very specific coordinate.

  • Why a Point? In CFD-Post, the XY Transient Chart tool often hides boundaries like the "Outlet" from the location list. Creating a Point bypasses this limitation.
  • Workflow: Insert a Point at your target coordinates → Insert a Chart → Select 'XY Transient' → Set X-axis to Time and Y-axis to Velocity at that Point.

Method 3: Polyline & Expressions (Most Professional)

If you want the Average Velocity across the entire outlet width (which is more physically meaningful than a single point), use this expression-based method.

Expression: lengthAbs(Velocity)@Polyline 1

By creating a Polyline at the boundary intersection, you can use the Length Average function to get a single scalar value for every time step, resulting in a smooth, professional transient plot.

Which method worked best for you?

Transient simulations can be tricky, but mastering post-processing is half the battle. If you have specific errors, drop them in the YouTube comments!

▶ Subscribe for more ANSYS Tips

Billboard Wind Load Analysis | Fluid-Structure Interaction (FSI) Simulation

When a strong wind hits a large structure like a billboard, two critical phenomena occur: the airflow is diverted around the obstacle, and the structure itself bends or vibrates under the pressure. To accurately simulate this, we use Fluid-Structure Interaction (FSI).

In this comprehensive tutorial, we use ANSYS Fluent to calculate wind pressure and then couple those results with ANSYS Static Structural to determine how much the billboard deforms. This "One-Way FSI" approach is essential for engineering safe and durable outdoor structures.


Phase 1: Geometry & Fluid Domain

The first step is creating a realistic 3D model in DesignModeler.

  • Billboard: A 6m x 3m board mounted on a 5m tall circular pole (0.5m diameter).
  • Fluid Domain: An air box measuring 30m x 30m x 80m to allow for fully developed flow and wake formation.
  • Boolean Operation: We subtract the billboard from the air box using the "Subtract" tool, ensuring we preserve the tool body (the billboard) for the subsequent structural analysis.

Phase 2: CFD Setup & Wind Load

With the mesh generated, we move to ANSYS Fluent to simulate the wind behavior.

  • Models: We use the K-Epsilon (Standard) turbulence model to handle the high-velocity air.
  • Boundary Conditions: A velocity inlet of 15 m/s is applied. We also set the outer boundaries to Symmetry to simulate an open atmosphere.
  • Drag Force: Using report definitions, we monitor the total drag force (Z-direction) acting on the billboard walls until convergence.

Phase 3: Structural Analysis & Deformation

This is where the FSI coupling happens. We link the Fluent "Solution" cell directly to the "Setup" cell of Static Structural.

  • Material: Structural Steel.
  • Imported Load: We map the pressure distribution calculated in Fluent onto the structural surfaces of the billboard.
  • Constraints: A Fixed Support is applied at the bottom of the pole, along with Standard Earth Gravity.

Results Outcome

After solving, we analyze several key outputs:

  • Total Deformation: Shows the maximum bending at the top edges of the billboard.
  • Equivalent Stress (Von-Mises): Reveals that the most stressed point is the joint between the board and the pole.
  • Flow Visualization: 3D Streamlines and 2D Velocity contours show the formation of eddies (vortices) behind the structure.

Master FSI Simulations

Watch the full 29-minute walkthrough to see every setting and click required to complete this project.

▶ Subscribe to ANSYS Tutor

NEWTONIAN VS NON NEWTONIAN FLUIDS

Ever wondered why some liquids flow easily while others behave strangely? In the world of Fluid Dynamics, understanding the difference between Newtonian and Non-Newtonian fluids is critical for accurate simulations. While Newtonian fluids like water maintain constant viscosity, fluids like human blood are complex—their viscosity changes depending on the force applied.

In this tutorial, we analyze the Non-Newtonian Blood Flow through a Stenosed Pipe using ANSYS Fluent. We explore how blood behaves as a shear-thinning fluid and observe the sharp viscosity drops in constricted passages.


Project Overview

The simulation focuses on a stenosed pipe (a pipe with a constriction) to mimic a blood vessel with a blockage. We aim to find the flow velocity and observe changes in the molecular viscosity of the blood as it passes through the throat of the stenosis.

1. Geometry Creation (DesignModeler)

  • Dimensions: Total pipe length of 50mm.
  • Stenosis: A 10mm middle section with a minimum diameter of 0.5mm.
  • Method: We use the Polyline tool in the YZ Plane to draw the half-profile and then Revolve it around the G-axis to create the 3D volume.

2. Meshing & Quality Check

A structured mesh is vital for capturing gradients near the wall.

  • Sizing: We applied edge sizing to the circular edges with 100 divisions.
  • Quality: Checked the Skewness and Aspect Ratio to ensure the cells stay within the student version limits for stability.

3. Solver Setup (ANSYS Fluent)

Since blood flow in small vessels is typically slow, we use the Laminar Viscous Model with Double Precision.

Material Properties: The Carreau Model

Because blood is not in the standard database, we modify 'water-liquid' with the following Carreau Model parameters:

  • Density: 1050 kg/m³
  • Time Constant: 3.313 s
  • Power Index: 0.3568
  • Zero Viscosity: 0.056 Pa·s
  • Infinite Viscosity: 0.00345 Pa·s

4. Boundary Conditions

  • Inlet: Velocity Inlet of 0.01 m/s.
  • Outlet: Default Pressure Outlet.
  • Initialization: Hybrid Initialization with 500-600 iterations for convergence.

Results & Analysis

The post-processing results reveal a fascinating inverse relationship between the shear rate and viscosity:

  1. Center Region: Higher viscosity occurs near the center where the shear rate is low.
  2. Near Walls: Viscosity is lower near the pipe walls due to higher velocity gradients.
  3. The Stenosis Throat: As the diameter reduces, flow accelerates significantly. This causes high shear rates, leading to a sharp drop in viscosity—confirming the shear-thinning behavior of blood.
WATCH THE FULL STEP-BY-STEP TUTORIAL ON THE ANSYS TUTOR YOUTUBE CHANNEL

Subscribe for more CFD & FEA Tutorials →