introduction to the particle tracing module · introduction to the particle tracing module ......

38
VERSION 4.4 Introduction to Particle Tracing Module

Upload: hakien

Post on 13-Apr-2018

233 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

VERSION 4.4

Introduction toPar ticle Tracing Module

Page 2: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

C o n t a c t I n f o r m a t i o nVisit the Contact COMSOL page at www.comsol.com/contact to submit general inquiries, contact

Technical Support, or search for an address and phone number. You can also visit the Worldwide

Sales Offices page at www.comsol.com/contact/offices for address and contact information.

If you need to contact Support, an online request form is located at the COMSOL Access page at

www.comsol.com/support/case.

Other useful links include:

• Support Center: www.comsol.com/support

• Product Download: www.comsol.com/support/download

• Product Updates: www.comsol.com/support/updates

• COMSOL Community: www.comsol.com/community

• Events: www.comsol.com/events

• COMSOL Video Center: www.comsol.com/video

• Support Knowledge Base: www.comsol.com/support/knowledgebase

Part number. CM022702

I n t r o d u c t i o n t o t h e P a r t i c l e T r a c i n g M o d u l e © 1998–2013 COMSOL

Protected by U.S. Patents 7,519,518; 7,596,474; 7,623,991; and 8,457,932. Patents pending.

This Documentation and the Programs described herein are furnished under the COMSOL Software License Agreement (www.comsol.com/sla) and may be used or copied only under the terms of the license agreement.

COMSOL, COMSOL Multiphysics, Capture the Concept, COMSOL Desktop, and LiveLink are either registered trademarks or trademarks of COMSOL AB. All other trademarks are the property of their respective owners, and COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by those trademark owners. For a list of such trademark owners, see www.comsol.com/tm.

Version: November 2013 COMSOL 4.4

Page 3: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Contents

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .i

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

The Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Physics Interface List by Space Dimension and Preset Study Type 7

Boundary Conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Secondary Particles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Particle Release Mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Modeling Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Special Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Monte Carlo Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Auxiliary Dependent Variables and Residence Time . . . . . . . . . . . 15

Particle Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Particle Trajectory Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Poincaré Maps and Phase Portraits. . . . . . . . . . . . . . . . . . . . . . . . . . 16

Particle Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Operations on Particle Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Histograms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

The Model Libraries Window . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Computing Particle Trajectories through a Laminar Static Mixer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

| i

Page 4: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

ii |

Page 5: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Introduction

Particle tracing provides a Lagrangian description of a problem by solving ordinary differential equations using Newton’s law of motion. Newton’s law of motion requires specification of the particle mass, and all forces acting on the particle. The forces acting on particles can be divided into two categories, those due to external fields and due to interactions between particles. Forces due to external fields are typically computed from a finite element model, using the physics interfaces available in COMSOL Multiphysics.For each particle, an ordinary differential equation is solved for each component of the position vector. This means that three ordinary differential equations are solved for each particle in 3D and two in 2D. At each time step, the forces acting on each particle are queried from the external fields at the current particle position. If particle-particle interaction forces are included in the model then they are added to the total force. The particle position is then updated, and the process repeats until the specified end time for the simulation is reached. Since the Particle Tracing Module uses a very general formulation for computing particle trajectories, the particle tracing physics interfaces can be used to model charged particle motion in electromagnetic fields, large scale planetary and galactic movement, and particle motion in laminar, turbulent, and multiphase fluid systems.

The Applications

CHARGED PARTICLES

Charged particles in the context of this discussion refers to electrons, individual ions or small ion clusters in electric and magnetic fields. There are three primary forces that affect such particles:• The electric force, which arises either due to a gradient in the electric

potential or due to a time-varying magnetic vector potential. Particles with negative charge move in the opposite direction to the electric field and particles with positive charge move in the direction of the electric field. The electric force does work on the particles.

• The magnetic force, which does no work on the charged particles but can significantly alter their trajectory. The magnetic force often results in

Introduction | 1

Page 6: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

“banana” orbits for charged particles, causing them to orbit around magnetic field lines with a distance proportional to their mass.

• Collisional forces, which do work on the particles. This corresponds to the charged particles colliding with a background gas. The higher the background pressure, the more important the collisional forces.

If the number density of charged species is less than around 1013 1/m3, the effect of the particles on the fields can be neglected. This allows the fields to be computed independently from the particle trajectories. The fields are then used to compute the electric, magnetic, and collisional forces on the particles. The fact that the particle trajectories can be computed in their own study allows efficient and computationally inexpensive iterative solver to be used.If the density of charged particles is suitably high then it may be necessary to include the Coulomb force which acts between the particles. When particle-particle interactions are included in a model the computational requirements increase and scale with the number of particles squared. When including the Coulomb force, it is often best to start with a small number of particles, solve the model, and then assess whether or not the effect is important.Charged particles can acquire significant energy from electric fields, and when they strike surfaces secondary particles may be ejected. This may be desirable or undesirable depending on the specific application.

Photomultiplier. A single incident particle enters the modeling domain on the left side. As it strikes the first electrode, secondary electrons are ejected, which are then accelerated to the second electrode. This process continues across all 8 stages leading to an exponential growth in the electron density.

2 | Introduction

Page 7: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

If the number density of charged particles is high, the particles may significantly affect the electric field in the surrounding region. This change in the electric field, in turn, may perturb the trajectories of the charged particles. Two-way coupling between charged particles and fields can either be modeled directly, by treating the particles as point sources in the equation for the electric potential, by assigning extra degrees of freedom for the charge density and current density in each element. When modeling particle-field interactions, the space charge density due to a single particle is distributed over the element the particle is in, so modeling particle-field interactions is more accurate when the number of particles is very large.If the electric field in the region surrounding the particles is constant, the two-way coupling between particles and fields can be modeled more efficiently by coupling a time-dependent solution for the particle trajectories and charge density to a stationary solution for the electric potential. These two steps can be run in a loop until a self-consistent solution is reached. This approach can be used to efficiently model beams of ions or electrons.

PARTICLES IN FLUIDS

Motion of microscopic and macroscopic sized particles is typically dominated by the drag force acting on particles immersed in a fluid. There are two phases in the system: a discrete phase consisting of bubbles, particles, or droplets, and a continuous phase in which the particles are immersed. In order for the particle tracing approach to be valid, the system should be a dilute or dispersed flow. This means that the volume fraction of the discrete phase should be much smaller than the volume fraction of the continuous phase, generally less than 1%. When the volume fraction of the particles is not small, the fluid system is categorized as a dense flow and a different modeling approach is required.It is important to realize that with the particle tracing approach, particles do not displace the fluid they occupy.

Sparse FlowIn a sparse flow, the continuous phase affects the motion of the particles but not vice versa. This is often referred to as “one–way coupling.” When modeling such a system, it is usually most efficient to solve for the continuous phase first, then compute the trajectories of the dispersed phases. For example, in the figure below

Introduction | 3

Page 8: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

the stationary velocity field and pressure were first solved using a stationary study, and then the particle trajectories were computed in a time-dependent study.

Comet tail plot of particle trajectories through a laminar static mixer (colored). In addition, Poincaré maps show the deviation of particle trajectories from their initial position (blue & red).

Dilute FlowIn a dilute flow the continuous phase affects the motion of the particles, and the particle motion in turn disrupts the continuous phase. This is often referred to as “two–way coupling.” If the fluid flow profile and the mass flow rate of particles do not change over time, it is possible to couple a time-dependent solution for the particle trajectories to a stationary solution for the fluid flow, repeating the two steps until a self-consistent solution is reached. Otherwise the continuous and dispersed phases must be computed simultaneously. Thus, the computational demand is significantly higher when modeling dilute flows than sparse flows. When modeling fluid-particle interactions, the force exerted by each particle on the fluid is distributed over the mesh element occupied by the particle. This force may either be applied directly by using the particle positions to define a source term in the equations for fluid flow, or indirectly by assigning extra degrees of freedom in each mesh element for the volume force exerted by the particles.

Dispersed FlowIn addition to the effects mentioned above, particle-particle interactions may also need to be taken into account. This is often referred to as “four-way coupling.”

4 | Introduction

Page 9: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Particle–particle interactions can be included in models but the following limitations apply:• Hard sphere collisions are not supported. Forces must vary continuously

with respect to the distance between particles as in, for example, the Coulomb force between charged particles.

• The computation time scales as the number of particles squared. This is because every particle interacts with every other particle over all distances. There is no way to implement a cut-off scheme, where particles only see other particles within a certain radius.

• If the particle-particle interaction law is highly nonlinear, it may be necessary to use a very small time step. This is particularly true if the Lennard-Jones option is selected.

Modeling Advection and DiffusionContinuum methods have one major drawback when it comes to modeling the advection and diffusion of a particulates in a fluid. The higher the Péclet number, the more numerically unstable the method becomes. The Péclet number is the ratio of the rate of advection to the rate of diffusion. In general, continuum methods cannot handle systems where the Péclet number is above around 1000. In typically microfluidic systems, for 100 nm diameter particles in water at room temperature, the Péclet number is on the order of 108. Handling such a large Péclet number with continuum methods is clearly not possible. Particle trajectories, on the other hand, are computed in a Lagrangian reference frame, removing the restriction of the Péclet number. The Péclet number can be anything from 0 to infinity without introducing numerical instabilities. Advection is added to the particles via the drag force. Diffusion is added to particles by adding a Brownian force. If the background velocity field is zero then particle motion will be purely diffusive (zero Péclet number). If the Brownian force is neglected and the background velocity is nonzero, the motion will be pure advection (infinite Péclet number).

MATHEMATICAL PARTICLE TRACING

Particle tracing is also of interest in cases where the particles are neither charged nor immersed on a fluid. Mechanical systems may be modeled using a particle based approach, with the equations of motion specified by Newton’s second law, a Lagrangian or a Hamiltonian. Often it is easier to write down an expression for the Lagrangian or Hamiltonian for particles rather than deriving the equations of

Introduction | 5

Page 10: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

motion. The Hamiltonian formulation solves for both the particle position and the particle momentum.

Motion of stars in a galaxy using the user-defined particle-particle interaction option.

6 | Introduction

Page 11: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Physics Interface List by Space Dimension and Preset Study Type

CHARGED PARTICLE TRACING

The Charged Particle Tracing interface ( ) is found under the AC/DC branch in the Model Wizard, and can be used to model the trajectories of ions and electrons. There are predefined forces for the electric force, magnetic force, and elastic collision force. In addition, you can model particle-particle interaction using the Coulomb force.

PARTICLE TRACING FOR FLUID FLOW

The Particle Tracing for Fluid Flow interface ( ), found under the Fluid Flow branch in the Model Wizard, computes the motion of particles in a background fluid. Particle motion can be driven by drag, gravity, and electric, magnetic, and acoustophoretic forces. User-defined forces can also be added. It is also possible to compute the particle mass and temperature as well as particle-particle interactions.

MATHEMATICAL PARTICLE TRACING

The Mathematical Particle Tracing interface ( ) gives access to the underlying mathematical formalism on which the Charged Particle Tracing and Particle Tracing for Fluid Flow interfaces are built. The Mathematical Particle Tracing interface also allows for specification of particle motion in terms of either a Lagrangian or Hamiltonian. Often it is easier to write down an expression for the Lagrangian or Hamiltonian for particles rather than deriving the equations of

INTERFACE ICON TAG SPACE DIMENSION

AVAILABLE PRESET STUDY TYPE

AC/DC

Charged Particle Tracing cpt 3D, 2D, 2D axisymmetric

time dependent

Fluid Flow

Particle Tracing for Fluid Flow fpt 3D, 2D, 2D axisymmetric

time dependent

Mathematics

Mathematical Particle Tracing pt 3D, 2D, 2D axisymmetric

time dependent

Introduction | 7

Page 12: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

motion. The Hamiltonian formulation solves for both the particle position and the particle momentum, so the number of degrees of freedom doubles when the Hamiltonian formulation is activated.

8 | Introduction

Page 13: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Boundary Conditions

There are six different options available for the boundary conditions for particles when they make contact with a wall: Bounce, Freeze, Stick, Disappear, Diffuse scattering, and General reflection.The Freeze option (default) fixes the particle position and velocity at the instant a wall is struck. So, the particle position no longer changes after contact with the wall, and the particle velocity remains at the same value as when the particle struck the wall. This boundary condition is typically used to recover the velocity or energy distribution of charged particles at the instant contact was made with the wall.The Bounce option specularly reflects from the wall such that the particle momentum is conserved. This option is typically used when tracing microscopic particles in a fluid.The Stick option fixes the particle position at the instant the wall is struck. The particle velocity is set to zero. This can be used if the velocity or energy of the particles striking a wall is not of interest.The Disappear option means that the particle is not displayed once it has made contact with the wall. This option should be used if display of the particle location after contact with the wall is not of interest.The Diffuse scattering option bounces particles off a wall according to Knudsen’s cosine law. That is, the probability a particle bouncing off the surface in a given direction within a solid angle d is given by cos(q)d, where q is the angle between the direction of the particle and the wall normal. The total particle momentum is conserved.

Boundary Conditions | 9

Page 14: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

The General reflection option allows an arbitrary velocity to be specified after a particle makes contact with the wall. This can either be done in Cartesian coordinates or in the tangent-normal coordinate system. The velocity components can be functions of the incident particle velocity, energy or any other quantity. Note that the total momentum of the particle is not necessarily conserved with this option.The above boundary conditions for the particles striking the wall can be conditional based on either an expression or a probability. The Probability option applies the boundary condition with a certain probability. The Evaluation expression option only applies the boundary condition if the expression evaluates to something nonzero.

Secondary ParticlesSecondary particles can be introduced into the modeling domain when a primary particle strikes the wall. It is possible to specify the Number of secondary particles per incident particle as well as their initial velocity. The initial velocity can either be User defined, Isotropic hemisphere, which releases the secondary particles with a constant speed and hemispherical velocity direction with the north pole directed in the normal direction away from the wall, or Reflection of primary particle.

Particle Release MechanismsThere are several ways to release particles, either from a grid, by selecting specific domains, or on specific boundaries. In each case the number of particles and the release frequency can be specified. There are also specific options available for the specific release features, described below.

10 | Boundary Conditions

Page 15: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

RELEASE FROM A GRID

Particles can be released from a grid that can either be regular or graded. In addition to the initial coordinates of the particles the initial velocity and times to release the particles can be specified. There are also four predefined initial velocity distributions available to release particles with a Maxwellian, Isotropic Constant Speed, Isotropic Hemispherical, or Isotropic Conical distribution function.

RELEASE FROM A DOMAIN

Particles can be released from a domain according to the mesh associated with the model geometry or according to an arbitrary expression.

Boundary Conditions | 11

Page 16: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

When the particle release is Mesh based, there is an option to specify the Refinement factor. The higher this factor, the more particles are released from within each mesh element. When the particle release is Density based, the release of particles is weighted according to a user defined expression. This is the most flexible option for releasing particles because the weighting function can be an analytic expression, a random function, or even the solution to a partial differential equation.

INLET

The inlet feature allows for particles to be released from boundaries. Both release options for the Release from domain feature are available, as well as an additional option to release particles uniformly from a selected boundary.

12 | Boundary Conditions

Page 17: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Modeling Tools

The Particle Tracing Module provides a wide range of specialized modeling tools to assist in extracting specific quantities of interest.

Special VariablesThe particle tracing interfaces define a number of special variables, some of which can only be used during results processing. These variables can be found in the Particle statistics plot group during results processing, as shown below:

An example of variables available from the particle statistics menu and available with the Mathematical Particle Tracing interface.The following variables are defined:• Particle index. Each particle is assigned a unique index starting from 1 up to

the total number of particles. This expression can be passed into a function, which can create, for example, random forces that are unique for each particle.

• Particle release feature. If there are multiple release features in a model, it is useful to be able to visualize how the particles mix together based on their initial release position. The Particle release feature variable takes a numeric value, starting at 1, which is unique to each release feature.

• The release time of a given particle. This works for both primary and secondary particles and thus allows for extraction of the time at which particles were released into the modeling domain.

• The time at which a particle stopped at a boundary.

Modeling Tools | 13

Page 18: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

There are also variables that are only available during results processing and can only be evaluated using the Global Evaluation node under Derived Values.• Total number of particles. The total number of particles released may not be

known in advance, especially in models that include secondary particle emission.

• Total number of particles in selection. If a selection has been applied to the Particle data set, the number of particles in that selection can be evaluated.

• Transmission probability. Often the transmission probability is the main quantity of interest in a particle tracing model. The Transmission probability variable is available on domains, boundaries, or combinations of both.

Monte Carlo ModelingIt is possible to add forces on particles which are stochastic. In the Particle Tracing for Fluid Flow interface, the Drag Force and Brownian Force features potentially include random contributions. When these features are included in a model, it may be necessary to solve the problem multiple times and take some kind of statistical average of the results. Each time the model is solved, a new set of random numbers, which are used to compute the force, should be generated. The Brownian Force feature has a parameter called Additional input argument to random number generator. This value can be set by a parameter, which can then be set in a parametric sweep.All three particle tracing interfaces contain a velocity reinitialization feature. This allows for general purpose Monte Carlo modeling, since the velocity vector can be discretely changed at each timestep according to some logical expression. The Charged Particle Tracing interface exploits this functionality in the Elastic Collision Force feature. The collision probability between the charged particles and background gas are determined by the collision frequency. If a collision should occur, the charged particle has its velocity vector reinitialized according to an elastic collision with isotropic scattering. This provides an accurate description of a charged particle interacting with a background gas. It is also possible to use auxiliary dependent variables to count the collisions between each particle and each background species.

14 | Modeling Tools

Page 19: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Brownian motion for particles all starting at a single point. They diffuse outwards. Top left t = 0 s, top right, t = 10 s, lower left t = 30 s and lower right t = 100 s.

Auxiliary Dependent Variables and Residence TimeAuxiliary dependent variables can be used to help keep track of things like residence time, particle trajectory length, integrated shear rate and so forth. When an Auxiliary Dependent Variable feature is added to the physics interface an additional ordinary differential equation (ODE) is solved for each particle.The residence time can also be computed in a different way, by setting the Store particle status data property to On. This creates variables for the particle release time and the particle stop time (the time when a particle left the modeling domain). The residence time is then simply the difference between the two.

Modeling Tools | 15

Page 20: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Results Processing Tools

Particle Data SetThe Particle data set is automatically created when solving a model containing one of the Particle Tracing Module interfaces, provided that the Generate default plots option is selected in the Study. Selections may be added to the particle data set which allows, for example, the number or fraction of particles in a given domain or on a given boundary to be computed during results processing.

Particle Trajectory PlotsA Particle Trajectories plot is created automatically when a Study solving for a particle tracing interface is computed. There are options to set the particle trajectories to be rendered as Lines or Tubes. It is also possible to render the particles as points or comet tails, in which case only the location of the particles at the selected output time is shown. For models where the number of output times is small, an interpolation option is available that will create smoother looking particle trajectory plots.

Poincaré Maps and Phase PortraitsPoincaré maps are available in both 2D and 3D . This plot type is useful to visualize the particle trajectories in a plot that represents the position of the particles in a section that is usually transversal to the particle trajectories. The

16 | Modeling Tools

Page 21: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Poincaré map represents the particle trajectories in a space dimension that is one dimension lower than the original particle space.

Phase portraits are available as a 2D plot type under More Plots. Use a Phase Portrait plot to visualize large data sets of particle trajectories. The traditional use of a phase portrait is to plot the particle position on the x-axis and the particle velocity on the y-axis. Each dot in the xy-plane represents a particle.

Modeling Tools | 17

Page 22: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Particle EvaluationInformation about expressions and variables along particle trajectories can be written to the Results Table using the Particle Evaluation option under Derived Values. Once the data has been written to the results table it can be manipulated and plotted accordingly. There are options to only write data to the table for a fraction or a specific number of particles.

Operations on Particle DataIt is possible to set the source data set for the Integration , Average , Maximum and Minimum to be a Particle data set. This allows operations to be performed on the particle data set, to compute average particle velocity, maximum energy, and so on.

HistogramsStatistical information about the behavior of the particles is often best visualized with a histogram. The histogram sorts the value of a variable into a specified number of bins. The most obvious application of the histogram is that it allows for visualization of the velocity and energy distribution function of a set of particles.

FiltersVisualizing the trajectory of systems with a very large number of particles can consume a lot of computer resources and often particles obscure one another. It is possible to filter the type of particle and the number of particles which should

18 | Modeling Tools

Page 23: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

be rendered. To do this, right click the Particle Trajectories plot type and choose Filter.

The Particle type can be set to render Primary particles, Secondary particles, All, or a Logical expression.If particles are obscuring one another or the burden on the graphics card is very high, the number of particles rendered can be reduced by changing the Particles to render option. A Fraction of the total number of particles to render or the total Number of particles to render can be set.

Modeling Tools | 19

Page 24: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

The Model Libraries Window

To open a Particle Tracing Module model library model, click Blank Model in the New screen. Then on the Home or Main toolbar click Model Libraries . In the Model Libraries window that opens, expand the Particle Tracing Module folder and browse or search the contents. Click Open Model to open the model in COMSOL Multiphysics or click Open PDF Document to read background about the model including the step-by-step instructions to build it. Due to the fact that the Particle Tracing Module enhances the capabilities of other modules, some of the models utilizing the particle tracing interfaces are placed in the model library folders for other products. The following modules have additional particle tracing example models:

AC/DC MODULE

• Electron Beam Divergence• Ion Funnel• Magnetic Lens• Quadrupole Mass Filter• Quadrupole Mass Spectrometer

CFD MODULE

• Micromixer• Thermophoresis

ACOUSTICS MODULE

• Acoustic Levitator

PLASMA MODULE

• Ion energy Distribution Function

The Model Libraries are updated on a regular basis by COMSOL in order to add new models and to improve existing models. To check all available Model Libraries updates, select Update COMSOL Model Library ( ) from the File>Help menu (Windows users) or from the Help menu (Mac and Linux users).

20 | The Model Libraries Window

Page 25: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

The MPH-files in the COMSOL model library can have two formats—Full MPH-files or Compact MPH-files.• Full MPH-files, including all meshes and solutions. In the Model Libraries

window these models appear with the icon. If the MPH-file’s size exceeds 25MB, a tip with the text “Large file” and the file size appears when you position the cursor at the model’s node in the Model Libraries tree.

• Compact MPH-files with all settings for the model but without built meshes and solution data to save space on the DVD (a few MPH-files have no solutions for other reasons). You can open these models to study the settings and to mesh and re-solve the models. It is also possible to download the full versions—with meshes and solutions—of most of these models when you update your model library. These models appear in the Model Libraries window with the icon. If you position the cursor at a compact model in the Model Libraries window, a No solutions stored message appears. If a full MPH-file is available for download, the corresponding node’s context menu includes a Download Full Model item ( ).

The Model Libraries Window | 21

Page 26: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Computing Particle Trajectories through a Laminar Static Mixer

This section takes you through the modeling stages of computing particle trajectories based on a computed velocity field. In static mixers, also called motionless or in-line mixers, a fluid is pumped through a pipe containing stationary blades. This mixing technique is particularly well suited for laminar flow mixing because it generates only small pressure losses in this flow regime. This example studies the flow in a twisted-blade static mixer. It evaluates the mixing performance by calculating the trajectory of suspended particles through the mixer..

Model Wizard

Note: These instructions are for the user interface on Windows but apply, with minor differences, also to Linux and Mac.

1 To start the software, double-click the COMSOL icon on the desktop. When the software opens, you can choose to use the Model Wizard to create a new

22 | Computing Particle Trajectories through a Laminar Static Mixer

Page 27: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

COMSOL model or Blank Model to create one manually. For this tutorial, click the Model Wizard button.If COMSOL is already open, you can start the Model Wizard by selecting New from the File menu and then click Model Wizard .

The Model Wizard guides you through the first steps of setting up a model. The next window lets you select the dimension of the modeling space.

2 In the Select Space Dimension window click the 3D button .3 In the Select physics tree, select Fluid Flow>Single-Phase Flow>Laminar

Flow .4 Click the Add button.5 Click the Study button.6 In the tree, select Preset Studies>Stationary .7 Click the Done button.

Global Definit ions and Definit ions

1 On the Home toolbar, click Parameters .Note: On Linux and Mac, the Home toolbar refers to the specific set of controls near the top of the Desktop.

2 In the Parameters settings window, locate the Parameters section.

Computing Particle Trajectories through a Laminar Static Mixer | 23

Page 28: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

3 In the table, enter the following settings:

Geometry

The mixer geometry is quite complicated so start by importing it from a file.1 On the Home toolbar, click Import .2 In the Import settings window, locate the Import section.3 Click the Browse button.4 Browse to the model library folder and double-click the file laminar_mixer_particle.mphbin. The location of the files used in this exercise varies based on your installation. For example, if the installation is on your hard drive, the file path might be similar to C:\Program Files\COMSOL44\models\.

24 | Computing Particle Trajectories through a Laminar Static Mixer

Page 29: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

5 Click the Import button. You should see the geometry appear in the Graphics window as shown below.

Materials

1 On the Home toolbar, click New Material .2 In the Material settings window, locate the Material Contents section.3 In the table, enter the following settings:

Computing Particle Trajectories through a Laminar Static Mixer | 25

Page 30: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Physics interfaces

Now add an expression for the inflow velocity which is parabolic.1 On the Physics toolbar, click Boundaries and choose Inlet .2 Select Boundary 23 only.3 In the Inlet settings window, locate the Velocity section.4 In the U0 edit field, type 2*(1-(x^2+z^2)/ra^2)*u_mean.The boundary condition which was just added was rather complicated but necessary to get a fully developed flow profile. The CFD, Microfluidics and Plasma modules all have a special Laminar Inflow boundary condition which ensures laminar flow. It is not necessary to enter a complicated expression for the velocity profile, just the average velocity of flowrate.5 On the Physics toolbar, click Boundaries and choose Outlet .6 Select Boundary 20 only.

26 | Computing Particle Trajectories through a Laminar Static Mixer

Page 31: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Mesh

The mesh needs to be quite fine to ensure that the particle motion is accurate through the modeling domain. In this case, take care to ensure that the mesh is fine on the mixing blades.1 In the Model Builder window, under Component 1 right-click Mesh 1 and

choose More Operations>Free Triangular .2 Click the Wireframe Rendering button on the Graphics toolbar.3 Select Boundaries 5, 16–18, and 53–55 only.4 Right-click Component 1>Mesh 1>Free Triangular 1 and choose Size .5 In the Size settings window, locate the Element Size section.6 From the Calibrate for list, choose Fluid dynamics.7 From the Predefined list, choose Extremely fine.8 In the Model Builder window, under Component 1>Mesh 1 click Size.9 In the Size settings window, locate the Element Size section.10From the Predefined list, choose Extremely fine.11Click the Custom button.12Locate the Element Size Parameters section. In the Curvature factor edit field,

type 0.15.13In the Model Builder window, right-click Mesh 1 and choose More

Operations>Free Triangular .14Select Boundary 23 only.15Right-click Component 1>Mesh 1>Free Triangular 2 and choose Size .16In the Size settings window, locate the Element Size section.17From the Calibrate for list, choose Fluid dynamics.18From the Predefined list, choose Extra fine.19In the Model Builder window, right-click Mesh 1 and choose Free

Tetrahedral .20In the Settings window, click Build All .

Study

1 On the Home toolbar, click Compute .

Computing Particle Trajectories through a Laminar Static Mixer | 27

Page 32: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

Model Wizard

Now that the fluid velocity has been computed, add a physics interface and a new study to compute the particle trajectories.1 On the Home toolbar, click Add Physics .2 Go to the Add Physics window.3 In the Add physics tree, select Fluid Flow>Particle Tracing for Fluid Flow .4 Find the Physics in study subsection. In the Solve column, deactivate Study 1

by clicking on the green check . It will turn into a cross indicating that this physics interface will not be solved for in Study 1. This subsection will then look like the following:

5 Click the Add to Component button.6 On the Home toolbar, click Add Study .7 Go to the Add Study window.8 Find the Studies subsection. In the tree, select Preset Studies>Time

Dependent .9 Find the Physics in study subsection. In the table, click on the green check

next to the Laminar Flow interface so that this subsection looks like the following:

10Click the Add Study button.

Physics interfaces

1 On the Physics toolbar, click Domains and choose Drag Force .2 Select Domain 1 only.3 In the Drag Force settings window, locate the Drag Force section.4 From the u list, choose Velocity field (spf/fp1).5 From the list, choose Dynamic viscosity (spf/fp1).

28 | Computing Particle Trajectories through a Laminar Static Mixer

Page 33: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

The goal is to release particles in a way where they are more dense where the velocity field is higher. To do this you use the Density option for the particles Initial Position.6 On the Physics toolbar, click Boundaries and choose Inlet .7 In the Model Builder window, under Component 1>Particle Tracing for Fluid

Flow click Inlet 1 .8 Select Boundary 23 only.9 In the Inlet settings window, locate the Initial Position section.10From the Initial position list, choose Density.11In the N edit field, type 3000.12In the edit field, type spf.U.13Locate the Initial Velocity section. From the u list, choose Velocity field

(spf/fp1).14On the Physics toolbar, click Boundaries and choose Outlet .15Select Boundary 20 only.16In the Model Builder window, under Component 1>Particle Tracing for Fluid

Flow click Particle Properties 1 .17In the Particle Properties settings window, locate the Particle Properties section.18In the dp edit field, type 5E-7[m].

Study 2

1 In the Model Builder window, expand the Study 2 node, then click Step 1: Time Dependent .

2 Expand the Values of Dependent Variables section. Select the Values of variables not solved for check box.

3 From the Method list, choose Solution.4 From the Study list, choose Study 1, Stationary.5 Locate the Study Settings section. Click the Range button .6 Go to the Range dialog box.7 In the Step edit field, type 0.2.8 In the Stop edit field, type 5.

Computing Particle Trajectories through a Laminar Static Mixer | 29

Page 34: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

9 Click the Replace button. The Study settings should look like this:

10On the Home toolbar, click Compute .

Results

By default you end up in the Particle Trajectories (fpt) node after the model has finished solving. 1 In the Particle Trajectories (fpt) settings window, click to expand the Color

Legend section.2 From the Position list, choose Bottom.3 In the Model Builder window, expand the Particle Trajectories (fpt) node,

then click Particle Trajectories 1 .4 In the Particle Trajectories settings window, locate the Coloring and Style

section.5 Find the Line style subsection. From the Type list, choose Line.

30 | Computing Particle Trajectories through a Laminar Static Mixer

Page 35: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

6 Find the Point style subsection. From the Type list, choose None.7 In the Model Builder window, expand the Results>Particle Trajectories

(fpt)>Particle Trajectories 1 node, then click Color Expression 1 .8 In the Color Expression settings window, click Replace Expression in the

upper-right corner of the Expression section. From the menu, choose Laminar Flow>Shear rate (spf.sr).

9 Click the Plot button .10Click Zoom Extents in the Graphics toolbar.

Now create a new Particle data set with a selection at the outlet so the transmission probability can be evaluated.1 In the Model Builder window, expand the Results>Data Sets node.2 Right-click Particle 1 and choose Duplicate .3 Right-click Results>Data Sets>Particle 2 and choose Add Selection.4 In the Selection settings window, locate the Geometric Entity Selection section.5 From the Geometric entity level list, choose Boundary.6 Select Boundary 20 only.7 On the Results toolbar, click Global Evaluation.8 In the Global Evaluation settings window, locate the Data section.9 From the Data set list, choose Particle 2.

Computing Particle Trajectories through a Laminar Static Mixer | 31

Page 36: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

10From the Time selection list, choose Last.11Click Replace Expression in the upper-right corner of the Expression

section. From the menu, choose Particle Tracing for Fluid Flow>Particle statistics>Transmission probability (fpt.alpha).

12Click the Evaluate button . The transmission probability should be about 0.8.

One useful way of visualizing how particles mix is to use a Poincaré plot. The Poincaré plot places a colored dot for each particle at the location at which the particle passes through a cut plane (known as a Poincaré section). 1 In the Model Builder window, under Results right-click Data Sets and choose

Cut Plane .2 In the Cut Plane settings window, locate the Data section.3 From the Data set list, choose Particle 1.4 Locate the Plane Data section. From the Plane list, choose xz-planes.5 In the y-coordinates edit field, type 0.006.6 Select the Additional parallel planes check box.7 In the Distances edit field, type 0.006 0.016 0.026 0.036 0.042.8 Click the Plot button .9 On the Home toolbar, click Add Plot Group and choose 3D Plot Group.10In the 3D Plot Group settings window, locate the Data section.11From the Data set list, choose Particle 1.12Click to expand the Color Legend section. From the Position list, choose

Bottom.13On the 3D plot group toolbar, click More Plots and choose Poincaré Map.14In the Model Builder window, under Results>3D Plot Group 4 click Poincaré

Map 1.15In the Poincaré Map settings window, locate the Data section.16From the Cut plane list, choose Cut Plane 1.17Locate the Coloring and Style section. Select the Radius scale factor check box.18In the associated edit field, type 6E-5.19Click the Plot button .20Right-click Results>3D Plot Group 4>Poincaré Map 1 and choose Color

Expression.21In the Color Expression settings window, locate the Expression section.22In the Expression edit field, type at(0,qx<0).

32 | Computing Particle Trajectories through a Laminar Static Mixer

Page 37: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

23Locate the Coloring and Style section. Clear the Color legend check box.24In the Model Builder window, right-click 3D Plot Group 4 and choose

Surface .25In the Surface settings window, locate the Data section.26From the Data set list, choose Cut Plane 1.27Locate the Expression section. In the Expression edit field, type 1.28Locate the Coloring and Style section. From the Coloring list, choose Uniform.29From the Color list, choose Gray.30Click the Go to Default 3D View button on the Graphics toolbar.31Click the Plot button .

In the above figure, the location of the particles at 6 Poincaré sections are shown. The color represents the location of the particle at its initial position. So, particles marked as red had an initial position of x < 0 and particles marked as blue had an initial position of x > 0. The at() operator is used to mark the particles with the color of their initial position. The first Poincaré section (the one furthest to the left in the above figure) clearly indicates which particles start with coordinates of x < 0. As the particles begin to follow the flow field, they begin to mix together. By the end of the mixer, the particles have not mixed completely—there are still significant pockets of only red and only blue particles.

Computing Particle Trajectories through a Laminar Static Mixer | 33

Page 38: Introduction to the Particle Tracing Module · Introduction to the Particle Tracing Module ... available in COMSOL Multiphysics. For each particle, an ordinary differential equation

34 | Computing Particle Trajectories through a Laminar Static Mixer