Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

The development of lab-on-a-chip systems relies heavily on the presence and correct function of microfluidic channels and other liquid handling components that can play various roles: They can be there merely to transport liquids from A to B, or they can have more active roles, i.e., be structured in a way that can help mix two fluids, have structures that apply forces on particles, e.g., electrodes for electrical forces in order to sort particles etc. Especially in the case where microfluidic channels are needed for something more than transport, it is an advantage to have an idea how they are going to work before embarking on expensive and time-consuming production of the structures.

A very inexpensive, but not necessarily fast way of ensuring that your envisioned structures are indeed going to do what you want them to do is to simulate their function using analytical or—most often—numerical calculations. Optimization of the design can be obtained in such a way before the fabrication process and its function can be tested under several working conditions.

Although simulations provide valuable input, one should keep in mind that a simulation is only as accurate as you set it up to be. A lot of assumptions are being made when a real-life problem is put on paper, and these can in principle be wrong or at least not very good. Also, even though we can try and simulate all the effects that can take place when we do an experiment, this is in practice quite difficult. Take for example a situation where a voltage is applied in electrodes within a microfluidic channel in order to affect charged particles that flow within. You can easily calculate the force applied to the particles, as well as the particles’ trajectories. You can even simulate how the voltage will influence the liquid due to electroosmotic phenomena in some but not all cases. But there is a number of other things that could take place and which are difficult to simulate, mainly because there is no accurate model or no knowledge of the values of the parameters involved, for example electrothermal forces. For that reason you should not use all your time doing simulations. It is difficult to provide a number, as it depends on the application, but generally not more than 30 % of the total development time should be used on simulations.

This chapter will provide information about how to set up a microfluidic simulation, concentrating mainly on how to simulate flow through a channel, as well as species transport within a channel. The chapter will touch subjects such as dimensionality of the problem, i.e., simulation in 1D, 2D, etc, concepts such as the Reynolds and Péclet numbers, lumped elements for faster calculations, mesh setup and importance of a good mesh, and simulations of species diffusion and mixing. Microfluidic theory is provided in Chap. 2; therefore only little theory is going to be presented here.

A number of finite element modeling software is available, all having their advantages and disadvantages. It is not the aim of this chapter to provide recipes for one or more of these; therefore the concepts that are being presented are generalized and can be applied on any of these simulation tools. The examples presented in this chapter have all been done using COMSOL multiphysics, which is the software used by the authors currently. At the end of the chapter you will find a list with software that can be used along with a brief discussion. You can also find some interesting papers dealing with simulations of microfluidic systems.

3.1 Setting Up a Simulation: A Quick Checklist

In recent years, modern simulation software has become very user friendly and provides more or less ready solutions to almost every conceivable physics problem. A lot of the available software has preset equations to calculate not only flow, but also dielectrophoretic forces, gravitational forces, turbulent flow, etc. Quite a few can now also per default provide a decent mesh so that all you need to do is design your geometry, choose the materials and press start. Although this approach works for a lot of simple geometries and problems, it is not advisable, as one often ends up with a large geometry with a large number of elements that takes hours to solve.

Instead, one should always examine the problem at hand. Is a simulation necessary? Why? What information will come out of the simulation, which was not easily achievable by simple analytical calculations? If we establish that a numerical simulation is necessary, then the next step is to figure out what kind of problem we want to solve. Is it a pure flow problem, e.g., how the flow will look like in a complicated (perhaps 3D) geometry? Or do we also need to introduce species that can diffuse, e.g., when we want to see how a flow from an inlet can be focused by being pressed by flows from other inlets, or how diffusion works in bends? Are there other physical phenomena affecting the flow, e.g., a heat source, a moving structure or similar? Answers to these questions help us establish what kind of physics we need to include in our simulation and how the different physics are connected with each other.

This latter question, how physics are connected with each other, can save us a lot of time and computational power. Take for example the problem where two inlets merge into one channel. One of the inlets contains some species of concentration c, while the other does not. We are interested to see how the species will mix with the non-species carrying fluid in the common channel. We need to solve two problems: the actual flow of fluid in the channel and the convection and diffusion of species. Although the two problems can be solved simultaneously, there is no reason for it. The flow profile will look the same, regardless of the concentration c. However, the diffusion of the species will depend on the flow profile. This type of problems are called one-way coupled and the solution time can be greatly reduced by first solving the flow problem and then using the calculated velocity profile as input to solving the convection/diffusion problem. Should we need to change the concentration of the species, then we do not need to re-solve for the velocity, but only for the convection/diffusion problem. We use this example more in the coming sections to illustrate the various points.

When the above issues are resolved then it is time to look on the specifics of the geometry. Clearly, in real life everything is in 3D. However, a few times it is possible to take advantage of symmetries or invariability in one axis to simplify the geometry to 2D or even 1D. Doing this greatly reduces the computations and the times needed for the simulation, however, it should be applied with care. Sect. 3.4 presents details of this dimension analysis, and gives some tips and tricks on what to look for and how to apply these shortcuts.

Another geometry issue is how much of your structure you need to simulate. Let us return to the example of the two inlets that merge into a channel. Undoubtedly in practice our two inlet channels will be a few mm long before they merge and the outlet will also most likely be a few mm away from the merging region. However, modeling this many mm long system is not necessary at all. The interesting part for modeling is where the two inlet channels meet and merge and then some length inside the common channel where mixing takes place. Simple analytical calculations taking velocity and diffusion into account will provide us with an order of magnitude estimate on the length of the common channel that we need to model in order to see what is happening. The rest is just “dead space,” a part of the channel where the fluid just flows with the velocity specified. These parts can easily be replaced by the so-called lumped elements, which are described further in Sect. 3.3.

Finally, after you have set up your geometry, your physics, boundary conditions, you are ready to solve your problem. To do so you need a mesh. The quality of your mesh is directly proportional to the accuracy of your solution. A bad mesh will give you an answer, too, but whether or not that answer is accurate is another story. Mesh generation is greatly dependent on the software you use and there are many ways different software improves the mesh. But some general concepts and practices will be presented in Sect. 3.7.

3.2 How to Approach Microfluidics Modeling

Even for very simple microfluidic systems that are very easy to model in commercial simulation software packages such as COMSOL, a too hasty numerical modeling approach can lead to false or even completely misleading results. Therefore we are encouraging all students, teachers, and researchers that are planning to set up microfluidic systems, and who want to base their design on more than “Trial and error,” to consider how to proceed.

Should you go straight to the computer and start the simulation software or should you rather fetch a pen and an empty sheet of paper?

We will argue about this choice in the following.

3.2.1 The Wonders of Present Simulation Software

Within the last 10 years, simulation software packages have improved greatly! Earlier on, each element used in the modeling process, such as geometrical design, mesh, numerical solvers, and visualization should be created or performed in separate programs, and much effort laid in managing and transferring the different model elements between the required programs. The resulting simulation procedure was therefore very complex and required training and experience.

Now all the elements of a complete numerical modeling process are covered and combined in a single software, seamlessly combining all the steps from building the geometry, adding the involved physical properties and dynamics, solving the model numerically to analyzing, visualizing and exporting the final results. This greatly reduces the complexity of working with numerical modeling, and therefore their use has also become “Mainstream,” reaching out to a large group of users. This evolution is a great success for the software developers, and has boosted the use of numerical modeling within all branches of science and industry, but there is also the following catch: One might say that these programs have become too easy to use, such that you replace the actual modeling process of your system with the fixed building process supplied by the numerical modeling program. You are thereby limiting the whole process to that of the capabilities of the program.

Many essential properties of the planned system can be estimated theoretically within 10 % accuracy, which is well enough for judging if the chosen approach will fulfill the requirements originally set for the system. Moreover, the time used on achieving the theoretical estimate is often an order of magnitude smaller than the time needed to set up the numerical model. If your primary goal, during the early stage of system design, is to investigate the durability of the proposed design, then fast initial theoretical estimates will enable you to consider many alternative candidate solutions; at the same time it would require to set up one single numerical model of your first candidate solution, and make one realization for some given system-parameters.

Below in Fig. 3.1 we illustrate our view on how far both the theoretical and numerical approach can bring us towards getting insight into a given proposed system. We imagine an “insight scale-bar” or “distance to realism,” where to the far left, we have the pure concept of the system. This could be obtained by answering questions like: “Which physical and/or chemical effect do we utilize?”, “What responses are we looking for?”, and “How should a rough candidate design with the involved elements look like?” In the other end of the scale the ultimate insight into the system would be the actual experimental results, which define the far right of the scale, and while this often is the final goal, the idea of modeling systems is indeed to save time and resources in getting valuable insight into the different candidate systems before actually conducting the often laborious experimental work.

Fig. 3.1
figure 1

“Distance to reality” of different modeling approaches, with the initial concept without any insight to the left, and full insight, i.e., coming from the experimental results to the right

There is no doubt that good numerical models are superior in predicting the system responses, and thereby can reach very close to the insight gained from performing the real experiment. Therefore the range of numerical models spans an interval from close to experimental verification and a bit downward, since some systems involve very complex properties that are intrinsically hard to model numerically such that they will limit your insight obtained even from state-of-the-art numerical models. We state that well-chosen theoretical estimates can reach quite close to the level of insight given by numerical models, where again the applicability may vary depending on the type of system, as seen in Fig. 3.1. Since such theoretical estimates can be quite easy to perform, we therefore encourage all to use the essential insight that can be gained from simple theoretical models as a first approach to system design. In the following we argue for pros and cons of applying theoretical models early in the system design phase.

3.2.2 Theoretical Versus Numerical Modeling

We give in the following table our version of the pros and cons of theoretical versus numerical modeling in the early system design phase. For each kind of activity related to modeling, we compare it between “Theoretical estimates” and “Numerical simulations” by first giving a small headline, followed by a rating within the following interval of choices [(−),(~),(+),(++)], where (~) represents neutral/“either-or”. Then we give a small argument for each choice.

3.2.3 The Strength of Dimensionless Numbers

In Table 3.1, we had to reserve a double-plus (++) in rating the use of dimensionless numbers as a theoretical tool—due to its easy generation of valuable information. This information comes by comparing the mutual influence of different properties in the system.

Table 3.1 Pros and cons of theoretical estimates and numerical modeling

The simple reason that these numbers are dimensionless is that they evaluate the ratio between similar quantities, such that the most dominating forces acting in the system, or two important time-scales.

We will focus on the Reynolds number and the Péclet number, which are the most obvious choices for Lab-on-a-Chip systems, taken out of a broad palette of dimensionless numbers that are valuable in other types of systems.Footnote 1

3.2.4 The Reynolds Number

In the simplest flow systems, described only by the flow velocity and the pressure, only one dimensionless quantity is needed, namely the Reynolds number (Re) that evaluates the ratio between the characteristic inertial force and the characteristic viscous force in the system, Eq. (2.6).

The Reynolds number can be quantized by the expressions above by rewriting the governing equation for fluid flow (the Navier–Stokes equation, see Sect. 2.2) using a characteristic length-scale L and a characteristic flow speed U of the system, with the fluid density ρ, the dynamic viscosity η, or using the kinematic viscosity ν. Normally L is chosen as a small typical length-scale in the flow system, and U as the mean flow speed.

For small values of the Reynolds number, Re < 1, the viscous forces completely dominate the flow, and the flow is called laminar. Laminar flows are the steady smooth flows that are well-known from the handling of everyday thick, viscous liquids such as mayonnaise or liquid honey. This is in complete contrast to high Reynolds number fluids, where the inertial force, i.e., the weight of the fluid, dominates the motion, and such flows are called turbulent. Strong turbulent flows are seen in for example the atmosphere or violent flowing rivers, and are dominated by a complex, irregular motion of eddies on all length-scales.

Because of the sub-millimeter length-scale of channels in Lab-on-a-Chip systems, the corresponding Reynolds numbers are always low, and we can assume that the microfluidic flows are laminar. This is very handy when modeling such flows, as no spontaneous irregularities or eddies thereby occur in normal micro-channels. This makes it possible to use simple linear flow-relations as the Lumped Element modeling, presented in one of the following sections. Still you should always check if the Reynolds number is indeed below unity, before you apply such linear models.

3.2.5 Péclet Number

Once we introduce different molecular species, and thereby varying concentration fields, there are mainly two kind of transport inside Lab-on-a-Chip systems:

  • Advective transport, where the molecules follow the flow of the surrounding fluid.

  • Diffusive transport, that can either consist of Brownian motion for medium sized particles, or a diffusive flux, proportional to the concentration gradient (Fick’s law) for substances described by a related concentration field.

Whereas advective transport by laminar flows tends to create strong concentration gradients, diffusive transport smears out concentration variation. Therefore their mutual ratio gives valuable information about the general transport properties of the species, and this leads directly to the definition of the Péclet number (Pé), Eq. (2.18).

Generally, the species transport in systems characterized by small Péclet numbers (Pé < 10) will be governed by diffusion, and concentration gradients will spontaneously spread out, independently of the underlying flow pattern. On the contrary, species transport in systems characterized by large Péclet numbers (Pé > 1,000) will be strongly governed by the flow pattern, where strong concentration gradients will persist through the system. The effect of varying the Péclet number on a numerical model of how two miscible fluids merge downstream are shown below in Fig. 3.2. A side fluid inlet containing a diffusive substance is added to a main fluid flow, and the transition from low Pe diffusive transport to high Pe advective transport is clearly illustrated.

Fig. 3.2
figure 2

Numerical example, showing the influence of varying Péclet numbers. A side fluid inlet containing a diffusive substance is added to a main fluid flow, and the transition from diffusive transport to advective transport is clearly illustrated, as the Péclet number for the different examples increases in steps of one order of magnitudes. (Simulations done in COMSOL by the authors)

Knowing the three characteristic quantities (L, U, and D) of a fluidic system, the Péclet number can be computed with minimal effort, and knowing its value gives direct information about the mixing properties of the system. This will then help in deciding if diffusion does the job, or if additional means have to be taken to ensure good mixing.

In that way, dimensionless quantities give quick and important estimates, valuable for all researchers within a large group of natural and technical sciences.

3.3 Lumped Element Modeling

One of the biggest issues when modeling real systems is that the size of these is usually forbidding for finite elements simulations. Microfluidic channels are often long from inlet to outlet, however, usually only a smaller part is the “active” part of the system, which needs to be simulated. For the remaining parts basic microfluidic calculations can be applied, e.g., in order to replace the long inlet and outlet channels with equivalent hydraulic resistances. The following section will present when such a replacement is possible and how it can be calculated. An example of how a simulation result changes when this is used will be given.

3.3.1 Hydraulic Resistance

For a pressure-driven, steady-state flow of an incompressible Newtonian fluid through a straight channel (the so-called Poiseuille flow), and a constant pressure drop Δp will result in a constant flow rate Q. The proportionality factor of this relationship is called the hydraulic resistance of the channel, so that we can write the Hagen–Poiseuille law as:

$$ \Delta p={R}_{\mathrm{hyd}}Q $$
(3.1)

The hydraulic resistance has thus units of kg/m4s.

In the majority of the cases the fabricated microfluidic channels have a rectangular cross-section. The hydraulic resistance in this case is given by

$$ {R}_{\mathrm{hyd}}=\frac{12\eta L}{1-0.63\left(h/w\right)}\frac{1}{h^3w} $$
(3.2)

Where η is the viscosity of the fluid, L the length, h the height and w the width of the microfluidic channel, with h < w. Other solutions to the Navier–Stokes equation can be obtained for other channel cross-sections.Footnote 2

An important note is that Eq. (3.2) can only be derived if the nonlinear term in the Navier–Stokes equation can be neglected. This is only the case when the Reynolds number of the channel is much smaller than 1.

The hydraulic resistance is completely analogous to the electrical resistance. Therefore it can also be used in the same way, when we have straight channels connected in series or in parallel. However, one should always make sure that the Reynolds number is smaller than 1 before using these equations.

Serial and Parallel Coupling of Straight Channels

Consider two straight channels as shown in Fig. 3.3 that are connected in series or in parallel. In the case of the serial coupling the pressure drops across the two channels can be added to each other (as in the case of adding voltages in the case of two electrical resistors in series), so that the total pressure drop of the coupled channels is given by:

Fig. 3.3
figure 3

Channels connected in series and in parallel

$$ \begin{array}{c}\hfill \Delta {p}_1={R}_1{Q}_1\hfill \\ {}\hfill \Delta {p}_2={R}_2{Q}_2\hfill \end{array}\to \Delta \mathrm{p}=\left({R}_1+{R}_2\right)Q\to {R}_{\mathrm{tot}}={R}_1+{R}_2 $$
(3.3)

Therefore the total hydraulic resistance of the system is simply the sum of the hydraulic resistances of the two connected channels.

In the case of the parallel coupling of the two channels it is the conservation of the flow rate that applies, so that

$$ Q={Q}_1+{Q}_2\Rightarrow Q=\left(\frac{1}{R_1}+\frac{1}{R_2}\right)\Delta \mathrm{p}\to {R}_{\mathrm{tot}}=\frac{R_1{R}_2}{R_1+{R}_2} $$
(3.4)

Example

To demonstrate the importance of the hydraulic resistance, let us take an example of a channel that is splitting up in two outlet channels (called channel 1 and channel 2) after a certain length L. It is our intention to split the flow into two equal parts in the two outlet channels. Assuming that the lengths of these two channels are the same, this will also be the case. However, in practice, it is relatively difficult to get the lengths to be exactly the same, mainly due to fabrication uncertainties but also due to the various tubing used to connect the microfluidic channels to the outside equipment. It is important to know how a small variation in the lengths (or widths or heights) of the outlet channels can influence the flow separation. We assume that the pressure at both outlets is the same (atmospheric pressure). From Eq. (3.2) we can see that the hydraulic resistance is proportional to the length. Assume that channel 2 has a 1 % longer length than channel 1, i.e., L 2 = 1.01L 1. Then R 2 = 1.01R 1 and consequently Q 2 ≈ 0.99Q 1, which means that the flow will not be divided equally between the two outlets.

If we now decide that we would like to obtain a particular flow split ratio, other than 1, and then we can back-calculate the required ratio of the channel hydraulic resistances and use that in our simulations without having to model our entire system. Different simulation programs achieve this in different ways, but for example in COMSOL Multiphysics one can use the concept of “laminar inflow” and “laminar outflow” in order to provide the length of the channel that is after the boundary defined as outlet. By simply changing this length the flow division in the two outlet channels will change without us having to use a different geometry and a new mesh, as shown in Fig. 3.4.

Fig. 3.4
figure 4

(a) Velocity profile inside the channel at the splitting region when the hydraulic resistance ratio in the two outlets is 1:1. (b) Velocity profile when the hydraulic resistance ratio is 2:1

3.4 Illustration of Dimensional Analysis by Simple Microfluidics Example

The following example is nearly as simple as it can get, but has nevertheless caused troubles for some of our former students in a microfluidics modeling course: They had to model the flow of water from a short narrow microchannel to a wider longer microchannel. The full layout is shown below in Fig. 3.5 with specification of dimensions, and the height is the same for the two channels.

Fig. 3.5
figure 5

Illustration of the simple channel setup with specification of dimensions and flow arrows, used in the following to exemplify the different modeling approaches

Pure water is flowing through the system, so we only need to gain insight in the flow-field through the channels. The flow is driven by a pressure drop of 1 Pa (Pascal) between inlet and outlet.

3.4.1 Direct Three-Dimensional Numerical Modeling

Since the modeling of both the channel geometry and the fluid dynamics is a simple task, a direct numerical simulation of the full 3D flow-field is quickly made (with the aid of efficient simulation software) and 3D streamlines of the flow are shown in Fig. 3.6. This once and for all gives all the information needed about this simple system. Still we can utilize some properties of the system to simplify the needed model, as shown in the following.

Fig. 3.6
figure 6

Direct numerical simulation of the full 3D flow field of the given simple example. (Simulations done in COMSOL by the authors)

3.4.2 Simplification by Using a Quasi-3D Flow-Model

Since in this example, the channel height is constant, it is advantageous to model the system with a quasi-3D flow-model. As the name describes, it models the 3D flow by solving a modified flow problem in the 2D plane by averaging the velocity variations in the height dimension. To be more specific, the viscous damping of the fluid from the top and button of the channels is implemented in the quasi-3D model by an additional damping force term, denoted the Darcy damping term:

$$ {\overrightarrow{F}}_{\mathrm{Da}}=-\alpha \overrightarrow{u},\kern0.5em \mathrm{with}\ \mathrm{the}\ \mathrm{damping}\ \mathrm{coefficient}\;\alpha =\frac{12\ \eta }{h^2} $$
(3.5)

As seen above, the damping coefficient α depends only on the viscosity η and the channel height h (the direction over which the velocity is averaged), and for this quasi-3D flow-model to be accurate in the given implementation, the height should be constant, as in the case in the example. The resulting 2D flow-field is shown in Fig. 3.7 visualized by streamlines and the flow speed in color-coding.

Fig. 3.7
figure 7

Flow field calculated using quasi-3D flow model and visualized by streamlines and the flow speed in color-coding

Comparing the streamline pattern of the full 3D simulation in Fig. 3.6 and the quasi-3D flow-model in Fig. 3.7 shows that indeed the quasi-3D is capable of capturing the overall flow-pattern of the system.

3.4.3 Theoretical Estimations

Our last modeling approach is theoretical, and in this case, the applied equivalent circuit model is particularly simple. This is because the hydraulic resistance only has to be calculated for two channels, which are placed in series connection, such that the resistances just have to be added. Knowing the pressure drop, the flow-rate can be calculated, and from there the mean velocity can be estimated in the broad channel.

For the first narrow channel, the width is comparable to the height, and therefore the extended relation has to be used:

$$ {R}_{\mathrm{Hyd},1}=\frac{12\eta L}{\left[1-0.63\left(h/w\right)\right]{h}^3w}=\frac{12\times {10}^{-3}\mathrm{Pa}\;\mathrm{s}\kern0.5em 1.5\times {10}^{-3}\;\mathrm{m}}{\left[1-0.63\left(\frac{3}{5}\right)\right]\ {\left(3\times {10}^{-4}\;\mathrm{m}\right)}^3\kern0.5em 5\times {10}^{-4}\;\mathrm{m}}=2.14\times {10}^9\ \mathrm{Pa}\;\mathrm{s}/{\mathrm{m}}^3 $$
(3.6)

where we have omitted the units when entering the values for the h/w ratio.

For the second channel, the correction-term in the extended relation can be omitted as the width is much larger than the height, and we get:

$$ {R}_{\mathrm{Hyd},2}=\frac{12\eta L}{h^3w}=\frac{12 \times {10}^{-3}\;\mathrm{Pa}\;\mathrm{s}\kern0.5em 6\times {10}^{-3}\;\mathrm{m}}{\ {\left(3\times {10}^{-4}\;\mathrm{m}\right)}^3\kern0.5em 4.5\times {10}^{-3}\;\mathrm{m}}=0.593\times {10}^9\ \mathrm{Pa}\ \mathrm{s}/{\mathrm{m}}^3 $$
(3.7)

We have kept the result in units of 109 Pa s/m3 to emphasize the much larger contribution from the smaller channel than from the larger, wider channel.

Driving the fluid with a pressure difference of Δp = 1 Pa we apply the Hagen–Poiseuille law to calculate the total flow rate, where the total hydraulic resistance is just the sum of the contribution from each channel:

$$ \Delta p=\left({R}_{\mathrm{hyd},1}+{R}_{\mathrm{hyd},2}\right)\ Q $$
(3.8)

giving Q = 3.65 × 10− 8m3/s = 11.0 μL/min that relates to an approximate outlet velocity of

$$ u=\frac{Q}{w\ h}=\frac{3.65\times {10}^{-8}\;{\mathrm{m}}^3/\mathrm{s}}{5\times {10}^{-4}\;\mathrm{m}\kern0.5em 3\times {10}^{-4}\;\mathrm{m}}=2.71\times {10}^{-4}\;\mathrm{m}/\mathrm{s}=0.271\;\mathrm{m}\mathrm{m}/\mathrm{s} $$
(3.9)

As a last added bonus, we can calculate the Reynolds number:

$$ \mathrm{R}\mathrm{e}=\frac{\rho\ U\ L}{\eta }=\frac{10^3\;\mathrm{kg}/{\mathrm{m}}^3\kern0.5em 2.71\times {10}^{-4}\;\mathrm{m}/\mathrm{s}\kern0.5em 3\times {10}^{-4}\;\mathrm{m}}{10^{-3}\;\mathrm{Pa}\;\mathrm{s}}=0.081 $$
(3.10)

which is much smaller than unity, meaning that it is a creeping flow and it is valid to apply the equivalent circuit model.

3.4.4 Comparing the Different Approaches

The best way to evaluate the different modeling approaches of the example is to plot the flow profile close to the broad outlet, as shown in Fig. 3.8. In this case we have averaged over the height direction for the full 3D model (solid blue curve), and show the flow profile as a function of the distance away from the side wall. This is exactly the field calculated in the quasi-3D flow-model (solid red curve), and this enables a direct comparison, where both curves go to zero at the wall. To also compare the theoretical estimation, we have added the estimated mean flow speed (dashed blue line) which shows that a simple linear theoretical model can predict the result within 10 %. The black vertical dashed line illustrates the good “rule of thumb” that the impact from the sidewalls on the averaged velocity extends only a length-scale into the channel, approximately equal to the height of the channel.

Fig. 3.8
figure 8

Comparison of flow profiles averaged over the height direction. The full 3D model (solid blue), the quasi-3D model (solid red), and the theoretical model (dashed blue). The vertical dashed line illustrates the “rule of thumb” that the impact from the sidewalls on the averaged velocity extends only a length approximately equal to the height of the channel

3.5 When Doing Numerical Modeling: Do It Right!

We introduced this simple example because it played a trick on some students, and here is the reason why: Observing that the simple channel geometry only changes its width and length, one might be tempted to focus on these variations only, and ignoring the height of the channels. Thereby one could choose to make a pure 2D model of the given example, and that is indeed a total failure!—As will be illustrated in the following.

The resulting velocity-field of the pure 2D flow-model is shown in Fig. 3.9, and visualizing it in the same way as the quasi-3D velocity-field in Fig. 3.7, you can immediately see a difference in the flow pattern when compared to the other approaches. Now two eddies arise just after the channel has broaden. To understand this change, it is crucial to realize that all 2D models assume an infinite extension within the last direction. In this example, the flow would then broaden from an infinitely deep narrow slab out into a broader, but still infinitely deep, slab. Having this realistic interpretation of the 2D model, there would indeed be two rolls on each side of the transition between the two slabs.

Fig. 3.9
figure 9

The flow-field of the fatal choice of working with a pure 2D model, ignoring the contribution from the channel height. Visualized in the same way as Fig. 3.7

Actually a calculation of the corresponding Reynolds number gives the value 10.4, which is in nice correspondence with the existence of the two rolls, and therefore not even the value of the Reynolds number will indicate that the pure 2D approach is an erroneous model of the given example.

What should prevent such an approach is to realize that it is always the smallest extension of fluid channels that dominate the flow properties of the channel, since viscosity can be interpreted as a diffusion of momentum from the channel walls into the fluid flow.

The impact of such a gross error can be illustrated by extending the “insight scale-bar” or “distance to realism” axis, as introduced earlier, into the “negative” direction, shown below in Fig. 3.10.

Fig. 3.10
figure 10

Illustration of the impact of bad numerical models on the insight gained, by extending the “Distance to reality” axis, introduced in the beginning of the chapter

Now the bad numerical models increased the distance from “reality” beyond the initial concept, since we may be misled in the further investigations, if they are based on such false results.

The extension of the error is clearly illustrated in Fig. 3.11 by once again plotting the height averaged flow profile, as in Fig. 3.8, but now across the whole width of the broad channel and including the result from the pure 2D model as a solid black curve.

Fig. 3.11
figure 11

The flow profiles gives by the different model. Compared to Fig. 3.8 the pure 2D result totally deviates from the other models

The pure 2D velocity profile strongly deviates from all the other approaches, and that nicely emphasizes the point that it is a good habit to do a quick check of the numerical results using for example a simple lumped element model (given by the dashed blue line in Fig. 3.11 that are barely distinguishable from the exact velocity profile) instead of wasting many hours or even days pursuing the implications based from erroneous results.

3.6 Modeling Convection and Diffusion

One of the most common modeling problems in microfluidics is the transport of species in a microfluidic channel. Typical problems include mixing of two concentrations or studies of hydrodynamic focusing. In all these cases the flow problem can be solved separately and the solution for the velocity can then be used as input for the concentration problem.

In these types of models users usually experience that the concentration they obtain after solving the problem sometimes is negative or much higher than the maximum concentration they had set as input. This is a very common numerical error based on the fact that the software cannot easily deal with abrupt changes in the variable under investigation.

Let us illustrate this with an example. Take the geometry of Fig. 3.2 and reverse the flow, so that it now is a two inlet system, with the two inlets merging into a single outlet channel. If we model the system like it is shown in Fig. 3.2 we will notice that the concentration is very nice and smooth with no overshooting at any point apart from a slight “unsmoothed” region at the corner where the two inlet channels meet. This is shown in Fig. 3.12.

Fig. 3.12
figure 12

(a) The obtained velocity profile for a two inlet system exiting in one outlet. The two inlets have identical hydraulic resistances. (b) The obtained concentration profile for this system, where one inlet has been set to concentration of 1 mol/m3, while the other at 0. The result is in this case also constrained within these two limits, as expected

Although modeling this two inlet system like it is shown in Fig. 3.12 is by no means difficult it can be of interest to skip the modeling of the forked inlets and just split the inlet boundary of the outlet channel into two, half with a concentration of 1 mol/m3 and the other half with a concentration of 0. This is a particularly attractive solution in case the main channel has some complicated structures that will greatly increase both the number of mesh elements but also the complexity of the velocity profile.

In such a case you can define your concentration at the point (boundary) where the two inlet channels meet as shown in Fig. 3.13a. If we take a line profile of the concentration across the boundary it will look like a step function, as shown in Fig. 3.13b. This is usually very easily definable by using logical functions to specify the concentration, e.g., c = 1 when y > 0, for the case of Fig. 3.13a. However, such a function cannot be produced numerically and the software will try to fit it to a continuous function, as shown in Fig. 3.13b. Therefore your boundary will suddenly contain over- and undershooting of the concentration and the obtained result will not be bounded by 0 and 1 as you would expect.

Fig. 3.13
figure 13

(a) Schematic of a divided boundary for modeling two inlets with different concentrations. (b) Line profile of the actual concentration across the divided boundary (step function) along with the real concentration as will be fitted by the software in order to find a solution

The effect of this to the concentration profile obtained will of course be greatly dependent on the mesh you use on this boundary as well as the type of problem you use (stationary or time-dependent). A very fine mesh will eliminate this error to a great degree but will cost you in computation time. Time-dependent problems will also show this error even though their stationary counterparts do not—again, dependent on the mesh size. The geometry of the problem will also play a role, as well as the software that you use.

It is generally considered good practice to use functions to define the concentration at a boundary. Taking COMSOL multiphysics as an example one can define step functions, pulse functions, Gaussian functions and use these as an input to the concentration boundary. These are smoothed to begin with (by a factor we can decide ourselves) and therefore no undesirable fit occurs. However, one should take care of that the initial value is not unnaturally smoothed out by the input function. Figure 3.14 shows an example of the concentration profile obtained in the channel when using the boundary condition shown in Fig. 3.13a. The over- and undershooting is about 8 %, whereas it drops to under 4 % when using a function to define the boundary concentration. Although the difference is not that big in this particular simple channel, it can be significantly higher for more complicated geometries, with an overshooting of more than 20 % when using logical input at the boundary instead of functions.

Fig. 3.14
figure 14

Surface concentration in a splitting channel for a species with diffusion coefficient of 10−12 m2/s, with the inflow concentration boundary set as a logical function. The inset shows the concentration profiles in lines along the x axis at a height of 20 μm. The overshooting is visible everywhere along the channel, but it is highest closest to the inlet. We also notice that the division line at the inlet is not sharp but follows the mesh elements. Therefore, your starting point may differ depending on the mesh size

Simulation software is becoming better and many programs have worked around these issues and can therefore provide good solutions even though the boundary conditions are not optimal. The solution presented in Fig. 3.14 would look completely different only a handful of software updates ago. It is therefore far from certain that you will encounter such results in your simulations. However, should some overshooting arise in your solutions, it would be a good idea to check the mesh and the boundary condition definition. You should also consider that a really sharp boundary such as the one presented in Fig. 3.14 is not found in any device you may fabricate. A smoothed step function is therefore much closer to reality.

3.7 The Importance of a Good Mesh

One of the most important parameters that can influence the solution of a certain problem is the quality of the mesh. In fact, this is also one of the steps in a simulation that may cause you the most problems. A bad mesh may not only result in a bad solution but also—more often—in no solution at all. Ironically, making a mesh is also one of the most difficult parts of a simulation, not only for beginners but also for more advanced users.

A very crude guideline is that the larger the number of elements, the better the mesh in terms of obtaining a correct solution. However, this only holds true to a certain degree. At some point in time further increasing the mesh size will only increase the computational complexity without really offering any advantages for the solution.

Let us illustrate this with a simple example. Assume that you have a microfluidic channel that is 20 μm high and 200 μm long, while the width is much larger than the height. We can therefore approximate the flow in a 2D geometry. The expected flow is of course laminar and therefore we expect to see a parabolic flow profile across the channel height. The input flow rate for a channel that is 50 μm wide is set to 1 ml/h. This corresponds to a 2D flow rate of 5.5556 × 10−6 m2/s, which should be constant along the channel length. Figure 3.15 shows the calculated flow rate in units of % of inlet flow rate in the middle of the channel as a function of mesh size. Clearly, we cannot get the correct flow rate by using only a few number of elements. Increasing the number of elements from 60 to about 4,000 provides a huge improvement to the solution. Further increasing the number of elements to 30,000 does not change the obtained solution significantly, so increasing the number of elements above 4,000 only contributes to a greater computational load and not to the improvement of the solution. This mesh convergence graph is something you should do at least once when you have a new problem. The parameter that you monitor is something that should have a well-known value that you can compare your solution to.

Fig. 3.15
figure 15

Mesh convergence data for the calculated flow rate compared to the input flow rate. There is a great improvement by increasing the number of elements from 70 to 4,000

Another guideline for creating good meshes is to make sure that your mesh is detailed, i.e., use smaller mesh elements, where you expect your solution to change rapidly spatially. If you expect your solution to change from 0 to a maximum value for example within 2 μm from a certain boundary, then it will be a good idea to include at least a few elements in those 2 μm, otherwise you will not be able to resolve the change. Most software available lets you manipulate the mesh on every level, i.e., domain, boundary, edge, or even point, so such action is possible, as long as you have a certain idea about how your solution should look like.

Let us illustrate this with another example. Assume again that you have a microfluidic channel that is infinitely wide so that you can do the simulation in 2D. In a small part of the channel bottom and top you have a concentration (1 mol/m3) of small molecules diffusing into the channel with a diffusion coefficient of 10−12 m2/s. You are interested to see what the concentration of your species will be in the channel at steady state conditions given a certain flow of liquid from left to right (see Fig. 3.16).

Fig. 3.16
figure 16

The velocity profile in the microfluidic channel. The two diffusion inlets are marked with dotted lines. The axes are distances in μm. The inlet is at 0 μm (x axis) and the outlet at 300 μm (x-axis)

Clearly, the most interesting part from the diffusion point of view is the region immediately above and below the bottom and top diffusion inlets. To obtain a good solution for the steady state concentration in the channel we should therefore have a thin mesh close to these two boundaries. For the sake of the argument we will create a thin mesh only on the bottom boundary and a very crude mesh at the top boundary, as shown in Fig. 3.17.

Fig. 3.17
figure 17

The mesh of the domain for solving for the concentration. For the sake of the argument we have used a very fine mesh on only one of the diffusion boundaries

The solution of the problem using the mesh of Fig. 3.17 is shown in the inset of Fig. 3.18a. As the problem is completely symmetric, there should not be any differences in the concentration between the bottom half and the top half of the channel. This is clearly not the case and the diffusion from the top boundary which was poorly meshed is not only not well resolved but also results in the calculation of negative concentrations. Figure 3.18a shows the concentration profile at five different points in the channel. The same graphs are presented in Fig. 3.18b when the mesh on the top boundary is also thin. You can clearly see that choosing a mesh that can resolve the physics you are solving is very important in this case.

Fig. 3.18
figure 18

(a) Solution of the convection/diffusion problem when using the mesh of Fig. 3.17. The effect of the mesh size can clearly be seen: although the concentration profile on the bottom boundary has been resolved, the same is not the case for the much rough meshed top boundary. (b) The correct solution of the problem, when using a good mesh on both boundaries

3.8 Software and Further Reading

As has been mentioned in the previous sections, there are a lot of different simulation programs available that can perform numerical calculations. Table 3.2 presents a few of these, although the list is not by any means complete. Which one you choose depends mainly on your simulation experience, knowledge of the program by you or your colleague as well as by license availability and price. Some programs are not limited to microfluidic simulations but are more general, while others are very specific to fluids.

Table 3.2 Some of the available software for microfluidic simulations together with a brief description

There is a lot of literature showing how simulations help the design of lab-on-a-chip systems or provide explanations for experimental results. Some examples are presented in Table 3.3.

Table 3.3 A few examples of publications utilizing numerical simulations

3.9 Conclusion

In this chapter we have tried to give an introduction to how one should approach simulations of microfluidic systems. If you are a beginner in the field, this chapter has hopefully provided some insight into how to start your simulation and how to proceed, with the focus being primarily on the most common sources of errors and the suggested solutions. The most important take home message is that simulations can and do provide false results if they are not set up properly. The key to success lies in following these few steps:

  1. 1.

    Always start by taking a piece of paper and a pen and do some simple calculations that will give you insight into the nature of your problem. The simplest thing to start with is to calculate the relevant dimensionless numbers.

  2. 2.

    Check how you can simplify your geometry properly by utilizing symmetries, quasi-2D if applicable, lumped modeling.

  3. 3.

    Carefully consider your input parameters, boundary and domain settings.

  4. 4.

    Create a mesh that will provide you with the level of detail you expect.

  5. 5.

    Always verify that the solution you get also makes sense.