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:

As concerns over climate change rise, the conservation and reuse of water is a pertinent discussion. For instance, the EPA issued best practices for water management and countries are passing laws that make it safer to reuse water. The U.S. Congress passed the Microbead-Free Waters Act in 2015 (with Canada, New Zealand, and the United Kingdom soon following suit) to prohibit the manufacture and distribution of rinse-off cosmetics containing microbeads. Plastic microbeads, which are often found in exfoliating shower gels, are nonbiodegradable and get rinsed down the drains and into our wastewater.

*Microbeads and other microplastics commonly found in bath products prior to the 2015 ban in the U.S. Image by Oregon State University. Licensed under CC BY-SA 2.0, via Flickr Creative Commons.*

Even with steps toward banning harmful contaminants, treatment plants still rely on physical, chemical, and biological processes to clean wastewater. Engineers working with wastewater treatment and contaminant removal processes can use simulation to study and design clarifiers.

Wastewater treatment involves two main stages:

- Physical methods, such as using clarifiers to separate solids and oils from water
- Bacterial degradation of pollutants, such as chemical oxidation, an advanced aeration technique

Clarifiers, one primary treatment method, rely on sedimentation, the process by which gravity is used to remove suspended solids from water. In the physical wastewater treatment process, solid particles are removed through sedimentation, aided by flocculation and filtration. Flocculation is obtained by adding coagulants, which leads to aggregation of very small particles to form flocs. Again, sedimentation removes these flocs.

*Close-up view of a secondary circular clarifier. Image by Annabel. Licensed under CC BY-SA 3.0, via Wikimedia Commons.*

During sedimentation, gravity causes flocs to fall toward the bottom of a clarifier tank. But there are many other processes at work that should be considered in the clarifier design.

The influent well is placed in the middle of the clarifier with the inlet at the bottom of the well. After ejection at the inlet, the larger heavy particles fall close to the middle of the clarifier almost immediately. This is due to their large mass-to-outer-surface ratio. The smaller heavy particles (those that are not small enough to form flocs) follow the main flow until there is a sharp change in direction of the flow. For example, if the main water flow in the clarifier changes from a downward to upward direction, then the heavier particles continue to fall and gather at the bottom of the clarifier, where they slowly leave through the sludge outlet. The clarified water exits at the peripheral outlet.

Turbulence can impede the formation of flocs and also break up flocs that are formed as they fall to the bottom of the tank, causing the very small particles to follow the water flow through the peripheral outlet. Turbulence can also transport small particles from the center to the periphery of the tank so rapidly that they never have time to settle (or to form flocs and then settle). The risk of mixing explains why the peripheral outlet of a typical clarifier is very large. The flow velocity decreases substantially with the radius, which causes less turbulence, less turbulent mixing, and larger residence time for each stream that travels through the clarifier outlet (giving enough time for particles to settle).

*A 3D view of a secondary clarifier model. The blue streamlines show a possible path for the clarified water, while the dark-yellow streamlines show a path for the dispersed solid phase, consisting of very small but heavy particles. The solid phase follows the flow of water until it takes a steep turn upward, where the higher density forces the heavy particles to take a lower path down to the sludge outlet.*

By modeling a circular secondary clarifier using the CFD Module, an add-on to the COMSOL Multiphysics® software, we can study how different factors affect the contaminant removal process for wastewater.

The model geometry for the secondary clarifier has a diameter of 24 m and a varying depth between 3.3 m and 4 m. Due to axial symmetry, we can simplify the model geometry from 3D to 2D axisymmetry (see the figure below). The inlet is at the bottom of the influent well at the center of the tank, as shown below. Here, the mixture of solids and water enters the clarifier in the form of a jet. There are two outlets: the sludge outlet at the bottom and the peripheral outlet where the clarified water leaves the clarifier. The flow rate is slow enough to assume a flat horizontal water surface.

*Geometry of the circular clarifier in 2D.*

The particles, including the flocs, are assumed spherical and of equal size and form the so-called dispersed phase. The k-ε turbulence model is used in combination with the mixture model for two-phase flow including gravity as volume force. The initial conditions are zero velocity, zero relative pressure, and zero solid phase volume fraction in the entire clarifier.

The boundary conditions are set as follows:

- Inlet:
- Velocity of 1.25 m/s
- Dispersed phase volume fraction: 0.003
- Turbulence intensity: 5%
- Length scale: 0.07*
*r*(where_{in}*r*= 0.2 m is the radius of the inlet)_{in}

- Velocity of 0.05 m/s at the sludge outlet
- Zero relative pressure at the peripheral outlet
- Slip conditions at the free surface
- No-slip conditions at the walls
- Axial symmetry at the symmetry axis

After 12 hours, the flow in the clarifier reaches steady state. We can see below that the dispersed phase volume fraction is higher at the bottom, as expected, but that turbulent mixing tends to spread out the particles, forming a smooth volume fraction profile. Also, we can see that the dispersed phase volume fraction profile is sharper as mixing decreases with distance from the center, since flow rate and hence also turbulence decrease as the mixture flows away from the inlet.

At the peripheral outlet (top right of the plot below), the particles and flocs have been allowed to settle enough to give a clear effluent (clarified water). Note that the maximum volume fraction of the dispersed phase (particles and flocs) is less than 1% in the whole clarifier, which verifies that the mixture model is accurate.

*Mixture-velocity streamlines and solid phase volume fraction after 12 hours.*

The dispersed phase mass flow rates at the inlet, peripheral outlet, and the sludge outlet are shown below. Using these results, we can calculate the particle removal rate. The calculations show that the clarifier removes 0.52 – 0.10 = 0.42 kg solid particles per second. Thus, the separation efficiency of the secondary clarifier is 81%.

*Mass flow rates of the dispersed phase at the inlet (blue), peripheral outlet (green), and central outlet (red).*

Finally, we can study the volume fraction of the dispersed phase and streamlines for both dispersed and continuous phases after 12 hours. We can see that the streamlines for the dispersed phase tend to move downward to a higher extent as the flow reaches the outer wall of the clarifier, while the continuous phase (water) tends to move upward toward the peripheral outlet to a higher extent.

There are two large recirculation zones close to the surface. The first one is found close to the center in the wake of the inlet jet. The second one is created by the mixture falling to the bottom at the edges of the first zone and the clarified water moving outward at the peripheral outlet of the clarifier. The dispersed phase tends to follow the lower path of the second recirculation zone and does not follow the streamlines up to the surface in this second zone.

*Cut through the swept-out volume of the clarifier with streamlines for the dispersed (blue) and continuous (white) velocity fields.*

We can easily modify the secondary clarifier model for more advanced analyses by:

- Adding baffles to the geometry
- Changing the inlet and outlet velocities
- Increasing the dispersed-phase volume fraction in the sludge
- Changing the density and size of the dispersed particles

You can try modeling a secondary clarifier by clicking the button below. Doing so will take you to the Application Gallery, where you can download the MPH-file if you have a COMSOL Access account and a valid software license.

To learn more about simulating mixers, check out these blog posts:

]]>

An ejector is a simple mechanical component with no moving parts that uses momentum and energy transfer from a high-velocity primary jet to induce a secondary flow. During this process, a high-energy fluid (the primary flow) moves through a convergent–divergent nozzle, eventually achieving supersonic conditions.

When the primary fluid leaves the nozzle, it mixes with a secondary flow in an area called a mixing chamber, which is a constant-area duct. This mixing results in a set of complex interactions between the mixing layer and shocks. The fluid expands and decelerates in the mixing chamber and diffuser, a device often placed before the outlet to help recover pressure and return the flow to stagnation. As a result, the fluid speed is reduced to subsonic conditions before it is released into the atmosphere.

*Simple schematic of an ejector.*

Ejectors are used for various applications, such as:

- Space debris removal
- Industrial refrigeration (e.g., in supermarkets)
- Gas recirculation
- Thrust augmentation in aircraft propulsion systems
- Vacuum generation

*Ejectors can be used to launch nets and capture space debris (like dead satellites) that orbit around Earth and pose a danger to astronauts and space-faring vehicles.*

To further advance ejector designs, it’s possible to use simulation to study the compressible turbulent flow within these devices.

This benchmark model of a supersonic ejector analyzes air in the primary and secondary streams. For verification purposes, the model definition with geometry, fluid properties, domain settings, and boundary conditions are all taken from scientific literature. Just like in the literature, this example is defined in a 2D axisymmetric coordinate system, since the problem is rotationally symmetric.

For details about the dimensions of this example, check out the model documentation for the supersonic ejector.

*Model geometry of the supersonic air-to-air ejector.*

In this example, the pressure of the secondary flow is smaller than the outlet pressure. The secondary flow is induced by the supersonic primary flow exiting the primary nozzle, which can induce a flow with an adverse pressure gradient. This flow is used in vacuum generation, where very low pressures can be achieved in the secondary inlet, and gas recirculation in, for example, fuel cell systems. In the case of recirculation, the COMSOL Multiphysics® software can be used to compute the recirculation mass flows, as seen in the model documentation.

The ejector problem discussed here can be solved using the *High Mach Number Flow* interface in the CFD Module, which is useful for accurately describing supersonic flows in gases.

The first result, below, shows that the flow velocity in this example is large enough to cause significant density and temperature variations in the fluid. Further, the flow exceeds a Mach number of 1 in the divergent section of the primary nozzle and in the mixing chamber. The deceleration of the fluid (from supersonic to subsonic flow) occurs through a complex succession of shocks, called a shock train or pseudoshock wave, caused by the boundary layers interacting with the mixing layers. These shocks are clearly seen as shock diamonds in the simulation results.

*Results showing a typical pattern with shock diamonds in the velocity field. These shock diamonds can also be observed experimentally in the case of reacting flow; for example, when combustion takes place in the flow.*

As expected, the primary flow accelerates within the nozzle’s convergent section, achieves sonic conditions in the throat, and expands in the divergent section.

*Mach number distribution in the ejector (left) and velocity distribution in the nozzle and mixing chamber (right). Both plots depict shock diamonds.*

Meanwhile, the secondary flow behaves like an artificial wall for the primary flow at the outlet of the primary nozzle. This results in virtual nozzle throats and a succession of expansion and compression waves past the mixing zone. Eventually, the flow decelerates within the constant-area duct and returns to stagnation at the diffuser.

*Turbulent kinetic energy distribution in the ejector, showing the two flows combining in the mixing chamber.*

Moving on, the plot below analyzes the pressure at the mixing chamber centerline and walls. While it’s true that the multiple shocks cause the flow to switch from supersonic to subsonic at the centerline of the duct, these shocks cannot be detected via wall pressure measurements. The reason the shocks can’t be detected is that the dissipation in the boundary layer can smear out the surface pressures.

*Pressure distribution along the mixing chamber centerline (blue) and walls (green).*

Next is the temperature of the ejector. The results here indicate that there are very low temperatures within the ejector. The outlet even has a lower temperature than both of the inlets. This is an important observation for those designing ejectors, especially when they are working with two-phase flows.

*Temperature distribution in the ejector.*

The results of the ejector benchmark model correlate well with results found in existing literature, showcasing the ability of the CFD Module to accurately analyze ejectors.

Want to try modeling a supersonic ejector? Get started by clicking the button below. This button takes you to the Application Gallery, where you can use your COMSOL Access account to download the MPH files (with a valid software license) for the example discussed here.

To learn more about supersonic flows, check out this blog post: How to Model Supersonic Flows in COMSOL Multiphysics®

]]>

Fluid flow can be accurately described by the laws for conservation of momentum, mass, and energy. The most accurate way to describe these laws is by partial differential equations (PDEs). The system of PDEs that describes these laws is nonlinear. In most practical cases, these equations cannot be solved analytically. Instead, we can discretize in space and time in order to get an approximation of the PDEs in the form of algebraic equations that we can solve. We can say that we approximate our mathematical model with a numerical model.

*The “real” description of the geometry, to the left, is approximated with a discretized description where momentum balances and mass balances in each element are carried out.*

For problems in space and time, COMSOL Multiphysics uses the method of lines, where the discretization in space is done using the finite element method and time discretization is done using some standard method for ordinary differential equations, such as backwards differentiation formula (BDF) or Generalized-α.

The fluid flow equations are nonlinear, which means that the discretized numerical model equations are also nonlinear. For transient problems, a system of nonlinear equations has to be solved at every time step. For steady flows, the numerical model equations form a system of nonlinear equations that has to be solved once.

The method for solving the systems of nonlinear equations, both for the time-dependent and stationary problems, is a damped Newton method, when the system is solved fully coupled. This method is based on linearization of the nonlinear equations and solving the linear equations in a sequence of iterations, often referred to as Newton iterations, until we obtain the desired accuracy.

In our case, we have hundreds of thousands or millions of equations and unknowns, proportional to the number of nodes in the finite element mesh that we used to generate the numerical equations. The linear equation system that has to be solved in each Newton iteration is too expensive to solve with a direct solver. However, we can solve the linear equations with an iterative solver using much less memory.

*Even this relatively simple model of the flow in a centrifugal pump requires 350,000 equations and unknowns. Thanks to the AMG solver, the equations can be solved on a desktop computer.*

For fluid flow problems, COMSOL Multiphysics uses the generalized minimal residual (GMRES) method, which is an iterative method for solving very large systems of linear equations. We can modify the linear equation system so that the GMRES method performs much better.

Multigrid methods provide an optimal technology for modifying, or preconditioning, the equation system for iterative techniques like the GMRES method.

The GMG method acts on the linear equation system for different mesh levels, from fine to coarse meshes. It transfers solution candidates, the iterates, between different linear systems corresponding to coarser and finer meshes. The idea is that a direct method is solved only for the coarsest mesh and this information is used to find a solution for the finer mesh levels more quickly. The coarse problem needs to be so small that it does not affect the performance of the method.

In each GMRES iteration, the GMG method may go from a finer mesh, where the right-hand side of the system is obtained, mapping the approximate solutions at the finer levels to the coarser mesh in a process called *presmoothing*. The solution of the equations is corrected at the coarsest level using a direct solver. This solution is then mapped to the fine levels again, in a process called *postsmoothing*.

The process of going down and up the mesh levels (V-cycle) can be repeated for each GMRES iteration. When the tolerance in the GMRES iterations is reached, we have a good-enough solution to the linear system.

The GMG method is extremely efficient for fluid flow problems. However, it has a very serious limitation. For complex geometries, it may be difficult or almost impossible to generate a coarse mesh that gives a system of equations that is small enough to be solved at the coarsest level.

*The thin blades of the centrifugal pump result in very small elements in the fluid around the blades. This also implies that even the coarsest mesh level generates too many elements and consequently too many equations to be solved with a direct solver using GMG.*

The AMG method does not require different mesh levels. The coarsening process in the AMG method is based only on the structure of the linear system of equations, or, more precisely, on the matrix that represents the left-hand side of the equation system. The method agglomerates entries in the matrix that are connected into fewer entries into a new matrix with smaller size. The process of agglomerating entries can be repeated and even smaller matrices can be constructed. These are then assigned different levels according to how many aggregations have been performed. The principle of the multigrid cycle with presmoothing, postsmoothing, and coarsest level solve is then the same as for the GMG method for the constructed matrices at the different levels.

*The settings for the iterative solver (GMRES) used in combination with the AMG method to solve the model equations for the Ahmed body shown below. Note that the method is used to solve for the momentum and continuity equations (u, v, w, p) and for the turbulence model variables (k, ε) in two separate steps in the segregated solver.*

In order to monitor the performance of the different solver settings in COMSOL Multiphysics, a couple thousand tests are run every day. One of the test cases for iterative solvers and fluid flow is the so-called Ahmed body model. Another test is the so-called laminar static mixer test. The results of the measurements show that for 6.3 million degrees of freedom, the AMG method beats the GMG method with about a 13% shorter solution time on a single-core computer.

*The Ahmed body is a benchmark model for turbulent flow and a verification model for turbulence models in general.*

Note that these results reflect the COMSOL Multiphysics implementation of these methods, not a general property of the methods. On a computer with four cores, this difference drops to around 6%. For 32 cores, the two methods are equal. The reason for this behavior is that the GMG solver is parallelized to a higher degree than the AMG solver. The new AMG method has already in its first year shown superior robustness and excellent performance, on par with the best-case scenario for the GMG method.

Learn more about the key features of COMSOL Multiphysics for your numerical modeling needs via the button below.

Read more about using multigrid methods on the COMSOL Blog:

]]>

Rolandi began his keynote talk by explaining that there is diversity in the biopharma industry when it comes to what Amgen is modeling. Their projects have both breadth and depth, which can require advanced modeling of biological systems. Rolandi said that one of his team’s goals is to move “beyond” simulation through the development and deployment of modeling apps.

Pablo Rolandi divided his keynote talk into Amgen’s biologic and synthetic medicine projects. The first synthetics application he discussed was an agitated dryer filter (ADF). This filter helps avoid bottlenecks in the drying stage of drug manufacturing by performing three key isolation steps (instead of five, like earlier methods). Amgen researchers used simulation to determine pressure, temperature, and agitation operating conditions at the manufacturing site. They also built a simulation app so that other team members could evaluate quantitatively the difference between an ADF with a heating plate only and an ADF with a heating plate and added agitation.

Next, Rolandi discussed an ethylene oxide sterilization simulation model, which, at Amgen, they call ETHOSS. The background of this model was that a novel container used for vial sterilization did not comply with standards, so the team built a simulation app to test parameters for the transport diffusion process of ethylene oxide. They found concentration and time profiles as well as numerical values for point concentrations, speeding up the development of ETHOSS by months due to the avoidance of uninformative experiments.

*From the video: Pablo Rolandi discusses ETHOSS, a model used to study vial sterilization processes.*

The third application featured in the presentation dealt with the purification of biologic via a polishing cation exchange chromatography step. This unit operation is used in the biopharma industry to separate drug substances from materials that cause side effects, but simulating this process requires estimating many material properties and transport/isotherm parameters. Amgen built, calibrated, and validated a chromatography model before turning it into an app that end users could use to test the various design parameters.

Rolandi shifted gears to talk about simulation for Amgen’s combination product (i.e., drug and device) applications. First, he showed the crowd a plunger position model, nicknamed PIT. By building a simulation app and deploying it, team members across the organization were able to estimate process capability metrics of plunger position manufacturing operations to meet quality requirements.

The final model Rolandi discussed was a component injection time model, nicknamed KIT. In the biopharma field, the injection time for a drug delivery system must be precise, but factors like the container, drug product, and injector device cause variance. Amgen ran a global sensitivity analysis, or “factor analysis”, on the system’s parameters; e.g., viscosity, equilibrium length, and needle radius. They found that only the parameters for the needle and spring affected the results, simplifying the problem. Amgen built a KIT simulation app for team members to run uncertainty and sensitivity analyses using their own combination product parameters.

By creating simulation apps like the five examples featured in Rolandi’s keynote presentation and deploying them organization-wide via the COMSOL Server™ product, Amgen has been able to move “beyond” simulation. Rolandi even said that at Amgen, they think of the COMSOL® software as their “compute kernel” and aim to find a way for everyone there to access the wealth of the simulation data they are producing. By moving beyond simulation with apps, Rolandi sees both new challenges and new opportunities.

To learn more about how Pablo Rolandi and Amgen use multiphysics modeling and simulation apps in biopharma applications, watch the video at the top of this post.

]]>

The important boundary condition that we will discuss here is called the *Inflow* boundary condition. It is available at boundaries that are exterior to a fluid domain and is equivalent to having a virtual channel “upstream”. The *Inflow* boundary condition is used to define a heat flux at the inlet boundary that brings the same energy to the fluid domain as if you had modeled the virtual channel as a real CFD domain. The virtual channel can be seen as a long insulated channel with given thermal properties at the inlet, and with the same velocity profile as defined in the settings for the *Inflow* boundary condition.

*Representation of the virtual domain corresponding to an* Inflow *boundary condition.*

From a mathematical point of view, the boundary condition is formulated as a flux condition:

(1)

-\mathbf{n} \cdot \mathbf{q} = \rho \Delta H \bf{u}\cdot \mathbf{n}

where the enthalpy variation is defined as:

(2)

\Delta H = \int_{T_{\mathrm{upstream}}}^{T}{C_p \mathrm{d}T}+\int_{p_{\mathrm{upstream}}}^{p}{\frac{1-\alpha_p T}{\rho}\mathrm{d}p}

where we can designate the two terms:

{\Delta H}_T = \int_{T_{\mathrm{upstream}}}^{T}{C_p \mathrm{d}T}

and

{\Delta H}_p = \int_{p_{\mathrm{upstream}}}^{p}{\frac{1-\alpha_p T}{\rho}\mathrm{d}p}

so that we can write:

\Delta H ={\Delta H}_T + {\Delta H}_p

This expression contains two terms. The first, , depends on the temperature difference while the second, , depends on the pressure difference.

Eq. (1) expresses the fact that the normal conductive heat flux () at the inflow boundary is proportional to the flow rate and enthalpy variation between the upstream conditions and inlet conditions.

As shown in Eq. (2), the enthalpy variation depends in general both on the difference in temperature and in pressure. However, the pressure contribution to the enthalpy, , is neglected when the work due to pressure changes is not included in the energy equation.

In the COMSOL Multiphysics® software, this is controlled in the *Nonisothermal Flow* multiphysics feature using the corresponding check box:

There is another classical case where this term cancels out: when the fluid is modeled as an ideal gas. Indeed, in this case, .

First, let’s assume that the pressure contribution to the enthalpy is null. (We have seen above that this is actually quite often the case.) Then, the boundary condition reads:

(3)

k\nabla T \cdot \mathbf{n} = \int_{T_{\mathrm{upstream}}}^{T}{C_p \mathrm{d} T} \: \rho\mathbf{u} \cdot \mathbf{n}

When advective heat transfer dominates at the inlet (large flow rates), the temperature gradient, and hence the heat transfer by conduction, in the normal direction to the inlet boundary is very small. So in this case, Eq. (3) imposes that the enthalpy variation is close to zero. As is positive, the *Inflow* boundary condition requires to be fulfilled. So, when advective heat transfer dominates at the inlet, the *Inflow* boundary condition is almost equivalent to a *Dirichlet* boundary condition that prescribes the upstream temperature at the inlet.

Conversely, when the flow rate is low or in the presence of large heat sources or sinks next to the inlet, the conductive heat flux cannot be neglected. In addition, the inlet temperature has to be adjusted to balance the energy brought by the flow at the inlet and the energy transferred by conduction from the interior, as described by Eq. (3).

This makes it possible to observe a realistic upstream feedback due to thermal conduction from the inlet surroundings.

Keeping the assumption that the enthalpy only depends on the temperature and that, in addition, the heat capacity is constant, Eq. (1) reads:

(4)

k \nabla T \cdot \mathbf{n} = (T-T_\mathrm{upstream})C_p \rho\mathbf{u} \cdot \mathbf{n}

which corresponds to a *Danckwerts* boundary condition that is used in, for example, the *Transport of Diluted Species* interface.

In practice, there are many models where the heat capacity is nearly constant, so the *Inflow* boundary condition behaves like a *Danckwerts* boundary condition with an averaged heat capacity. Interestingly, if this is not the case, the *Inflow* boundary condition automatically accounts for an incoming flux that corresponds to the enthalpy and cannot be expressed by simply using a *Danckwerts* boundary condition.

Let’s discuss a general case. In Eq. (2), the enthalpy variation depends both on the difference in temperature and in pressure.

Considering that the *Inflow* boundary condition models a virtual channel feeding the inlet, we expect pressure losses between the virtual channel inlet and the boundary where the condition is defined. This explains why the upstream pressure is different from the inlet pressure. While the fluid flows through the channel, it is subject to pressure work that results in a temperature change between the virtual channel inlet and the boundary where the *Inflow* boundary condition is defined. This is what is described by the pressure-dependent term in Eq. (2). Note that the viscous dissipation in the virtual channel is not accounted for.

In practical situations, the pressure contribution, , is often zero (for ideal gases or when work done by pressure changes are neglected) or small in the sense that a very small difference between the upstream temperature and the inflow temperature is enough to balance it. To illustrate this, consider two common fluids:

- Air: Its density is defined from the ideal gas law in the Material Library, hence the pressure contribution to the enthalpy, , is zero.
- Water: The order of magnitude of is 1000 J/K/kg while the order of magnitude of is 0.001 m
^{3}/kg. A pressure difference of 1 bar (= 10^{5}Pa) and a temperature difference of 0.1 K induce and , respectively; two contributions with the same order of magnitude in .

To illustrate how the *Inflow* boundary condition behaves compared to a *Temperature* boundary condition, we can study the stationary temperature profile in a long channel in 2D, which actually represents a flow between two plates. Beyond a certain point, the channel is cooled by a convective heat flux on both sides. The channel height is 1 cm and the part exposed to the convective heat flux is 10 cm long. The channel is filled with air (the density follows the ideal gas law).

At the inlet located at some distance from the cooling area, the average velocity is U_{in} and the temperature is T_{hot} = 30°C. The convective heat flux is defined as h(T_{cold}-T), with h = 100 W/m^{2}/K and T_{cold} = 10°C.

Most of the temperature variations occur beyond the point where the heat flux is applied, so we can choose to reduce the computational domain by modeling only a fraction of the channel before the cooling area. The image below contains two sketches. The one at the bottom has a section of length *L*_{inlet} = 2 cm before the cooling area, while on the one on top, the inlet coincides with the beginning of the cooling area (*L*_{input} = 0).

*Representation of the geometry with a section before the area exposed to the heat flux (top) and with the inlet at the beginning of the area exposed to the heat flux (bottom).*

Now we solve the model using either a *Temperature* or *Inflow* boundary condition at the inlet. We vary two parameters in the model:

- Inlet velocity, U
_{in}: 1 cm/s and 10 cm/s - Length of the channel before the area exposed to the heat flux,
*L*_{inlet}: 0, 0.2, 1, and 2 cm

The goal of these simulations is to determine the values of *L*_{inlet}for which we are able to set accurate thermal boundary conditions using *Temperature* and *Inflow* boundary conditions, respectively.

Let’s comment on the results for U_{in} = 10 cm/s. In the left part of the figure below, we see the temperature profile using the *Temperature* boundary condition (top) and the *Inflow* boundary condition (bottom). The two graphs look very similar and it is difficult to draw any conclusion from them, but the graph on the right gives more details.

The graph to the right shows the temperature profile along the vertical line located at the beginning of the cooling zone. (It coincides with the inlet boundary, when *L*_{inlet} = 0. Let’s call it “reference line” in the rest of this blog post.) The solid lines represent the results obtained using an *Inflow* boundary condition and the dotted lines correspond to the *Temperature* boundary condition. The different colors correspond to different values of *L*_{inlet}.

Let’s first check the results obtained using the *Temperature* boundary condition (dotted line). We see that as *L*_{inlet} increases, the temperature profile along the reference line converges to a given profile. The results for *L*_{inlet} = 2 cm show no improvement; they coincide with the results obtained for *L*_{inlet} = 1 cm, so we can consider that there is no need to further extend the channel.

For *L*_{inlet} = 0, the temperature profile is quite different from the converged profile. This illustrates a classical issue using a *Temperature* boundary condition: As the temperature profile is not known in advance along the reference line, the best option is to prescribe a reasonable temperature; here, the upstream temperature.

When an *Inflow* boundary condition is used, if the value of *L*_{inlet} is increased, the temperature profile along the reference line convergences to the same profile as when a *Temperature* boundary condition is used.

We notice that especially with *L*_{inlet} = 0, the solution is much closer to the converged profile than when using the *Temperature* boundary condition.

*Left: Temperature field in the channel using the* Temperature *boundary condition (top) and* Inflow *boundary condition (bottom) for* L* _{inlet} = 0 and U_{in} = 10 cm/s. Right: A comparison of the temperature along the reference line with the* Inflow

It is important to keep in mind that in many projects, the geometry contains inlets that are fed by channels that are not represented in the geometry. While for simple geometries — like here — it is easy to modify it to include a part of the channel before the inlet, it can be challenging for advanced geometries. Even with *L*_{inlet} = 0, the *Inflow* boundary condition gives a decent prediction of the temperature profile at the inlet.

When the channel before the inlet can be extended a sufficient distance, the temperature profile on the inlet boundary obtained using *Inflow* and *Temperature* boundary conditions coincide. This is in agreement with the analysis made before stating that when the advective heat transfer dominates and an ideal gas model is used, the *Inflow* boundary condition is similar to a *Temperature* boundary condition. It is interesting to mention here that from a numerical point of view, the two conditions behave similarly in this case. (For example, the number of iterations taken by the nonlinear solver is identical for both conditions.)

Apart from the temperature profile, another quantity that should be monitored is the heat rate induced by the heat flux. The table below contains this heat rate for the different values of *L*_{inlet}. One column contains the value for the *Inflow* boundary condition and the other for the *Temperature* boundary condition.

*The heat rate tabulated for the case with highest inlet velocity.*

When the *Inflow* boundary condition is used, the heat rate is almost constant. When using a *Temperature* boundary condition, the heat rate is affected by the value of *L*_{inlet}.

Because the velocity is lower in this case, the advective effects no longer dominate. The image below to the left shows the temperature field obtained using the *Temperature* boundary condition (top) and *Inflow* boundary condition (bottom). Although the two plots look similar, a closer look at them reveals that at the end of the inlet boundary, there is a difference between the two temperature profiles.

The graph to the right shows the temperature profile along the reference line. As before, the solid lines represent the results obtained using an *Inflow* boundary condition, the dotted lines correspond to the *Temperature* boundary condition, and the different colors correspond to different values of *L*_{inlet}.

Again, for *L*_{inlet} = 0, the *Temperature* boundary condition prescribes a constant temperature along the reference line. This temperature profile is far from the solution obtained with the largest values of *L*_{inlet}. As before, we see that as *L*_{inlet} increases, the temperature converges to a given profile. However, here, the convergence is slower, compared to the case with *U*_{in} = 10 cm/s. Comparing the solution obtained using the *Inflow* boundary condition and the *Temperature* boundary condition, we notice that for any value of *L*_{inlet}, the solution obtained using the *Inflow* boundary condition is always closer to the converged profile.

*Left: Temperature field in the channel using the* Temperature *boundary condition (top) and* Inflow *boundary condition (bottom) for* L* _{inlet} = 0 and* U

The table below again shows the heat rate for the two boundary conditions.

*The heat rate tabulated for the case with the lowest inlet velocity.*

The trend is similar to the first case, but when a *Temperature* boundary condition is used, the influence of *L*_{inlet} on the heat rate is much larger. Using a *Temperature* boundary condition with *L*_{inlet} = 0, the value of the heat rate is overestimated by a factor of almost 2 compared to the solution obtained with a long inlet. Using an *Inflow* boundary condition, the heat rate is correctly predicted for any value of *L*_{inlet}.

These results show that when *L*_{inlet} is small (especially when *L*_{inlet} = 0), the temperature profile and the heat flux are more realistic using an *Inflow* boundary condition rather than a uniform *Temperature* boundary condition. This can be explained by the fact that at the inlet, a uniform temperature profile is not realistic. In practical situations, the temperature is not controlled exactly at the inlet but, for example, in a tank located at some distance.

While in many configurations, the *Temperature* and *Inflow* features describe similar conditions and lead to similar simulation results, there are a number of configurations (especially for slow flow and small dimensions) where the conductive effects are not dominated by the advective effects and where the *Inflow* boundary condition usually leads to a temperature profile that is closer to the reality than a *Temperature* boundary condition. In addition, a *Temperature* boundary condition could enforce an erroneous temperature value that induces large heat fluxes that are not realistic.

As the *Inflow* boundary condition is simple to use and usually does not induce an additional numerical cost to be solved, it ought to be the first choice to define a heat transfer condition at the flow inlet. The vast majority of model examples in the Application Libraries use it.

Learn more about all of the functionality available for heat transfer modeling in COMSOL Multiphysics by clicking the button below.

: Heat capacity (SI unit: J/K/kg)

: Heat transfer coefficient (SI unit: W/m^{2}/K)

: Boundary normal vector (SI unit: K)

: Thermal conductivity (W/K/m)

: Pressure (SI unit: Pa)

: Heat flux (SI unit: W/m^{2})

: Pressure of the upstream (SI unit: Pa)

: Temperature (SI unit: K)

, : Cold and hot temperatures (SI unit: K)

: Temperature of the upstream (SI unit: K)

: Inlet temperature (SI unit: m/s)

: Coefficient of thermal expansion (SI unit: 1/K)

: Density (SI unit: kg)

: Velocity (SI unit: m/s)

: Enthalpy change vs. reference enthalpy (SI unit: K)

]]>

Compared to other heat exchangers, compact heat exchangers have a much larger heat transfer area per volume, usually thanks to dense arrays of plates or tubes. This attribute makes these heat exchangers lighter and more compact than classical heat exchangers. One disadvantage of the smaller heat exchangers is that they have higher pressure drops, which limits the flow rate and thus the amount of heat they can transfer.

*An illustration of a plate-and-frame heat exchanger, a common type of compact heat exchanger.*

In Reference 1, researchers explored whether they could improve the performance of compact heat exchangers by adding a dynamic wall. When the wall deforms, it generates oscillations that help mix the fluid and lessen the thermal boundary layers. As a result, the heat exchanger is able to transfer more heat. In addition, the oscillations generate a pumping effect similar to that of a peristaltic pump. This makes up for pressure losses, increasing the efficiency of the heat exchanger.

Oscillation might be a useful way to enhance the performance of compact heat exchangers. Using COMSOL Multiphysics, we can test this idea by easily creating and examining a model of the dynamic wall heat exchanger…

We start by modeling a static heat exchanger without a dynamic wall. This way, we can compare the results of both heat exchanger designs.

The static heat exchanger geometry consists of an upper wall, bottom wall, and channel. Fluid (water in this case) moves through the channel, steadily increasing in temperature due to a heat flux applied to the bottom wall. At this wall, we set the delivered heat rate to 125 W. Probes at the outlet determine the temperature and mass flow rate of the water when it exits the exchanger.

*The geometry of a static heat exchanger.*

Next, we prescribe a deformation on the upper wall based on the following parameters:

- Time
- Channel height
- Channel length
- Oscillation frequency
- Oscillation amplitude
- Number of waves in the channel length direction

*Animation showing the deformation of the dynamic wall.*

For the full details of how to model the dynamic wall heat exchanger, go to the Application Gallery, where you can download the model documentation and MPH-file.

To simulate the heat transfer and oscillation, we couple two built-in features. The first is the *Conjugate Heat Transfer* multiphysics coupling, which enables us to account for the heat transport between the exchanger and the water. We combine that coupling with the *Moving Mesh* feature, which simulates the deformation of the wall and channel.

Let’s look at the results for the static analysis of the heat exchanger. When the upper wall remains flat, we get a mass flow rate of 5.5 g/s and a heat transfer coefficient of 2900 W/m^{2}.

*The temperature profile in the channel for the static heat exchanger.*

Next, let’s look at the time-dependent analysis for the dynamic wall heat exchanger. The oscillation reaches a pseudoperiodic state after around 0.6 seconds. After it enters this regime, the average mass flow rate is 10.5 g/s, nearly double the rate at static conditions. As expected, the heat transfer coefficient is also higher: about 19,000 W/m^{2} for an oscillation amplitude of 90%.

*Left: The variations in temperature and flow rate. Right: The temperature profile in the channel of the dynamic wall heat exchanger.*

With simulation, it’s possible to analyze and optimize heat exchanger designs for maximum performance and efficiency.

- Check out these related blog posts:

- P. Kumar, K. Schmidmayer, F. Topin, and M. Miscevic, “Heat transfer enhancement by dynamic corrugated heat exchanger wall: Numerical study,”
*Journal of Physics: Conference Series*, vol. 745, 2016.

In 1773, André Bordier, a Swiss naturalist, used the term “fluid” to describe the movement of mountain glaciers for the first time. However, it took more than a century for scientists to agree on a unified description for the dynamics of glaciers.

One of the most confusing aspects of glaciers is the observation that ice exhibits both viscous and plastic behavior, depending on the glacier. British physicist John Glen observed and described this intermediate behavior using a nonlinear relationship between stress and strain. Known as *shear thinning*, this classical behavior applies to many different fluids (e.g., ketchup and blood).

The life of any mountain glacier can be schematically described as follows:

- Snow piles up at a high altitude, where the temperature is low, and compresses into ice
- The ice starts deforming and flowing down the slope under its own weight
- The ice melts away at a lower altitude, where the temperature is higher

*Sketch of a typical mountain glacier.*

Thus, we have a dynamical process for the ice, even at steady state (when the snow fall exactly compensates for the melting): *creep*. This fluid model is a standard Navier-Stokes equation with one simplification: the *Stokes (low-Reynolds) approximation*, which neglects the advection term. A typical value for the Reynolds number is *Re* = 10^{-15}, so the assumption undoubtedly holds.

The simulation of viscous flow generally assumes a linear relationship between stress and strain. This assumption describes a *Newtonian fluid*. Many fluids are, indeed, Newtonian in their standard condition (e.g., water and air). However, many fluids exhibit a variation of their viscosity when submitted to shearing. A slightly more general approach is to use a constitutive law to describe the viscosity as a function of a certain power of the shear rate. Mathematically speaking, it is written , where is the shear rate and is classically defined as the norm of the strain rate tensor .

Get more details in these blog posts about non-Newtonian fluids and the non-Newtonian behavior of ketchup.

To completely define the flow law, two parameters need to be evaluated:

- Consistency,
- Stress exponent,
*n*

In the case of ice, it is common to take . However, the viscosity of the ice depends not only on the shear rate but also the temperature and pressure. The consistency is then defined in order to represent these dependencies. A classical way to define the consistency in ice modeling is to use an Arrhenius law (Ref. 1): , where *R* is the perfect gas constant and *T’* is the temperature relative to the pressure melting point.

Indeed, the pressure dependency is reflected through the shift of the ice’s melting point with pressure (which is lowered with increasing pressure). Using the Clausius-Clapeyron relation, we obtain , where is the Clapeyron constant. The values for *A*_{0} and *Q* are a matter of debate. (Ref. 2)

This elegant flow law, established empirically over the years through rigorous lab work, has failed to predict the high velocities observed on real-life glaciers. It took many years to understand what was missing. Consensus was brought about by J. Weertman in the late 1950s with the notion of *basal sliding*.

At an equation level, the basal sliding law of glaciers is not different from the *viscous slip* concept introduced by H. Navier a century earlier, based on molecular interaction considerations. However, the physical process behind this law, in the case of ice flow, is still a matter of debate and is not the subject of this post. Let’s just recall that it is written as , where *u _{t}* is the velocity of the base; is the viscosity (nonlinear here); is the

The *Mer de Glace*, which translates to “Sea of Ice”, is a mountain glacier located in the Mont Blanc massif in the French Alps above the Chamonix Valley. Considered the largest glacier in France, it has been widely observed and monitored because of its considerable moving speed for a valley glacier (around 100 meters per year) and its significant retreat and decrease in size in the past 80 years. Studies show an average loss of 5 meters per year in thickness and 30 meters per year in length.

Below (right) is a sketch of a geometry for a valley glacier, set up using COMSOL Multiphysics and the CAD geometric kernel (available with the CAD Import Module). The geometry approximately mimics the measurements and visuals of the Mer de Glace (left).

*Left: Aerial photo of the Mer de Glace in 1909. Image in the public domain, via Wikimedia Commons. (Annotations added by the author.) Right: Model geometry, colored by thickness.*

Let’s simulate the nonisothermal flow of the ice mass downslope, under its own weight and subject to basal sliding.

In terms of fluid, the inflow and outflow boundary conditions are the normal constraints, corresponding to the applied pressure of the ice, which is not included in the domain. It simply corresponds to an assigned hydrostatic (or cryostatic) pressure. The upstream boundary weighs on the domain, thus contributing to a streamwise velocity, while the downstream boundary resists to the flow. The surface of the glacier is a free surface.

In terms of heat transfer, the surface is considered to be at an ambient temperature. The boundary in contact with the bedrock is normally subject to a geothermal heat flux, which could be modeled as a boundary condition. However, since such a value is spatially varying and generally unknown, a temperature is imposed in the present case. This way, we ensure that the ice remains at a temperature below 0°C, thus avoiding the phase change and latent heat flux contribution. It is worth noting that this aspect could be taken into account using a *Material with Phase Change* interface. Heat is allowed to enter and leave the domain at the inflow and outflow boundaries.

An extruded mesh is used that is consistent with the aspect ratio of the geometry.

The external weather conditions are an important input data for geophysical simulations. Accessing the ASHRAE 2017 database directly through the *Heat Transfer* interface, we can import the average external temperature and wind velocities at a given time of the year for more than 6000 weather stations all over the world. Here, we use the data from the *Grand Saint Bernard* station in the Swiss Alps, located at 16 km of the Mer de Glace, around at the same altitude on the first of February at noon. The ambient temperature is imposed at the glacier surface and the wind velocities are used to simulate a convective heat flux at the surface.

First, we run the simulation without basal sliding to see how much the viscous flow contributes to the observed velocities of the glacier. The results are expected to be around 120 meters per year at the top of the glacier and 90 meters per year at the end of the glacier.

As we can see on the left-hand side of the plot, solely based on the viscous law described here, we get only 50% of the expected velocity.

We can introduce a viscous slip with a slip length *L _{s}* = 250 m and run the simulation again. Below, we plot the velocity at the surface along the central flowline of the glacier for both cases.

Now the velocity is globally much higher and better matches the expected magnitude. It is interesting to note that the viscous sliding does not only introduce a pure shift of the velocities. Indeed, as a function of the nonlinear viscosity, it adds a nonlinear contribution, thus it is not purely rigid. With this value for the slip length, the sliding contributes to around 60% of the velocity at the surface.

Next, let’s move on to the results about the effect of temperature on the ice flow, which is an important coupling in the context of recent climate change studies. To quantify the effect of global warming on the glacier, let’s consider the following experiment. According to data, the temperature has been globally stable between 1940 and 1970, so we can assume that the glacier reached a steady state during this period. Measurements show that the global average temperature has increased by around 1 degree over 50 years. We can thereby simulate the transient flow of ice over these 50 years with the average temperature steadily increasing for a total of 1 degree.

To see the effect of this change in temperature, we can plot the evolution of the mass outflux, in cubic meters per year, at the downstream boundary.

It’s interesting to observe the delay between the beginning of the temperature increase and the beginning of the glacier’s response. The linear temperature increase starts in 1970 and the first significant effects are observed around 8 years later. This delay is mainly due to the time for a temperature change at the surface to propagate through the whole glacier (and thus increase the average temperature in the whole bulk). As a result, the output mass flux increases by around 12% during this period, leading to a net extra ice loss of 10 meters over the period, a 6% increase (compared to the case where temperature would have remained steady).

Let’s compare our results with the data about the Mer de Glace discussed earlier. If the glacier decreases in thickness by 5 meters per year for our domain (5500 meters long and 600 meters wide in average), we get 15 Mt/yr of ice loss per year. Even assuming that all of this ice flux will melt at a lower altitude (which is not the case), the 3 Mt/yr per year computed for 2017 is much smaller than the real mass loss that the Mer de Glace has undergone in past decades. This is because the simulation does not take into account the negative *surface mass balance* (the accumulation of snow minus the melting of ice at the surface).

Surface mass balance, in terms of modeling, is a data input and itself the product of complicated physics. As an example, hotter summers have a very strong effect on glaciers, because the small amount of snow that normally falls in the summer acts as a shield against solar radiation, thereby protecting the glacier from a large part of summer melting. If the summer snowfall does not occur, the melting is then much greater. This extra melting results in large infiltrations of liquid water through crevasses, which eventually form a subglacial hydrological network that plays a significant role in the basal slipperiness, mostly via the lubrication of the ice-bedrock interface and the water pressure “lifting” the glacier.

The fact that the simulation is performed for a given geometry of the glacier, neglecting the evolution of the geometry through the surface mass balance and dynamics, is also important, since the geometry affects the dynamics.

This blog post has presented the setup and solution of a simple glacier flow model with COMSOL Multiphysics. The COMSOL® software offers specialized functionality for most problems involved in such modeling scenarios. The main limitation here, and in glaciology in general, is the data; typically, the topographical data, basal slip length, surface mass balance, accumulation, and melting.

In an upcoming blog post, we will demonstrate how to get the most out of glacier simulations using sensitivity analysis and data assimilation through the Optimization Module. Stay tuned!

*Climate Change 2013: The Physical Science Basis*.*Contribution of Working Group I to the Fifth Assessment Report of the Intergovernmental Panel on Climate Change*, T.F. Stocker et al. (eds.), Cambridge University Press, 2013.- R. Greve and H. Blatter, “Dynamics of Ice Sheets and Glaciers,”
*Springer*, 2009.

The process of natural convection, also called buoyancy flow or free convection, involves temperature and density gradients that cause a fluid (like air) to move, leading to the transport of heat. Unlike forced convection, no fans or external sources are needed to generate fluid flow — just differences in temperature and density.

Natural convection in air has a wide range of applications in various industries. In the electronics field, this phenomenon dissipates heat in devices, which helps prevent them from overheating. Additionally, structures like solar chimneys and Trombe walls take advantage of this heat transport method to heat and cool buildings. The agricultural industry also depends on natural convection, which helps in the drying and storage of various products.

*Natural convection of air through vertical circuit boards.*

With the COMSOL Multiphysics® software, it is possible to study natural convection in air for both 2D and 3D models. Let’s take a look at one example…

The Buoyancy Flow in Air tutorial shows how to model natural convection in air for two geometries:

- 2D square
- 3D cube

In both cases, all of the edges are insulated except for the left and right sides, which are set to a low and high temperature, respectively. The temperature difference (around 10 K) leads to density gradients in the air, generating buoyancy flow. Note that the cube has more sides than the square, which influences how the air flows.

To simplify the model setup, there are a couple of built-in features in COMSOL Multiphysics that we can use. First up is the predefined *Nonisothermal Flow* interface, which couples fluid dynamics and heat transfer in the model. We can also use the Material Library to easily determine the thermophysical properties of air.

Next, we can estimate the flow regime by computing the Grashof, Rayleigh, and Prandtl numbers. The Grashof and Rayleigh numbers suggest that the flow is laminar, with a velocity of around 0.2 m/s. As for the Prandtl number, it indicates that viscosity doesn’t influence the buoyancy of the air and that the shear layer thickness is about 3 mm.

For more details on estimating the flow regime, download the model documentation from the Application Gallery.

*Note: The Buoyancy Flow in Water tutorial model demonstrates a similar model setup with water instead of air.*

Let’s take a look at the results, starting with the velocity magnitude of air in the 2D square. In the left image below, we see that the velocity increases as the air nears the left and right edges, with a maximum velocity of 0.05 m/s. While this is a bit lower than the estimated velocity calculated using the Grashof and Rayleigh numbers, it is still in the same order of magnitude. Further, the shear layer thickness (3 mm) corresponds with the estimate from the Prandtl number.

*The velocity magnitude (left) and velocity profile (right) of air in the 2D square.*

As shown below, the results for the velocity magnitude in the 3D cube are similar to those for the 2D square.

*Velocity magnitude in the cube.*

Next up, let’s look at the temperature results for the 2D geometry. A single convective cell fills the square, with the air flowing around the edges. We see that the flow of air is faster at the left and right sides, where the temperature differences are the greatest.

*The temperature field in the square.*

The 3D results show a slightly different scenario. There are small convective cells in the cube at the corners of a vertical plane perpendicular to the heated sides. As mentioned, this difference is likely due to how the front and back sides in the cube affect the airflow.

*The temperature and velocity fields in the 3D cube.*

The model geometries in the Buoyancy Flow in Air tutorial are rather simple, but the example provides you with a solid foundation for modeling natural convection in more detailed models that represent real-world applications.

For more details about this example, go to the Application Gallery via the button above. From there, you can download the MPH-file and step-by-step instructions on how to build the model.

]]>

Modeling the transport of heat and moisture through porous materials, or from the surface of a fluid, often involves including the surrounding media in the model in order to get accurate estimates of the conditions at the material surfaces. In the investigations of hygrothermal behavior of building envelopes, food packaging, and other common engineering problems, the surrounding medium is probably moist air (air with water vapor).

*Moist air is the environing medium for applications such as building envelopes (illustration, left) and solar food drying (right). Right image by ArianeCCM — Own work. Licensed under CC BY-SA 3.0, via Wikimedia Commons.*

When considering porous media, the moisture transport process, which includes capillary flow, bulk flow, and binary diffusion of water vapor in air, depends on the nature of the material. In moist air, moisture is transported by diffusion and advection, where the advecting flow field in most cases is turbulent.

Computing heat and moisture transport in moist air requires the resolution of three sets of equations:

- The Navier-Stokes equations, to compute the airflow velocity field and pressure
- The energy equation, to compute the temperature
- The moisture transport equation, to compute the relative humidity

These equations are coupled together through the pressure, temperature, and relative humidity, which are used to evaluate the properties of air (density ; viscosity ; thermal conductivity ; and heat capacity ); molecular diffusivity and through the velocity field used for convective transport.

With the addition of the *Moisture Flow* multiphysics interface in version 5.3a, COMSOL Multiphysics defines all three of these equations in a few steps, as shown in the figure below.

*Single-physics interfaces and multiphysics couplings for the coupled resolution of single-phase flow, heat transfer, and moisture transport in building materials and moist air.*

Whenever studying the flow of moist air, two questions should be asked:

- Does the flow depend on moisture distribution?
- Does the nature of the flow require the use of a turbulence model?

If the answer is “yes” for at least one of these questions, then you should consider using the *Moisture Flow* multiphysics interfaces, found under the *Chemical Species Transport* branch.

*The* Moisture Flow *group under the* Chemical Species Transport *branch of the* Physics Wizard*, with the single-physics interfaces and coupling node added with each version of the* Moisture Flow *predefined multiphysics interface.*

The *Laminar Flow* version of the multiphysics interface combines the *Moisture Transport in Air* interface with the *Laminar Flow* interface and adds the *Moisture Flow* coupling. Similarly, each version under *Turbulent Flow* combines the *Moisture Transport in Air* interface and the corresponding *Turbulent Flow* interface and adds the *Moisture Flow* coupling.

Besides providing a user-friendly way to define the coupled set of equations of the moisture flow problem, the multiphysics interfaces for turbulent flow handle the moisture-related turbulence variables required for the fluid flow computation.

One advantage of using the *Moisture Flow* multiphysics interface is its usability. When adding the *Moisture Flow* node through the predefined interface, an automatic coupling of the Navier-Stokes equations is defined for the fluid flow and the moisture transport equations by the software (center screenshot in the image below) by using the following variables:

- The density and dynamic viscosity in the Navier-Stokes equations, which depend on the relative humidity variable from the
*Moisture Transport*interface through a mixture formula based on dry air and pure steam properties (left screenshot below) - The velocity field and absolute pressure variables from the
*Single-Phase Flow*interface, which are used in the moisture transport equation (right screenshot below)

*User interfaces of the* Moisture Flow *coupling,* Fluid Properties *feature (*Single-Phase Flow *interface), and* Moist Air *feature (*Moisture Transport in Air *interface).*

The performance of the *Moisture Flow* multiphysics interface is especially attractive when dealing with a turbulent moisture flow.

For turbulent flows, the turbulent mixing caused by the eddy diffusivity in the moisture convection is automatically accounted for by the COMSOL® software by enhancing the moisture diffusivity with a correction term based on the turbulent Schmidt number . The Kays-Crawford model is the default choice for the evaluation of the turbulent Schmidt number, but a user-defined value or expression can also be entered directly in the graphical user interface.

*Selection of the model for the computation of the turbulent Schmidt number in the user interface of the* Moisture Flow *coupling.*

In addition, for coarse meshes that may not be suitable for resolving the thin boundary layer close to walls, *Wall functions* can be selected or automatically applied by the software. The wall functions are such that the computational domain is assumed to be located at a distance from the wall, the so-called lift-off position, corresponding to the distance from the wall where the logarithmic layer meets the viscous sublayer (or would meet it if there was no buffer layer in between). The moisture flux at the lift-off position, , which accounts for the flux to and from the wall, is automatically defined by the *Moisture Flow* interface, based on the relative humidity.

*Approximation of the flow field and the moisture flux close to walls when using wall functions in the turbulence model for fluid flow.*

Note that the *Low-Reynolds* and *Automatic* options for *Wall Treatment* are also available for some of the RANS models.

For more information, read this blog post on choosing a turbulence model.

By using the *Moisture Flow* interface, an appropriate mass conservation is granted in the fluid flow problem by the *Screen* and *Interior Fan* boundary conditions. A continuity condition is also applied on vapor concentration at the boundaries where the *Screen* feature is applied. For the *Interior Fan* condition, the mass flow rate is conserved in an averaged way and the vapor concentration is homogenized at the fan outlet, as shown in the figure below.

*Average mass flow rate conservation across a boundary with the* Interior Fan *condition.*

Let’s consider evaporative cooling at the water surface of a glass of water placed in a turbulent airflow. The *Turbulent Flow, Low Reynolds k-ε* interface, the *Moisture Transport in Air* interface, and the *Heat Transfer in Moist Air* interface are coupled through the *Nonisothermal Flow*, *Moisture Flow*, and *Heat and Moisture* coupling nodes. These couplings compute the nonisothermal airflow passing over the glass, the evaporation from the water surface with the associated latent heat effect, and the transport of both heat and moisture away from this surface.

By using the *Automatic* option for *Wall treatment* in the *Turbulent Flow, Low Reynolds k-ε* interface, wall functions are used if the mesh resolution is not fine enough to fully resolve the velocity boundary layer close to the walls. Convective heat and moisture fluxes at lift-off position are added by the *Nonisothermal Flow* and *Moisture Flow* couplings. The temperature and relative humidity solutions after 20 minutes are shown below, along with the streamlines of the airflow velocity field.

*Temperature (left) and relative humidity (right) solutions with the streamlines of the velocity field after 20 minutes.*

The temperature and relative humidity fields have a strong resemblance here, which is quite natural since the fields are strongly coupled and since both transport processes have similar boundary conditions, in this case. In addition, heat transfer is given by conduction and advection while mass transfer is described by diffusion and advection. The two transport processes originate from the same physical phenomena: conduction and diffusion from molecular interactions in the gas phase while advection is given by the total motion of the bulk of the fluid. Also, the contribution of the eddy diffusivity to the turbulent thermal conductivity and the turbulent diffusivity originate from the same physical phenomenon, which adds further to the similarity of the temperature and moisture field.

Learn more about the key features and functionality included with the Heat Transfer Module, and add-on to COMSOL Multiphysics:

Read the following blog posts to learn more about heat and moisture transport modeling:

- How to Model Heat and Moisture Transport in Porous Media with COMSOL®
- How to Model Heat and Moisture Transport in Air with COMSOL®

Get a demonstration of the *Nonisothermal Flow* and *Heat and Moisture* couplings in these tutorial models:

If you could look below the earth’s surface, what would you see? You would find a great amount of fresh water, as around 30% of the total fresh water on Earth is located under the surface. Groundwater doesn’t flow like an underground river, but instead acts like water in a sponge, filling up the spaces between soil and rock particles.

*Schematic depicting groundwater.*

Ensuring that groundwater remains unpolluted is critical. Not only do we rely on this water for drinking and irrigation, but it also affects the health of different habitats and contributes to the flow of rivers and streams. Engineers work to prevent groundwater pollution (which can harm both humans and wildlife) and routinely monitor groundwater movement and health. These efforts involve detecting pollutants in groundwater and using devices like artificial tracers to investigate groundwater flow and movement.

To accurately predict the transport of solutes like pollutants and tracers within subsurface fluids, environmental and geoscience engineers can use the COMSOL Multiphysics® software and the add-on Subsurface Flow Module. With these tools, engineers can help prevent pollution and enhance the design of groundwater tracers.

In this example, we track a solute within a prescribed groundwater flow that takes longitudinal and transversal dispersivity into account. The solute moves through a 16-square-km area over a time period of 1000 days. This particular setup often serves as a benchmark for verifying different methods of simulating species transport. Here, we use a benchmark situation published by Zimmermann et al. in 2001.

Using the *Transport of Diluted Species* interface, we solve for the initial concentration of the model, which follows a Gaussian distribution.

*The model geometry consists of a square with sides that are 4 km long. The initial concentration follows a Gaussian distribution, shown here.*

To confirm the accuracy of this model, we compare it to an analytical solution from Wilson and Miller (Ref. 1 in the tutorial documentation). To do so, their analytical solution is defined as a function in COMSOL Multiphysics. Since the resulting expression is long and only used for comparison, we simply load a preset file that already contains the analytical solution.

*The analytical solution, showing the concentration after 1000 days have passed.*

To compare the simulation results to analytical results, we generate a plot depicting the concentration distribution after 1000 days. This plot, depicted below, shows that the simulation results (black contour lines) match the analytical solution (white contour lines within the black contour lines).

*Concentration distribution after 1000 days. The prescribed flow direction is indicated by the red arrows.*

When we compare the simulation and analytical results in a solute transport breakthrough plot, we see that the results match here as well. This agreement further verifies the accuracy of the subsurface transport simulation.

*Solute transport breakthrough plot comparing numerical and analytical results.*

Try the solute transport model discussed in this blog post by clicking the button below: