On a windy December morning in 1903, the Wright brothers prepared to make an attempt at flight in Kitty Hawk, North Carolina. Orville Wright took control of the plane and, making history, flew for 12 seconds across a distance of 120 feet. This groundbreaking moment marked the world’s first successful powered flight.
The Wright brothers were aviation pioneers, flying the first powered airplane in 1903.
Since that time, we have continued to take to the air, with airplanes growing in size and strength. While modern airplanes may fly much farther than the Wright brothers’ plane, they still obey the same laws of physics. A force known as lift holds airplanes aloft by opposing the weight of the airplane, thus enabling these machines to soar high above the ground.
By being able to easily compute lift and drag forces on an NACA airfoil with a customized simulation app, we can optimize these designs for aeronautical applications. Let’s get started…
The NACA Airfoil Optimization app allows for the computation of the lift and drag forces on a fully parameterized NACA airfoil. The fourdigit NACA airfoil is an airfoil shape developed by the National Advisory Committee for Aeronautics (NACA), the precursor to the National Aeronautics and Space Administration (NASA).
The basic geometry of an NACA airfoil.
The naming convention for the airfoil is as follows:
The NACA 2412, for instance, is an airfoil with a maximum camber of 2%, located at 40% of the leading edge. Its maximum thickness is 12% of the chord. The NACA 2412 is the default airfoil in this app.
The airfoil geometry is fully parametric and the app incorporates the Optimization interface to find the wing geometry parameters that maximize the lifttodrag ratio.
The app’s user interface.
You can choose to enter the airfoil parameters and Reynolds number directly, or let the app’s optimization solver find the right geometry parameters to maximize the lifttodrag ratio. The app computes and displays the flow velocity and pressure, the lift and drag coefficients, as well as the optimized geometry and its parameters.
COMSOL Multiphysics has a userfriendly interface, but building an airfoil model can still be a complex task. As the modeling engineer, you have to build the geometry and select the right fluid flow interface based on the flow regime. If the flow is turbulent, you also need to select the right turbulence model. This process requires both time and simulation expertise.
With the NACA Airfoil Optimization app, building the geometry, choosing the correct fluid flow interface, and postprocessing are already taken care of when you design the app. The resulting app can therefore be deployed to your colleagues and customers for production uses.
Because the geometry is fully parameterized, the app can model any NACA wing geometry. The same is valid for the flow regime: The appropriate fluid flow interface is automatically chosen by the app based on the Reynolds number. Low Reynolds number simulations are performed on a coarse mesh with the Laminar Flow interface. Higher Reynolds number simulations use the SpalartAllmaras turbulence model, which has been specifically developed for airfoil simulations. Both of these fluid flow interfaces allow for accurate computation of the lift and drag forces.
The app user specifies the flow regime in the app through the Reynolds number. Since the app is meant for a nonspecialist who might not be familiar with the Reynolds number, the Compute the Re number button allows the user to calculate the Reynolds number based on wing chord length, wind or flow speed, as well as fluid density and viscosity.
While the Application Builder and COMSOL Server™ are initially meant to manage and deploy your simulations, you can also use the Application Builder to extend the capabilities of the Model Builder for your own needs. The Application Builder and the included Method Editor allow for easy access to the COMSOL API. For the NACA Airfoil Optimization app, the API is used to create a plot that can’t be built automatically in the Model Builder.
Pressure distribution on the airfoil, plotted using the Method Editor and COMSOL API.
Open the NACA Airfoil Optimization example app, explore its functionality, and use the same methodology to build your own apps. This particular example teaches you how to create an app that can optimize the airfoil geometry for a given objective, automatically switch physics interfaces and meshes based on user input, and create advanced plots for easy postprocessing.
There are many more ways that you can benefit from the Application Builder and COMSOL Server™. You could use this app for teaching purposes and use the pressure distribution plot to explain to your students how the pressure difference on both sides of the airfoil creates an upward lift. The students could then test different airfoil parameters to try to improve the wing design and get some physical understanding of the lift without having any CFD background. Additional ways to use the Application Builder are detailed in this previous blog post.
For our example, we will use a model that couples the NavierStokes equations and the heat transfer equations to model natural convection in a square cavity with a heated wall. The temperature on the left and right walls is 293 K and 294 K, respectively. The top and bottom walls are insulated. The fluid is air and the length of the side is 10 cm.
We will use this model to compare the computational cost of three different modeling approaches:
Each of these three approaches and their variables are defined here.
In COMSOL Multiphysics, the model is solved with a stationary study using the Laminar Flow, and Heat Transfer in Fluids interfaces, and the NonIsothermal Flow multiphysics coupling:
While setting up the model, it is important to check whether the flow is laminar or turbulent. For a natural convection problem, this is done by calculating the Grashof number, Gr. For an ideal gas, it is defined as
The Grashof number is the ratio of buoyancy to viscous forces. A value below 10^8 indicates that the flow is laminar, while a value above 10^9 indicates that the flow is turbulent. In this case, the Grashof number is around 1.5 \times \hspace{1pt} 10^5, meaning that the flow is laminar.
When using the full NavierStokes equation, we set the buoyancy force to \rho \mathbf{g}:
The buoyancy term is added using a volume force feature. The terms nitf1.rho and g_const represent the temperature and pressuredependent density, \rho, and the gravitational acceleration, \mathbf{g}, respectively.
When using the NavierStokes equations with pressure shift, we have to make three changes.
First, we need to change the definition of the volume force to (\rho\rho_0)\mathbf{g}, as such:
The term rho0 refers to the reference density \rho_0.
Next, we evaluate the reference density \rho_0 and the reference viscosity \mu from the material properties in a table of variables:
Here, pA and T0 represent the reference temperature and pressure.
The air viscosity is set to the constant \mu_{0}:
Finally, when using the Boussinesq approximation, we need to set the buoyancy force to \rho_0\frac{TT_0}{T_0}\,\mathbf{g}:
As with Approach 2, we also evaluate the reference density and viscosity from the material properties. A third and final step with Approach 3 is to set the fluid density to the constant reference density \rho_{0} (the Boussinesq approximation states that the density is constant except in the buoyancy term).
Note: If your model includes a pressure boundary condition (open domain), set the pressure to the hydrostatic pressure rho0*g_const*y for Approach 1 or to 0[Pa] for Approach 2 and Approach 3. The boundary conditions for models including gravitational forces are also discussed here.
The mesh is made of 15,000 triangular elements and 1,200 boundary layer elements. These are firstorder elements.
The resulting velocity magnitude and streamlines are nearly identical for all three approaches. The maximum temperature difference between Approach 1 and 2 is less than 2 \times \hspace{1pt} 10^{6} K and the maximum temperature difference between Approach 1 and 3 is around 5 \times \hspace{1pt} 10^{4} K. The only thing that differs is the simulation time.
Velocity magnitude and streamlines.
Because of the short running time of this 2D simulation (around 30 seconds), we look at the computational load by comparing the number of iterations it takes the solver to converge to the steadystate solution. The number of iterations, in this case, is nearly proportional to the CPU time.
The table below compares the number of iterations across all three approaches.
Approach 1  Approach 2  Approach 3  

Number of Iterations  39  55  55 
These results are very surprising!
While the Boussinesq approximation is supposed to reduce the nonlinearity of the model and the number of iterations required for convergence, the full NavierStokes equations (39 iterations) can be solved faster than the Boussinesq approximation (55 iterations). We also note that the use of NavierStokes equations with a pressure shift leads to the same number of iterations as the Boussinesq approximation.
To better understand these results, we can run a second set of simulations after disabling the pseudo timestepping algorithm. Pseudo time stepping is used for stabilizing the convergence toward steady state in transport problems. The pseudo time stepping relies on an adaptive feedback regulator that controls a Courant–Friedrichs–Lewy (CFL) number. The pseudo time stepping is often necessary to get the model to converge. In this particular case, however, it is not needed .
Here’s a look at the COMSOL Multiphysics settings window for the default solver settings with pseudo time stepping:
The following snapshot shows the updated solver settings without pseudo time stepping. We recommend that you always keep pseudo time stepping switched on, unless you feel comfortable tuning the solver settings.
Note on the solver settings for natural convection:
Due to the very strong coupling between the laminar flow and heat transfer physics in natural convection modeling, always use a fully coupled solver. The COMSOL software automatically switches to a fully coupled solver when a volume force is added in the laminar flow physics, meaning that you are modeling natural convection.
This second table shows the number of iterations without pseudo time stepping:
Approach 1  Approach 2  Approach 3  

Number of Iterations  9  7  7 
These results make more sense than the previous ones with pseudo time stepping. This is because Approach 3, the most linear problem, now converges faster than Approach 1. What is surprising is that Approach 2 and Approach 3 converge with the same number of iterations.
Comparing these results with the first set of results, a speedup of 8 (from 55 to 7 iterations) is observed for the third approach — the Boussinesq approximation. These results also indicate that the number of iterations in the first set of results not only depend on the linearity of the problem, but also on the tuning of the pseudo timestepping algorithm.
Here, we have discussed the implementation and benefits of the Boussinesq approximation as well as using the pressure shift method. The results show that, for this particular model, there are no real benefits in terms of computational time for using the Boussinesq approximation, regardless of whether or not pseudo time stepping is enabled. This is generally the case since the Boussinesq approximation is only valid when the nonlinearity is small. A much shorter computational time for the Boussinesq approximation with respect to the full NavierStokes equations would indicate that the Boussinesq approximation might not be valid.
Because of the small speedup observed with the Boussinesq approximation and the fact it is not always easy to know a priori if the Boussinesq approximation is valid, we generally recommend solving for the full NavierStokes equations. Implementing the pressure shift (Approach 2 and 3), however, does avoid roundoff errors and simplifies the implementation of timedependent problems as well as models with open boundaries. This will be the object of a future blog entry.
Using Approach 3 (Boussinesq approximation with pressure shift) involves more implementation steps and does not reduce the number of iterations as compared with Approach 2 (NavierStokes equations with pressure shift). The final simulation time might be slightly shorter for Approach 3, since it does not require the evaluation of the temperature and pressuredependent density and the temperaturedependent viscosity, but this speedup might not be noticeable.
The number of iterations is reduced by a factor 4 to 8, depending on the chosen approach, by disabling the pseudo timestepping algorithm. Please keep in mind, however, that most problems will not converge without pseudo time stepping or other load ramping or nonlinearity ramping strategies.
You can set up and solve this model using the CFD Module or the Heat Transfer Module. If you have any questions about the models that I’ve presented here, contact our Technical Support team. If you are not yet a COMSOL Multiphysics user and would like to learn more about our software, please contact us via this form — we’d love to connect with you.
]]>
Journal bearings are typically used to support a rotating shaft. They are made of two parts: a shaft (or journal) rotating in a fixed bearing. To reduce the friction and wear between the fixed bearing and the rotating shaft, the thin gap between these two parts is filled with a viscous fluid, such as oil, thus avoiding surfacetosurface contact. This lubricant also damps undesirable mechanical vibrations. This thin layer of fluid is referred to as the lubrication layer. Its thickness is ideally in the realm of thousandths to hundredths of a millimeter.
Because of the loads applied to the bearing and the shaft, the lubrication layer’s thickness is not constant, and neither is the flow pressure. When the flow pressure drops below the ambient pressure, the air and other gases dissolved within the lubricant are released. This phenomenon, characteristic of loaded bearings, is known as cavitation or gaseous cavitation.
Schematic of a journal bearing.
In some cases involving highfrequency varying loads, as in internal combustion engines, the pressure might drop below the oil vapor pressure (which is lower than the ambient pressure). In this case, bubbles are formed by rapid evaporation/boiling of the oil. This phenomenon is known as vapor cavitation.
Being able to predict the onset and extent of cavitation in the lubrication layer is important for two main reasons:
The pressure of the lubricant can be computed from the Reynolds equation. This equation is not solved in the threedimensional fluid domain between the bearing and the shaft, but instead on a twodimensional surface within the gap.
Therefore, the clearance between the shaft and the bearing is not represented in the geometry, where the two parts are in contact. This “lower dimension” approach drastically reduces both the CPU usage and memory load during the model resolution. In the COMSOL Multiphysics simulation software, the Reynolds equation has been modified to account for gaseous cavitation effects.
This tutorial from our Model Gallery predicts the onset and extent of cavitation in the lubrication layer of a journal bearing. The color represents the mass fraction of the lubricant in the cavitation region. The white contour shows the outline of the region of cavitation. (This model requires COMSOL Multiphysics and the CFD Module.)
At the COMSOL Conference 2013 Rotterdam, Rob Eling from Mitsubishi Turbocharger & Engine Europe presented his work where he used COMSOL Multiphysics and the thin film physics interface to evaluate the risk of rotor instability caused by the interaction between the rotor and the bearings in a turbocharger.
Image Credit: R. Eling, Mitsubishi Turbocharger & Engine Europe, Almere, The Netherlands.
This highly nonlinear analysis involves two main components:
The coupled analysis of this problem enables the prediction of the following critical performance criteria:
Because of the complexity of the model, the problem was tackled in three steps.
The first step involved performing an analysis of the rotor dynamics (i.e., the structural mechanics problem without considering the bearings):
Image Credit: R. Eling, Mitsubishi Turbocharger & Engine Europe, Almere, The Netherlands.
In the second step, he performed an analysis of the hydrodynamic bearings:
Image Credit: R. Eling, Mitsubishi Turbocharger & Engine Europe, Almere, The Netherlands.
Finally, he ran an analysis of the coupled rotorbearing system:
Image Credit: R. Eling, Mitsubishi Turbocharger & Engine Europe, Almere, The Netherlands.
Eling ran simulations over the full operating range and showed the presence of many interesting — and potentially dangerous! — selfinduced vibrations of the system due to the fluidstructure interactions between the rotor and the bearings.
For more information on the research shown here, please refer to Eling’s paper “Dynamics of Rotors on Hydrodynamic Bearings“, as presented at the COMSOL Conference 2013 in Rotterdam. If you have any questions, please contact your local technical support team.
]]>
The COMSOL Multiphysics software’s multiphase flow capabilities cover a wide range of applications, including:
These application areas are covered by six different physics interfaces, and it is not always trivial to determine which physics interface is better suited to solve your particular application.
Screenshot of the model tree displaying the six interfaces.
In this blog post, we describe these six multiphase flow physics interfaces to make it easier for you to choose. Very specific application areas, such as twophase flow in porous media or cavitation problems, will be the object of future blog entries.
The six multiphase flow models can be split into two main categories, which we will refer to as the interface tracking methods and the disperse methods.
The interface tracking methods model the flow of two different immiscible fluids separated by a clearly defined interface. These methods are typically used to model bubble or droplet formation, sloshing tanks, or separated oil/water/gas flow. In the below example by the Philips® FluidFocus team, the meniscus between two immiscible liquids is used as an optical lens.
Image credit: Philips.
The shape of the meniscus in this device is controlled by changing the voltage applied to the conducting liquid, thus changing the focal point of the lens. The lens is then integrated within a miniature variablefocus camera. Because the exact location of the interface is of interest here, the FluidFocus team used an interface tracking method in their numerical model.
A tutorial showing how to reproduce this model can be found in our Model Gallery.
While the interface tracking methods are accurate and provide a clear picture of the flow field (velocity, pressure, and surface tension force), they are not always practical due to their high computational cost. Thus, the interface tracking methods are generally better suited to microfluidics problems in which only a few droplets or a few bubbles are tracked.
Largerscale simulations involving a greater number of bubbles, droplets, or solid particles require computationally cheaper methods. Cue: the disperse methods.
This second category of methods does not explicitly track the position of the interface between the two fluids, but instead tracks the volume fraction of each phase, thus lowering the computational load. A circulated fluidized bed, which is a very common apparatus in the food, pharmaceutical, and chemical processing industries, can be modeled using a disperse method.
In this example, the dispersed phase, consisting of solid spherical particles, is fluidized by air and transported upwards through a vertical riser:
Tracking every single solid particle would not be computationally practical here. Instead, we compute the volume fraction of solid particles. The disperse methods are typically used to model particleladen flow, bubbly flow, and mixtures.
In the next few sections of this blog post, I will discuss and compare the different tracking and homogeneous methods.
The disperse methods include the following:
The EulerEuler model simulates the flow of two continuous and fully interpenetrating incompressible phases. Typical applications are fluidized beds (solid particles in gas), sedimentation (solid particles in liquid), or transport of liquid droplets or bubbles in a liquid.
This model requires the resolution of two sets of NavierStokes equations, one for each phase, in order to calculate the velocity field for each phase. The volume fraction of the dispersed phase is tracked with an additional transport equation.
The EulerEuler model is the correct twophase flow method to model the fluidized bed that I presented earlier. The model relies on the assumption that the dispersed particles, bubbles, or droplets are much smaller than the grid size.
The EulerEuler model is the most versatile of the three disperse models, but it comes at a high computational cost. The model solves for two sets of the NavierStokes equations, instead of one, which is the case for all other models presented here. Both the bubbly flow and mixture models are simplifications of the EulerEuler model and rely on additional assumptions.
The bubbly flow model is used to predict the flow of liquids with dispersed bubbles. It relies on the following assumptions:
In this model of an airlift loop reactor, air bubbles are injected at the bottom of a reactor filled with water:
The bubbly model solves one set of NavierStokes equations for the flow momentum, a mixtureaveraged continuity equation, and a transport equation for the gas phase. Although this model does not track individual bubbles, the distribution of the number density (i.e., the number of bubbles per unit volume) can still be recovered. This can be useful when simulating chemical reactions in the mixture.
The mixture model is used to simulate liquids or gases containing a dispersed phase. The dispersed phase can be bubbles, liquid droplets, or solid particles, which are assumed to always travel with their terminal velocity. While this model can be used for bubbles, it is recommended to use the bubbly flow model instead for gas bubbles in a liquid.
The mixture model solves one set of NavierStokes equations for the momentum of the mixture, a mixtureaveraged continuity equation, and a transport equation for the volume fraction of the dispersed phase. Like the bubbly model, the mixture model can also recover the number of bubbles, droplets, or dispersed particles per unit volume.
The mixture model relies on the following assumptions:
This tutorial models the flow of a dense suspension consisting of light, solid particles in a liquid placed between two concentric cylinders.
Particle concentration.
I have summarized the disperse models for you in a table:
EulerEuler Model  Bubbly Flow Model  Mixture Model  

Valid for these continuous phases: 



Valid for these dispersed phases: 



Assumptions: 



Equations solved for (laminar flow): 



Available turbulence models: 



These three multiphase flow models require the CFD Module. The mixture model for rotating machinery problems also requires the Mixer Module. More details on the required COMSOL products can be found in our specification chart.
The interface tracking methods include:
All these methods very accurately track the position of the interface between the two immiscible fluids. They account for differences in density and viscosity of the two fluids, as well as effects of surface tension and gravity.
With the level set and phase field methods, the interface is tracked using an auxiliary function, or color function, on a fixed mesh.
The NavierStokes equations and the continuity equation are solved for the conservation of momentum and mass, respectively. The color function, and therefore the interface position, is tracked by solving additional transport equations (one additional equation for the level set method and two additional transport equations for the phase field method). This color function varies between a low value (0 and 1 for the level set and phase field methods, respectively) in one phase and high value of 1 in the second phase.
The interface is diffuse and centered on the center value of these functions (0.5 and 0 for the level set and phase field methods, respectively). The material properties of both phases such as the density and viscosity are scaled according to the color function.
This plot shows the filling of a capillary channel using the level set or phase field method. The higher value of the color function (red region) shows the location of the fluid phase, while the lower value (blue region) represents the gas phase. The two phases are separated by a diffuse interface that is not aligned with the fixed mesh.
The phase field method, which is physically motivated, is generally more numerically stable than the level set method and is compatible with fluidstructure interactions. The level set method, however, usually represents surface tension slightly more accurately than the phase field method.
Unlike the level set and phase field methods, which are solved on a fixed mesh, the twophase flow moving mesh method tracks the interface position with a moving mesh using the ALE method.
Here, the same capillary filling simulation is implemented using the moving mesh method. This time, the interface is sharp and it follows the boundary between the fluid and the gas domain. Because the position of the interface is given by the boundary between the two meshes, it does not require any additional transport equations. Only one set of NavierStokes equations is solved on each mesh.
Since physical interfaces are usually much thinner than practical mesh resolutions, the twophase flow moving mesh technique offers the most accurate representation of the interface. This method also accounts for mass transport across the interface, which is very difficult to implement using the two other interface tracking methods. Finally, the sharp interface also means that different physics can be solved in the domains on either side of the interface.
The main drawback of the moving mesh methods is the fact that the mesh must deform continuously, which means that problems involving topological changes cannot be solved. This drastically limits its applications. Problems such as droplet breakup or the transition from jetting to dripping of a liquid jet cannot be modeled using the moving mesh method and require the level set or phase field method. This jet instability simulation shows the breakup of a jet into droplets over time using the level set method.
Liquid regions (shown in black).
Tutorials for the droplet breakup and jet instability simulations are available in the Model Library and our online Model Gallery.
As with the homogeneous models above, I have put the interfacing tracking methods in a table for an easy overview:
Level Set  Phase Field  Moving Mesh  

Applicability: 
Does not support topological changes 

Accurate representation of the interface:  Better  Good  Best 
Speed and convergence:  Good  Better  Best 
Equations solved for: 



Available turbulence models: 



Required COMSOL products for laminar flow:  
Required COMSOL products for turbulent flow: 
In this blog post, we compared six different twophase flow methods. The COMSOL Multiphysics simulation software does offer additional multiphase flow methods, including twophase flow methods in porous media or cavitation in thin films, such as journal bearings. These topics will be the object of future blog entries.
If you have any multiphase flow modeling questions, feel free to contact our Technical Support team. If you are not yet a COMSOL Multiphysics user and would like to learn more about our software, please contact us via this form — we’d love to connect with you.
PHILIPS is a registered trademark of Koninklijke Philips N.V.
]]>
As I’m writing this, it’s Friday and we’ve had a long and very productive week. Like me, you’re probably wondering what type of IPA you will order with your nachos later. We are quite lucky to have such a wide selection of beers available in the U.S., thanks to the recent rise of craft beers. But rather than going to our local micro brewery, we could take it a step further and attempt to make our own beer.
Here, we give you a crash course on beer brewing and explain how you can improve the brewing process with CFD simulations. The main purpose is to find out how to cool down five gallons of boiling water as quickly as possible. But, first: Some context.
Making your own beer is relatively straightforward. If you can make tea, you can probably make beer.
Here’s my list of seven steps to brewing beer:
That’s the standard procedure. But, why settle for standard when we can improve the process? Most of the above steps can be optimized with simulations. Let’s start with the most crucial one — Step 3: Cooling the wort.
In Step 3, the boiling wort needs to be cooled down very quickly for several reasons.
First of all, it needs to be cool enough for the yeast to survive. Second, cooling it limits the production of sulfur compounds and other contaminants during the cooling process. These compounds are associated with offflavors in the finished beer. Finally, some proteins need to be thermally shocked in order for them to precipitate.
We won’t go into these reasons in detail, as we prefer to focus on the engineering aspect of the process. The size of a typical home brew batch is between five and ten gallons. The problem of cooling down the liquid quickly becomes even harder in an industrial setup, where the amount of wort to be cooled down is massive.
I’ve seen on YouTube that you might try throwing ice in the boiling kettle. I would not recommend this as it might introduce contaminants in the beer and will dilute it.
How about placing the boiling kettle in an ice bath in our kitchen sink? While this is the cheapest way, it is not the most efficient. I will let you find that out on your own using our Conjugate Heat Transfer interface (included in the CFD Module and the Heat Transfer Module.)
The cooling of the kettle in an ice bath can modeled very similarly to the Free Convection in a Water Glass model tutorial, found in our Model Gallery.
Free convection in a glass of water.
This model treats the free convection and heat transfer of a glass of cold water heated to room temperature. Initially, the glass and the water are at 5°C and are then put on a table in a room that’s 25°C warm. The boiling kettle cooling problem could be modeled the same way by setting the initial wort temperature to 100°C and the external wall temperature to 0°C.
Alternatively, we could use a wort chiller. Basic wort chillers consist of a long helicoidal pipe that you immerse in the kettle at the end of the boiling process. You will then run cold water from your sink into the pipe to cool down the wort.
Sketch of a wort chiller.
As you can deduce by the shape, the modeling procedure for this wort chiller is identical to the one found in our geothermal heating problem model of a pond loop:
In this example, a pond is used as a thermal reservoir and fluid circulates underwater through polyethylene piping in a closed system. The model finds out how much heat is transferred from the pond to the working fluid in the pipes. To this end, the NonIsothermal Pipe Flow interface sets up and solves the equations for the temperature and fluid flow in the pipe system.
In the pipe flow physics interface, the pipes are represented by 1D lines, rather than actual 3D pipes, which drastically reduces the computational load of such a model. The following snapshot shows a possible design for the wort chiller, immersed in the boiling kettle, and the corresponding temperature field within the pipes:
We could also combine method 2 and 3 for faster results, i.e., use a wort chiller while the kettle is in an ice bath.
Another option is to use a flat plate or counterflow heat exchanger. A heat exchanger is a device that transfers heat from one fluid to another. Water, initially at a low temperature and used as the coolant, is being heated up while the wort is being cooled down. The following picture shows a flat plate heat exchanger.
Flat plate heat exchanger used to cool down beer at a local “brewyourownbeer” establishment. (You might recognize it from a similar picture on our Instagram account, COMSOL_.)
These types of heat exchangers are very popular due to their compact size. Many brewers also use counterflow heat exchangers.
You can model these devices by following the stepbystep instructions in the ShellandTube Heat Exchanger model, which shows the basic principles of setting up a heat exchanger model. In the model, two separated fluids at different temperatures flow through the heat exchanger, one through the tubes (tube side) and the other through the shell around the tubes (shell side).
Using a heat exchanger is not only the fastest way to cool down your wort, it is also the most efficient. Indeed, most of the heat taken form the wort is transferred to the water. This water can then be reused to steep the next batch of malted barley. This way, no energy is wasted!
Here, we have discussed conjugate heat transfer problems, a pipe flow model, and a heat exchanger model. I encourage you to try modeling these different cooling strategies in COMSOL Multiphysics and find out what works best. You can set up and solve these models using the CFD Module, Heat Transfer Module, and Pipe Flow Module.
After all this modeling, your beer must be pretty tasty and your friends are probably asking for more. It’s time to scale up and use a larger mixer tank, so that you don’t need to stir it manually anymore. Mixing tanks can be modeled using the Mixer Module, an addon to the CFD Module that allows you to analyze fluid mixers and stirred reactors.
Model of a turbulent mixer with a threebladed impeller. The model also considers the shape of the free surface.
If you have any questions about the models that I’ve presented here, contact our Technical Support team. If you are not yet a COMSOL Multiphysics user and would like to learn more about our software, please contact us via this form — we’d love to connect with you.
]]>
COMSOL Multiphysics uses the Finite Element Method (FEM), which is a wellknown 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 straightforward. For convectiondominated 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 convectiondiffusion transport equation for an unknown solution, u:
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), NavierStokes 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:
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 halftrue, 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 nonzero 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 timedependent 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 timedependent 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:
This mass transport example illustrates the first point, since we chose a spacedependent initial concentration profile. We can determine the mesh element size that forces the Péclet number to be smaller than 1:
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:
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:
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 timedependent problem, it is also a good idea to look at the timedependent solver settings to make sure that the problem is also well resolved in time. In COMSOL Multiphysics, the accuracy of the timedependent solver is controlled by the relative and absolute error tolerances.
The next plot shows the solution as a function of the userdefined 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 NavierStokes 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 gridbased methods (i.e., finite elements, finite differences, finite volumes), Lagrangian particlebased 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 gridbased methods.
To get you started with COMSOL Multiphysics, our Model Library includes the example of a static mixer solved with both methods (the gridbased 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 labonachip systems have played a major role in recent years in shrinking the size of conventional labscale chemical and biological analyses to a chipformat that is millimeters to a few centimeters in size. These devices are often referred to as micrototalanalysissystems (μ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 pointofcare 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.
Onboard mixing and control of fluid is important in a typical labonachip 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 fluidsolid interface. The majority of labonachip 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 acidbase 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 fluidsolid interface and consists of two layers surrounding the object:
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 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 HelmholtzSmoluchowski relation:
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 noslip 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 nearwall 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 molecularweight 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 indepth 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.
]]>