Xiangyu-Hu / SPHinXsys

SPHinXsys provides C++ APIs for engineering simulation and optimization. It aims at complex systems driven by fluid, structure, multi-body dynamics and beyond. The multi-physics library is based on a unique and unified computational framework by which strong coupling has been achieved for all involved physics.
https://xiangyu-hu.github.io/SPHinXsys/
Apache License 2.0
301 stars 225 forks source link

Deviations in Simulation Outcomes for Long Channel Configurations from Analytical Results #605

Closed YuVirtonomy closed 2 weeks ago

YuVirtonomy commented 3 months ago

Issue/Question: Deviations in Simulation Outcomes for Long Channel Flow Configurations from Analytical Results

Description

When simulating fluid flow in long channel configurations, deviations in the velocity field from analytical results are observed. The simulation setup includes a parabolic velocity inlet with a maximum velocity of 1.0 and an outlet pressure set to 0. The Reynolds number (Re) is 100, with viscosity calculated accordingly. The resolution is set to DH/40. For the same setup, if DL = 10 DH, the results fit the analytical results very well.

Simulation Setup

Observations

  1. Velocity Field:

    • The velocity field deviates from the expected analytical results as the channel length increases.

    Velocity Field Velocity field visualization

  2. Pressure Field:

    • The pressure field shows significant variations along the length of the channel instead of a steady pressure gradient toward the outlet.

    Pressure Field Pressure field visualization

  3. Velocity Profile at Mid-Channel:

    • The velocity at the radial direction measured from X = DL0.5 (where DL = DH 50) shows deviations from the analytical profile.

    Velocity Profile Velocity at radial direction measured from X = 0.5DL

    The velocity profile obtained from an observer at the last time step demonstrates that the maximum velocity is slower than the analytical result.

Steps to Reproduce

Check out the branch: issue/velocity_inlet.

Straight Channel Simulations

This section summarizes the results of simulations, focusing on various configurations within a straight channel each configuration details the parameters used, including domain length (DL), resolution, and corrections applied.

Parameters and Configurations

Each simulation varied the domain length (DL), transport correction, linear correction, and resolution (DH/40), with Riemann solvers consistently applied. Observer in this section is located at 0.5DL.

Simulations with DL = 10*DH

Simulations with DL = 30*DH

Simulations with DL = 40*DH

Summary with Straight Channel

FDA Geometry Simulations

Simulations in FDA geometries with DL = 30*DH and DL = 40*DH were conducted, focusing on the effectiveness of different correction strategies. Observer in this section is located at 0.5 L_in. image

DL = 30*DH

DL = 40*DH

Summary with FDA Channel

Observations Without Transport Correction

Without using transport correction, the particle distribution is uneven in the sudden expansion region of the nozzle-type channel. This uneven distribution is particularly problematic in simulations of channels with sudden changes in geometry.

Visual Examples of Particle Clamping due to without Transport Correction

Results with Transport and Linear Corrections

Using both transport and linear corrections, the results in the FDA simulations align well with predictions. The velocity profiles between the inlet and the shrinking region (DH) form an effective parabolic shape. However, the flow at sudden expansion region's flow is asymmetric.

Visual of asymmetric flow at sudden expansion region

Xiangyu-Hu commented 3 months ago

@FengWang3119 Could you also have this issue. It may related to the transport formulation too.

FengWang3119 commented 3 months ago

OK I will check it. Maybe measuring velocity from X = 0.9DL will make a difference

YuVirtonomy commented 3 months ago

@Xiangyu-Hu @FengWang3119 With transport and linear corrections applied, the velocity profile fits analytically very well. In the FDA geometry, a parabolic flow forms between the inlet and the nozzle region. However, the flow becomes asymmetric after the sudden expansion in the FDA geometry.

FengWang3119 commented 3 months ago

@YuVirtonomy Did you add a constant time-reducing gravity to avoid the start-up instability? Similar in the case, free stream flow around cynlinder. I also meet this kind of problem for the long channel case.

Xiangyu-Hu commented 3 months ago

https://www.mdpi.com/2311-5521/6/1/4#B33-fluids-06-00004 in 2d, you can see the instant flow is no symmetric even when Re is much less that 500.

Xiangyu-Hu commented 3 months ago

@Xiangyu-Hu @FengWang3119 With transport and linear corrections applied, the velocity profile fits analytically very well. In the FDA geometry, a parabolic flow forms between the inlet and the nozzle region. However, the flow becomes asymmetric after the sudden expansion in the FDA geometry.

https://www.mdpi.com/fluids/fluids-06-00004/article_deploy/html/images/fluids-06-00004-g003-550.jpg

YuVirtonomy commented 3 months ago

@Xiangyu-Hu @FengWang3119 With transport and linear corrections applied, the velocity profile fits analytically very well. In the FDA geometry, a parabolic flow forms between the inlet and the nozzle region. However, the flow becomes asymmetric after the sudden expansion in the FDA geometry.

https://www.mdpi.com/fluids/fluids-06-00004/article_deploy/html/images/fluids-06-00004-g003-550.jpg

With transport and linear corrections applied, the velocity profile fits analytically very well. In the FDA geometry, a parabolic flow forms between the inlet and the nozzle region. However, the flow becomes asymmetric after the sudden expansion in the FDA geometry.

Based on the same setup, the results are almost exact. The referenced study uses the average velocity at the inlet to calculate the Reynolds number, while in this test case, the Reynolds number is defined using the maximum velocity at the inlet. Therefore, for the test case, Re = 100 corresponds to their Re = 50.

image The result was converted to grid-based for streamlined visualization image

@Xiangyu-Hu @FengWang3119 Any suggestion to wrap up this branch?

Xiangyu-Hu commented 3 months ago

@YuVirtonomy and @FengWang3119 I suggest that we set user case both in 2d and 3d forms, so that Feng can later test turbulence model here.

Xiangyu-Hu commented 2 weeks ago

This seems not a code issue but due to low resolution.