CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Particle tracking during unsteady RANS calculation with sliding mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2025, 13:34
Post Particle tracking during unsteady RANS calculation with sliding mesh
  #1
New Member
 
Kalyan
Join Date: Mar 2020
Location: USA
Posts: 5
Rep Power: 7
kalyan106 is on a distinguished road
Hello everyone,

I have a question on CFX particle tracking and would like your valuable insights on that.

I am running an unsteady RANS simulation of an axial flow compressor with a sliding mesh. The simulation consists of (1) aerothermal calculations to obtain the flow field and (2) particle tracking, in which particles are injected and tracked through one-way coupling with the flow. The aerothermal calculation is very expensive; particle tracking is cheaper, but I need to study many kinds of particles (think of a parametric study). Also, during particle tracking, I want the flow field to keep changing. I can think of two ways to achieve this:

One, keep solving for the fluid on the fly as particles are injected and travel through the domain. However, this is very expensive.

Two, perform the aerothermal calculation once, save the flow field at different timesteps, and then perform particle tracking by loading the saved unsteady solutions as particles are tracked.

Challenge: I found that it is possible to turn the fluid solver off while particles are tracked. So, after the simulation is initiated, the flow field in the first time step is loaded. As time goes, particles are tracked, and the rotor also rotates. However, the flow field is not updated.

Solution: Is it possible to update the flow field as particles are tracked? If this is not possible within the software, can a workaround be developed? Like PyAnsys?

For example, let’s say I have a fluid time step of 1 s and saved the flow fields at t = 1, 2, …, N s in a previous aerothermal calculation (time step of 1 s). Can I build a script to (a) initiate the simulation using flow solution at t=1s, (b) track particles till time reaches 2 s (end of 1st time step), (c) reinitialize/change flow field using the saved flow solution at t = 2s and continue particle tracking? This process is repeated every time step.

P.S. - In step (c), if particles cannot be continuously tracked from the previous step, I can also inject particles using their information at t= 2s and restart the tracking process.

Thank you!
kalyan106 is offline   Reply With Quote

Old   March 25, 2025, 18:43
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,981
Rep Power: 145
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
What are the different flow fields you want to do this with? Are they a transient simulation? Or are they totally different conditions (different flow rate or pressure)?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   March 31, 2025, 12:02
Default
  #3
New Member
 
Kalyan
Join Date: Mar 2020
Location: USA
Posts: 5
Rep Power: 7
kalyan106 is on a distinguished road
Thank you for answer. Here is what I would like to do:

Before particle tracking: Yes, the flow fields come from different timesteps in a transient simulation. I have all the timesteps saved as .trn files, example, 1_full.trn, 2_full.trn,.....,10_full.trn for a transient fluid simulation (initial and boundary conditions fixed) for 10 timesteps. These timesteps also contain 10 different angular positions of the rotating domains, say rotor 1.

When particle tracking starts: I would like to initialize the fluid using say 1_full.trn, and then do the particle tracking for 9 timesteps, with the fluid solver turned off and the rotating parts still rotating ((using expert parameters)) What I would also like is to be able to load the files 2_full.trn,.....,10_full.trn during the particle tracking, so that the particles see different flow fields as they travel across the domain, without solving for the fluid in real time.

Let me know if you need any other information.
kalyan106 is offline   Reply With Quote

Old   March 31, 2025, 17:30
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,981
Rep Power: 145
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
What you describe is easily done by:
* Do a transient simulation and generate the trn files at the time points you want the particle tracking done
* Do particle tracking simulations at each time point, using the trn files as initial conditions and using expert parameters to turn the fluids and thermal solvers off.

This approach only works if the particle time scale (ie: time taken for a particle to go from inlet to outlet) is small relative to the fluid time scale (ie: time taken for the transient flow features). If they are of similar time scales this approach will not work and you will have to do a normal transient fluids/thermal simulation with particle tracking as well.

I am confused why you say you want to do the particle tracking for 9 timesteps. Can't you just do it in a single time step?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   March 31, 2025, 18:10
Default
  #5
New Member
 
Kalyan
Join Date: Mar 2020
Location: USA
Posts: 5
Rep Power: 7
kalyan106 is on a distinguished road
Thanks for your reply. To answer your question at the end, I would inject particles only at the end of the 1st time step and let them travel throughout the domain. I want to see the effect of the changing state of the fluid on the particle trajectories. I would not like track the particles in one single timestep, otherwise they would see a "frozen" state of the fluid as they travel across the domain.
To give you an idea of the time scale differences, here is what I have to say. I have a rotor with a pitch of 15 degrees, and I want to choose a fluid timestep so that each pitch contains 100 timesteps (to capture the unsteadiness). This gives me a fluid timestep of ~ 1e-7 s. If I now consider the no. of such timesteps required for the particles to travel from inlet to outlet, it is around 9k timesteps. I want to write a script or CCL, so that after the initialization, once the particle tracking starts, CFX keeps changing the fluid state after each timestep the particles are tracked for. And this should come from the already saved .trn files, not solving for the fluid again.
I hope that gives you a better picture. The solution you gave in the beginning makes sense, but I want to automate it. Let me know if you think this is feasible or have any other questions.
kalyan106 is offline   Reply With Quote

Old   March 31, 2025, 18:19
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,981
Rep Power: 145
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
OK, so you are saying the particle time scale and the flow time scales are similar. In that case you have to run a transient simulation with particle tracking. You cannot use a series of pre-generated flow fields (not easily at least).
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   March 31, 2025, 18:25
Default
  #7
New Member
 
Kalyan
Join Date: Mar 2020
Location: USA
Posts: 5
Rep Power: 7
kalyan106 is on a distinguished road
Yes you are right, it is not straightforward in the CFX GUI, so I was wondering if I could do it using either User Fortran, Junction Box Routine or PyAnsys. I looked up the CFX documentation and other online sources, but haven't had any luck yet.
Maybe it is possible in Fluent, but for some reason I have to use CFX.
kalyan106 is offline   Reply With Quote

Old   March 31, 2025, 18:30
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,981
Rep Power: 145
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Yes, it can be done in user fortran. But it is not easy, hence my comment. CFX user fortran is complex and not well documented so it is challenging.

I have no idea on Fluent, I am not an expert on that one.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   March 31, 2025, 18:35
Default
  #9
New Member
 
Kalyan
Join Date: Mar 2020
Location: USA
Posts: 5
Rep Power: 7
kalyan106 is on a distinguished road
Your comment "Yes, it can be done in user fortran." gives me some confidence. I have used it before for implementing a lot of user defined stuff in CFX, so I know how to write one. But I wasn't sure if my problem can also be solved using this. Let me try doing it with user fortran. I will update if I have any luck, thanks!
kalyan106 is offline   Reply With Quote

Old   March 31, 2025, 18:50
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,981
Rep Power: 145
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Sounds good, good luck! I suggest it sounds like a junction box routine which overwrites the flow field every time step with a flow field loaded in from the trn files. Junction box routines are more complex than the CEL function, but if you have some experience with CFX fortran you have a head start.
kalyan106 likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Reply

Tags
cfx, compressor, particle tracking, sliding mesh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
flow over cylinder in openFoam saeed jamshidi OpenFOAM Pre-Processing 3 August 11, 2023 15:16
Unsteady Particle Tracking akbar.mech Fluent Multiphase 0 July 12, 2016 01:13
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Warning 097- AB Siemens 6 November 15, 2004 04:41
SOS autosave unsteady particle tracking Alex Munoz FLUENT 2 June 27, 2003 00:37


All times are GMT -4. The time now is 04:35.