In this tutorial you will learn how to setup a particle tracing system to obtain the residence time distribution of flow in a T-channel. This method can essentially be applied in conjunction with any incompressible solver, like icoFoam, pisoFoam, pimpleFoam and etc.
- Solver: pimpleFoam
- Compatible with: OpenFOAM 7, OpenFOAM v1912
- Model: incompressible flow, RAS turbulence model, 3D, icoUncoupledKinematicCloud
- Physical system: Particle tracing in a T-channel for residence time distribution (RTD)
- Description: In many engineering applications we need to know how long each fluid particle stays in a reactor. This is essentially called the residence time distribution (RTD) of fluid in the reactor. OpenFOAM solvers do not naturally provide such information to us. However, there are some useful tools for particle/tracer tracking in flow system. In this tutorial you will learn how to utilize this tracer tracking system to obtain flow path of tracers inside a T-channel with baffles. The flow system is very simple to minimize unnecessary details and to have enough space for details about setting up tracer/particle tracking system.
The RTD is obtained by injecting an inert substance or molecule into the reactor (reactor inlets) at t = 0 and measuring the tracer concentration in the outlet stream of the reactor. The tracer should be nonreactive. Its physical properties should be similar to the fluid and it should not affect the flow behavior of the fluid in the reactor. It should not be adsorbed on the reactor walls so that it completely reflects the flow behavior of the reactor.
In this simulation, tracers are small (100 micron) artificial particles with density 1000 kg/m3(similar to fluid density). These particles with small time constant follow fluid flow path and since we use one-way coupling, tracer presence does not affect the flow behavior. Although the obtained data is not post-processed to obtain RTD, but the raw results can be used for this purpose.
Hi, may you tell me how can i view the flow with spheres in paraView? ; i tried but couldn’t.
Regards.
Hi, Use Gylph (the icon is similar to an sphere) and use “sphere” as type.
Hello Nourouzi,
Many thanks for helping through this great article. I have a question about the visualisation – how do you colour the particles separately for the bottom and top outlet, as shown in the figure at page 14 of the .pdf?
Hi, simple. use two different diameters (with small difference). 🙂
Hello,
I wanted to replicate this tutorial with OpenFOAM version 8. Everything ran fine but there is no folder related to the “lagrangian” or “kinematicCloud” particles in the timestep directories, as you’ve mentioned here: https://www.cemf.ir/residence-time-distribution-rtd-in-stirred-tank-reactor-openfoam-simulation/#comment-28. Looks like pimpleFOAM does not take account of the addition in the controlDict. It means the “functionObjects” addition made by you to the controlDict, is not working.
functions
{//https://cpp.openfoam.org/v8/namespaceFoam_1_1functionObjects.html#details
// #includeFunc residuals;
tracks
{
libs (“liblagrangianFunctionObjects.so”);
type icoUncoupledKinematicCloud;
kinematicCloud kinematicCloud;
}
}
Is this a oF version problem or something? Can you please help me with that?
I have not tested it on OP8. Try OF7.
Hello,
Is this tutorial compatible with version 5.x?
I have not tested it with 5.x. The principles are the same, but if it was not compatible, you may need a few changes.
What about the others solvers (like pisoFoam)? I’m tring to replicate the results but I am not able to get the results as shown in the images (with the moving particles). Please, could you list the post-processing steps?
Thank you
This is a function object which is a wrapper around the base class that performs calculations. As it was mentioned, it works with solvers like icoFoam, simpleFoam, pimpleFoam, and etc.
How do you get the parth of the particles?
convert foam files to vtk files (using foamToVTK) and then visualize your results in paraview. There, you can see the path of particles.
I mean generate that image with the particle path lines.
In Paraview, use streamline filter and set U as the field, then apply a tube filter on streamline.
Dear Norouzi,
convert foam files to vtk files (using foamToVTK) -> this is simple,
and then visualize your results in paraview–> this is not easy, is there any tutorial?
many thanks
Unfortunately not.
Hi, thanks for this tutorial. Iḿ struggling with paraview.
can you please explain how you get the particles running throw the domain?
Do I have to load the VTK file or the “normal” file ?
Hi Johannes,
I have answered this question in the previous comments. There is no different between loading vtk file or .foam file. You will get the same output I expect.
Thanks for this helpful tutorial
Can I modify it to use the particles as soil particles in the bed of an open channel filled with water such as river ?
Hi, you cannot use the same solver, since the river flow is a flow with free surface. In addition, depending on the size, density and concentration of soil particles in the water, you may need to have two-way or four-way coupling between soil and water in the simulation. This simulation is one-way coupling in which fluid flow affects particle flow only.
Hello first of all thanks for this good tutorial. I wanted to ask if it’s possible to see in paraview differently the clouds which we inserted without giving them a different radius. In this case now we see the two different clouds which we inserted but only because they have different radius so we can select in paraview the radius. Thanks in advance.
Why did you use two clouds?
Thanks for the useful tutorial. I am wondering whether it is possible to specify particles with different densities in one run instead of in different runs.