-
-
July 9, 2023 at 5:19 pm
Alassedi
SubscriberDear all, I have a cylinder involving a piston being moved by water, as depicted in Figure 1. The water exerts a force on the piston, pushing the water located behind the piston towards the outlet. The mesh employed has an element size of 0.15 mm. I have compiled a User-Defined Function (UDF) in ANSYS Fluent for the properties of water density, water sound speed, and the motion of the piston as a “rigid body” as in the corresponding TXT File. Most simulation settings are in figures 2 through 9. The time step is 0.001 sec.
In my attempts to solve this problem, I have explored three different solution methods: SIMPLE, PISO, and Coupled. Unfortunately, all three methods have yielded the same result – convergence has not been achieved.
I kindly request assistance from anyone who can identify the errors in my work. Furthermore, I would appreciate guidance on how to correctly implement this simulation.
Thank you in advance for your support.=================================
TXT File
=================================
#include "udf.h"
#define Bulk_Modulus 2.2e09
#define rho_ref 997.0
DEFINE_PROPERTY(water_density, c, t)
{
real rho;
real p, dp, p_operating;
p_operating = RP_Get_Real("operating-pressure");
p = C_P(c, t);
dp = p - p_operating;
rho = rho_ref / (1.0 - dp / Bulk_Modulus);
return rho;
}
DEFINE_PROPERTY(water_speed_of_sound, c, t)
{
real a_soundspeed;
real p, dp, p_operating;
p_operating = RP_Get_Real("operating-pressure");
p = C_P(c, t);
dp = p - p_operating;
a_soundspeed = (1.0 - dp / Bulk_Modulus)*sqrt(Bulk_Modulus / rho_ref);
return a_soundspeed;
}
DEFINE_SDOF_PROPERTIES(piston_rec, prop, dt, time, dtime)
{
prop[SDOF_MASS] = 0.094488;
prop[SDOF_IXX] = 0.0000291338;
prop[SDOF_IYY] = 0.000003937;
prop[SDOF_IZZ] = 0.000031496;
prop[SDOF_ZERO_TRANS_X] = FALSE;
prop[SDOF_ZERO_TRANS_Y] = TRUE;
prop[SDOF_ZERO_TRANS_Z] = TRUE;
prop[SDOF_ZERO_ROT_X] = TRUE;
prop[SDOF_ZERO_ROT_Y] = TRUE;
prop[SDOF_ZERO_ROT_Z] = TRUE;
} -
July 10, 2023 at 12:12 pm
Federico Alzamora Previtali
SubscriberHello,
Do you get any error messages or warnings? Does it runs for any number of time steps before it diverges?
-
July 10, 2023 at 4:56 pm
Alassedi
SubscriberThank you very much for your reply.
The drawing initially was as shown in Figure 1 (note that the drawing has been reversed from right to left). After executing the program, the result after the first time step is as shown in Figure 2, and the message is as shown in Figure 3 (Update-Dynamic-Mesh failed. Negative cell volume detected). There may be several other time steps before reaching the same result when reducing the viscosity of water to a level lower than that of air.
-
July 11, 2023 at 7:11 am
Alassedi
SubscriberAdditional information:
The water velocity at inlet = 0.06 m/s.
The element size of mesh = 0.15 mm.
The time step = 0.001 sec.
-
July 11, 2023 at 12:15 pm
Federico Alzamora Previtali
SubscriberNegative volume cells is the result of collapsed cells in a dynamic mesh with excessive boundary zone movement within a time step. Looking at your figures 1 and 2, your piston appears to move several times its width in a single time step. Ideally, you would want this movement to be less than a cell width (0.15mm) for any given time step to allow the solver to remesh.
I would suggest reducing the time step by a couple of order of magnitudes. You may also set the Remeshing interval to 1.
-
July 11, 2023 at 7:58 pm
Alassedi
SubscriberI have re-executed the program as you indicated, reducing the time step value to 1.0E-05 and resetting the Remeshing Interval value to 1. After the fourth time step, the result was as shown in Figure 1 & 2, and the message in Figure 3 was 'floating point exception.' The Residuals plot is shown in Figure 4.
-
July 12, 2023 at 12:25 pm
Federico Alzamora Previtali
SubscriberAgain, it seems like Remeshing is not behaving correctly. In the Mesh Method Settings, I would suggest enabling the Region Face remeshing, this will allow remeshing of faces adjacent to the moving boundary (piston).
Are you using Smoothing as well? Smoothing and Remeshing are typically used together.
-
July 14, 2023 at 4:30 am
Alassedi
SubscriberThank you, Federico Alzamora Previtali! Your assistance has been very helpful to me. I have reduced the time step value to 1.0E-06, and although the program is stable, it will take a very long time to complete the execution of the work. Is there a better way? Which of the following options is the best for a triangular mesh (Spring/Laplace/Boundary Layer, Diffusion, or Linearly Elastic Solid)?
-
July 14, 2023 at 1:08 pm
Federico Alzamora Previtali
SubscriberYes, these transient simulations can take quite a long time for a relatively fine mesh. As mentioned earlier, you want to have any boundary movement to be less than a cell width at any given time step to avoid collapsing cells. Depending on the objectives of your simulation and if the physics allow it, you could try to increase the size of your mesh and use a larger time step (at least for a first iteration of your simulation).
Spring-based smoothing would be your best bet for this type of translational motion. Diffusion or Linearly Elastic will be more expensive and hence take up more CPU time.
-
-
July 14, 2023 at 4:58 am
Alassedi
SubscriberI think that from the point of view of CFD, when water enters from the left side, it will cause vibrations in tiny parts of second to the piston in the horizontal direction. Therefore, CFD calculations should capture these small vibrations. This leads to instability unless the time step is reduced to 1.0E-06 sec. Does ANSYS Fluent software provide another option to address this issue?
-
July 14, 2023 at 1:14 pm
Federico Alzamora Previtali
SubscriberI am not convinced that you will see "vibrations" for this setup. Piston velocity may oscillate slightly but should always point to the same direction.
-
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7584
-
4434
-
2951
-
1422
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.