When viewed within a rotating frame of reference, *centrifugal force* is an inertial force that acts on an object as it moves around an axis of rotation. This type of force is directed away from the axis of rotation. Picture one of those spinning amusement park rides that pushes you against the wall as it picks up speed. (*Centripetal force* is when an object moves in a circular motion, requiring an inward force acting on the object to facilitate an inward acceleration.)

*If Faith Hill changed her lyrics to mention centripetal motion (left) instead of centrifugal motion (right), the song would make much more sense.*

Centrifugal pumps, which move fluid by converting rotational energy into hydrodynamic energy, rely on centrifugal motion to operate. These pumps are common in many industries and application areas, such as vacuum cleaners and pumps for water, sewage, and gas.

The basic operation of a centrifugal pump entails three main steps:

- Fluid enters the pump casing, moving through the impeller blades
- Fluid passes through the impeller into the diffuser with increasing velocity and pressure
- The diffuser slows down the fluid flow, but increases the pressure even more

*A typical centrifugal pump. Image by Bernard S. Janse — Own work. Licensed under CC BY-SA 3.0, via Wikimedia Commons.*

Using the Mixer Module, an add-on product to the CFD Module and the COMSOL Multiphysics® software, you can model a centrifugal pump and analyze its operation. The Centrifugal Pump tutorial model includes a helpful demonstration of how to set up this rotating machinery simulation using the frozen rotor approximation.

The centrifugal pump used in this example is a semiopen impeller with seven vanes and a spiral-shaped volute. The outer radius of the impeller is 10 cm, which is typical for automotive applications. To analyze different possible configurations of the pump, the geometry is highly parameterized.

*The centrifugal pump model geometry.*

The tutorial model includes step-by-step modeling instructions for a variety of useful tasks, including:

- Partitioning geometries for rotating and nonrotating domains
- Finding a pump curve with a parametric analysis
- Extruding mesh, inlet channels, and outlet channels
- Defining geometries with a high degree of parameterization
- Defeaturing geometries

The COMSOL® software includes a *Frozen Rotor* feature that is especially fitting for the analysis of centrifugal pumps and other types of turbomachinery. A frozen rotor approximation basically freezes the motion of the pump in a given position, which allows you to study the flow field with the rotor in a fixed position.

The frozen rotor approximation, governed by both the Navier-Stokes and continuity equations, is especially useful for saving computational time and resources. A typical model of a centrifugal pump requires moving mesh and wastes resources simulating the “start-up” period of the mixer between the resting state and basic mixing pattern. The frozen rotor approach assumes that the vanes of the pump are frozen relative to the impeller and adds centrifugal forces to the surrounding domain. It also provides a good estimate of the pseudo-steady-state condition of the pump. The approximate value can be used as an initial condition for a full simulation, enabling you to find a final solution in a fraction of the time steps.

*Specialized CFD functionality makes it easier to solve complex models of centrifugal pumps.*

The algebraic multigrid (AMG) method is also available for solving CFD models with large, detailed, and complex geometries in the COMSOL® software. This method doesn’t require different levels of mesh (in fact, it only requires one mesh). The functionality provides robust solutions for models that are extremely computationally expensive and nonlinear.

After running the simulation, you can plot the mass flow probes at the inlet and outlet of the centrifugal pump. Here, the values for the inlet and outlet are equal, which suggests that any numerical errors that may be present are not revealed in the mass conservation. The almost perfect mass conservation suggests that the numerical errors may be small. The “jumps” in the graph below represent a change in the total pressure at the inlet.

By looking at the pressure and velocity magnitude distributions (shown below), you can see that there is a rising pressure and changing velocity from the inlet radially toward the pump volute.

The solution to the model equations yields the pump performance curve. This curve is central to determining if the design of a centrifugal pump is appropriate for a given application. An optimized configuration for a pump accomplishes three main goals:

- Maximum efficiency
- Prolonged life
- Reduced operational costs

To expand on this model, you might want to consider trying different pump designs and running a shape optimization study. Let us know how it goes in the comments below!

Read more about simulating centrifugal pumps and mixers on the COMSOL Blog:

]]>

After setting up the flow conditions for a fluid flow model, COMSOL Multiphysics enables us to invoke physics-controlled meshing sequences. Such a sequence depends on the following aspects:

- Physics property settings
- A turbulence model with automatic wall treatment, for example, gives finer mesh than a laminar flow model

- Certain features
- Walls, for example, can induce finer meshes and boundary layer meshes

- Geometry bounding box size
- This controls the size scale of the elements

The physics-controlled meshing sequence for the Ahmed body model, which we also used in the previous blog post, looks like this:

Under the *Mesh 1* node, the:

*Size*subnode contains a set of mesh size parameters that depend on the property settings and the bounding box of the geometry*Size 1*subnode is active on all no-slip walls and prescribes a somewhat finer mesh there*Corner Refinement 1*subnode automatically identifies all sharp-enough angles internal to no-slip walls and prescribes an even finer mesh along such edges (in this case, it finds most of the sharp edges on the car, except for the one connecting the roof and the slant)*Free Tetrahedral 1*subnode creates the actual mesh on both boundaries and in domains*Boundary Layers 1*subnode adds boundary layer mesh to all no-slip boundaries

*A zoomed-in view of the mesh resulting from the physics-induced meshing sequence for the Ahmed body model. We can see that the mesh is finer on the walls than in the volume, and even finer close to sharp edges. The boundary layer mesh on the no-slip walls is also visible.*

The physics-induced mesh can sometimes be sufficient for simple models and is always a good starting point for more advanced meshing. It is perfectly possible to solve the Ahmed body problem with the mesh shown above. However, we can see that the mesh-controlled domain behind the car hasn’t resulted in any finer mesh and the unstructured mesh covers the whole wind tunnel. So, the mesh could be finer behind the car and it is unnecessarily fine far downstream of the car. Using the mesh-controlled domain behind the car and the partition face shown in the first part of this blog series, the total number of elements can be approximately kept constant, but with much better resolution in the wake.

COMSOL Multiphysics provides a wide selection of tools to control and generate mesh. We can start by discussing options for surface meshing, since we recommend to mesh faces first to verify adequate resolution and a high element quality. Note that a tool that meshes entities of a certain dimension also meshes adjacent entities of lower dimensions. A *Free Triangular* feature, for example, meshes both its designated faces as well as all adjacent edges and points that were not meshed previously. Therefore, we don’t need to mesh all edges before we mesh a face and volumes can be meshed without meshing all the enclosing faces first.

Mapping has the potential to create the very best surface meshes. The figure below shows a high-quality mapped surface mesh for one of the panels in the solar panel model. The mapped mesh is refined so that we obtain finer elements close to the free edges and smooth transitions to the fine meshes covering the beams. The anisotropy is obtained by using *Distribution* nodes, which contain settings to control the number of elements and their distribution along the edges. The fact that all elements have 90° angles means that the elements have no skewness at all.

*Mapped mesh on one surface of the solar panel model.*

Mapped meshes can be particularly powerful for 2D simulations, such as the NACA 0012 airfoil benchmark shown below. The most appealing property of the mapped mesh for this model is the extremely good control it provides over element size, quality, and growth rate — even though it can require some work to prescribe the optimal distributions on all edges.

*A mapped 2D mesh for the NACA 0012 airfoil model.*

Some surfaces are just too much trouble to divide into faces that can be mapped. In these cases, the *Free Quad* node is an option. The example below shows where the face of a frame is meshed by an unstructured quad mesh. The maximum element size on the face is controlled by a *Size* attribute, and *Distribution* attributes control the distributions along a number of edges.

*Unstructured quad mesh on a surface on the solar panel model.*

This face could also have been meshed with a Free Triangular operation, but that would result in many more elements. We can also notice that the growth rate, measured from the adjacent mapped meshes, isn’t the very best. The frame is on the underside of the solar panel, so there isn’t much going on for flow, hence the mesh mainly impacts the structural mechanics part of the model for which growth rate isn’t an issue.

The Free Triangular operation is the “workhorse” for 2D CFD models, as it is a quick and simple way to obtain meshes of high element quality that cover the whole geometry. The ease of creating unstructured meshes comes with a cost. Unstructured triangular meshes give more numerical diffusion than structured meshes. This means that solutions obtained on unstructured meshes are more smeared out than solutions obtained using structured meshes with comparable element sizes. Furthermore, unstructured meshes cannot be highly anisotropic without becoming skewed.

In general, unstructured meshes must be much finer than structured meshes to give the same level of accuracy for CFD problems. However, the extra diffusion can sometimes be desired, since it becomes easier to obtain convergence. This is perfect for a model like the supersonic ejector, shown below, where the mesh serves as a starting mesh for mesh adaption (see below).

*Triangular mesh for a 2D axisymmetric model of a supersonic ejector.*

The Free Triangular operation has little use in 3D models. The main use is to “test mesh” individual faces; in particular, faces where we have applied virtual operations. We can investigate the mesh quality on individual faces without having to mesh the adjacent volume. Unstructured triangular mesh can also be useful as a starting point for swept meshes. Such a strategy results in a mesh consisting of prismatic elements whose quadratic sides can be stretched, thereby creating an anisotropic mesh.

Almost all geometries of industrial applications contain one or several domains that are just not practical to sweep. These domains must then be covered by a tetrahedral mesh. The Free Tetrahedral operation builds surface meshes on unmeshed faces before it builds volume meshes. The surface mesh must conform with geometry boundaries, but the *Surface Mesh* nodes can be moved around within the faces during element quality optimization. Faces that are already meshed, however, remain frozen and can therefore result in a lower element quality.

A tetrahedron only has triangular sides, so something is needed to transition from faces with quadrilateral elements. This “something” is the pyramid. A pyramid element is formally a hexahedral element where one of the element faces is collapsed into a point, leaving an element with one quadrilateral face and four triangular faces. The solar panel model has a lot of faces with quadrilateral elements, and consequently requires pyramids to transition to the unstructured mesh in the domain surrounding the solar panel, as shown below.

Sometimes, we hear that pyramids are inferior to other types of elements, but there is nothing that makes pyramids bad *per se*. However, when a pyramid is placed on an anisotropic quad, its base must have the same anisotropy. Any small disturbance of the pyramid shape will then result in an element with rather high skewness. This is shown below, where the pyramids placed on top of highly anisotropic quad faces at the edges of the panels typically have lower quality than the pyramids in the center of the panels. In this case, the lower quality is a price we happily pay for a much smaller overall mesh size compared to using unstructured meshes within the panels.

*Pyramids placed on top of quadrilateral elements on the solar panel geometry. The elements are colored by quality calculated from skewness.*

The control over the meshes generated by the Free Tetrahedral operation can be greatly improved by using mesh control domains. For the example shown below, the *Size 3* attribute prescribes a small maximum element size on the slant and the back of the Ahmed body. The *Size 1* attribute to *Free Tetrahedral 1* prescribes a low growth rate in the mesh control domain, and this results in a fine mesh with low growth rate and high element quality in the wake region. When the surrounding air domain is meshed, the boundaries containing the mesh control domain are removed, leaving freedom for boundary layer mesh to be added and to move neighborliness elements.

*A mesh control domain behind the Ahmed body.*

We could have considered a swept mesh for the mesh control domain above. That would make the transition to the rest of the unstructured mesh more difficult and would not actually improve things, since the swirling motions that we expect behind the “car” are relatively isotropic, meaning that a structured mesh would also need to be more or less isotropic.

The 3D correspondence to a mapped mesh is denoted swept mesh in COMSOL Multiphysics. Sweeping takes a set of source faces; meshes and projects them on a number of destination faces; and connects these faces using prismatic elements or hexahedral elements, depending on whether the source meshes have triangular or quadrilateral elements. Sweeping is perfect for obtaining meshes that are stretched in the streamline direction while retaining a given resolution in the cross-section plane.

An example is shown below, where a swept mesh is added in the downstream region of the wind tunnel of the Ahmed body model. An attentive person would point out that the growth rate between the unstructured tetrahedral mesh and the swept mesh close to the ceiling could be better. But the flow field will display almost no variations there, so it is more important to obtain a good growth rate in the wake behind the “car”.

*Swept mesh downstream of the Ahmed body.*

The swept mesh above uses the face mesh from a Free Tetrahedral operation and a Boundary Layer operation as its source mesh. This is often a useful strategy. We could have created an unstructured triangular mesh on the outlet boundary and swept the mesh from the outlet up to the curved face. That would, however, put restriction on the Free Tetrahedral operation (see the “Triangular Mesh” section). We would also need to push in boundary layer elements along the whole wind tunnel floor, compared to only creating boundary layer mesh in the part with unstructured mesh and then sweep the result downstream.

Boundary layer meshing, central for CFD simulations, creates highly anisotropic meshes close to walls without having to use swept meshes or specially designated domains. These elements are needed because of the boundary layers that typically form at no-slip walls, as described in this previous blog post.

*Boundary layer mesh for the Ahmed body model. The elements are colored by quality based on skewness.*

In COMSOL Multiphysics, boundary layer meshes are added after the domain has been meshed. Anisotropic prismatic or hexahedral elements are pushed into the computational domain, resulting in a number of highly anisotropic elements as exemplified below. Observe that the quality of the elements is good despite the anisotropy. The reason is that the boundary layer mesh is in this case built from triangles with high quality, and that results in high-quality prismatic elements as well.

The boundary layer mesh has three characteristics:

- Height of the first layer
- Growth rate
- Number of layers

The first is the height of the first element and it is often specified as a fraction of the length scale of the face element. A typical default is that the length scale of the face elements is 50 times larger than the height of the first boundary layer element. Higher aspect ratios have the potential to yield better resolution, but the resulting equation system can also be more difficult to solve, especially when using iterative solvers.

The second characteristic is the stretching factor; that is, the growth rate from one element layer to the next. This is necessary to obtain a decent transition to the unstructured mesh (as shown above). The jump in element size as the roof boundary layer transitions into the unstructured mesh is clearly visible. The boundary layer could do with either a higher stretching factor or more layers in the boundary layer mesh (the number of layers is the third characteristic of the boundary layer mesh). But the boundary layer mesh shown above cannot be much thicker, because the mesh in the gap between the car and the floor is already rather squished in order to avoid high skewness in the unstructured mesh. This compression of the boundary layer mesh is done automatically by the underlying algorithm.

Selecting the first element height, growth rate, and number of elements is a balancing act between necessary resolution, good transition to the unstructured mesh, and quality of the resulting elements.

If you’ve wrapped your own gifts, you know how easily the paper can rip when tightened around sharp edges. Boundary layer meshes have similar problems, as shown below. The boundary layer mesh elements at the trailing sharp edge are rather skewed, as are the elements just downstream of the airfoil.

*The sharp trailing edge of an airfoil with no special mesh treatment.*

One option is to “split” the boundary layer at sharp edges. The result is shown in the middle image below. The boundary layer mesh now ends with two special columns of elements, both starting with a triangle followed by an appropriate number of quadrilateral elements. Splitting allows you to control how sharp a corner must be to be considered sharp, as well as the maximum angle that each “special” column of elements should cover. Optimizing these parameters can greatly improve the element quality at sharp edges.

*Splitting the boundary layer at the sharp edges of an airfoil.*

Splitting doesn’t always work. Complicated 3D CAD geometries, where any number of edges can connect to a sharp corner, are particularly difficult. The algorithm must be programmed for each topologically unique configuration, and it is likely that an advanced geometry contains at least one sharp corner that the algorithm doesn’t know what to do with.

The third way to treat sharp corners can then be an option. It is called *trimming* and is the default option for sharp corners in COMSOL Multiphysics. The result for the airfoil is shown below. As the layer approaches the sharp edge, it decreases in height with two elements for each element that comes closer to the edge. Alternatively, the method can be regarded as a growth of the number of boundary layer elements from the sharp edge. The number of elements to grow and the minimum angle for trimming can both be controlled in order to obtain an optimal mesh.

Trimming reduces the effective resolution at the sharp corner, compared to no treatment or splitting. Trimming should therefore always be combined with a general refinement of the mesh, which is why the *Corner Refinement* feature discussed above is included by default in the physics-induced mesh sequence.

*Trimming, the default option for meshing a boundary layer with sharp corners.*

Boundary layer meshes can increase the resolution in narrow regions. If you look closely at the mesh in the figure above, the region between the car and the floor is covered by 15 elements (6 + 3 + 6). This is enough to represent any velocity profile that can occur in that narrow region. Without the boundary layer mesh, the gap would be covered by only 3 elements, severely limiting the capability of the mesh to represent the flow profile beneath the Ahmed body. Then, the flow is typically artificially throttled so that the narrow region appears even more narrow numerically than it is geometrically. Boundary layer meshes can hence be of use, not only for turbulent boundary layers, but also in laminar and even microfluidic systems. A good rule of thumb: Narrow regions must be resolved with at least five elements across.

Finally, we will cover how to copy a mesh from one entity to another. This is possible for entities of the same dimension as long as the source mesh can be mapped on the destination entity by a translation, rotation, and an isotropic scaling. This means that the destination must have the same shape as the source, but it can be located in another place, rotated in some way, and possibly have a different size.

Copying mesh is particularly useful for mapped and swept meshes. Copying allows us to replace a number of map and sweep operations and a number of distribution attributes with one copy operation. This is possible if the geometry has been properly partitioned, as described in the previous blog post. In addition to saving work when creating the mesh, any subsequent change of the mesh is much easier to administrate, since you only need to change the sequence for the source domain. The copy operation automatically transfers these changes to the destination domains.

*The swept mesh from the yellow domain is copied to the two pink domains.*

When simulating CFD problems, we strive to create dense meshes in regions with large gradients. There are, however, cases when it is difficult to predict where the sharp gradients will appear. There are also time-dependent cases where the sharp gradients move. This could be addressed by creating fine mesh in all regions where the sharp gradients appear, but that is typically expensive. The solution is instead to invoke adaptive meshing.

One example of adaptive meshing is in the pressure contours for a shock-system created by transonic flow over a wall-mounted bump. The shocks can be captured by the stabilization scheme, but coarse meshes would make them appear smeared out.

*Pressure contours for Euler flow over a wall-mounted bump.*

The sharp shocks in the figure above are obtained by starting from a homogeneous, relatively coarse mesh (shown below and to the left). The solution on the coarse mesh is used to approximate the equation residual and refine the mesh where the residual is large. The equations are resolved on the resulting finer mesh. This procedure can be repeated until satisfactory accuracy is obtained.

The mesh used to compute the pressure field above is shown below and to the right. It is the result of the very simple starting mesh being adaptively refined twice. Adaption still requires work to create the starting mesh, since the problem must converge on that mesh.

*Starting mesh (left) and adapted mesh (right) for the Euler flow model.*

Adaption for time-dependent models works a bit differently. A coarse base mesh is used to advance the solution for a certain time interval. The solution is then used to refine the mesh based on some indicator function. Then, the adapted mesh is used to simulate the time interval again. Below, the left image shows the base mesh of an inkjet nozzle model and the middle image shows the adapted mesh. Since this is a two-phase model, the adaption is based on , where is the level set function (0 in one phase and 1 in the other). The right image shows the solution at the end of an adaption time interval. We can see how the refined mesh covers the transport of the interface front during the whole time interval.

*Time-dependent mesh adaption for an inkjet nozzle.*

Time-adaptive meshing can be a very cost-effective method for obtaining excellent results. The efficiency is highly dependent on the base mesh, which can’t be too fine, since the problem must be solved for an extra time on the base mesh. Putting some work into the base mesh, especially for more advanced geometries, often pays off.

Creating a good mesh for CFD problems is an art. Even when using adaptive meshing, a high-quality mesh is the result of understanding how various meshing tools work and anticipating the expected solution to the flow problem.

The first mesh we create is rarely sufficient, and we often need to alter the geometry, the mesh, or both. Geometry and meshing sequences in COMSOL Multiphysics are helpful for this reason. A change introduced in the geometry sequence is propagated down through the model so that we don’t need to respecify the physics or mesh settings when introducing changes in the geometry. Or, we can substantially change mesh settings and rebuild the whole mesh sequence without starting over from scratch. Another possibility is to use parameters in both geometry and mesh and obtain a model where the mesh can be refined by a few clicks.

This series of blog posts has merely scratched the surface of the possibilities for creating meshes in COMSOL Multiphysics. There are many more settings and options than those mentioned here, and CFD models can benefit greatly from them.

Read more about meshing and CFD analyses on the COMSOL blog:

]]>

A CFD mesh must fulfill two basic rules:

- No void regions in the computational domain
- No overlapping mesh elements

Most modern meshing tools either contain automatic checks or provide tools to easily detect and remedy transgressions. The COMSOL Multiphysics® software performs automatic checks that prevent the violation of these two rules (unless specified).

A good CFD mesh should also aim for the following three factors, which are often in conflict:

- High quality
- Sufficient resolution for the desired accuracy
- Low computational cost

Let’s go over these factors in more detail.

A mesh element of high quality is one that is as isotropic as possible; for example, a hexahedral cube-shaped element. Different quality measures are used to quantify the quality of elements. For instance, perfect elements commonly have quality one, but there is also the logic that perfect elements have quality zero.

COMSOL Multiphysics describes a perfect element as quality 1. A mesh element that somehow deviates from its perfect form consequently has a quality that is less than one.

The worst scenario for an element is that it collapses or inverts so that its area or volume becomes zero or negative. Such elements are generated in rare cases, and it is important to modify the mesh to eliminate them because they generate equation systems that are extremely difficult to solve and possibly have nonphysical solutions. An element with negative volume has a quality that is zero or less than zero. An example of an inverted hexahedra is shown below.

*Hexahedral elements from perfect quality (far left) to inverted (far right).*

A mesh element can deviate from its perfect form in a number of ways. A harmless deviation is a “compression” in one direction, as demonstrated by the anisotropic element in the figure above. The *aspect ratio* is defined as the length of the longest side divided by the length of the shortest side. Elements with high aspect ratios are capable of giving high accuracy for regions where the flow is anisotropic. These elements are often used to create structured meshes in general and boundary layer meshes in particular. When using high-aspect-ratio elements, though, the resulting equation system becomes harder to solve, as the aspect ratio rises. Aspect ratios up to order 100 (or close to it) are often acceptable, while aspect ratios that approach 1000 can prove troublesome.

The worst way to deform a mesh element without inverting it is to skew it. A *skewed mesh element* has angles that deviate substantially from 90°. Badly skewed elements have a negative impact on both the local accuracy and the condition number of the equation system (the equations are harder to solve). Skewed elements typically appear when creating boundary layer meshes or mapped meshes in curved geometries, or when transitioning from high-aspect-ratio elements to isotropic tetrahedral elements through pyramid elements. *Skewness* is a measure to detect skewed elements. There is no sharp lower limit on quality based on skewness, but qualities lower than 0.01 should be avoided.

A mesh quality measure that is specific to CFD is growth rate. The *growth rate* is the change in element size from one element to one of its neighbors, and it should be small in order to get accurate results. The highest growth rates typically appear in transitions between structured meshes, such as boundary layer meshes, mapped meshes, and free unstructured tetrahedral meshes. There is no formal upper limit for the growth rate, but a good rule of thumb is that it should not be above 20%.

For a CFD problem, the mesh harbors the shape functions that in turn represent the flow and pressure fields. Sharp gradients in any of these fields require a locally dense mesh in order to be resolved. Underresolved gradients are, in the best case, dissipated by the numerical discretization scheme, such as stabilization or upwinding. This reduces accuracy but can also result in widespread oscillations or even divergence. A skilled specialist in fluid mechanics can anticipate where sharp gradients are likely to appear and create locally finer mesh at these locations instead of refining the mesh everywhere.

It is always possible to build a mesh that is very dense everywhere, but, in most cases, the resulting computational cost becomes immense. It is therefore important to only refine the mesh in regions where it is required by the flow and to provide a good transition to regions where larger elements can be used. But the flow is often anisotropic, so the most efficient approach is to utilize anisotropic structured meshes to capture gradients. As a result, a typical CFD mesh contains regions with structured meshes and regions with free, unstructured, meshes.

*A mixer model with regions of free tetrahedral and structured meshes. Note that the boundary layer mesh along the walls is structured.*

Anisotropic meshes and differences in element sizes can reduce the mesh quality, so it is not trivial to both minimize the number of mesh elements with a high mesh quality while resolving gradients in the flow.

It is very important to properly prepare a geometry of a CFD model for meshing. Often, a CAD team provides a file containing a geometry description. The final geometry should both contain entities to prescribe appropriate physical conditions (such as boundaries to be specified as inlets and outlets) and be partitioned in a way that the mesh can be controlled. It helps to have an intuitive idea of what the solution will look like so that the mesh can be refined where necessary and coarsened where we expect that the solution accuracy allows it.

Often, the geometry supplied by a CAD team is exactly what a flow mechanics specialist *does not* want. It is typically some solid component, such as a valve, vehicle, or electronic device, so the specialist’s first step is to remove everything that isn’t needed and create the fluid domains.

For instance, the classical Ahmed body benchmark case shows the flow around a simplified car. The CAD file that you typically see on the internet is for the actual car, but we want to simulate the flow when the car is located in a wind tunnel. So, in this case, we draw a rectangle and subtract the car to obtain a wind tunnel with the car cut out (below, right).

Notice how we have only retained half of the car. It is generally advised to utilize symmetry whenever possible, such as for symmetric flows in stationary Reynolds-averaged Navier-Stokes (RANS) simulations. (A large eddy simulation (LES), on the other hand, requires the full geometry.) In this case, using the symmetry plane removes 50% of the elements and reduces the computational time by a lot more than 50% — without any loss of accuracy!

*The actual CAD geometry of the Ahmed body (left) and half of the geometry inscribed in a wind tunnel (right).*

A CAD geometry is seldom as simple as the Ahmed body and often contains details that CFD specialists aren’t interested in, such as bolts, springs, and logotypes. These details can almost always be removed or replaced by simplified representations.

CAD geometry parts also tend not to fit perfectly. The figure below shows an impeller blade that is slightly larger than the shaft to which it is attached. If we leave these sliver faces, mesh elements need to conform with them, which results in a very dense mesh around the sliver faces. The sliver faces are typically also much smaller than the smallest allowed element size, so elements that are attached to sliver faces tend to become highly anisotropic and have high skewness. As sliver faces produce unnecessarily dense meshes with bad element quality, they should be removed.

*Sliver faces (in blue) on a CAD geometry of an impeller.*

COMSOL Multiphysics includes tools to identify and remove small details, such as virtual operations. One important aspect when working with CFD applications is retaining the curvature of surfaces. Using virtual operations to remove edges and sliver faces may result in effectively “buckled” surface meshes, which can, in the worst case scenario, change the characteristics of the flow.

Structured meshes are efficient tools to help us obtain sufficient resolution. However, not all geometries can be mapped or swept. Roughly speaking, geometries need to be homeomorph to a set of squares in 2D or a set of cubes in 3D for mapping and sweeping to work. This can require a partitioned geometry, as described in this previous blog post. In the figure below, we add a curved face that partitions the wind tunnel of the Ahmed body model in the front, where the simplified car is, and the rear, where we intend to create a structured mesh.

*Ahmed body model geometry with a curved face that can be used to create a structured mesh in the rear part of the wind tunnel.*

Structured meshes can be particularly useful in multiphysics simulations, such as the FSI analysis of a solar panel shown below. The solar panel consists of a lot of flat plates and beams of which the short sides must be meshed by a number of elements across. The large surfaces don’t require a fine mesh, except for the regions close to the edges. In this case, anisotropic mesh elements are required to obtain a reasonably small problem for the desired accuracy.

Structured meshes can be constructed for most of the beams and plates individually, but conflicts can arise when different meshes need to share faces or edges. Partitioning the plates and beams, as shown to the right in the figure below, remedies this issue. The additional edges and surfaces give extra control over the number of elements and their distribution.

*A solar panel geometry, cleaned (left) and cleaned and partitioned (right).*

Introducing additional faces and edges to control the mesh has a drawback: The mesh needs to conform with these extra entities. This can pose a problem when boundary layer meshes are introduced. COMSOL Multiphysics uses a method where the boundary layer mesh is pushed into the domains after the volume has been meshed. The elements in the domains need to leave space for the boundary layer elements. They can move within the faces and along edges, but they cannot detach and move out of the faces or away from the edges. If elements are not allowed to move, both the elements and boundary layer elements that try to enter the domain can get squished.

The screenshot below shows a domain added behind the Ahmed body in order to control the mesh size in the wake. The domain doesn’t reach all the way to the bottom, so a boundary layer mesh introduced on the wind tunnel floor would be squished between the floor and the bottom of the extra domain if movement was not allowed. The COMSOL® software features so-called *mesh control entities*, as seen with the mesh control domain behind the car.

A mesh control domain disappears when it is completely embedded in a mesh, releasing the elements that were previously constrained to within its boundaries when they need to move (for example, when a boundary layer mesh is created). In this case, the boundary layer mesh on the floor below the mesh control entity will be able to move the elements above and across the mesh control faces in order to avoid squishing the elements.

*The Ahmed body model with a mesh control domain behind the simplified car.*

Mesh control entities can smooth the mesh locally when the entities are removed, so they generally produce better-quality meshes locally, compared to leaving the entities in the model even if there is no boundary layer mesh.

In the next part of this blog series on meshing for CFD problems, we will go over physics-controlled mesh, the different meshing tools, and adaptive mesh refinement. Stay tuned!

*Editor’s note, 6/13/18: The second part in this blog series, “Your Guide to Meshing Techniques for Efficient CFD Modeling“, is now live.*

Check out the features and functionality that are available in the CFD Module for specialized fluid flow analyses by clicking the button below.

Read these related blog posts on meshing in COMSOL Multiphysics:

]]>

We have already concluded that the position of a soccer ball suspended above the tube of a leaf blower should be inversely proportional to the terminal velocity. Therefore, a higher ball position corresponds to a lower terminal velocity, and a lower terminal velocity means a higher drag coefficient (*C _{d}*). We estimated that a difference between a

So, on we went. Our Video team in Boston built the test rig under very strict instructions from me. I even made them wear white lab coats, shave, and cut their hair — all for the sake of getting into the right mode for the measurements. The “high-tech” rig is shown in the figure below.

*The high-tech rig set up by the Video team in Boston during the proof of concept. Unfortunately, none of them wore lab coats, nor did they shave! Maybe they were also standing a little bit too close to the wall. The pipe was corrected later, since it was a bit crooked.*

Alright, maybe it was not a high-tech test rig and maybe our team did not shave after all, but the measurements turned out pretty well. The videos below show the Adidas® Telstar® ball and the Nike® Ordem V ball suspended by the airflow from the leaf blower. We can also see the calibrated ruler that measures the position of the ball.

We were able to sample about 110–150 points in each time series once the ball was hovering at a relatively stable point above the leaf blower tube. For trademark reasons, we removed the logos from the balls afterward. But both balls are the real, high-end balls from the two manufacturers. The Nike® Ordem V ball is the winter ball, but besides the color, it should be a regular Nike® Ordem V ball with the Nike® Aerowtrac ball grooves and microtextured casing.

*The Adidas® Telstar® (top) and the Nike® Ordem V (bottom), levitated by the jet from a leaf blower.*

During the preparations, we also measured the diameter and the mass of the two balls. The diameter was about the same for the two balls: 21.9 cm for the Adidas® Telstar® ball and 21.7 cm for the Nike® Ordem V ball (rounded to 22 cm for both balls). The mass was 430 g for the Adidas® Telstar® ball and 435 g for the Nike® Ordem V ball. This depends, of course, on the pressure of the two balls. We tried to pump them to get the same mass. The difference in mass was about 1.2%, which we considered to be acceptable.

What about the results? The figure below shows the position of the ball above the leaf blower tube for two of the measurement series. The two balls hover around similar values. If there was a difference in the drag coefficient of around 0.05 (0.2 compared to 0.15), we should be able to see a difference of almost 2 cm in the average position of the two balls.

The amplitude of the movement is about 1.6–1.7 cm, while the average value is about 13.5 cm for the Adidas® Telstar® ball and 13.7 for the Nike® Ordem V ball. However, as we can see from the plots, this difference is substantially smaller than the amplitude of the hovering. The difference is not significant. In none of the measurements did we get a difference in position that came close to the 2 cm that we estimated from our calculations, if there was a large difference in the two balls’ *C _{d}* values.

*The position above the tube for the Adidas® Telstar® ball (blue squares) and the Nike® Ordem V ball (orange triangles).*

One interesting detail is that the frequency in the hovering between the two balls is slightly different. The Nike® Ordem V ball shows on a slightly lower frequency, although the difference is small: 0.78 Hz for the Adidas® Telstar® ball and 0.62 Hz for the Nike® Ordem V ball. This behavior is seen in all of the measurements: the Adidas® Telstar® ball frequency varies between 0.74 and 0.78 Hz, while the Nike® Ordem V ball varies between 0.62 and 0.68 Hz.

What could be the cause of this sinusoidal behavior? Could it be the leaf blower? If that was the case, then the frequency would be the same for both balls. The difference is small, so we cannot completely rule out that the leaf blower gives these fluctuations. However, it could be the frequency in the separation of the larger-scale eddies behind the balls. The vortex and the wakes behind the ball cause it to move sideways and up and down when the ball does not have a spin; an effect called the *knuckle ball effect* or *beach ball effect*. The frequency is certainly within that range.

So, with our experiment, we have possibly detected a difference between the two balls. A higher frequency should mean a smaller wake behind the ball, which would also imply smaller eddies. The smaller wake may be caused by an earlier onset of turbulence on the surface of the ball facing the wind.

The figure below shows the panels of the Adidas® Telstar® ball separated by the welded seams. The total length of the seams is about 4.30 m, which is a high value compared to 3.22 m for the Adidas® Brazuca® ball and 3.53 m for a regular 32-panel ball. The seams are about 1.5 mm in depth, which is about the same as the Adidas® Brazuca® ball and deeper than a stitched ball.

*A representation of the Adidas® Telstar® ball panels drawn in the COMSOL Multiphysics® software in order to measure the total length of the seams.*

The Nike® Ordem V also has a higher total seam length compared to a regular 32-panel ball. In this case, we have grooves that are probably supposed to emulate seams, which divide each larger pentagon into smaller units. This results in 12 regular pentagonal faces and 20 hexagonal faces, where each of the 20 hexagonal faces is divided by a fuse-welded seam along the middle. This gives an estimated emulated seam length of about 4.14 m for the Aerowtrac grooves and around 2.37 for the fuse-welded seams for a total of 6.51 m! The seams are somewhat narrower than the grooves. The depth of the grooves is about 1.5 mm while the fuse-welded seams are 1.2 mm in depth.

*A representation of the unit cell of the Nike® Ordem V ball. The ball consists of 12 fuse-welded pentagonal but curved unit cells (blue edges) and panels with smaller pentagonal grooves and lines (gray).*

*There are twelve panels in the Nike® Ordem V ball. The representation shown here is divided into three different colors. Inside each panel are the Nike® Aerowtrac grooves.*

Both balls have substantially longer “seams” (or grooves that emulate seams) compared to the regular 32-panel ball. The length and depth of the wider grooves of the Nike® Ordem V ball are comparable to the depth and total seam length of the Adidas® Telstar® ball. What does this mean? The larger total length of the seams and the grooves of the Nike® Ordem V ball should result in a slightly higher drag coefficient. This could be the case, but the difference would be relatively small compared to the Adidas® Telstar® ball, considering that we did not see any differences at all in the levitation height.

*Seam of the Adidas® Telstar® ball (left) and the Nike® Ordem V ball (right).*

The longer seam may imply that the turbulent boundary layer is stable at lower velocities for the Nike® Ordem V ball compared to the Adidas® Telstar® ball. So, the two balls may have a different speed at the *drag crisis*, where the boundary layer changes from turbulent to laminar, with a higher speed for the Adidas® Telstar® ball. However, this difference is probably small, considering both the structure of the surface of the balls and the very high values of the seam lengths (compared to previous balls, such as the Adidas® Brazuca® ball and Jabulani® ball). The Adidas® Telstar® ball has rectangular imprints similar to a plain weave structure while the Nike® Ordem V ball has very discreet circular projections and stripes running in parallel to the fuse-welded seams. The more pronounced surface structure of the Adidas® Telstar® ball should lower the speed at the drag crisis and even out the difference in seam and groove length between the balls.

*Surface structure of the Adidas® Telstar® ball (left) and the Nike® Ordem V ball (right). The picture was taken during the pumping procedure.*

The Adidas® Telstar® ball and the Nike® Ordem V ball probably behave similarly in the air, both for the speed when given a certain impulse (a kick), the onset of the spin when the ball is given a spin (the Magnus effect), and the speed for the onset of the knuckle-ball effect (beach-ball effect) when the ball is kicked with no spin at all. Maybe the Adidas® Telstar® ball could have a slightly higher speed when the Magnus effect sets in (when the ball curves) and a slightly higher speed when the beach-ball effect sets in (when the ball starts moving sideways and up and down).

What about the errors in our measurements? Like I mentioned in the previous blog post in this series, we have no wind tunnel and this is the first time we ran such an experiment. We had very little time and limited resources. If we had the time to redo the experiments, we would have used at least four leaf blowers connected to the same pipe. This would have given a higher elevation point for the two balls and made it possible to measure smaller differences in the *C _{d}* value at the terminal velocity. The fact that the ball hovers so close to the leaf blower tube could have also caused very large separation zones behind the ball, although this does not seem to have disturbed our experiments.

We could also have introduced a pitot tube to measure the flow rate and a highly porous honeycomb structure at the bottom entrance of the last straight tube in order to make sure that the flow was even and free from larger eddies at the outlet of the tube.

*Plans for a future experiment with a more controlled and powerful flow.*

Perhaps this experimental setup is for the next FIFA World Cup™. For 2018, we are fairly convinced that the ball will not present any controversies. Our measurements show a slight difference in the hovering frequency between the Adidas® Telstar® ball and the Nike® Ordem V ball: They are close, but not identical.

Still, none of the teams seem to be taking any chances. All teams, including those sponsored by Nike, have been seen practicing and playing with the Adidas® Telstar® ball to better prepare for the FIFA World Cup™. Me? I prefer the Adidas® Jabulani® ball. The extremely low drag coefficient and high speed at the onset of the Magnus and beach ball effects facilitate spectacular free kicks and long range shots! But then again, I have never been a goalkeeper…

- Read Part 1 of this blog series for a closer look at the theory and setup behind the soccer ball experiment:
- Browse more blog posts about the physics of sports:

*Adidas and Brazuca are registered trademarks of adidas AG. Telstar and Jabulani are registered trademarks of adidas International Marketing B.V. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by adidas AG or adidas International Marketing B.V.*

*Nike is a registered trademark of Nike, Inc. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by Nike, Inc.*

*FIFA World Cup and 2018 FIFA World Cup are trademarks of FIFA. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by FIFA.*

It’s all in the name: An electrostatic precipitator filters carbon particles out of exhaust via static electricity. The electric filter component charges and accelerates particles, which accumulate and collect on plates in the precipitator that can then be removed. This device can be attached to chimneys and clean flue exhaust, for instance.

*An electrostatic precipitator at an incineration plant in Poland. Image by LukaszKatlewa — Own work. Licensed under CC BY-SA 3.0, via Wikimedia Commons.*

In a typical electrostatic precipitator, exhaust released through a flue goes through two electrodes, usually in the form of metal bars, plates, or wires inside a pipe or smokestack. One of the electrodes is charged with a high negative voltage, which is passed to the smoke particulates so that they gain a negative charge in turn. The second electrode, located further down the pipe, has a different voltage — usually grounded — which creates a strong electrical field between the two, thus leading to an acceleration of the negatively charged particles. Consequently, the particles are attracted by the grounded electrode and collected there until removal and disposal.

Seeking a way to improve and further develop the charging mechanism of an electrostatic precipitator, specifically the air ionization process in the electric filter, researchers Donato Rubinetti and Josef Wüest from the Institute of Biomass and Resource Efficiency at the University of Applied Sciences and Arts Northwestern Switzerland in Windisch, Switzerland, collaborated with emission-reduction company OekoSolve. They presented their findings at the COMSOL Conference 2017 Rotterdam.

The research team built an electrostatic precipitator model with the COMSOL Multiphysics® software and the add-on CFD Module. The model involves the interdependent phenomena of fluid mechanics, particle dynamics, and electrostatics. The model uses the Electrostatics interface, a fluid flow interface, PDE interfaces, and the *Particle Tracing for Fluid Flow* interface.

In a previous paper from the COMSOL Conference 2015, the group explained how they developed the electrostatics model. They initially determined the forces on the particles (Coulomb force vs. drag force) as well as where to place the electrode to optimize the capture and charging of particles.

In the paper from the COMSOL Conference 2017, the researchers discussed their test case based on that model. The physical and numerical modeling practices are identical to the previous paper, except for the geometry. To obtain the acceleration that triggers the removal of particles, they were able to achieve a broad range of space charge density across the geometry of the filter. This distribution was modeled using Poisson’s equation and the transport equation for electric charge.

As represented below in both 3D and 2D, point number 5 is the electrode where the particles are negatively charged and numbers 1 through 4 are the positively charged rings that the particles are drawn to as the exhaust travels through the cylinder.

*3D (left) and 2D (right) representations of the electric filter model. Images courtesy Rubinetti, Wüest, and OekoSolve AG and taken from their COMSOL Conference 2017 Rotterdam paper.*

By setting up a numerical model, the researchers were able to analyze the electrical field strength for each axis. They performed 2D and 3D simulations, comparing the distributions of the electric field.

Because the 3D simulation amounted to a total of 1.6 million mesh elements and the 2D simulation approximately 300,000 mesh elements, the team wanted to find out if the 2D model would be sufficient in further studies for quicker computations. They confirmed that the 2D model is suitable for a qualitative understanding of the process and realistic enough to produce accurate results.

After confirming the suitability of the 2D model for their experiments, the research team set up an experimental validation model. They verified this model using experimental data obtained from a test rig.

In the schematic below, the experimental setup for the test rig is shown, with electrode P3 and measurement ring units M1 through M4, with C as the current starting from the top. The emitting electrode was given a variable electric potential from -2 kV to -30 kV. Due to the ionization and acceleration of the plasma layer, the electrical current can be observed and measured on the ground rings.

*Laboratory test rig schematic. Image courtesy Rubinetti, Wüest, and OekoSolve AG and taken from their COMSOL Conference 2017 Rotterdam paper.*

Let’s take a look at the 2D electrical field strength results in the numerical model. In the image below on the left, the electric field lines indicate that there is a decrease in intensity from ring 1 to ring 4. The electrical field strength is depicted as blue in color because the current is so strong near the electrode before being pulled through the rings.

In the image on the right, we can see a close-up view of the electrode. Even in the close-up, the electrical field strength dissipates quickly, as the strongest area (red) is a thin line. These results demonstrate the feasibility of running 2D simulations, because they accurately show the electrical field strength at the most important part of the process close to the electrode.

*Electrical field strength and field lines (left) and a close-up view near the electrode (right). Images courtesy Rubinetti, Wüest, and OekoSolve AG and taken from their COMSOL Conference 2017 Rotterdam paper.*

While 2D simulation is effective for observing field strength, the researchers could only compare the measured electrical current to a certain extent because of a dimensional mismatch. The research team dedimensionalized the results to get a closer look.

As shown below, in the overview of all measurements (M1–M4) and simulations (S1–S4), the discrepancy between the results can be explained by the dimensional mismatch, as well as some other factors from the test rig setup. However, we can see in the simulation and measurements that the first ring differs significantly from the fellow rings that are closer to each other — meaning it’s still possible to predict the behavior of the physics when reduced to a 2D arrangement.

*Comparison of the simulation and measurements. Image courtesy Rubinetti, Wüest, and OekoSolve AG and taken from their COMSOL Conference 2017 Rotterdam paper.*

Since the COMSOL Conference 2017 Rotterdam, the researchers have resolved the mismatch and added the dimensions back into the model. They’ve also focused more intensely on the electric aspect of the simulation, especially on how the ionization processes change with temperatures up to 1000 K. Having built an axisymmetric test rig in order to get a quantitative agreement between the experiments and the model, they also built a 2D axisymmetric model.

The new test rig helped them test the behavior of the electrode by:

- Placing the electrode in line with the cylinder axis
- Changing the voltage of the electrode up to 30 kV
- Measuring the current on the rings

As we can see below, the experiments now match the simulation results much more closely:

*Comparison of the new validation model and measurements. Image courtesy Donato Rubinetti.*

The team was able to validate the model results and modeling approach, since, as shown in the animation below, the current only started to flow above approximately 12 kV.

*An animation of the updated validation model results. Animation courtesy Donato Rubinetti.*

From the test case to the industry-relevant model, the research team proved that multiphysics modeling can help accelerate further research and development of particle control technologies. As demonstrated, 2D cases are sufficiently accurate for insights into space change distribution within a domain.

Could further simulations provide more groundbreaking insights? In their paper, the team focused on the type of electric field that is given by the potential difference between electrodes. While the current model does not account for the influence of particles on the electric field, a second approach may account for this impact. Established by a “cloud” of charged particles, the new approach could account for a more dynamic field, moving through all parts of the pellet burner until the particles are deposited on the collector.

Usually, the experiments only allow researchers to see the particles that are already deposited. Given more time and computational resources, Rubinetti says that a 3D simulation for the complete pellet burner system could help visualize the particle cloud clearer than ever before: They’d be able to see the actual path and interactions of the charged particles.

Long-term, Rubinetti says he wants to “further develop the electrostatic precipitator modeling approach to understand the influence of external convection on ionization processes, as well as include temperature dependencies for the particle-charging processes and fluid properties such as density and viscosity.” Based on the researchers’ promising results, they continue to see opportunities for improvement, setting goals to optimize particle control technology designs.

- Check out the paper from the COMSOL Conference 2017 Rotterdam: “Innovation of Combustion Particle Control Technologies Assisted by Numerical Modeling“
- Read more about electrostatics modeling: How to Create Electrostatics Models with Wires, Surfaces, and Solids

The drag coefficient of a soccer ball depends on its speed, which plays an extremely important role for the precision of crosses, long-range passes, long balls, long-range shots, corner kicks, and free kicks. In modern soccer, set piece situations are often decisive for scoring. It is important that the attacking players can deliver the ball with high precision and the defending players can predict the trajectory of the ball once the ball is delivered. If the path of the ball is unusual and the players are not used to it, it will impact the outcome of the tournament.

In the FIFA World Cup™, some teams are sponsored by Adidas, maker of the FIFA World Cup™ official match ball, while some teams are sponsored by Nike, Puma, or other brands. The squads that practice with a ball other than the Adidas® Telstar® ball, the official match ball of the 2018 FIFA World Cup™, will have a disadvantage during the games if their ball performs differently. For example, the teams sponsored by Nike, such as France, Brazil, and England, could likely practice with the Nike® Ordem V. Spain, Germany, and Argentina will probably practice with the Adidas® Telstar® ball, made by their sponsor. The dilemma of training with the official ball or the team sponsor’s ball is unusually polarized this year, since three of the favored teams are sponsored by Adidas and three are sponsored by Nike!

These six teams, with the addition of Italy, cover the winners of the last 16 FIFA World Cup™ tournaments. For a winning team not on this list, we have to go back to the FIFA World Cup™ in Brazil in 1950: the heroic Uruguayan squad that delivered the “Maracanazo” and defeated Brazil in front of 200,000 spectators at the Maracaná Stadium in Rio.

In fact, the “big six” in this tournament, plus Uruguay and Italy, cover all of the world champions in the history of the FIFA World Cup™, which started in 1930. Italy, who won the cup twice since 1982 and is sponsored by Puma, did not qualify for the 2018 FIFA World Cup™ in Russia. They were eliminated in the playoffs by the hardworking and disciplined Swedish squad (sponsored by Adidas). Uruguay, also sponsored by Puma, made it to the 2018 tournament with star players in almost every position. Their team is still an unlikely match compared to the superstar squads of the big six. Another outsider is Belgium, another team with a lot of stars, sponsored by Adidas. History has shown that the possibility of winning the highest trophy is clearly limited to a few teams and there is a very large probability that the winner is among the six teams listed below!

*The main contenders: Germany, Argentina, and Spain are sponsored by Adidas and train with the official World Cup ball, the Adidas® Telstar® ball. Brazil, England, and France are sponsored by Nike. Will they train with the Nike® Ordem V or with the Adidas® Telstar® ball, the ball used during the games? Interesting side note: The old World Cup trophy (the Jules Rimet Trophy, used from 1930 to 1970) depicts Nike, the Greek goddess of victory.*

We can estimate the possible impact of the ball on the major FIFA World Cup™ contenders by comparing the drag coefficient of the Adidas® Telstar® ball and the Nike® Ordem V. However, there is a limitation: Drag coefficients are measured in wind tunnels with advanced equipment that can measure the forces on the ball. At COMSOL, we are software developers and don’t have a wind tunnel. We also seriously doubt that we could set up a wind tunnel measurement program on short notice. Is there a way to get some kind of estimate of the drag coefficient in a more simple way?

You have probably seen YouTube videos where people attempt to levitate a soccer ball with a leaf blower. Can we use a leaf blower instead of a wind tunnel to measure and compare the drag coefficients of both balls?

To figure out if teams practicing with the Adidas® Telstar® ball will start the FIFA World Cup™ with a certain advantage, we made the following assumptions for our experiment:

- If we can suspend each ball in the air using the leaf blower, we would know that the relative speed of the air around the balls is equal to the terminal velocity of the balls. The terminal velocity is the velocity that the balls would obtain if thrown from a high altitude and let fall until they no longer accelerate as they fall.
- The terminal velocity is related to the drag coefficient of the ball. The higher the drag coefficient, the lower the terminal velocity.
- The air flow from the leaf blower is technically a turbulent jet. The velocity at the center of a turbulent jet decreases with distance from the jet outlet; in this case, the tube of the leaf blower.
- Combining assumptions 2 and 3 means that a ball with a higher drag coefficient would be suspended at a higher distance from the leaf blower’s tube compared to the ball with a lower drag coefficient.

The relation for the terminal velocity and the drag coefficient at this velocity is obtained using a balance of forces. Since the ball weighs about 80 times more than the corresponding volume of air, we can probably neglect the effect of buoyancy. Under this assumption, we arrive at a balance between the two forces to the left in the figure below.

*The drag force, which is directed upward, , is balanced by the force of gravity directed downwards, .*

Here, denotes the drag force, the drag coefficient, the cross sectional area of the ball, the density of air, the terminal velocity of the ball, the force of gravity, the mass of the ball, and *g* the gravity constant.

The cross sectional area, the mass of the ball, and the density of air are the same, regardless of the ball we choose for the measurements. The only values that vary are and , since a higher value of the drag coefficient gives a lower value of the terminal velocity.

When the ball hovers above the leaf blower, the drag and gravity forces are equal in size but with opposite directions, as in the figure above. This gives the equation below:

\[\frac{1}{2}{C_d}A{\rho _{air}}{u_0}^2 = {m_b}g\]

which results in the following expression for the terminal velocity:

\[{u_0} = \sqrt {\frac{{2{m_b}g}}{{{C_d}A{\rho _{air}}}}} \]

From this formula, we can see that a change in the value of from 0.2 to 0.15 results in a change in terminal velocity of around 15%.

As a comparison, an old ball design with 32 panels should have a value of around 0.2 in the regime of turbulent boundary layer separation, while the Adidas® Jabulani, used in the World Cup in South Africa, has a value of around 0.15. The Jabulani is considered to have a very unusual behavior in the air and presented some problems for players (it was especially difficult for goalkeepers to adapt to). If the Adidas® Telstar® ball has a drag coefficient that is 0.05 lower than the Nike® Ordem V, we should get a difference in terminal velocity of the order of magnitude of 15%. Such a difference would have a large impact on the squads that practice with the Nike® Ordem V during the FIFA World Cup™.

The main idea behind the experiment is that we would place the leaf blower pointing straight up and put the ball on top of the jet. We have prepared the experiments by running some simulations in the COMSOL Multiphysics® software to predict the position of the ball at a realistic velocity delivered by the leaf blower, as shown in the figures below.

*The idea behind the experiment, with a computed estimate of the distance that we are going to be able to get between the leaf blower and the two different balls. Does the Adidas® Telstar® ball differ substantially from the Nike® Ordem V?*

There are doubts about the success of the leaf blower experiments.

- Where will the measured drag coefficient be along the curve for the drag coefficient as a function of the ball’s velocity?
- Will the terminal velocity be in the regime of laminar or turbulent boundary layer separation?
- How large must the difference in drag coefficient between the balls be in order for us to be able to measure a difference in distance from the leaf blower?

The figure below shows a schematic graph of the drag coefficient as a function of the ball velocity for different types of balls. The drag crisis region is between 10 and 20 m/s for a soccer ball. From the formula above, we can estimate the terminal velocity to around 35 m/s, which is in the regime of turbulent boundary layer separation, as shown in the figure below. This also corresponds to the highest velocity of the hardest long-range shots and the hardest free kicks in soccer, but the drag coefficient does not change dramatically all the way down to around 15–20 m/s, where the transition to laminar boundary layer separation may occur. So, one measured point will be representative for the ball’s drag over the whole regime of turbulent boundary layer separation. The lower part of this regime corresponds to long-range crosses, long balls, free kicks, and corner kicks.

*Schematic of the drag coefficient as a function of velocity. The drag coefficient does not vary much in the regime of turbulent boundary layer separation. The green curve could represent the Adidas® Jabulani, the blue curve the Adidas® Teamgeist II used in the UEFA Euro 2008™, and the red curve a typical 32-panel traditional ball, such as the first version of the Adidas® Telstar® ball used in the 1970 FIFA World Cup™ in Mexico.*

We can conclude from published measurements of the drag coefficient that most long-range crosses and offensive set piece kicks are within the regime of turbulent boundary layer separation, for which the drag coefficient at the terminal velocity is representative. Our first doubt may then be discarded: even a single point on the curve gives us valuable information.

However, assume that we manage to get a leaf blower that is powerful enough to get the ball to hover about half a meter above the leaf blower’s tube. How large will the difference be in the distance of two soccer balls with a difference in drag coefficient of 0.05 at terminal velocity? Assume that the terminal velocity for the ball with the lowest drag coefficient is 40 m/s ( value of around 0.15). We know that the velocity of a turbulent jet decreases with the inverse of the distance from the leaf blower’s tube. Using this relation, we can estimate the change in height to be around 7–8 cm higher for the ball with the larger drag coefficient. So, from a ball with a low value to a ball with a high value, we should get 0.50 m and 0.58 m distances from the tube, respectively. We should be able to measure this difference!

We now know that if we are very careful, we should be able to measure a difference in the position of the Adidas® Telstar® ball and the Nike® Ordem V above the leaf blower if there is a substantial difference in their drag coefficients.

There are a few important specifications of the experiment that we have to follow:

- Pump the Adidas® Telstar® ball to the official pressure for the FIFA World Cup™ (8.5–15.6 psi) with a soccer pump that can measure pressure with high accuracy.
- Pump the Nike® Ordem V to get the same weight (or as close as possible) as the Adidas® Telstar® ball. The pressure should be almost the same. It is more important that the weight is the equal for the two balls than the pressure.
- Measure the diameter of the two balls. They should be about the same, since they are official balls, but we need to know the difference to account for it in the estimates of the drag coefficient.
- Place the leaf blower in the same position with the same angle throughout the experiment, using a spirit level to make sure that the blower tube is in a 90° angle to the ground (parallel to the direction of gravity). This is very important.
- The leaf blower should not be held by a person, since a person may disturb the airflow around the ball.
- In the suggested setup (shown below), we have to make sure that the end tube length is at least ten times the diameter in order to reduce the influence of the elbow on the flow pattern at the outlet.
- Place the camera and calibrate the distance measurements so that the camera system measures the distance from the leaf blower tube to the ball.
- The screen should be far enough from the ball to avoid disturbing the jet.
- Place the camera on a tripod in a 90° angle to the screen and keep it in the same position relative to the screen and the leaf blower.
- Place the ball above the leaf blower tube, making sure that the ball does not spin. (It should not spin at all during the experiment.)
- Run each experiment 10 times in order to get an average distance. The values may change depending on what part of the ball faces the leaf blower’s mouth.
- Make sure to record everything so that it is easy to go back and check any strange results.

*Schematic of the experiment. The screen has to be placed far enough from the ball to avoid disturbing the air jet from the leaf blower. “Camera on Tripod Silhouette” by GDJ via openclipart.*

The hypothesis is that if we are able to measure a difference in height between the Adidas® Telstar® ball and Nike® Ordem V, then it is bad news for England, Brazil, and France (the Nike®-sponsored squads), unless they practice with the Adidas® Telstar® ball during the FIFA World Cup™. Additionally, it would be good news for Germany, Spain, and Argentina (the Adidas®-sponsored squads). Obviously, if we can measure a difference, we will all bet our life savings on Germany, Spain, and Argentina.

Note that even if we do not measure a larger difference in the drag coefficient, then the drag crisis regime in which the boundary layer transitions from turbulence to laminar (when the ball slows down due to drag) is also very important for when the ball will be affected by spin (the Magnus effect) or start wobbling (the knuckle ball or beach ball effect) for a ball that has no spin. If the drag crisis comes early for the Adidas® Telstar® ball compared to the Nike® Ordem V (i.e., already at high speeds like the Adidas® Jabulani did compared to a regular soccer ball), then this may even have a greater impact than the drag coefficient. Chances are, though, that a similar drag coefficient at the turbulent regime also gives a similar velocity at the drag crisis regime. We need to think of a simple way of measuring the drag crisis, but that is for a later experiment.

Did the England, Brazil, and France squad organizations read this blog post and make sure to practice with the Adidas® Telstar® ball for the FIFA World Cup™? We have seen reports that these teams are training with the Adidas® Telstar®ball, so they do not want to take any chances.

The preparation for our experiments are well underway. We have purchased the Nike® Ordem V and the Adidas® Telstar® ball, and we are going to rent the most powerful leaf blower that we can find. Stay tuned for the results from the experiments, as they could reveal which team will win the FIFA World Cup™…

Go Sweden! Go Uruguay!

*Editor’s note, 6/6/18: The follow-up blog post, “Does It Matter Which Ball the FIFA World Cup™ Teams Practiced With?“, is now live.*

*Adidas is a registered trademark of adidas AG. Telstar is a registered trademark of adidas International Marketing B.V. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by adidas AG or adidas International Marketing B.V.*

*PUMA is a registered trademark of PUMA AG. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by PUMA AG.*

*Nike is a registered trademark of Nike, Inc. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by Nike, Inc.*

*The UEFA word and all marks related to UEFA competitions, are protected by trademarks and/or copyright of UEFA. COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by UEFA.*

To demonstrate the moving mesh functionality, we will use the same problem as we did in the previous blog post on the phase field and level set methods. The model is of a solid bar that is partially immersed in water in a small channel. Note that the moving mesh functionality is actually also used to prescribe the movement of the little rectangular bar back and forth on the surface in the level set and phase field methods, as well as the moving mesh method.

*Geometry and definition of the example problem.*

The moving mesh method for the free surface prescribes the displacement of the rectangular bar and keeps track of the displacement of the water surface. We account for gravity in the model by adding a source in the momentum equations. In order to compare the results from the moving mesh method with the phase field and level set methods, we use Navier slip conditions for the walls. The slip length is equal to the size of the element length.

The moving mesh free surface modeling feature in the COMSOL Multiphysics® software is a completely different approach for the same problem, compared to the level set and phase field methods discussed previously. With the moving mesh approach, the free surface is modeled as a geometrical surface separating two domains. Surface tension and other surface forces are directly applied as boundary conditions at the free surface.

Using the *Free-Surface* feature, the displacement velocity of the free surface is obtained as the fluid’s velocity at the surface at any given time. The solution of the moving mesh equations smoothly displaces the mesh nodes inside the bulk of the fluid. The Navier-Stokes equations are in turn formulated on a moving coordinate system where the movement is obtained from the moving mesh equations that are solved simultaneously.

With this approach, the liquid is modeled while the flow field in the gas domain above the free surface is not treated other than through surface tension and pressure effects. Therefore, it is not possible to obtain the flow field in the gas phase with the current implementation. (This can, of course, be changed by manually adding a second fluid flow interface or by using the *Fluid-Fluid Interface* feature available in the *Two-Phase Flow, Moving Mesh* interface in the Microfluidics Module.) Furthermore, the moving mesh implementation in COMSOL Multiphysics is not able to treat topology changes of the free surface, such as breaking waves.

The modeling of free surfaces is, in a way, cleaner using moving mesh compared to the level set and phase field methods, since we can apply surface tension and other surface forces directly as boundary conditions, as mentioned above. Not solving for the fluid flow in the air domain above the free surface results in a substantial improvement in performance, since the number of degrees of freedom for the Navier-Stokes system are reduced to roughly half of that used by the field-based methods. Neglecting the influence of the air domain is motivated in this case by the large ratios in density and dynamic viscosity between water and air. The resulting differences are discussed in the next section.

The figures below show the free surface computed using moving mesh, as compared with the results computed using the phase field method. We can see that the agreement between the two methods is decent and both the shape of the free surface and the streamlines of the velocity field are similar.

However, the models are not identical. The air domain above the free surface in the phase field case has a small damping effect on the surface in the phase field method. The air domain is not present in the moving mesh case and the surface only “sees” a constant air pressure on top of the fluid surface. In other words, the free surface in the moving mesh case does not have to displace air and can use this energy to create slightly higher waves and a more undulated surface.

*The shape of the free surface and the velocity field at different times, computed using the moving mesh interface for two-phase flow (left) and the phase field method (right).*

The animation below shows the solution from the moving mesh method for free surfaces, which we can compare with our previous animation using the phase field method. We can clearly see that the free surface is more wavy and reacts more quickly compared to the phase field animation. This may be due to the missing air domain in the moving mesh, whose presence in the level set and phase field methods damps the movement of the free surface.

*Animation obtained from the moving mesh method for free surfaces.*

We can also compare the default free surface moving mesh feature with the full *Two-Phase Flow Moving Mesh* interface, which is able to account for the flow field in both the liquid and gas phases. We can see that the pattern of the flow field and the magnitude of the velocity vectors are very similar for the moving mesh with two phases compared to the results with the phase field method. The shape of the free surface is very similar for all three cases (moving mesh, phase field, and moving mesh with two phases), but here the two moving mesh cases have a more similar shape. The conclusion is that the air domain has some damping effect on the velocity field in the liquid, according to the simulation results. In addition, the difference in how the moving mesh and the phase field methods treat the wall surfaces at the phase boundary seems to be responsible for the differences (although small) in the shape of the free surface.

*Results using the* Two-Phase Flow Moving Mesh *interface.*

For the phase field, level set, and moving mesh methods, we can also consider using automatic remeshing, which automatically remeshes when the quality of the elements is too poor to fulfill the required quality. The quality is related to the largest angle of an element and also to the relation between the largest and smallest edges. A very large angle or a very compressed element means a poor element quality, which triggers an automatic remeshing when this functionality is selected. The figure below shows automatic remeshing applied on our little example problem. The quality of the elements after 0.35 s is poor enough to trigger a remeshing, which substantially improves the quality of the mesh.

*The mesh before remeshing is triggered (left) and after remeshing (right). We can see that the elements to the right of the little rectangular bar are stretched out before remeshing, but look more isotropic after remeshing.*

In the example problem, we prescribe the displacement of the little rectangular bar on the surface. It is quite straightforward to extend the problem by applying a force to the bar and actually computing the displacement of the bar due to the counterforces applied by the fluid. This gives a so-called fluid-structure interaction (FSI) problem.

As of COMSOL Multiphysics version 5.3a, the definitions of free surface problems (or two-phase flow problems) with FSI was facilitated by the introduction of the new fluid-structure interaction interface. The figure below shows the classical problem of a fluid wall collapsing, but now also hitting a small obstacle in its way. The effects of surface tension, the position of the liquid interface, and the flow are fully coupled with the structural displacement and the stresses and strains in the little whisker hit by the flow.

*Animation of two-phase flow FSI problem of a whisker that is hit by an incoming water pulse.*

In part one of this series of blog posts, we concluded that the phase field method is superior to the level set method in terms of performance versus accuracy for modeling free surfaces for systems where surface tension effects are present. The solution of our example problem shows that the moving mesh method with the free-surface feature is even better in terms of performance versus accuracy. However, it has two shortcomings:

- It cannot handle topology changes.
- It does not by default account for the air (or other gas) above the free liquid surface.

We can conclude that the moving mesh method should be the first alternative for modeling free surfaces, provided that we do not foresee any topology changes. If we have surface tension and topology changes, then the phase field method is the best alternative. Perhaps in a future blog post, we can compare these three methods for problems with negligible surface tension effects with and without topology changes.

Read the preceding blog post on the level set and phase field methods.

All of the examples above are available in the Application Gallery. If you wish, you can reproduce and check the validity of the results! Access the models mentioned in this series and read more about modeling free surfaces:

]]>

An airlift loop reactor is filled with water and injected with air bubbles at the bottom. Buoyancy causes the bubbles to rise, which creates circulation of the liquid. By modeling the induced turbulence in this type of bubbly flow model, you can predict the flow of liquids with dispersed bubbles, which is important in, for example, biochemical applications. Airlift loop reactors, such as airlift bioreactors, are useful for culturing microorganisms because they can create a relatively constant environment for cells and also provide a gentle form of stirring since cells are sensitive to mechanical stress.

*An example of a laboratory bioreactor. Image by Miropiro — Own work. Licensed under CC BY-SA 3.0, via Wikimedia Commons.*

Bioreactors that employ airlift bubble technology could potentially advance cell and tissue culturing techniques, such as culture aeration and disposable culture bags that simplify culturing and fermentation processes. In addition, scientists are developing new cancer treatments using bubble-based, jet-flow sorting techniques. T cells are cultured in bioreactors with hundreds of millions of cells and reintroduced into patients to identify and attack cancer cells. By using microvapor bubbles to generate air flow in the reactor, the sorting technique is gentle enough on the cells while retaining a speed of 5000 cells per second per single microfluidic channel.

In order to investigate the effects of bubble-induced turbulence in an airlift loop reactor design to advance reactor applications such as these, you can turn to simulation. The benchmark model discussed here is based on data from experiments published in peer reviewed scientific journals.

For the benchmark airlift loop reactor model, the liquid phase of the flow in the reactor is water and the gas phase is air. The model parameters are taken from experimental work and boundary conditions are set for the inlet, outlet, and symmetry:

*Inlet*boundary condition: Two frits (glass components of the reactor design) at the bottom of the reactor, through which air bubbles are injected with a superficial speed of 0.015 m/s*Outlet*boundary condition: Free surface approximated by a slip condition for the liquid; the gas is able to exit the reactor through the outlet*Symmetry*boundary condition: Mirror symmetry invoked in the*xy*-plane at*z*= 0.04 m

Other boundaries are represented by the wall functions for the liquid and with zero gas flux for the bubbles. In addition to meshing the frits very finely, the mesh should be relatively fine in the interior of the reactor, since bubbles tend to create complicated flow structures.

*Model geometry for the airlift loop reactor.*

Next, the multiphase flow is set up using the *Bubbly Flow* interface available in the CFD Module, an add-on to the COMSOL Multiphysics® software. Instead of tracking individual bubbles, the *Bubbly Flow* interface tracks the averaged gas-phase concentration. This interface solves for the liquid velocity (the velocity of the continuous phase), pressure, and volume fraction of the gas phase and provides several slip models for the gas bubble (dispersed phase) velocity relative to the liquid phase. For this benchmark model, it’s best to use a pressure-drag balance slip model with a drag coefficient tuned for large bubbles.

When you model turbulence in bubbly flow, you need to account for the extra production and dissipation of turbulence due to the relative motion between the bubbles and the liquid by adding source terms to the turbulence equations. For example, if you take the equation for the single-phase turbulent model, *k-ε*, you can add a source term in the *k* equation, denoted by S_{k}. Other areas, such as turbulent transport, can be accounted for using the *k-ε* model.

One of the many advantages of the *Bubbly Flow* interface is its flexibility. You can turn the *k-ε* model on and off and control whether to include or exclude the bubble-induced turbulence term S_{k}. The interface for the physical model also has a default low gas concentration option, because, as indicated by reactor experiments, the gas concentration could be high.

The results show the gas volume fraction and velocity streamlines for the liquid in the symmetry plane at t = 30 s. Other than a recirculation zone that is left out of the analysis, the results agree with the results of the reference experiment. As shown below, the maximum value of the gas concentration is about 7% closer to the two frits and higher than 2% in substantial parts of the reactor, which confirms that the low gas concentration assumption is not valid.

*Gas concentration and liquid velocity in the reactor at 30 seconds.*

Next, let’s examine the turbulent viscosity. After inducing turbulence with bubbles, there are relatively high levels of turbulent viscosity just above the frits. Levels are also high beneath the free surface, which could be why there’s no recirculation zone by the top-left corner. Another reason why the recirculation zone might be absent is because sloshing has been neglected in this example.

*Turbulent viscosity in the symmetry plane.*

For the final result, we compare our simulation results with the experimental results for vertical velocities at the following probe positions: #3, #5, #7, and #9. Each probe position corresponds to lines in the symmetry plane at different, constant heights: *y* = 300 mm for position #3, *y* = 650 mm for #5, *y* = 1250 mm for #7, and *y* = 1650 for #9. The probes are positioned in the rising part of the reactor.

Looking at the plots below, we can see that at probe positions #3 and #5, which are in the lower part of the reactor, both liquid and gas velocities from the simulation are in close agreement with the experimental results. In the upper part of the reactor, the agreement at positions #7 and #9 isn’t as good — but this can be accounted for because, again, the recirculation zone at the top-left corner is left out of the simulation.

*Comparison between the simulation results (blue) and experimental results (red) for vertical velocities at four different probe positions.*

Keeping the many modeling assumptions used in this example in mind, we can consider the simulation results to be in good agreement overall with the experiment results, showing that CFD simulation is a valid method for airlift loop bioreactor design analysis.

Try this benchmark model yourself by clicking the button below. This button takes you to the Application Gallery, where you can use your COMSOL Access account, along with a valid software license, to download the MPH-file.

- Check out this guide on choosing a multiphase flow interface
- Want more information on modeling reactors? Here are some topics to get you started:

The level set and phase field methods are both field-based methods in which a free fluid surface is represented as an isosurface of the level set or phase field functions. The free liquid surface corresponds to the phase boundary between the liquid and the gas and is represented on a fixed mesh.

The figure below shows the surface of two droplets in a channel, taken from the droplet breakup model in the Application Library of the add-on Microfluidics Module. We can see in this plot that although the surface of the droplet is very sharp, the elements around the droplet do not adhere to the droplet’s surface.

*The droplet surface does not coincide with the surface of the elements, neither in the level set method nor in the phase field method.*

The level set and phase field functions are both advected by the velocity vector computed by the Navier-Stokes equations. For both the level set and the phase field methods, this looks like:

(1)

\[\frac{{\partial \phi }}{{\partial t}} + \nabla \phi \cdot u = F\]

Note that we are using *Φ* for both the level set and phase field functions. The right-hand side of the equation, *F*, is where the two methods differ. In the original level set method, *F* = 0, which gives a pure advective transport equation. However, the numerical solution with *F* = 0 is unstable and of small practical use in most cases. Instead, terms with higher-order derivatives of *Φ*, designed to keep the interface compact, are introduced in *F* in the level set method.

In the phase field method, *F* represents a term that tries to minimize the free energy of the system. Also, higher-order derivatives of *Φ* are introduced in this term. In fact, the source term in the phase field equation includes fourth-order terms. This means that, for practical reasons, the equation is often broken up into two equations, where an auxiliary dependent variable is defined as a function of the second derivatives of *Φ*. This is also what is done in COMSOL Multiphysics.

Both methods introduce the source term into the Navier-Stokes equations that originate from the surface tension at the free liquid surface. In the level set method, the curvature of the level set isosurface that represents the free boundary is used to describe surface tension. In the phase field method, the contribution to the Navier-Stokes equations from the surface tension is calculated from the chemical potential, which yields the surface tension and the gradient of the phase field function close to the interface.

The properties of the fluid transition smoothly from liquid to gas over a given value of the level set or phase field functions; i.e., the value that represents the free surface.

The level set function, *Φ*, varies between 0 and 1 across the free surface and is constant at 0 or 1 in the bulk of the two fluids. The level set function can, for example, be 0 for the liquid and 1 for the gas phase. The free liquid interface; i.e., the phase boundary between liquid and gas; corresponds to the value of the level set function *Φ* = 0.5. The density is thus a function of the level set function according to:

(2)

\[\rho = {\rho _1} + \phi \left( {{\rho _2} - {\rho _1}} \right)\]

As well as the dynamic viscosity:

(3)

\[\mu = {\mu _1} + \phi \left( {{\mu _2} - {\mu _1}} \right)\]

We can see in the two equations above that when *Φ* = 0, we get the properties of fluid 1 (for example, the liquid) and when *Φ* = 1, we obtain the properties of fluid 2 (for example, the gas). We obtain a smooth transition of fluid properties across the free surface; i.e., as smooth as the level set function.

The phase field function, *Φ*, varies between -1 and 1, where the free liquid surface is the isosurface for *Φ* = 0. The computation of the viscosity and density is done in an analogous way to the level set method, but with a different expression, since the phase field function varies between -1 and 1.

The *Level Set* and *Phase Field* interfaces contain a number of parameters that need tuning in order for the methods to perform optimally. The values of these parameters depend on the modeled system and the numerical discretization of the equations. The size of the geometry (length, width, and depth); properties of the fluids; wetting of the walls; initial conditions; operating conditions; and size of the elements in the created mesh all have an impact on the selection of the model settings.

Let’s start with the level set method’s settings. The reinitialization parameter, *γ* in the user interface, makes sure that the gradients in the level set function are concentrated to the free surface over time; i.e., to the interface between water and air in our example below. It does not set the thickness of the surface, but it makes sure that the variations of the level set function are contained within this thickness. If we set this value too low, variations in the level set function can be entrapped in the bulk of one of the fluids, creating liquid-gas interfaces out of nowhere. A value that is too high tends to give small time steps and large computation times.

*The Settings window for the* Level Set *interface.*

The interface thickness parameter, denoted *ε* in the user interface, is more intuitive to understand. It simply controls the thickness of the region where the variations of the level set function are obtained. A large thickness smears out the shape of the free surface. The problem becomes easier to solve, but accuracy in the shape of the free surface is lost. A small value of *ε* yields a compact representation of the surface but requires a corresponding resolution of the mesh. There is no point in setting a value that is much smaller than the mesh element size, since the interface then becomes ragged and unresolved surface tension forces might cause spurious velocities. The value of *ε* should be set approximately to the same value of the largest elements close to the surface.

If we now look at the phase field method, the interface thickness parameter, *ε*, is almost identical to the level set method above and the same reasoning can be applied to the selection of its value.

*The settings for the* Phase Field *interface.*

The mobility tuning parameter for the phase field method, *χ* in the user interface, determines in a certain way the diffusivity of the phase field. This value has to be large enough for the phase field equation to be stable but small enough to give a sharp interface. The proper value is proportional to the speed at the surface and inversely proportional to the coefficient of surface tension.

(4)

\[\chi \propto \frac{{\left| {\mathbf{u}} \right|}}{{\sigma}}\]

This means that once we have found a proper value of *χ* for a certain set of operating conditions, we can use the relation above to set *χ* for a new set of conditions.

The figures below show the example problem that we are going to use to investigate the level set and phase field methods for modeling free surfaces in COMSOL Multiphysics.

A solid bar is half immersed in water in a small channel. The bar is put into motion back and forth, tangential to the water surface, in order to generate a gentle wave on the water surface. The dimensions of the channel and bar are small enough to keep the flow laminar.

*Geometry and definition of the example problem.*

Note that the moving mesh functionality is used to prescribe the movement of the little rectangular bar back and forth on the surface. However, in the level set and phase field methods, the mesh is not moved with the liquid surface.

Here are a few remarks about the model implementation in COMSOL Multiphysics:

- We add gravity as a source in the momentum equations
- We add a reference and a point constraint for the pressure field
- In order to compare results, we select Navier slip conditions for the walls and use a slip length equal to the size of the element length

The results for the flow field and the shape of the water surface are shown below for the following times: 0.07 s, 0.57 s, and 1.0 s. The flow streamlines and the shape of the water surface are in decent agreement for both methods at the respective times. There is a slight difference in the maximum velocity and in the height of the water surface, which may be explained by the fact that the two methods treat surface tension differently.

There are also some differences in the streamlines after longer times, for example, in the recirculation zones at t = 1.0 s. The phase field method tends to give a slightly calmer behavior of the surface. The level set method computes the surface tension force from the curvature of the surface, which is obtained from the gradient of the level set function. This gives a more “spiky” surface force compared to the smoother force obtained with the phase field method.

*Results from the level set (left) and phase field (right) methods after 0.07 s (top), 0.57 s (center), and 1.0 s (bottom).*

We can also visualize the full results from the simulation in an animation for the period from 0 s to 2 s. We can see that although the movement of the rectangular bar causes vigorous stirring, the free surface never breaks.

*An animation created from the solution of the problem using the phase field method.*

The level set and phase field methods also compute the flow field in the air domain above the free liquid surface. We can see that the movement of the rectangular bar leads to a vigorous flow field pattern that is continuous over the phase interface.

*The flow field in the water and air domains as computed with the phase field method after 0.57 s.*

If the agitation of the surface is increased so that it becomes more vigorous, then the surface can break up and later coalesce, which is shown in the animation below. This is also one of the benefits with the level set and phase field methods: It is relatively easy to deal with topology changes in the free surface in any of these two methods.

*The agitation with the rectangle-shaped bar is increased both in frequency and amplitude until a small wave breaks and generates entrapped air pockets in the water phase.*

Although the level set and phase field methods are similar, the treatment of the surface tension has a large impact on the stability of the two methods, at least in the implementation in COMSOL Multiphysics. For problems involving a strong effect from surface tension, the phase field method shows better performance regarding computation time compared to the level set method. The reason for this difference is that the computation of the surface curvature in the level set method forces the time-dependent solver to take substantially smaller time steps compared to the phase field method.

In our example, the time steps are on average five times larger in the phase field method, which results in a five-times-larger computation time for the level set method. So, for free surface problems at a small scale and for laminar flows where surface tension has a large impact (for example, in microfluidics), the phase field method is in general a better option.

In the 2D example that we have investigated in this blog post, the mesh is dense enough over the whole region where the free surface is expected to be found for the level set and phase field method. However, for 3D cases, we cannot always afford this type of resolution. One approach is to use the functionality for adaptive mesh refinement, which automatically creates a denser mesh according to whatever function we choose.

For example, the animations below show the mesh adaption according to the location of the largest gradients in the velocity (left) and according to the largest gradient in the phase field function (right). The plot shows both the air and the water phases. Note that the adaptive meshing with respect to the shear rate gives a refined mesh in the air phase and not that much in the water phase. In this case, we are interested in the water phase so we have to change the error indicator for adaptive meshing by scaling with the phase field function.

*Adaptive mesh refinement with velocity gradients as error indicator (left) and with the phase field gradient as error indicator (right).*

This blog post discusses the two field-based methods for modeling free surfaces: the phase field and the level set methods. In the second blog post in this two-part series, we will compare the modeling of free surfaces using moving mesh with the field-based methods shown here. Stay tuned!

Update: Part two is now live and you can read it here.

Learn more about the specialized features for simulating fluid flow available in the CFD Module, an add-on to COMSOL Multiphysics, by clicking the button below.

- Try it yourself: Download the MPH-file from the Application Gallery
- Read about other practical applications of the level set and phase field methods on the blog:

*Editor’s note: This blog post was updated on 5/25/2018 to include a link to the MPH-file of the example model, which has been added to the Application Gallery.*

The lid-driven cavity consists of a square cavity filled with fluid. At the top boundary, a tangential velocity is applied to drive the fluid flow in the cavity. The remaining three walls are defined as no-slip conditions; that is, the velocity is 0.

For benchmarking purposes, we want to solve something general that can easily be implemented in different tools. How can we compare different computational methods using the most generic formulation of this problem? One way is to nondimensionalize the equations, which means that the problem will not depend on specific materials, length scales, or operating conditions. In the case of fluid flow in a lid-driven cavity, we can solve the nondimensional Navier-Stokes equations.

The incompressible, stationary Navier-Stokes equations with no body forces take the following form:

\rho(\textbf u \cdot \nabla )\textbf u = -\nabla p + \mu \nabla^2 \textbf u

By nondimensionalizing the velocity (), pressure (), and length scale (), we can reformulate this equation as:

(\textbf u^* \cdot \nabla^* )\textbf u^* = -\nabla p^* + \frac{1}{Re} \nabla^{*2} \textbf u

The Reynolds number is defined as . This nondimensional number describes the relative importance of the inertial forces to the viscous forces in the flow, as described in this blog post.

By comparing the forms of these two equations, we can determine which parameters need to be entered into the COMSOL Multiphysics model in order to solve the nondimensionalized equations. Specifically, we see that the coefficient in front of the inertial term is 1, so we apply a density of 1 in the material properties. For the viscous term , we see that the coefficient is , so this is entered as the viscosity.

As the Reynolds number increases, the viscous term becomes less significant in the equation compared to the inertial term. Since the viscous term in the equation is linear and the inertial term is nonlinear, increasing the Reynolds number leads to the problem becoming more nonlinear. When solving nonlinear problems, we often want to apply nonlinearity ramping to provide good initial conditions for the solver. Nonlinearity ramping is discussed in detail in the following blog posts:

- Viscosity Ramping Improves the Convergence of CFD Models
- Nonlinearity Ramping for Improving Convergence of Nonlinear Problems

In this model, we perform an auxiliary sweep in the study over multiple Reynolds numbers. This sweep serves two purposes:

- Comparing the solutions for different Reynolds numbers to the results in the literature
- Demonstrating how to perform nonlinearity ramping to help the solver

In this case, the problem does not require nonlinearity ramping in order to converge. However, for highly nonlinear problems, this is an important technique to consider when improving the convergence.

In terms of boundary conditions, the top wall moves at a velocity of *U* = 1 in the *x* direction. The other three walls are applied as no-slip conditions (*U* = 0).

*The boundary conditions for the lid-driven cavity model.*

While these boundary conditions fully describe the physical problem we want to solve, there is one other essential condition that we need to apply to the closed cavity: a pressure point constraint. In a closed system at steady state, there are no inlets or outlets in which the pressure level is defined. Without a reference level for the pressure, the Navier-Stokes equations have infinite solutions to the steady-state problem, since they only solve with respect to the gradient in pressure. Thus, the pressure point constraint provides information about what the absolute pressure levels should be in the flow. When we apply a pressure point constraint of *p* = 0, it corresponds to an absolute pressure of 1 atm, as explained in this blog post on how to assign fluid pressure.

It is important to apply a pressure point constraint far away from the interesting behavior in the flow any time we solve for steady flow in a closed cavity — whether it is a mixed tank reactor or a natural convection problem. A couple of example models that use pressure point constraints are the Free Convection in a Water Glass and Modular Mixer tutorials.

Now that we have defined the boundary conditions, we can think about how we want to discretize the domain. The lid-driven cavity provides a perfect example of how mapped meshing can be applied to efficiently and effectively discretize four-sided geometries. Mapped meshing discretizes the domain using rectangular elements. These elements don’t need to be uniformly spaced. In fact, we can use *Distribution* subnodes to the *Mapped* node in the mesh sequence to define how the elements are spaced along the edges. In the lid-driven cavity, we want to stack more elements near the no-slip walls, where the gradients in the flow are higher, so we apply symmetric distributions along all of the edges.

*The mapped meshing of the lid-driven cavity model.*

While we are applying mapped meshing to a square in this case, the technique can be applied to any four-sided geometry. Irregular geometries can even be subdivided into four-sided entities so that mapped meshing can be applied. In some cases, mapped meshing can be computationally more efficient than free triangular meshing and it gives us more control over the element spacing. For examples of using mapped meshing, check out the Nonisothermal Turbulent Flow over a Flat Plate and Dissociation in a Tubular Reactor tutorials.

Now, let’s take a look at the results. First, we check the magnitude of the velocity in the cavity, plotted with the rainbow color scale, and the direction of the flow, indicated with the vector plot. We see that the velocity approaches *U* = 1 at the top of the cavity, where the fluid flow is being driven by the moving wall. The fluid is pushed into the wall on the right, where it flows downward before moving back up the left side of the cavity. This motion creates a large vortex in the center of the cavity. We can see that for a lower Reynolds number of 100 (figure on the left), the velocities in the center of the cavity are lower due to the dissipation of the energy through the large viscous term. As the Reynolds number increases to 10,000 (figure on the right), we see that the velocities are higher in the cavity and the vortex extends more prominently into the bottom of the cavity.

*The magnitude of the velocity and the direction of the flow in the cavity for Reynolds numbers of 100 (left) and 10,000 (right).*

The lid-driven cavity is a benchmark problem, so we want to compare it to existing literature (Ref. 1). To do so, let’s take a look at the velocities along the centerlines of the cavity. In the left image below, we see the *x*-component of the velocity (*u*) plotted along the vertical centerline, while the right image below plots the *y*-component of the velocity (*v*) along the horizontal centerline. We see that the simulation results closely match the results from the literature for the entire range of Reynolds numbers.

*Comparison of the results from the simulation and literature for the* x*- (left) and* y*-components (right) of the velocity for various Reynolds numbers.*

The velocity plot above shows that a large vortex is formed in the center of the cavity, but what about the flow behavior in the corners? We use streamlines to visualize the flow structures in all parts of the cavity. Because there is no inlet in this simulation, we set the *Streamline Positioning* to *Uniform density* (instead of *On selected boundaries*).

*Settings window showing the* Streamline Positioning *set to* Uniform density*.*

We can see that for lower Reynolds numbers, the flow separates near the bottom left and right corners and two vortices are formed. As the Reynolds number increases, there is more inertia in the flow, causing it to separate earlier along the wall and create larger corner vortices. Increasing the Reynolds number further, a third vortex forms in the top left corner. For the highest Reynolds number (10,000), two vortices are present in the bottom corners in addition to the one in the top left corner.

*The flow in the cavity for various Reynolds numbers.*

Here, we have showed how to define a classic CFD problem, the lid-driven cavity. An auxiliary sweep has enabled us to solve for multiple Reynolds numbers while improving the convergence of the simulation. We have also demonstrated how you can leverage mapped meshing to efficiently discretize a four-sided geometry and better resolve the high gradients in the flow near the walls. In addition, we have compared the results to existing literature and found that they closely match.

To try this example yourself, click the button below to head to the Application Gallery. There, you can download the model documentation and related MPH-file if you have a COMSOL Access account and valid software license.

- U. Ghia, K.N. Ghia, and C.T. Shin, “High-Re Solutions for Incompressible Flow Using the Navier-Stokes Equations and a Multigrid Method,”
*Journal of Computational Physics*, vol. 48, pp. 387–411, 1982.

The four valves in a human heart are flexible enough to both fully open, enabling blood to flow in one direction through the heart, and tightly close, sealing the heart chambers and preventing backflow. However, with valvular heart diseases, the valves do not function properly, which can cause serious cardiac health issues. As a result, studying heart valves is an important research area.

*Schematic of a heart. Image by Wapcaplet — Own work. Licensed under CC BY-SA 3.0, via Wikimedia Commons.*

One recent advancement in heart valve research has been the development of the smallest approved mechanical heart valve in the world. This is an important achievement, as every year, over 35,000 babies in the United States alone are born with congenital heart defects. For some of these newborns, the defects result in malfunctioning heart valves that require surgery to fix.

Of course, the creation of the smallest approved valve is only one example of innovation in heart valve research. This area has also sparked the interest of a team at Veryst Engineering, a COMSOL Certified Consultant who has worked with clients on similar real-world problems. To further advance heart valve research, the team was inspired to create an example model of a heart valve. Such a model could serve as a valuable design tool, providing crucial information to medical researchers.

As you might expect, modeling a human heart valve can be difficult and computationally expensive. For one, this problem involves strongly coupled fluid-structure interaction (FSI), with a moving and deforming structure interacting with a flowing fluid. In addition, it’s important to accurately account for nonlinear material behavior, contact modeling, and fluid-mesh movement.

To address this challenge, Nagi Elabbasi (a member of the Veryst team) used COMSOL Multiphysics, saying that the software provides a “unique capability to capture all [of] the coupled effects involved.” Using COMSOL Multiphysics, Elabbasi created a simple example to highlight how engineers can overcome the challenges of modeling realistic heart valves and predict their behavior.

In this model, a heart valve opens and closes in response to the fluid flow. Modeling this movement wasn’t easy, with Elabbasi noting that “the main challenges in this model are the closing of the heart valve and accurately representing the material behavior of the valve.” This poses an issue because the fluid mesh can collapse when the heart valve is closed. To avoid excessive mesh distortion, the team opted to use the advanced mesh control features in the COMSOL® software.

Let’s now take a look at some of the results the team at Veryst obtained from their heart valve model, which analyzes flow patterns, variations, and residence times; flow recirculation around heart valves; and how these factors are affected by the movement of a valve. It’s also possible to use the model to investigate stress and fatigue in the valve material as well as blood pressure, shear stresses, and deformation. The team also found that simulation enabled them to analyze multiple aspects of the heart valve at once, such as the interaction between blood velocity, valve deformation, and von Mises stress in the valve.

The model results (seen below) show that there are dead flow zones around the valve and recirculation in the fluid. Both of these factors are affected by the opening and closing of the valve. In addition, the root of the valve has high stresses. Researchers can use these results to identify potential issues and improve the designs of artificial heart valves. Please note that because this example was made only to demonstrate what you can achieve when modeling heart valves, the results seen here are not completely realistic.

*FSI model of a heart valve opening (left) and closing (right).*

Multiphysics models can also be used to visualize a heart valve in action, as shown in the example below.

*Animation of a heart valve. Animation courtesy Nagi Elabbasi of Veryst Engineering.*

This example shows what medical researchers can achieve by using FSI simulation. Using models like this one, researchers and engineers can predict the behavior of real heart valves, potentially using this information to improve the designs of artificial ones. Elabbasi also mentioned that “FSI modeling should be performed by all medical device companies working on heart valves, providing related products (stents, for example), or analyzing cardiovascular diseases (aneurysms, for example).” The information provided by such simulations will help improve the design of medical devices, making them more effective in treating diseases.

- Check out other medical applications of simulation on the blog: