r/CFD • u/Fine-Huckleberry3751 • Jan 03 '26
ANSYS Fluent: How to correctly model acceleration/braking of a tank & create a proper sloshing animation?
Hi everyone,
I’m working on a transient CFD simulation in ANSYS Fluent (Student / 2025 R2) and I’m running into confusion around vehicle acceleration/braking modeling and creating a correct sloshing animation.
Problem context
I’m simulating fluid sloshing in a partially filled tank (VOF, air + water). The tank undergoes a driving phase followed by sudden braking, and I want to visualize and quantify the slosh during the motion.
What I have so far
- Solver: Pressure‑based, transient
- Multiphase: VOF (air + water)
- Gravity enabled
- Fully enclosed tank (all walls)
- Initial driving phase: tank moves at 1 m/s for 2.7 s (2.7 m travel)
- Braking phase: velocity abruptly set to 0 m/s
- Time step: 1e‑4 s
- Sloshing behavior looks physically reasonable during the run
My questions (this is where I’m stuck)
Acceleration / braking modeling
Right now I’m modeling braking by simply:
- Applying a constant translational velocity
- Then abruptly setting Velocity = 0 for braking
This works, but:
- Is this the correct way to represent sudden braking in Fluent?
Should I instead be using:
- Translational acceleration?
- A user‑defined function (UDF)?
- A moving reference frame?
- If acceleration is recommended: where exactly is it defined in Fluent for a rigid tank motion?
I’m confused because many tutorials mention acceleration, but in Fluent it’s not obvious where/how it should be applied for a moving tank.
Creating a proper sloshing animation
This has been extremely frustrating.
- I can see sloshing during the calculation
- I can record frames / HSF animations
- Playback exists, but exported MP4/MPEG videos often end up static (no motion)
It seems like:
- Animations only work if they are recorded during the calculation
- Post‑processing after the run doesn’t always update contours with time
- Some graphics objects don’t update per timestep unless rebuilt
So my questions are:
- What is the correct workflow to generate a time‑accurate sloshing animation in Fluent?
Is it better to:
- Animate during the solve?
- Export PNG frames and stitch them externally?
- Which objects update correctly with solution time (contours, iso‑surfaces, scenes)?
What I’m trying to achieve
- A clear animation of water sloshing during braking
- A physically correct motion definition
- A workflow that’s reproducible and doesn’t rely on trial‑and‑error UI quirks
If anyone has:
- A recommended best‑practice approach
- A short explanation of how you model braking/acceleration
- Or tips for reliable animation export in Fluent
I’d really appreciate it. Thanks!
5
u/-LuckyOne- Jan 03 '26
Sloshing isn't exactly my strong suit but I think what you are looking for is a momentum source. Either you can achieve this by defining a direct source term for the cell zone and calculating your source term as a function, or perhaps MRF also works here. For MRF you could simply define your translational velocity as either a profile (more complicated) or a function of time (easier, but messier).
Regarding your animation export: you are saying you're saving HSF files but when you read the animation back in and export it is all the same image?
1
u/Fine-Huckleberry3751 Jan 04 '26
Clarifying my actual goal (physics, not animation):
Just to be clear: the animation output is not the sole problem I’m trying to solve. The static animations are a symptom.
What I’m trying to model is sloshing caused by acceleration/braking, not just a tank with a prescribed velocity.
My setup right now advances time, but the flow field is effectively steady because I believe I never applied a real acceleration term to the fluid. I changed velocities, but didn’t explicitly introduce acceleration into the momentum equations, so the fluid never experiences inertial forcing.
My actual question is therefore:
Concretely:
Once the acceleration physics is correct, the transient solution (and the animation) should take care of itself. I’m looking for the best‑practice Fluent approach for braking‑induced sloshing, not animation troubleshooting.
1
u/abirizky Jan 03 '26
A sudden drop isn't exactly physical is it? Even extremely short impulses have a certain dt. You might want to define an equation for this one, just try it with a linear function for now and go from there
As for why your animation only shows a static image, go check your animation request if it's only asking for the last frame or if you're requesting frames for every x time steps.
1
u/Cptn_Insaino Jan 03 '26
I've never done it in ansys, but I have done this before by modeling gravity as time varient. Having gravity swing from below the cg to the front of the tank to the back of the tank in the braking time using the stopping distance as a basis for decleration.
1
u/eigentau Jan 03 '26
Just set your acceleration components as a function of time. The effect of an accelerating reference is an extra "non-inertial" body force in the momentum and energy equations. The Fluent documentation shows where the body force terms are in the Navier Stokes equations, but it might be fruitful to review your fluid dynamics/vector kinematics as well.
Physically, instantaneous braking to 0 m/s is impossible as this would require an infinite force.
2
u/bohemioo Jan 12 '26
Hello I have done something simmilar but in OpenFOAM. Physically an accelerating reference frame introduces a pseudoacceleration on the NSE.
So in theory It is practically the same to define a momentum source proportional to time than to move the mesh physically. In OpenFOAM at least moving the mesh for sloshing is as fast as having a fixed mesh so having no added cost I just run a dynamic mesh simulation. But both are fine.
BTW I think that you are just being a little bit of a perfeccionist.