学习中心

Integrating Along Streamlines and Extracting Particle Statistics


Given a computed steady-state flow field, it is often desirable to compute quantities such as the residence time distribution function of the fluid within the domain, as well as other statistical data related to the distribution of times that it takes the fluid to pass through the domain. This article addresses such situations.

Modeling Notes

This example is presented in the context of a steady-state laminar flow field, representing the flow through a small device, as visualized in the image below. A fluid inlet is defined on one side of the domain, with a parabolic velocity profile, and a uniform pressure outlet defined on the other side. TheLaminar Flowinterface is used, and the model is solved as a stationary problem.

Simulation results showing steady-state laminar flow field through a small device, visualized in a rainbow color table with black arrows.
The computed steady-state laminar flow field through a device.

Beginning with a model that has a steady-state flow solution, add aParticle Tracing for Fluid Flowinterface. Within the settings, specify to use aMasslessformulation for the particles, and specify to store the particle status data. Within theParticle Properties, specify the particle velocity to be the flow field components,u,v, which is equivalent to defining a computational particle that traces streamlines.

A screenshot of the Settings window for the Particle Tracing for Fluid Flow interface, with the Particle Release and Propagation and Additional Variables sections expanded.
Settings for theParticle Tracing for Fluid Flowinterface. Massless formulation is used. Particle status data is stored.

A screenshot of the settings for the Particle Properties feature, with the Particle Properties section expanded.
Particle Propertiessettings. The particle velocity is the fluid velocity.

AnInletcondition is defined at the same boundary as the fluid inlet, and particles are released at time zero. The distribution of particles along this boundary is set to be proportional to the fluid velocity, since there are more particles of fluid passing through the domain where the inlet velocity is higher.

A screenshot of the Settings window for the Inlet boundary condition, with the Initial Position and Initial Value of Auxiliary Dependent Variables sections expanded.
Settings for the particleInletcondition.

As the computational particle moves along this streamline, an additionalAuxiliary Dependent Variableis used to monitor the time for each particle as it moves through the domain and gets to the outlet boundary. As shown in the screenshot below, theAuxiliary Dependent Variabledefinest_particle, with units of time. By integrating the source term,R = 1, with respect to time, this variable will track the time as the particle is traced through the domain. Once the particle reaches the outlet, this variable is frozen to the exit time. AParticle Counterfeature is also applied at the boundary to monitor statistics of the particles as they leave the modeling domain.

A screenshot of the Settings window for the Auxiliary Dependent Variable feature, with the Auxiliary Dependent Variable and Units sections expanded.
AnAuxiliary Dependent Variableis defined on each particle.

A separate study is used to compute the particle paths and uses the results from the first study. The output times specify how long to trace the particles, and how many output time steps are saved. It is not known ahead of time how long it will take for the particles to traverse the modeling domain, so the maximum time has to be studied. The intermediate output time steps, between the start and end time, only need to be saved if a visualization of the residence time is desired.

A screenshot of the Settings window for the Time Dependent study, with the Physics and Variables Selection and Values of Dependent Variables sections expanded.
Settings for the second study, which computes the particle paths.

Results Extraction

To visualize the residence time, add aParticle Trajectoriesplot and color it using the particle time variable. This plot will look more smooth as more output time steps are saved. If this plot is not desired, save only the start and end times as the output times.

Simulation results for the flow through a device, with the streamlines visualized in rainbow and colored by the residence time variable.
Visualization of streamlines, colored by the residence time variable.

It is also possible to plot those particles that have not yet left the modeling domain. These particles follow streamlines that pass very close to a wall, where the velocity approaches zero, leading to a trapping effect. This can be reduced with mesh refinement near the walls, although this is not always desirable due to the increased computational cost for solving the fluid flow problem. In reality, there will be some diffusion as well, but this is ignored when using the massless particle tracing formulation. One approach is to filter these remaining particles out of the results, and theParticle Counterfeature creates a logical variable, defined on each particle,fpt.pcnt1.rL, which is true if the particle reaches the outlet.

A view of the laminar flow model at the end of the simulation, visualized in gray with the remaining particles shown in red.Visualization of those particles left within the computational domain at the end of the simulation time.


To plot the residence time distribution function, use theHistogramplot type, and plot either theAuxiliary Dependent Variableof the particle time or theParticle Statusstop time. Use theSum of valuesnormalization of the output. To plot the cumulative distribution, use the same kind ofHistogramplot, withPeaknormalization, with theCumulativeoption enabled. Plot for the last time stored. TheFiltersubnode is added to theHistogramplots to filter on theParticle Counterlogical expression.

A screenshot of the Settings window for the Histogram plot for the residence time distribution function, with the Expression, Bins, and Output sections expanded.
Histogramplot settings for residence time distribution function.


A screenshot of the Settings window for the Histogram plot for the cumulative distribution function, with the Expression, Bins, and Output sections expanded.
Histogramplot settings for cumulative distribution function.


Side-by-side histogram plots comparing the residence time distribution and cumulative distribution for a fluid flow model.
Plots of residence time distribution (left) and cumulative distribution (right).


To compute the mean residence time, use nonlocal coupling operators viaResults>Derived Values>Global Evaluation. The expressionfpt.fptop1(fpt.pcnt1.rL*t_particle)/fpt.fptop1(fpt.pcnt1.rL)will average the residence time variable over all particles that have left the modeling domain. Here,fpt.fptop1is a predefined operator to compute a sum over all particles. The same operator can be used to compute the variance, as well as construct other metrics.

The supplementary model file with this example is available below.


请提交与此页面相关的反馈,或点击此处联系技术支持

Baidu
map