Fluent 6.1: How to do a visualization with time dependent particle release


The mixing of two streams with different inflow velocity is to be evaluated qualitatively by means of pathlines. Fluent's Pathline animation however only allows to either display the entire pathlines from inlet to outlet (Pulse Mode Continuos) or bursts of particles are released every time the predecessor burst leaves the domain (Pulse Mode Single) . The first mode eliminates the temporal component and tends to be very crowded with particles ( step size allows insufficient control) while the latter eliminates the spatial cohesiveness since the bursts are typically released too infrequent. Further, different inlet speeds are not taken into account.

This solution takes away these shortcomings by using the DPM model with a UDF governing the amount and instances of particle release at an arbitrary number of inlets. tif files at each timestep are saved to allow convenient creation of a movie for presentations. This procedure works for both steady and unsteady flow fields.

The approach is explained by means of a steady T-junction flow with the left inflow velocity twice of that of the right one. The final result can be seen as <a target=_blank href="http://www.fluentusers.com/support/solutions/1033/animation.gif">http://www.fluentusers.com/support/solutions/1033/animation.gif</a>http://www.fluentusers.com/support/solutions/1033/animation.gif

(1) Turn on unsteady solver (Define/Models/Solver Unsteady)
(2) Turn on DPM (Define/Models/DPM)
Turn on "interaction with continuos phase" with one iteration (otherwise DPM will not operate per time step, but only at the end of all time steps. We are not
interested otherwise in the two-way coupling since we use the particles as massless passive tracers)
Determine the required "max number of steps" such that the particles can reach the outlet
Specify an appropriate length scale
Define the injections. Here:
Left: release from surface inlet-left, large stop time
Right: release from surface inlet-right, large stop time

(3) Compile and load the UDF, hook into left and right injection initialization
(4) For steady state flow disable all equations (Solve/Controls/Solutions) to solve (eg. Flow and Turbulence equations, etc.). Here only particle tracking is performed.
(5) Execute on demand every timestep for which a frame should be stored. Execute a macro defined by:
Open, set, active new window
Display particle tracks (all injections selected, point, color by particle diameter, draw grid)
Hit display
Hardcopy (tif, color)
Save as eg. t-junction-%n.tif, where %n will be replaced by the frame number (0001, 0002, ....)
(6) Save .cas and .dat
(7) Solve iterate with appropriate time step and 1 max iteration per time step

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Below the listing of the UDF for the left inlet only. The right inlet is straight forward and typically will have a different release frequency to take into account the different flow velocity at the inlet. Also the Particle diameters P_DIAM(p) should be slightly different to allow different coloring for each inlet. This example releases a particle every third time step/iteration.


#include "udf.h"

DEFINE_DPM_INJECTION_INIT(init_left,I)
{
real t;
int i_count, count, release;
Particle *p;

release=2; /*release frequency (iterations)*/

Message("Initializing Injection: %sn",I->name);
/*t=RP_Get_Real("flow-time");
Message("flow-time: %fn", t);*/

i_count=N_ITER;
/*Message("i_count: %dn", i_count);*/

count=i_count%release;

loop(p,I->p_init) /* Standard Fluent Looping Macro to get particle
streams in an Injection */
{
if (count == 0 )
{

P_DIAM(p) = 1e-4;

}
else
P_DIAM(p) = 1e-9;
}

Message("count: %dn", count);





Show Form
No comments yet. Be the first to add a comment!