COMSOL Multiphysics uses the Finite Element Method (FEM), which is a well-known and established approach to solving the governing Partial Differential Equations (PDEs) numerically. When solving solid mechanics applications or transport phenomena driven by diffusion, the approach is straight-forward. For convection-dominated transport problems, however, it is known that the approach can lead to numerical instabilities, namely, oscillations in the solution. COMSOL Multiphysics automatically uses stabilization methods to prevent this phenomenon. Nevertheless, some knowledge can be really helpful to understand the performance of transport simulations.

Let’s start with a general convection-diffusion transport equation for an unknown solution, u:

\frac{\partial u}{\partial t}+\beta\cdot \nabla u = \nabla\cdot(c\nabla u)+F

The parameters \beta and c refer to the convective velocity vector and the diffusion coefficient, respectively, while F represents an arbitrary source term. This equation could represent the energy equation, i.e., the heat transfer equation, mass transport equations (used for the transport of chemical species), Navier-Stokes equations for the transport of momentum in fluids, or any other transport equation. It has been mathematically proven that numerical instabilities occur when the element Péclet number \mathrm{Pe} exceeds 1:

\mathrm{Pe}:=\frac{\|\beta\|h}{2c}>1

with h being the mesh element size.

The element Péclet number relates the convective and diffusive effects. Either large convective or small diffusive activity leads to a Péclet number larger than 1. But this is only half-true, since the mesh element size plays an important role, too. The higher the mesh resolution, the smaller the element Péclet number. This also means that for every non-zero diffusion term, there exists a mesh resolution that forces the element Péclet number to a value smaller than 1 in the whole computational domain.

However, such a mesh can be computationally expensive or even unfeasible. Stabilization methods allow for simulation on coarser meshes, thus drastically reducing the computational load.

To better understand the effect of stabilization methods, let’s look at an example and solve it with COMSOL Multiphysics. We consider a time-dependent mass transfer problem. Let’s imagine we have a three meter long pipe with a plug flow (a flow with constant velocity across the pipe cross section) of water. The velocity of the plug flow is 1 m/s. At the beginning of the experiment (i.e., at t = 0), a chemical species is dissolved in the water with the following concentration:

The initial concentration (in blue) is set to 1 for x < 0 and 0 for x > 1 m. This plot also shows the analytic solution for the concentration at t = 1 s. Because the fluid velocity is equal to 1 m/s, the concentration discontinuity should be located at x = 1 m. Next, our goal is to find the evolution of the concentration profile as a function of time.

We can model this problem in 1D in COMSOL Multiphysics using the *Transport of Dilute Species* physics interface. In this physics interface, we compute the evolution in time of the chemical species concentration, driven by convection and diffusion. The velocity is set to \beta=1~\mathrm{m/s} and the diffusion coefficient to c=10^{-9} ~\mathrm{m^2/s}.

At the inlet, we prescribe a concentration of 1~\mathrm{mol/m^3}. A mesh size, \Delta x=0.05, results in element Péclet numbers around 25 \cdot10^{6}, which is far beyond the critical value of 1. After running the time-dependent solver up to t = 1 s, the following solution (solid blue line) would be obtained *without* stabilization. For comparison, we also show the analytic solution (dotted red line).

We clearly see that the computed solution is useless. Oscillations are not only present around the concentration gradients, but are spread over the whole domain. These oscillations can occur where the Péclet number exceeds one and any of the following conditions exist:

- A space-dependent initial condition, which the mesh does not resolve
- A Dirichlet boundary condition leading to a solution containing a steep gradient near the boundary and forming a boundary layer
- A small initial diffusion term close to a non-constant source term or a non-constant Dirichlet boundary condition

This mass transport example illustrates the first point, since we chose a space-dependent initial concentration profile. We can determine the mesh element size that forces the Péclet number to be smaller than 1:

h\leq \frac{2c}{\|\beta\|}=2\cdot10^{-9}

Such a small mesh element size for the whole domain would result in *more than 1 billion* elements. This should be motivation enough to consider a different option.

All transport interfaces, such as heat transfer, fluid flow, or species transport, automatically use stabilization. In order to see the corresponding settings, you first need to switch on “Stabilization” by clicking the eye symbol above the Model Builder. In the physics node, you will then find two additional sections, namely “Consistent Stabilization” and “Inconsistent Stabilization”, as shown in the screenshot for the *Transport of Diluted Species* interface:

*How to make the stabilization settings visible.*

*Stabilization settings in the* Transport of Diluted Species *interface.*

By default, consistent stabilization is checked, because this method works well for most applications.

In the following section, we will briefly explain the idea of both methods and show the corresponding results for the mass transport example. The main idea of all stabilization methods is to add additional diffusive terms, in order to decrease the Péclet number. As simple as this sounds, this introduction of additional diffusion can be realized in many different ways.

The most simple approach is to define an artificial diffusion coefficient, c_{\mathrm{art}}, as:

c_{\mathrm{art}}=\delta h\|\beta\|

and add it to the physical diffusion coefficient, c, giving an overall diffusion of c+c_{\mathrm{art}}. The parameter \delta is a tuning parameter, by which the amount of artificial diffusion can be adjusted. The corresponding element Péclet number is then given by:

\mathrm{Pe}=\frac{h\|\beta\|}{2(c+c_{\mathrm{art}})}=\frac{h\|\beta\|}{2c+2\delta h\|\beta\|}

In order to make sure that the Péclet number does not exceed 1, a tuning parameter of \delta=0.5 is needed. In practice, a smaller value is often sufficient to stabilize the calculation. That is why the COMSOL software suggests that you use \delta=0.25. Since the method adds diffusion in all directions, it is denoted as *Isotropic diffusion*. It is referred to as inconsistent, because it adds a certain amount of diffusion independently of how close the numerical solution is to the exact solution.

It is important to note that the amount of artificial diffusion depends on the mesh element size. On one hand, a high mesh resolution means *less* isotropic diffusion, but more computational effort. On the other hand, allowing a coarser mesh requires *more* isotropic diffusion and can affect the solution significantly. We need to find a balance between accuracy and effort.

This comparison for the concentration profile at t = 1 shows that for the same mesh (\Delta x=0.05), the inconsistent stabilization (blue line) introduces much more diffusion than the consistent stabilization (green line). This is the reason why the consistent stabilization is the default choice for all transport physics interfaces. That’s what we will discuss next.

Unlike the inconsistent method, the consistent method gives *less* numerical diffusion the closer the numerical solution comes to the exact solution. In other words, no diffusion is added in the regions where the mesh is fine enough.

Tip: You can read more about the mathematical details and references in the COMSOL Multiphysics

Reference Manual.

The streamline diffusion method only adds diffusion in the streamline direction, which is also known as upwinding. As seen in the next plot, amplifying oscillations can usually be avoided by this method (blue line), but steep gradients can still lead to local disturbances (known as over- or undershoots). To overcome this problem, we also use crosswind diffusion.

Crosswind stabilization (green line) does not only add diffusion in the cross direction, it also captures discontinuities and, therefore, removes the numerical under- and overshoots. Consistent stabilization methods (streamline together with crosswind stabilization) are usually more efficient, because increasing the mesh resolution converges faster to the exact solution than inconsistent stabilization does. This, in turn, means that finding a physically acceptable solution requires less computational effort and time.

The previous plot shows that the consistent stabilization removes all oscillations and numerical over- or undershoots close to the sharp concentration gradients. The results are far from the analytic solution, though. This is due to the fact that the mesh is very coarse (\Delta x=0.05) compared to the size in the transition region in the initial concentration profile (\Delta transition=0.1) and the fact that first order elements are used. The next result shows that, as we refine the mesh, the solution converges to the exact one:

The consistent stabilization methods guarantee that the problem is well resolved in space. Because we are solving a time-dependent problem, it is also a good idea to look at the time-dependent solver settings to make sure that the problem is also well resolved in time. In COMSOL Multiphysics, the accuracy of the time-dependent solver is controlled by the relative and absolute error tolerances.

The next plot shows the solution as a function of the user-defined error tolerances:

A numerical overshoot is observed when the error tolerances are too loose and disappear for tolerances of 1e^{-3}. Tighter tolerances lead to more accurate results, but increase the computational load. By default, the relative and absolute error tolerances are set to 1e^{-2} and 1e^{-3}, respectively.

The *Transport of Diluted Species* interface offers additional advanced options. One option is the internal calculation of the residual. In order to save time, it is most often not necessary to calculate the full residual for the current solution, but rather approximate it by neglecting the derivatives of the diffusion tensor components.

Moreover, you can choose between two different crosswind diffusion methods: the “Do Carmo and Galeão” (default) and the “Codina” formulation. The first reduces over- and undershoots to a minimum and works also for anisotropic meshes. In case of convergence problems, even for optimal meshes, you should switch to the second formulation. The “Codina” formulation is less diffusive compared to the “Do Carmo and Galeão” option, but can result in more undershoots and overshoots.

The stabilization settings should, in general, not be modified in the fluid flow interfaces. The Navier-Stokes equations are unstable when using the default P1 + P1 elements independently of the Péclet number, and always require consistent stabilization (refer to the work of I. Babuška and F. Brezzi for more details). Pm + Pn means that the velocity is resolved with m order computational elements, while the pressure is resolved with n order elements.

The default consistent stabilization could only be removed when the velocity is resolved at a higher order than the pressure (P2 + P1 and P3 + P2) and when the Péclet number is small. These computational elements (P2 + P1 and P3 + P2) should only be used when the flow is well resolved by the mesh. In that case, the impact of the stabilization terms on the solution is negligible anyway and removing it won’t affect your results.

The physics interfaces in the COMSOL software include stabilization methods. If you are working with your own transport equations, however, you will need to do some literature review on stabilization methods for your particular application and implement the stabilization equations yourself. A first try can consist of adding artificial diffusion to your diffusive parameter manually. This example shows how to implement stabilization terms manually.

No need to change the default stabilization settings! Our developers, here at COMSOL, have done a fantastic job adding consistent artificial diffusion so that you don’t have to worry about stability issues. The consistent stabilization helps when the mesh is too coarse and hides when the equations are well resolved by the mesh. Be aware, however, that there is another way of solving mass transport problems without any artificial or viscous diffusion.

Yes, unlike grid-based methods (i.e., finite elements, finite differences, finite volumes), *Lagrangian particle-based methods* can very efficiently model high Péclet number problems without adding artificial diffusion. This alternative method is available in the Particle Tracing Module. COMSOL Certified Consultant, Veryst Engineering, collaborated with Nordson EFD to develop computational models of their laminar static mixers and found ways to improve and optimize their performance. Using COMSOL Multiphysics and the Particle Tracing Module, they were able to exclude numerical diffusion from the simulation for a more accurate solution, using far less computational resources than had they used grid-based methods.

To get you started with COMSOL Multiphysics, our Model Library includes the example of a static mixer solved with both methods (the grid-based transport of a diluted species physics and the particle tracing physics). Again, further details on numerical stabilization and the references can be found in the COMSOL Multiphysics *Reference Manual*.

Microfluidic lab-on-a-chip systems have played a major role in recent years in shrinking the size of conventional lab-scale chemical and biological analyses to a chip-format that is millimeters to a few centimeters in size. These devices are often referred to as *micro-total-analysis-systems* (μTAS) and have profound applications in medical diagnostics, drug testing and delivery, forensic analysis, DNA analysis, and even immunoassays and toxicity monitoring. These devices offer many advantages such as point-of-care testing (POCT) and diagnostics due to their extremely small device size. The fact that they require a smaller volume of fluids is suitable for situations where samples are not available in large volumes or when reagents are expensive. These devices can also process multiple samples at once (referred to as *parallel processing*) and have low power requirement.

On-board mixing and control of fluid is important in a typical lab-on-a-chip system and often these systems require micropumps to control the fluid flow inside the channels and micromixers to accelerate the mixing process. The size of the fluid channels in these microchips typically varies between 1 µm and 500 µm. At these length scales, it is not practical to use any moving parts to build the pumps and mixers. Devices without moving parts are also more reliable. So how do you activate the flow without any moving parts? The answer is: Electroosmosis.

In the field of microfluidics, the flow is often driven by an electric field. By definition, *electroosmosis* refers to the motion of a liquid induced by an applied potential across a microchannel. Driving the flow with an electric field allows for the fabrication of pumps and mixers *without moving parts*.

To get a better understanding of how the flow is driven by an electric field, we first have to understand what happens very close to the walls inside the microchannels, at the fluid-solid interface. The majority of lab-on-a-chip devices are made out of silicon glass. When in contact with the fluid (it can be water or any buffered solution), the glass surface participates in acid-base reactions and ion exchange — we will refer to this complex process as *surface chemistry*. Because of surface chemistry, the glass surface acquires a negative density charge. The concept of electrical double layer (EDL) has been introduced as a continuum description of this surface chemistry at the walls. It reflects an unequal distribution of charges (ions) at the fluid-solid interface and consists of two layers surrounding the object:

- The first layer, known as the
*surface charge layer*, is made of ions absorbed in the surface due to chemical reactions (negative charges in this case). - The second layer, known as the
*diffusive layer*, is made of free ions attracted to the surface due to the influence of electric attraction and thermal motion. This second layer screens the surface charge and its net charge is equal to the surface charge, but has the opposite polarity.

*Electrical double layer (EDL).*

The EDL structure is summarized in the figure above, showing the distribution of ions as a function of the distance to the glass wall, as well as the potential (blue line on top) in the EDL versus a point in the electroneutral bulk. If we take a closer look at the diffusive layer, we notice that it can be further split into two parts that are separated by a slipping plane. This plane separates the immobile fluid on the left (attached to the surface), from the fluid that is free to move under the influence of tangential stress. An electric field can then be used to induce the motion of the net charge in the EDL due to the Coulomb force. Further away from the wall is the third layer, the electroneutral bulk.

Since it’s difficult to make any kind of measurement in microfluidic channels without disrupting the flow, these chips are often analyzed from a computational point of view. How can we model this using simulation software?

Three physics are involved in this problem:

- The
*electrostatics*physics contains the equations, boundary conditions, and space charges for solving for the electric potential. The electric field is recovered from the gradients of the potential field (E=-\nabla V). The space charge is obtained by summing up the contribution of the anions and the cations. The concentration of these ions is computed by the*Transport of Diluted Species*interface. - The
*Transport of Diluted Species*interface solves for the mass transport of diluted species in mixtures, solving for the species concentrations. It simulates chemical species transport through diffusion (Fick’s law), migration (when coupled to an electric field. In this case, the electrical field is computed by the*Electrostatics*interface), and convection (when coupled to fluid flow. Here, the fluid flow is computed by the*Laminar flow*interface.) - The
*Laminar flow*interface has the equations, boundary conditions, and volume forces for modeling freely moving fluids using the Navier-Stokes equations, solving for the velocity field and the pressure. The volume force, \rho_{e} E, where \rho_{e} is the electric charge density, is computed by the*Electrostatics*interface.

The thickness of the EDL is generally around a few nanometers and the concentration of the ions varies exponentially close to the wall. Since the thickness of the EDL is so small, it can be advantageous to use an approximation in this region. COMSOL includes an electroosmotic velocity boundary condition that ignores the flow field between the wall and the slipping plane, and analytically computes the velocity at the wall based on the zeta potential using the Helmholtz-Smoluchowski relation:

\textbf{u}=\frac{\epsilon_{W} \zeta_{0}}{\eta} \nabla_{T} V

The resulting models will have significantly lower computational requirements. This is a very useful approach for many practical engineering applications.

Therefore, we recommend that you first calculate the Debye length, i.e. the length of the EDL, before you set up the model using COMSOL Multiphysics. If this length is much smaller than your geometrical length scale, use the electroosmotic velocity boundary condition. If not, use the traditional no-slip velocity wall boundary condition and resolve the flow in the EDL. Remember that concentration varies exponentially with potential in the double layers; a fine boundary layer mesh is necessary to resolve the abrupt change in the double layers if the electroosmotic velocity boundary condition is not used.

In the next section I will show you two examples where this applies. The first example is of a micropump that is resolved in the whole geometry, including the EDL. The second example, a micromixer, uses the electroosmotic velocity boundary condition.

In this example, the top and bottom walls of the microchannel (length 60 nm, height 10 nm) are negatively charged (-0.02 C/m^{2}) and electrodes are used at the inlet (left boundary, 6 mV) and outlet (right boundary, 0 V) to drive the flow. The resulting electric potential, space charge distribution, and velocity field are shown below:

*Plot visualizing the electric potential computed by the electrostatics physics.*

*Plot depicting the net space charge, i.e. the contribution of the anions and the cations. The positive net charge screens the negatively charged wall.*

*Velocity plot showing the motion of the net charge in the EDL due to the Coulomb force. This model is available upon request from Tech Support.*

In order to introduce the next example, the micromixer, let’s first see what happens when sections of the top and bottom glass walls (shown in blue in the next plot) are positively charged (0.06 C/m^{2}) instead of negatively charged:

The results for the electric potential, space charge, and velocity field follow:

While the space charge is positive around negatively charged walls, it is negative around the positively charged portions. The inversion of the space charge leads to an opposite electroosmotic velocity close to the wall. This opposite near-wall velocity leads to the introduction of a swirl in the channel (as seen in the streamline patterns), which could be used to mix different chemical species.

At the microscale, flow is usually a highly ordered laminar flow, and the lack of turbulence makes diffusion the primary mechanism for mixing. While diffusional mixing of small molecules (and therefore of rapidly diffusing species) can occur in a matter of seconds over distances of tens of micrometers, mixing of larger molecules such as peptides, proteins, and high molecular-weight nucleic acids can require equilibration times from minutes to hours over comparable distances. Such delays are impractically long for many chemical analyses. These problems have led to an intense search for more efficient mixers for microfluidic systems. In the following example, the walls are negatively charged, as in the micropump example we just went over, and electrodes are used at the inlet (left boundary) and outlet (right boundary) to drive the flow. To introduce some mixing, four additional electrodes are placed on the walls of the mixing chamber. These four electrodes induce a fluctuating electroosmotic velocity at the wall:

*Plot exemplifying how the mixer operates. Two fluids with different concentrations are
used at the inlet to study the mixing process.
*

When the electric field is not applied, the flow is laminar and the diffusion coefficient is very small, so the two fluids are well separated at the outlet.

When the alternating electric field is applied, the mixing increases considerably, owing to the alternating swirls in the flow.

This blog post briefly described electroosmotic flow and the concept of the electrical double layer. You also learned how to model this type of problem within the COMSOL environment. If you want even more information about the Electroosmotic Micromixer model, you can download the model and model documentation from our Model Gallery. You can get a general overview of COMSOL’s microfluidics modeling capabilities here, or contact us for more in-depth information on how you can use COMSOL Multiphysics to model a variety of applications.

Finally, don’t forget that COMSOL is a multiphysics software, allowing you to couple the physics seen in this model to other physics. Adding the *particle tracing* physics, for instance, would allow you to model electrokinetic phenomena such as electrophoresis and dielectrophoresis.