Canoeing is one of my favorite hobbies. In fact, I used to paddle dragon boats competitively on the beautiful Charles River here in Boston. If you’re ever in the city on a nice summer day, I strongly encourage you to rent a canoe and paddle down the river.
Dragon boats on the Charles River.
Boston’s weather, however, can change rather quickly. While it may be calm when you begin moving down the river, high winds can pick up and start blowing your canoe all over the place. Every time you raise your oar out of the water, it will catch the wind. As you swing your oar forward, you will hit the crests of the small waves that are being kicked up. Such movement leaves you wet and, even worse, throws off the balance of the boat. How might you change your paddle stroke to regain control of the situation?
An experienced paddler would start to use the Indian stroke, also called the Canadian Jstroke — just one of the many kinds of canoe paddle strokes. This stroke moves the paddle backward in the typical power stroke. Without lifting the paddle out of the water, the paddler rotates their grip, such that the paddle’s blade is parallel to the direction of travel on the return stroke.
The advantage of the Indian stroke, nicely demonstrated here, is that the paddle blade is never exposed to the wind and does not strike any of the wave crests. While easy to perform at slow speeds, this stroke is rarely used in races. It requires exceptionally strong control of the paddle as well as a solid understanding of how to move the paddle through the water.
With COMSOL Multiphysics, you can analyze and improve upon your paddle stroke. We’ll show you how.
Let’s simplify things a bit. We will consider a simplified paddle stroke and model it in the 2D plane. Although it is assumed that there is no variation in the zdirection (the water depth), we can begin here to gain some insight. The model under consideration is comprised of a rectangular fluid domain that is filled with water. The example includes a canoeshaped cutout as well as a rectangular cutout that represents the paddle.
We want to model the paddle moving back and forth along a known path and rotating about its center. We can specify the fluid velocity at the paddle blade based on the known translational and rotational movement. The fluid velocity at the canoe wall is zero and open boundary conditions surround our model space.
The modeling domain considers the paddle translating and rotating next to the canoe. The boat moves from left to right.
Previously on the blog, we highlighted approaches for modeling general translations of domains as well as rotations and linear translations. A combination of these techniques can be used to model the deformation and rotation of the paddle. The animation below illustrates such techniques, showing the mesh through one full stroke. The mesh faces can slide relative to one another, yet still maintain continuity of the solution across these disjoint mesh interfaces.
An animation depicting moving mesh. A very coarse mesh is shown for illustrative purposes.
Since the translation and rotation of the paddle blade are now completely defined, there is only one thing left to solve: the NavierStokes equations on the moving domains. In this analysis, we will assume laminar flow. We will also assume that the canoe is quite heavy and is not yet moving. The animation below allows you to visualize the results for the first few strokes.
Flow during the paddle stroke.
Now that you can visualize the flow patterns around the paddle blade, albeit in this somewhat simplified case, how might you improve your own stroke? Once you determine your optimal stroke, you might even want to consider joining a competitive dragon boat team here in Boston, or elsewhere — a healthy and fun way to put your COMSOL Multiphysics modeling skills to use!
Can you think of other situations in which this approach could be applicable? We are happy to hear your feedback. If you are interested in using COMSOL Multiphysics to model your paddle, or perhaps another form of fluidstructure interaction, please contact us.
]]>
In a previous blog post, we discussed the modeling of objects translating inside of domains that are filled with a fluid, or just a vacuum. This initial approach introduced the use of the deformed mesh interfaces and the concept of quadrilateral (or triangular) deforming domains, where the deformation is defined via bilinear interpolation. Such a technique works well even for large deformations, as long as the regions around the moving object can be appropriately subdivided. This, however, is not always possible.
A solid object moving along a linear path inside of a complicated domain.
Consider the case shown above, where an object moves along a straight line path, defined by \mathbf x(t), through a domain with protrusions from the sides. In this situation, it would be quite difficult to implement the original approach. So what else can we do?
The solution involves four steps. They are:
We can begin by dividing our original model space into two different geometry objects, as depicted in the figure below. Here, the red domains represent the stationary domains and the blue domains represent the regions in which our object is linearly translating. The subdivision process takes place in the geometry sequence, which is then finalized with the Form Assembly operation.
For a description of this functionality and steps on how to use it, watch this video.
Subdividing the modeling space into different geometry objects.
The Form Assembly step will allow the finite element meshes in the blue domains to slide relative to the meshes in the red domains. This step will also automatically introduce identity pairs that can be used to maintain continuity of the fields for which we will be solving. Let’s take a look at a representative mesh that may be appropriate in this case.
The subdivided domains with a representative mesh.
In the figure above, note that the dark red domains contain meshes that will not move at all. The dark blue domains, meanwhile, have translations completely defined by our known function, \mathbf x(t). The light blue domains are the regions in which the mesh will deform. We can simply use the previously introduced method of bilinear interpolation in these domains. You should also note that a Mapped mesh is used for these two rectangular domains and that the distribution of the elements is adjusted, such that they are reasonably similar in size or smaller than the adjacent nondeforming elements.
After the object has been linearly translated, the mesh in the light blue domains deforms.
From the previous images, you can clearly see that the meshes no longer line up between the moving and stationary domains. While COMSOL Multiphysics version 5.0 has introduced greater accuracy in the handling of noncongruent meshes between domains, there are some things that you should be aware of when using this functionality.
As a result of the Form Assembly geometric finalization step, COMSOL Multiphysics will automatically determine the identity pairs — the mating faces at which the mesh can be misaligned. We simply need to tell each physics interface within our model to maintain continuity at these boundaries. This can be accomplished via the Pairs > Continuity boundary condition, which is available within the boundary conditions for all of the physics interfaces.
Once this feature is added and applied to all of the identity pairs, the software will apply additional conditions at these interfaces to ensure that the solution is as smooth as possible over the mesh discontinuity. Each identity pair has a socalled source side and a destination side. The mesh on the destination side should be finer in all configurations of the mesh.
Assembly meshes with noncongruent meshes at the boundaries can be used in combination with most physics interfaces. There are, however, a few important exceptions. Whenever you are solving an electromagnetics problem involving a curl operator on a vector field, such a technique cannot be used. Common physics interfaces that fall into this category include the 3D Electromagnetic Waves interfaces, the 3D Magnetic Fields interfaces, and the 3D Magnetic and Electric Fields interfaces. This still, of course, leaves us with a wide range of physics.
Let’s look at one case of computing the temperature fields around our object, with differing temperatures for the object and the surrounding domain’s outer walls. The contour plots of the temperature fields shown below verify that the solution is quite smooth over the boundary where the mesh is not continuous.
The temperature fields over time are smooth across the Continuity boundary condition applied to the identity pair.
At this point, you can probably already see how this same technique can be applied to a rotating object. We simply create a circular domain around our rotating object and use all of the same techniques we have discussed here. Of course, if the object is only rotating, we no longer need the deforming mesh — making things even a bit simpler for us.
The figures below show the same object from before, except now the object is rotating.
An object rotating about a point.
An assembly composed of stationary and rotating objects as well as the mesh.
The expressions for the prescribed deformation of the rotating domain, (X_{r}, Y_{r}), can be expressed in terms of the angular frequency, \omega; the undeformed geometry coordinates, (X_{g}, Y_{g}); the point about which the object is rotating, (X_{0}, Y_{0}); and time, t. This gives us the following expressions:
where the prescribed deformation in the Deformed Geometry interface is quite simply:
Seems easy, right? In fact, the technique outlined in this section is actually applied automatically in COMSOL Multiphysics when using the Rotating Machinery, Fluid Flow and the Rotating Machinery, Magnetic physics interfaces. This provides you with a behindthescenes look at what is going on within these interfaces!
We have now introduced methods for modeling the motion of solid objects inside fluid or vacuumfilled domains. Although we have simply prescribed a displacement in all of these cases, the displacement of our solid objects could be computed and coupled to the field solutions in the surrounding regions. That is, however, a topic for another day.
Interested in learning more about using the deformed mesh interfaces for your modeling? Download the tutorial from our Application Gallery.
]]>
Suppose we want to set up a COMSOL Multiphysics model of a solid object moving around inside of a larger domain filled with fluid such as air, or even just a vacuum. To start, let’s assume that we know what path the object will take over time. We won’t worry about which physics we need to solve the model, but we’ll assume that we want to solve for some fields in both the moving domain and the surrounding domain. Of course, we will need a finite element mesh in both of these regions, but this finite element mesh will need to change.
A solid object moves freely around inside of a larger domain along a known path.
For situations like this, there are two options: The Deformed Geometry interface and the Moving Mesh interface. These two interfaces actually work identically, but are meant to be used in different situations.
The actual use of these two interfaces is identical, but choosing between them depends on which other physics you want to solve, as the interfaces handle each type of physics differently. Although we won’t cover how to choose between these two interfaces in this blog post, it is worth reading the sections “Deformed Mesh Fundamentals” and “Handling Frames in Heat Transfer” in the COMSOL Multiphysics Reference Manual as a starting point.
It is also worth mentioning that the Solid Mechanics interface cannot be combined with the Moving Mesh interface. The Solid Mechanics interface already computes the domain deformation via the balance of momentum. Other physics, such as heat transfer in solids, are solved on this deformed shape. On the other hand, it is reasonable to combine the Deformed Geometry interface with the Solid Mechanics interface if you want to study the change in stresses due to material removal, or if you want to perform a parametric sweep over a dimension without parameterizing the geometry, as described in this previous blog post.
Here, we look at the conceptual case of an object moving around inside of a larger domain with stationary boundaries, as shown in the figure above. The path of the object over time is known. We will look at how to set up the Deformed Geometry interface for this problem. But first, we need to take a quick look at which equations will be solved in COMSOL Multiphysics.
Our case of an object moving around inside of a domain is actually a boundary value problem. All boundaries have known displacements, and these boundary displacements can be used to define the deformation of the mesh within the interior of both domains.
There are four types of approaches for computing the deformation of the mesh within each domain: Laplace, Winslow, Hyperelastic, and Yeoh smoothing types. Here, we will address only the simplest case, referred to as a Laplace smoothing, and demonstrate how this approach is sufficient for most cases. The Laplace smoothing approach solves the following partial differential equation within the domain:
where lowercase (x,y,z) are the deformed positions of the mesh and uppercase (X,Y,Z) are the original, undeformed positions.
Since the displacements at all boundaries are known, this is a wellposed problem, and theoretically, the solution to this equation will give us the deformation of the mesh. However, in practice, we may run into cases where the computed deformation field is not very useful. This is illustrated in the figure below, which shows the original mesh on the original domain and the deformed mesh as the part is moved along the diagonal. Observe the highlighted region and note that the mesh gets highly distorted around the moving part edges, especially at sharp corners. This high distortion prevents the model from solving the above equation past a certain amount of deformation.
Original and deformed mesh. The region where the mesh gets highly distorted is highlighted.
In the above image, the deformation of the blue domain is completely described by its boundaries and can be prescribed. On the other hand, the deformation within the red region requires solving the above partial differential equation, and this leads to difficulties. What we want is an approach that allows us to model greater deformations while minimizing the mesh deformation.
If you have a mathematical background, you will recognize the above governing equation as Laplace’s equation and you might even know the solutions to it for a few simple cases. One of the simpler cases is the solution to Laplace’s equation on a Cartesian domain with Dirichlet boundary conditions that vary linearly along each boundary and continuously around the perimeter. For this case, the solution within the domain is equal to bilinear interpolation between the boundary conditions given at the four corners. As it turns out, you can use bilinear interpolation to find the solution to Laplace’s equation for any convex foursided domain with straight boundaries.
The first thing that we have to do is subdivide our complicated deforming domain into convex foursided domains with straight boundaries. One such possible subdivision is shown below.
Subdividing the domain so that the deforming region (red) is composed of foursided convex domains.
The deforming domain is divided into convex quadrilateral domains. In fact, we could have also divided it into triangular domains since that would simply be a special case of a quadrilateral with two vertices at the same location — a socalled degenerate domain. We would only need to decompose the domain into triangles if it were not possible to split the domains into quadrilaterals.
Now that we have these additional boundaries, we need to completely define all of the boundary conditions for the deformation within the domain. The boundaries adjacent to the deforming domain are known and there is no deformation at the outside boundaries. But what about the boundaries connecting these? We have a straight line connecting two points where the deformation is known, so we could just apply linear interpolation along these lines to specify the deformation there as well.
And how can we easily compute this linear interpolation? As you might have already guessed, we can simply solve Laplace’s equation along these connecting lines!
A very general way of doing this is by adding a Coefficient Form Boundary PDE interface to our model to solve for two variables that describe the displacement along each of these four boundaries. This interface allows you to specify the coefficients of a partial differential equation to set up Laplace’s equation along a boundary. We know the displacements at the points on either end of the boundary, which gives us a fully defined and solvable boundary value problem for the displacements along the boundaries.
These new help variables completely define the deforming domains. The results are shown below and demonstrate that larger deformations of the mesh are possible. Of course, we still cannot move the object such that it collides with the boundary. That would imply that the topology of the domain would change; also, the elements cannot have zero area. We can, however, make the deformed domain very small and thin.
The undeformed and deformed mesh after adding the help variables for the Deformed Geometry along the interior boundaries.
You are probably thinking that the mesh shown above appears rather distorted, but keep in mind that all of these distorted elements still have straightsided edges, which is good. In practice, you will often find that you can get good results even from what appear to be highly distorted elements.
However, we can observe that there are now very many small, distorted elements in one region and larger, stretched elements in other parts of our moving domain. The last piece of the puzzle is to use Automatic Remeshing, which will stop a transient simulation based on a mesh quality metric and remesh the current deformed shape.
The deformed geometry immediately before and after the Automatic Remeshing step.
We can see from the above images that Automatic Remeshing leads to a lower element count in the compressed region and adds elements in the stretched region, such that the elements are reasonably uniform. This total number of elements in the mesh stays about the same. There is also an added computational burden due to the remeshing, so this step is only warranted if the element distortion adversely affects the accuracy of the results.
We have looked at a case where we know exactly how our solid object will move around in our fluid domain. But what if there is an unknown deformation of the solid, such as due to some applied loads that are computed during the solution? A classic example of such a situation is a fluidstructure interaction analysis, where the deformation of the solid is due to the surrounding fluid flow.
In such situations, we can use the Integration Component Coupling operator, which makes the deformation at one point of a deforming solid structure available everywhere within the model space. The deformation of one or more points can then be used to control the deformation of the mesh. A good example of this technique is available in the Micropump Mechanism tutorial. The technique is visualized below.
When the actual deformation is unknown, an integration component coupling at a helper point can be used to control a helper line that defines the mesh deformation.
We can see in the image above that the modeling domain is actually not divided into convex quadrilaterals, and that the helper line is allowed to slide along the top boundary of the modeling domain. So this modeling approach is a little bit less strict, yet still allows the mesh to deform significantly. Hopefully it is clear that there is no single best approach to every situation. You may want to investigate a combination of techniques for your particular case.
We have described how to use the deformed mesh interfaces efficiently by decomposing the deforming domain into quadrilateral domains and introducing help variables along the boundaries. This approach makes the problem easier for the COMSOL Multiphysics software to solve. The addition of Automatic Remeshing is helpful if there is significant deformation. The approach outlined here can also be applied to 3D geometries. An example that uses both 2D and 3D cases is available here.
So far, we have only looked at translations of objects inside of relatively simple domains where it is easy to set up deforming domains. When we need to consider geometries that cannot easily be subdivided and cases with rotations of objects, we need to use a different approach. We will cover that topic in an upcoming blog post on this subject, so stay tuned!
]]>
Suppose you are tasked with computing the fluid flow through a network of pipes, as depicted below. You can see that there are many bends with long straight sections in between.
A piping network. Image by HervĂ© Cozanet, via Wikimedia Commons.
The geometry for a fluid flow model of just one pipe in this network might look like the image below.
A CAD model of a pipe volume for fluid flow analysis.
If you go ahead and mesh this geometry with just the default PhysicsControlled Mesh capability, you will obtain a mesh like that pictured below. Note that the boundary layer mesh is applied to the pipe walls and that the mesh is otherwise quite uniform in size within the long, straight sections of the pipe.
The default finite element mesh for this fluid flow problem includes a boundary layer mesh on all noslip boundaries.
An experienced fluid flow analyst would immediately recognize that the flow field in the long, straight sections will be primarily parallel to the pipe and vary quite gradually along the axis. Meanwhile, the variation of the velocity along the cross section and around the bends will be significant. We can exploit this foreknowledge of the solution to partition the geometry into various domains.
The pipe domain is partitioned into several subdomains, which are shown in different colors.
Once the geometry is partitioned, we can apply a Free Tetrahedral mesh feature. This mesh should only be applied to one of the domains along the length of the pipe; a domain that represents a bend (depicted below). Note that the Boundary Layers mesh feature is not yet applied.
A tetrahedral mesh is applied to only one of the domains.
From this one meshed domain, we can now use the Swept mesh functionality in the straight sections, as illustrated below. It is also possible to specify a Distribution subfeature to the Swept feature to explicitly control the element distribution and set up a nonuniform element size along the length. Since we anticipate that the flow will vary gradually along the length, the elements can be quite stretched in the axial direction.
The swept mesh along the straight sections also has a nonuniform element distribution.
We can now apply a tetrahedral mesh to nest the two bent sections and sweep the remaining straight sections. The last step of the meshing sequence is to apply the Boundary Layers mesh feature.
The combination of a tetrahedral and swept mesh with the boundary layers applied at the walls.
From the above images, we can observe that the swept mesh can significantly reduce the size of the model for this fluid flow problem. Our Flow Through a Pipe Elbow tutorial is one example in which this swept meshing technique is used.
Shifting gears, let’s now consider an inductive coil similar to the one pictured below.
An inductive coil. Image by Spinningspark, via Wikimedia Commons.
This coil consists of a long wire with quite gradual bends. If tasked with computing the inductance, we would also need to consider the surrounding air and the magnetic core materials. The geometry for such a model and the default mesh might look like the image below.
A coil surrounding a magnetic core in an air domain.
The default Free Tetrahedral mesh feature is applied to the entire model.
You’ve probably already recognized that the coil itself is an excellent candidate for swept meshing. The coil is long and uniform in cross section. As such, we can begin with a triangular surface mesh at one end and then sweep it along the entire length of the coil to create triangular prismatic elements.
A triangular mesh (represented in blue) is applied to the crosssectional surface at one end of the coil and then swept along the entire length.
We do, however, still need a volumetric mesh of the surroundings. This surrounding volume is amenable to only tetrahedral meshing, not swept meshing. A volume that is to be meshed with tetrahedral elements can only have triangular surface elements on all of its boundaries. Thus, we must first add a Convert feature to the mesh sequence and apply it to the surfaces between the coil and its surroundings. The operation is designed to split the elements touching the boundaries such that triangular face elements are created.
The convert operation introduces triangular elements on the boundaries of the coil.
The remaining domains are meshed with tetrahedra.
From the above image, we can see that fewer elements are used to describe the coil than in the default mesh settings. A similar example is the Anisotropic Heat Transfer Through Woven Carbon Fibers tutorial, which considers a combination of swept meshing and tetrahedral meshing of the surroundings (albeit with different physics involved).
Finally, let us consider a microelectromechanical system (MEMS) structure that is composed of microscale structural features that deflect. If different electrical potentials are applied to different objects, a perturbation of the structure will be measurable through a change in capacitance. A change in applied potentials can deform the system. Such an effect is exploited in devices like comb drives, accelerometers, and gyroscopes.
A MEMS cantilever beam at resonance. Image by Pcflet01, via Wikimedia Commons.
A common characteristic of such MEMS structures is that they are composed of various thin planar layers that need to be meshed along with the surrounding air domain. The gaps between structures may also be quite slender. A simplified model for part of such a MEMS structure might appear similar to the model shown below, with interleaved fingers.
A simplified model representing part of a typical MEMS structure.
When using the default mesh settings, small elements will be inserted in the narrow air gaps between the parts (illustrated below). However, we do know that the fingers on either side will be at different potentials and that the gap between the straight sections of the fingers and the ground plane will have a uniform electric field.
The default mesh settings show smaller elements than those that are needed in regions where we know the electric field will be nearly uniform.
This present structure is actually not amenable to swept meshing, as there are no domains in this model that have a uniform cross section. But, if we introduce some partitioning planes, we can break this domain up into prismatic domains that are amenable to swept meshing. We will first introduce two partitioning planes — one at the top and one at the bottom surface of the fingers — that will partition both the air domain and the two solid domains. We add these planes as Work Plane features to the geometry sequence and they are used as input by the two Partition Object features that divide the solids.
Two planes are introduced that partition both the air and the solid domains.
It is then possible to introduce additional partitioning planes, as shown below, to delineate the long, straight sections of the fingers. This is important because we know the electric fields and displacements will vary quite gradually in these regions.
Two additional planes divide the fingers into prismatic domains.
Now we can begin the meshing process using the Mapped mesh feature on the new rectangular surfaces introduced by the partitioning. The nonrectangular faces on the same plane can be meshed with triangular elements, as illustrated below.
A surface mesh applied to one of the partitioning planes.
The surface mesh can be used as the starting point for the swept mesh, which can be applied to the two layers of the thin domains — the fingers and the air gaps between the fingers and the ground. The air domain can be meshed with tetrahedral elements after a convert operation is applied to the adjacent rectangular element faces.
The final mesh consists of a combination of free and swept meshes.
We can observe that the number of total elements in the finite element model has been reduced. For an example demonstrating this technique of partitioning planes and swept meshing, please see our Surface Micromachined Accelerometer tutorial.
Swept meshing is a powerful technique for minimizing the computational complexity of many classes of COMSOL Multiphysics models. By using your engineering judgment and knowledge to address each problem, you can obtain highaccuracy results quickly and at relatively lower computational costs than with default mesh settings.
While you, of course, do not always need to use this approach, you should consider applying it to cases where your geometry has high aspect ratios, there are relatively thin or thick regions, and you are reasonably certain that the solution will be represented well by the swept mesh.
In conjunction with this topic, here are some additional blog posts to read:
Let’s begin by looking at a microfluidic device, as shown below. Such devices feature small channels that are filled with fluids carrying different chemical species. Within their design, a common goal is to achieve optimal mixing within a small surface area, hence the serpentine channel.
A typical microfluidic device. Image by IXfactory STK — Own work, via Wikimedia Commons.
The schematic below illustrates that there are two fluid inlets, both of which carry the same solvent (water) but a different solute. At the outlet, we want the species to be well mixed. To model such a situation, we want to solve the NavierStokes equations for the flow. This computed flow field can then be used as input for the convectiondiffusion equation governing the species concentration. The Micromixer tutorial, available in our Application Gallery, is an example of such a model.
Now, if desired, it is possible to model the entire device shown above. However, if we neglect the structure near the inlet and the outlet, we can reasonably assume that the flow within the channel bends will be identical between the unit cells. Therefore, we can greatly reduce our model by solving only for the fluid flow within one unit cell and patterning this flow solution throughout the modeling domain for the convectiondiffusion problem.
Schematic of a microfluidic mixer that depicts the repeated unit cell and the inlet and outlet zones.
For such a unit cell model, the walls of the channels are set to the Wall, No Slip condition. The Periodic Flow condition is used to set the velocity so it is identical at the inlet and outlet boundaries, allowing us to specify a pressure drop over a single unit cell. A pressure constraint at a single point is used to gauge fix the pressure field. The working fluid is water with properties defined at room temperature and pressure. The flow solution on this unit cell is also plotted, as shown below.
The periodic modeling domain and the fluid flow solution.
Now that we have the solution on one unit cell, we can use the General Extrusion component coupling to map the solution from this one unit cell onto the repeated domains. This will enable us to define the flow field in the entire serpentine section.
The General Extrusion feature is available in the model tree under Component > Definitions > Component Coupling. The settings for this feature are illustrated below. To map the solution from one domain into the other domains that are offset by a known displacement along the xaxis, the destination map uses the expression “xDisp” for the xexpression. Thus, every point in the original domain is mapped along the positive xdirection by the specified displacement. Since there is no displacement in the ydirection, the yexpression is set at its default “y”.
The variable Disp is individually defined within each of the three domains, as shown in the figure below. Therefore, only a single operator is needed to map the velocity field into all of the domains. Within the original domain, a displacement of zero is used.
The settings for the General Extrusion operator and the definitions of the variable in the three domains.
With the General Extrusion operator defined, we can now use it throughout the model. In this example, the operator is used by the Transport of Diluted Species interface to define the velocity field (illustrated below). The velocity field is given by u and v, the fluid velocity in the x and ydirections, respectively. The components of this velocity field are now defined in all of the repeated domains via the General Extrusion operator: genext1(u) and genext1(v), respectively.
The General Extrusion operator is used to define the velocity field in all three periodic domains.
Now that the velocity field is defined throughout the modeling domain, the species concentration at the inlet is defined via the Inflow boundary condition. This applies a varying species concentration over the inlet boundary. An Outlet boundary condition is applied at the other end.
Although it is not strictly necessary to do so, the mesh is copied from the one domain used to solve for the fluid flow to all of the other domains. The Copy Domain mesh feature can copy the mesh exactly, thereby avoiding any interpolation of the flow solution between meshes.
The model is solved in two steps — first, the Laminar Flow physics interface is solved, and then the Transport of Diluted Species interface is solved. This is reasonable to do since it is assumed that the flow field is independent of the species concentration. The results of the analysis, including the concentration and the mapped velocity field, are depicted below.
The species concentration (shown in color) is solved in all three repeating domains. The periodic velocity field, indicated by the arrows, is solved in one domain and mapped into the others.
We have discussed how the General Extrusion component coupling can be used to set up a linear pattern of a periodic solution as part of a multiphysics analysis. For circular periodicity, a rotation matrix, not a linear shift, must be used in the destination map. An example of defining such a rotation matrix is detailed in this previous blog post.
The approach we have applied here is appropriate for any instance in which a spatially repeating solution needs to be utilized by other physics. Where might you use it in your multiphysics modeling?
]]>
Let’s start this conversation with a very simple problem — computing the capacitance of two parallel flat square metal plates, of side length L=1\:m, separated by a distance D=0.1\:m, and with a dielectric material of relative permittivity \epsilon_r= 2 sandwiched in between. Under the assumption that the fringing fields are insignificant (a rather severe assumption, but we will use it here to get started), we can write an analytic expression for the capacitance:
where \epsilon_0 is the permittivity of free space.
We can easily differentiate this expression with respect to our three inputs to find the design sensitivities:
Now let’s look at computing these same sensitivities using the functionality of COMSOL Multiphysics.
Schematic of a parallel plate capacitor model, neglecting the fringing fields.
We can start by building a model using the Electrostatics physics interface. Our domain will be a block of length L and height D with a relative permittivity of \epsilon_r. The boundary condition at the bottom is a Ground condition, and at the top, an Electric Potential condition sets the voltage to V_0=1\:V. The sides of the block have the default Zero Charge boundary condition, which is equivalent to neglecting the fringing fields. We can solve this model and find the voltage field between the two plates. Based on this solution, we can also calculate the system capacitance based on the integral of the electric energy density, W_e, throughout the entire model:
This equation does assume that one plate (or terminal) is held at a voltage V_0, while all other terminals in the model are grounded. The integral of the electric energy density over all domains is already computed via the builtin variable comp1.es.intWe
, and we can use it to define an expression for the computed capacitance. Of course, we will want to compare this value and our computed sensitivities to the analytic values so we can define some variables for these quantities. We can use the builtin differentiation operator, d(f(x),x), to evaluate the exact sensitivities, as shown in the screenshot below.
Variables are used to compute the model capacitance, as well as to compute the exact capacitance and its sensitivities. The builtin differentiation operator, for example d(C_exact,L), can be used to evaluate the exact sensitivities.
After solving our model, we can evaluate the computed system capacitance, compare it to the analytic value, and evaluate the design sensitivities analytically. Now let’s look at how to compute these sensitivities with COMSOL Multiphysics.
The parameters that we are considering affect both the material properties as well as the geometric dimensions of the model. When the design parameters affect the geometry, we need to use the Deformed Geometry interface, which lets us evaluate the sensitivities with respect to a geometric deformation.
The design parameters will affect a change in the geometry as shown. The hidden faces experience no displacement normal to the boundaries.
We introduce two new Global Parameters, dL and dD, which represent a change in L and D. These will be used in the Deformed Geometry interface, which has four relevant features. First, a Free Deformation feature is applied to the domain, which means that the computational domain can deform based on the applied boundary conditions. Next, Prescribed Mesh Displacement features are applied to the six faces of the domain. In the screenshot below, the deformation (dL) normal to the faces is prescribed as shown in the sketch above.
The Prescribed Mesh Displacement features are used to control the displacement normal to all domain boundaries.
Finally, to actually compute the sensitivities, we must add a Sensitivity node to the Study Sequence. This is shown in the screenshot below. You will want to enter the objective function expression, in this case C_computed
, as well as all of the design parameters that you are interested in studying. Also, choose the value for the design parameters around which you want to evaluate the sensitivities. Since dL and dD represent an incremental change in the dimensions, we can leave these both at zero to compute the sensitivities for L=1\:m and D=0.1\:m. The parameter controlling the material permittivity needs no special handling, other than to choose it as one of the parameters in the Sensitivity study.
There are two options in the form shown below for the gradient method:
A Sensitivity feature using the adjoint method is added to the study sequence, and the settings show the objective function and the parameters that are considered.
After solving, you will now be able to go to Results > Derived Values > Global Evaluation and enter the expressions fsens(dL)
, fsens(dD)
, and fsens(epsilon_r)
to evaluate the sensitivity of the capacitance with respect to the design parameters. Of course, you can also compare these to the previously computed analytic sensitivities and observe agreement.
Analytic  Computed  

\frac{\partial C}{\partial \epsilon_r}

88.542 nF  88.542 nF 
\frac{\partial C}{\partial L}

354.17 nF/m  354.17 nF/m 
\frac{\partial C}{\partial D}

1770.8 nF/m  1770.8 nF/m 
Now that we have the basic idea down in terms of computing the sensitivity of the capacitance of this system, what else can we do? Certainly, we can move on to some more complicated geometries, but there are a few points that we need to keep in mind as we move beyond this example.
There are two conditions that must be fulfilled for sensitivity analysis to work. First, the objective function itself must be differentiable with respect to the solution field. This means that objective functions such as the maximum and minimum of a field are not possible. Second, the parameters must be continuous in the realnumber space. Thus, integer parameters (e.g., the number of spokes on a wheel) are not possible.
Sensitivity calculations are not currently available for eigenvalue problems, nor ray tracing or particle tracing.
The design parameters themselves are typically Global Parameters, but you can also use the Sensitivity interface to add a Control Variable Field defined over domains, boundaries, edges, and points as desired.
Objective functions are typically defined in terms of integrals of the solution over domains or boundaries. It is also possible to set up an objective function as a Probe at a particular location in the model space. Any derived quantity based on the solution field, such as the spatial gradients of the solution, can be used as part of the objective function.
Computing design sensitivities is helpful for determining which parameters affect our objective function the most and gives us an idea about which parameters we might want to focus on as we start to consider design changes. Some other examples that use this functionality include our tutorial model of an axial magnetic bearing and our sensitivity analysis of a communication mast detail. Of course, this method can be used in far more cases than we can describe at once.
This story continues when we start to use these sensitivities to improve our objective function — where we optimize the design. This can be done with the Optimization Module, which we will cover in an upcoming blog post.
]]>When modeling a manufacturing process, such as the heating of an object, it is possible for irreversible damage to occur due to a change in temperature. This may even be a desired step in the process. With the Previous Solution operator, we can model such damage in COMSOL Multiphysics. Here, we will look at the “baking off” of a thin coating on a wafer heated by a laser.
Let’s consider a wafer of silicon with a very thin layer of material coated on the surface. This thin film may have been introduced in a previous processing step, and we now want to quickly “bake off” this material by heating the wafer with a laser. The wafer is mounted on a spinning stage while the laser heat source traverses back and forth over the surface.
We will consider a layer of material that is very thin compared to the wafer thickness. We can thus assume that the film does not contribute to the thermal mass of the system, nor will it provide any additional conductive heat path. However, this coating will affect the surface emissivity. If the coating is undamaged, the emissivity is 0.8. Once the coating has baked off, the emissivity of that region of the wafer will change to 0.6. This will alter both the amount of heat absorbed from the laser heat source and the heat radiated from the wafer to the surroundings.
A laser beam traversing over a rotating wafer ablates a thin surface coating when the temperature is high enough.
We will not concern ourselves too greatly with the process by which the coating is removed from the wafer. Although the actual process may include phase change, melting, boiling, ablation, and chemical reactions, we are, in this case, dealing with a very thin layer of material. Thus, we can simply say that once the temperature of the wafer surface exceeds 60Â°C, the coating immediately disappears. Under the assumption of very fast dynamics of the material removal process relative to the heating of the wafer, this is a valid approach.
We will begin with the previously developed model of a rotating wafer exposed to a moving heat source. An additional boundary equation will be added to our existing model. Hence, we need to model this in a coordinate system that moves with the rotation of the wafer.
The equation we add will track the surface emissivity on the top boundary of the wafer. The Previous Solution operator is used since we simply want to change the surface emissivity once the temperature gets above the specified value and leave it otherwise unchanged. We have already introduced the use of the Previous Solution operator in a previous blog entry. We will now focus more specifically on modeling the removal of the film from the wafer surface.
The settings for the Boundary ODEs and DAEs interface. Note the shape function settings.
The domain settings and initial values settings for the Boundary ODEs and DAEs interface, which models the emissivity of the surface of the wafer.
The settings for the Boundary ODEs and DAEs interface are shown above. Note that a Constant Discontinuous Lagrange discretization is used to solve for the field “emissivity”, the surface emissivity. This discretization is equivalent to saying that the emissivity will have a constant value over each element and that the field can be discontinuous across different elements. We are assuming that the film is either present or not present, so the surface emissivity will have two discrete states. The initial value of the field variable is the undamaged value of the surface emissivity.
The settings for the Heat Flux boundary condition use the computed surface emissivity.
The settings for the Diffuse Surface boundary condition use the computed surface emissivity.
The computed surface emissivity is used in two places within the Heat Transfer in Solids interface, as shown above. The applied Heat Flux boundary condition and the radiation of ambient temperature via the Diffuse Surface boundary condition both reference the emissivity field.
Since the surface emissivity is constant across each element, a finite element mesh size of 0.3 mm is used to obtain a smoother representation of the damage field. Also, the relative solver tolerance is set to 1e6.
The results of the simulation are depicted in the animation below. As the temperature rises, certain portions of the wafer surface rise above the ablation temperature and the surface emissivity changes. The process is complete once the entirety of the wafer surface has been heated above the desired temperature.
An animation of the temperature field of the laser heating the rotating wafer (left). The dark gray color indicates the damage zone (right).
We have demonstrated how to model an irreversible change in the state of a material. In this case, we have analyzed the removal of a thermodynamically negligible thin layer of material from the surface of a wafer and modified the resultant surface emissivity as a consequence. The technique outlined here for using the Previous Solution operator can also be used in many other cases. What comes to your mind?
If you are interested in downloading the model related to this article,
it is available in our Application Gallery.
Whenever we want to solve a modeling problem involving Maxwell’s equations under the assumption that:
and
we can treat the problem as Frequency Domain. When the electromagnetic field solutions are wavelike, such as for resonant structures, radiating structures, or any problem where the effective wavelength is comparable to the sizes of the objects we are working with, then the problem can be treated as a wave electromagnetic problem.
COMSOL Multiphysics has a dedicated physics interface for this type of modeling — the Electromagnetic Waves, Frequency Domain interface. Available in the RF and Wave Optics modules, it uses the finite element method to solve the frequency domain form of Maxwell’s equations. Here’s a guide for when to use this interface:
The wave electromagnetic modeling approach is valid in the regime where the object sizes range from approximately \lambda/100 to 10 \lambda, regardless of the absolute frequency. Below this size, the Low Frequency regime is appropriate. In the Low Frequency regime, the object will not be acting as an antenna or resonant structure. If you want to build models in this regime, there are several different modules and interfaces that you could use. For details, please see this blog post.
The upper limit of \sim 10 \lambda comes from the memory requirements for solving large 3D models. Once your modeling domain size is greater than \sim 10\lambda in each direction, corresponding to a domain size of (10\lambda)^3 or 1000 cubic wavelengths, you will start to need significant computational resources to solve your models. For more details about this, please see this previous blog post. On the other hand, 2D models have far more modest memory requirements and can solve much larger problems.
For problems where the objects being modeled are much larger than the wavelength, there are two options:
If you are interested in Xray frequencies and above, then the electromagnetic wave will interact with and scatter from the atomic lattice of materials. This type of scattering is not appropriate to model with the wave electromagnetics approach, since it is assumed that within each modeling domain the material can be treated as a continuum.
So now that we understand what is meant by wave electromagnetics problems, let’s further classify the most common application areas of the Electromagnetic Waves, Frequency Domain interface and look at some examples of its usage. We will only look at a few representative examples here that are good starting points for learning the software. These applications are selected from the RF Module Application Library and online Application Gallery and the Wave Optics Module Application Library, as well as online.
An antenna is any device that radiates electromagnetic radiation for the purposes of signal (and sometimes power) transmission. There is an almost infinite number of ways to construct an antenna, but one of the simplest is a dipole antenna. On the other hand, a patch antenna is more compact and used in many applications. Quantities of interest include the Sparameters, antenna impedance, losses, and farfield patterns, as well as the interactions of the radiated fields with any surrounding structures, as seen in our Car Windshield Antenna Effect on a Cable Harness tutorial model.
Whereas an antenna radiates into free space, waveguides and transmission lines guide the electromagnetic wave along a predefined path. It is possible to compute the impedance of transmission lines and the propagation constants and Sparameters of both microwave and optical waveguides.
Rather than transmitting energy, a resonant cavity is a structure designed to store electromagnetic energy of a particular frequency within a small space. Such structures can be either closed cavities, such as a metallic enclosure, or an open structure like an RF coil or FabryPerot cavity. Quantities of interest include the resonant frequency and the Qfactor.
Conceptually speaking, the combination of a waveguide with a resonant structure results in a filter or coupler. Filters are meant to either prevent or allow certain frequencies propagating through a structure and couplers are meant to allow certain frequencies to pass from one waveguide to another. A microwave filter can be as simple as a series of connected rectangular cavities, as seen in our Waveguide Iris Bandpass Filter tutorial model.
A scattering problem can be thought of as the opposite of an antenna problem. Rather than finding the radiated field from an object, an object is modeled in a background field coming from a source outside of the modeling domain. The farfield scattering of the electromagnetic wave by the object is computed, as demonstrated in the benchmark example of a perfectly conducting sphere in a plane wave.
Some electromagnetics problems can be greatly simplified in complexity if it can be assumed that the structure is quasiinfinite. For example, it is possible to compute the band structure of a photonic crystal by considering a single unit cell. Structures that are periodic in one or two directions such as gratings and frequency selective surfaces can also be analyzed for their reflection and transmission.
Whenever there is a significant amount of power transmitted via radiation, any object that interacts with the electromagnetic waves can heat up. The microwave oven in your kitchen is a perfect example of where you would need to model the coupling between electromagnetic fields and heat transfer. Another good introductory example is RF heating, where the transient temperature rises and temperaturedependent material properties are considered.
Applying a large DC magnetic bias to a ferrimagnetic material results in a relative permeability that is anisotropic for small (with respect to the DC bias) AC fields. Such materials can be used in microwave circulators. The nonreciprocal behavior of the material provides isolation.
You should now have a general overview of the capabilities and applications of the RF and Wave Optics modules for frequency domain wave electromagnetics problems. The examples listed above, as well as the other examples in the Application Gallery, are a great starting point for learning to use the software, since they come with documentation and stepbystep modeling instructions.
Please also keep in mind that the RF and Wave Optics modules also include other functionality and formulations not described here, including transient electromagnetic wave interfaces for modeling of material nonlinearities, such as second harmonic generation and modeling of signal propagation time. The RF Module additionally includes a circuit modeling tool for connecting a finite element model of a system to a circuit model, as well as an interface for modeling the transmission line equations.
As you delve deeper into COMSOL Multiphysics and wave electromagnetics modeling, please also read our other blog posts on meshing and solving options; various material models that you are able to use; as well as the boundary conditions available for modeling metallic objects, waveguide ports, and open boundaries. These posts will provide you with the foundation you need to model wave electromagnetics problems with confidence.
If you have any questions about the capabilities of using COMSOL Multiphysics for wave electromagnetics and how it can be used for your modeling needs, please contact us.
]]>
When you are solving a transient model, the COMSOL software by default uses an implicit timestepping algorithm with adaptive time step size. This has the advantage of being unconditionally stable for many classes of problems and it lets the software choose the optimal time step size for the specified solver tolerances, thereby reducing the computational cost of the solution.
Two classes of timestepping algorithms are available: a backward difference formula (BDF) and a generalizedalpha method. These algorithms use the solutions at several previous time steps (up to five) to numerically approximate the time derivatives of the fields and to predict the solution at the next time step.
However, these previous solutions are not by default accessible within the model. The Previous Solution operator makes the solution at the previous time step available as a field variable in the model. This Previous Solution operator is available for both transient as well as stationary problems solved using the continuation method. Let us take a look at how you can implement and use this Previous Solution operator in a transient model in COMSOL Multiphysics.
Using the Previous Solution operator requires only two additional features within the model tree. You must add an ODE and DAE interface to store the fields that you are interested in and you must add the Previous Solution feature to the TimeDependent Solver. Let us take a look at the implementation in terms of a transient heat transfer example: The laser heating of a wafer with a moving heat load, solved on a rotating coordinate system.
The first step is to add a Domain ODEs and DAEs interface to the model, since we will be interested in tracking the solution at the previous time step throughout the volume of the part. If we were only interested in the previous solution across a boundary, edge, or point, or in some global quantity, we could also use a Boundary, Edge, Point, or Global ODEs and DAEs interface.
The Domain ODEs and DAEs interface for tracking the solution at the previous time step.
The screenshot above shows the relevant settings for the Domain ODEs and DAEs interface. Note that the units of both the dependent variable and the source are set to Temperature. It is a good modeling practice to appropriately set units. The discretization is set to a Lagrange Quadratic, which matches the discretization used by the Heat Transfer in Solids interface. You will always want to make sure that you are using the appropriate discretization. The name of the field variable here is left at the default “u”, although you can rename it to anything you would like.
The equation being solved by the Domain ODEs and DAEs interface.
The screenshot above shows the equation that stores the temperature solution at the previous time step. This equation can be read as:
unojac(T)=0
The nojac()
operator is needed, since we do not want this equation to contribute to the Jacobian (the system matrix). Lastly, we need to specify that this equation should be evaluated at the previous time step. This is done within the Solver Configurations.
The Previous Solution feature added to the Solver Configuration.
The screenshot above shows the Previous Solution feature added to the TimeDependent Solver. Once you add this feature, simply select the appropriate field variable to be evaluated at the previous time step. It will also be faster (although not necessary) to use the Segregated Solver rather than the Fully Coupled solver.
And that is all there is to it. You can now solve the model just as you usually do and you will be able to evaluate the temperature at the previous computational time step.
Of course, having the solution at the previous time step isn’t really all that interesting in itself, but we can do quite a bit more than just store this solution. For example, we can apply logical expressions directly with the ODEs and DAEs equation interface. Consider the equation:
unojac(if(T>u,T,u))
This equation can be read as: “If the temperature at the previous time step is greater than u, set u equal to temperature. Otherwise, leave u unchanged.”
That is, it stores the maximum temperature reached at the previous time step at every point in the modeling domain. You can now evaluate the variables T and u at any point in the model to get both the temperature over time and the maximum temperature attained. To get the maximum temperature, you will want to take the maximum of the temperature at the previous time step and the temperature at the current time step, so you can introduce a variable in the model:
MaxTemp = max(T,u)
This will return the maximum temperature up to that time as shown in the plot below.
Temperature at a point plotted over time. The variable MaxTemp is also plotted and shows the maximum temperature reached up to that instant in time.
We have shown here the implementation of the newly introduced Previous Solution operator for timedependent models. The three steps to use this functionality appropriately are:
We have shown how to evaluate the maximum temperature in this example, but there is a great deal more that can be done with this functionality, so stay tuned!
]]>
While many different types of laser light sources exist, they are all quite similar in terms of their outputs. Laser light is very nearly single frequency (single wavelength) and coherent. Typically, the output of a laser is also focused into a narrow collimated beam. This collimated, coherent, and single frequency light source can be used as a very precise heat source in a wide range of applications, including cancer treatment, welding, annealing, material research, and semiconductor processing.
When laser light hits a solid material, part of the energy is absorbed, leading to localized heating. Liquids and gases (and plasmas), of course, can also be heated by lasers, but the heating of fluids almost always leads to significant convective effects. Within this blog post, we will neglect convection and concern ourselves only with the heating of solid materials.
Solid materials can be either partially transparent or completely opaque to light at the laser wavelength. Depending upon the degree of transparency, different approaches for modeling the laser heat source are appropriate. Additionally, we must concern ourselves with the relative scale as compared to the wavelength of light. If the laser is very tightly focused, then a different approach is needed compared to a relatively wide beam. If the material interacting with the beam has geometric features that are comparable to the wavelength, we must additionally consider exactly how the beam will interact with these small structures.
Before starting to model any lasermaterial interactions, you should first determine the optical properties of the material that you are modeling, both at the laser wavelength and in the infrared regime. You should also know the relative sizes of the objects you want to heat, as well as the laser wavelength and beam characteristics. This information will be useful in guiding you toward the appropriate approach for your modeling needs.
In cases where the material is opaque, or very nearly so, at the laser wavelength, it is appropriate to treat the laser as a surface heat source. This is most easily done with the Deposited Beam Power feature (shown below), which is available with the Heat Transfer Module as of COMSOL Multiphysics version 5.1. It is, however, also quite easy to manually set up such a surface heat load using only the COMSOL Multiphysics core package, as shown in the example here.
A surface heat source assumes that the energy in the beam is absorbed over a negligibly small distance into the material relative to the size of the object that is heated. The finite element mesh only needs to be fine enough to resolve the temperature fields as well as the laser spot size. The laser itself is not explicitly modeled, and it is assumed that the fraction of laser light that is reflected off the material is never reflected back. When using a surface heat load, you must manually account for the absorptivity of the material at the laser wavelength and scale the deposited beam power appropriately.
The Deposited Beam Power feature in the Heat Transfer Module is used to model two crossed laser beams. The resultant surface heat source is shown.
In cases where the material is partially transparent, the laser power will be deposited within the domain, rather than at the surface, and any of the different approaches may be appropriate based on the relative geometric sizes and the wavelength.
If the heated objects are much larger than the wavelength, but the laser light itself is converging and diverging through a series of optical elements and is possibly reflected by mirrors, then the functionality in the Ray Optics Module is the best option. In this approach, light is treated as a ray that is traced through homogeneous, inhomogeneous, and lossy materials.
As the light passes through lossy materials (e.g., optical glasses) and strikes surfaces, some power deposition will heat up the material. The absorption within domains is modeled via a complexvalued refractive index. At surfaces, you can use a reflection or an absorption coefficient. Any of these properties can be temperature dependent. For those interested in using this approach, this tutorial model from our Application Gallery provides a great starting point.
A laser beam focused through two lenses. The lenses heat up due to the highintensity laser light, shifting the focal point.
If the heated objects and the spot size of the laser are much larger than the wavelength, then it is appropriate to use the BeerLambert law to model the absorption of the light within the material. This approach assumes that the laser light beam is perfectly parallel and unidirectional.
When using the BeerLambert law approach, the absorption coefficient of the material and reflection at the material surface must be known. Both of these material properties can be functions of temperature. The appropriate way to set up such a model is described in our earlier blog entry “Modeling LaserMaterial Interactions with the BeerLambert Law“.
You can use the BeerLambert law approach if you know the incident laser intensity and if there are no reflections of the light within the material or at the boundaries.
Laser heating of a semitransparent solid modeled with the BeerLambert law.
If the heated domain is large, but the laser beam is tightly focused within it, neither the ray optics nor the BeerLambert law modeling approach can accurately solve for the fields and losses near the focus. These techniques do not directly solve Maxwell’s equations, but instead treat light as rays. The beam envelope method, available within the Wave Optics Module, is the most appropriate choice in this case.
The beam envelope method solves the full Maxwell’s equations when the field envelope is slowly varying. The approach is appropriate if the wave vector is approximately known throughout the modeling domain and whenever you know approximately the direction in which light is traveling. This is the case when modeling a focused laser light as well as waveguide structures like a MachZehnder modulator or a ring resonator. Since the beam direction is known, the finite element mesh can be very coarse in the propagation direction, thereby reducing computational costs.
A laser beam focused in a cylindrical material domain. The intensity at the incident side and within the material are plotted, along with the mesh.
The beam envelope method can be combined with the Heat Transfer in Solids interface via the Electromagnetic Heat Source multiphysics couplings. These couplings are automatically set up when you add the Laser Heating interface under Add Physics.
The Laser Heating interface adds the Beam Envelopes and the Heat Transfer in Solids interfaces and the multiphysics couplings between them.
Finally, if the heated structure has dimensions comparable to the wavelength, it is necessary to solve the full Maxwell’s equations without assuming any propagation direction of the laser light within the modeling space. Here, we need to use the Electromagnetic Waves, Frequency Domain interface, which is available in both the Wave Optics Module and the RF Module. Additionally, the RF Module offers a Microwave Heating interface (similar to the Laser Heating interface described above) and couples the Electromagnetic Waves, Frequency Domain interface to the Heat Transfer in Solids interface. Despite the nomenclature, the RF Module and the Microwave Heating interface are appropriate over a wide frequency band.
The fullwave approach requires a finite element mesh that is fine enough to resolve the wavelength of the laser light. Since the beam may scatter in all directions, the mesh must be reasonably uniform in size. A good example of using the Electromagnetic Waves, Frequency Domain interface: Modeling the losses in a gold nanosphere illuminated by a plane wave, as illustrated below.
Laser light heating a gold nanosphere. The losses in the sphere and the surrounding electric field magnitude are plotted, along with the mesh.
You can use any of the previous five approaches to model the power deposition from a laser source in a solid material. Modeling the temperature rise and heat flux within and around the material additionally requires the Heat Transfer in Solids interface. Available in the core COMSOL Multiphysics package, this interface is suitable for modeling heat transfer in solids and features fixed temperature, insulating, and heat flux boundary conditions. The interface also includes various boundary conditions for modeling convective heat transfer to the surrounding atmosphere or fluid, as well as modeling radiative cooling to ambient at a known temperature.
In some cases, you may expect that there is also a fluid that provides significant heating or cooling to the problem and cannot be approximated with a boundary condition. For this, you will want to explicitly model the fluid flow using the Heat Transfer Module or the CFD Module, which can solve for both the temperature and flow fields. Both modules can solve for laminar and turbulent fluid flow. The CFD Module, however, has certain additional turbulent flow modeling capabilities, which are described in detail in this previous blog post.
For instances where you are expecting significant radiation between the heated object and any surrounding objects at varying temperatures, the Heat Transfer Module has the additional ability to compute gray body radiative view factors and radiative heat transfer. This is demonstrated in our Rapid Thermal Annealing tutorial model. When you expect the temperature variations to be significant, you may also need to consider the wavelengthdependent surface emissivity.
If the materials under consideration are transparent to laser light, it is likely that they are also partially transparent to thermal (infraredband) radiation. This infrared light will be neither coherent nor collimated, so we cannot use any of the above approaches to describe the reradiation within semitransparent media. Instead, we can use the radiation in participating media approach. This technique is suitable for modeling heat transfer within a material, where there is significant heat flux inside the material due to radiation. An example of this approach from our Application Gallery can be found here.
In this blog post, we have looked at the various modeling techniques available in the COMSOL Multiphysics environment for modeling the laser heating of a solid material. Surface heating and volumetric heating approaches are presented, along with a brief overview of the heat transfer modeling capabilities. Thus far, we have only considered the heating of a solid material that does not change phase. The heating of liquids and gases — and the modeling of phase change — will be covered in a future blog post. Stay tuned!
]]>
COMSOL Multiphysics uses the finite element method to solve for the electromagnetic fields within the modeling domains. Under the assumption that the fields vary sinusoidally in time at a known angular frequency \omega = 2 \pi f and that all material properties are linear with respect to field strength, the governing Maxwell’s equations in three dimensions reduce to:
where the material properties are \mu_r, the relative permeability; \epsilon_r, the relative permittivity; and \sigma , the electrical conductivity.
With the speed of light in vacuum, c_0, the above equation is solved for the electric field, \mathbf{E}=\mathbf{E}(x,y,z), throughout the modeling domain, where \mathbf{E} is a vector with components \mathbf{E}=. All other quantities (such as magnetic fields, currents, and power flow) can be derived from the electric field. It is also possible to reformulate the above equation as an eigenvalue problem, where a model is solved for the resonant frequencies of the system, rather than the response of the system at a particular frequency.
The above equation is solved via the finite element method. For a conceptual introduction to this method, please see our blog series on the weak form, and for a more indepth reference, which will explain the nuances related to electromagnetic wave problems, please see The Finite Element Method in Electromagnetics by JianMing Jin. From the point of view of this blog post, however, we can break down the finite element method into these four steps:
Let’s now look at each one of these steps in more detail and describe the options available at each step.
The governing equation shown above is the frequency domain form of Maxwell’s equations for wavetype problems in its most general form. However, this equation can be reformulated for several special cases.
Let us first consider the case of a modeling domain in which there is a known background electric field and we wish to place some object into this background field. The background field can be a linearly polarized plane wave, a Gaussian beam, or any general userdefined beam that satisfies Maxwell’s equations in free space. Placing an object into this field will perturb the field and lead to scattering of the background field. In such a situation, you can use the Scattered Field formulation, which solves the above equation, but makes the following substitution for the electric field:
where the background electric field is known and the relative field is the field that, once added to the background field, gives the total field that satisfies the governing Maxwell’s equations. Rather than solving for the total field, it is the relative field that is being solved. Note that the relative field is not the scattered field.
For an example of the usage of this Scattered Field formulation, which considers the radar scattering off of a perfectly electrically conductive sphere in a background plane wave and compares it to the analytic solution, please see our Computing the Radar Cross Section of a Perfectly Conducting Sphere tutorial model.
Next, let’s consider modeling in a 2D plane, where we solve for \mathbf{E}=\mathbf{E}(x,y) and can additionally simplify the modeling by considering an electric field that is polarized either InPlane or OutofPlane. The InPlane case will assume that E_z=0, while the OutofPlane case assumes that E_x=E_y=0. These simplifications reduce the size of the problem being solved, compared to solving for all three components of the electric field vector.
For modeling in the 2D axisymmetric plane, we solve for \mathbf{E}=\mathbf{E}(r,z), where the vector \mathbf{E} has the components < E_r, E_\phi, E_z> and we can again simplify our modeling by considering the InPlane and OutofPlane cases, which assume E_\phi=0 and E_r=E_z=0, respectively.
When using either the 2D or the 2D axisymmetric InPlane formulations, it is also possible to specify an OutofPlane Wave Number. This is appropriate to use when there is a known outofplane propagation constant, or known number of azimuthal modes. For 2D problems, the electric field can be rewritten as:
and for 2D axisymmetric problems, the electric field can be rewritten as:
where k_z or m, the outofplane wave number, must be specified.
This modeling approach can greatly simplify the computational complexity for some types of models. For example, a structurally axisymmetric horn antenna will have a solution that varies in 3D but is composed of a sum of known azimuthal modes. It is possible to recover the 3D solution from a set of 2D axisymmetric analyses by solving for these outofplane modes at a much lower computational cost, as demonstrated in our Corrugated Circular Horn Antenna tutorial model.
Whenever solving a wave electromagnetics problem, you must keep in mind the mesh resolution. Any wavetype problem must have a mesh that is fine enough to resolve the wavelengths in all media being modeled. This idea is fundamentally similar to the concept of the Nyquist frequency in signal processing: The sampling size (the finite element mesh size) must be at least less than onehalf of the wavelength being resolved.
By default, COMSOL Multiphysics uses secondorder elements to discretize the governing equations. A minimum of two elements per wavelength are necessary to solve the problem, but such a coarse mesh would give quite poor accuracy. At least five secondorder elements per wavelength are typically used to resolve a wave propagating through a dielectric medium. Firstorder and thirdorder discretization is also available, but these are generally of more academic interest, since the secondorder elements tend to be the best compromise between accuracy and memory requirements.
The meshing of domains to fulfill the minimum criterion of five elements per wavelength in each medium is now automated within the software, as shown in this video, which shows not only the meshing of different dielectric domains, but also the automated meshing of Perfectly Matched Layer domains. The new automated meshing capability will also set up an appropriate periodic mesh for problems with periodic boundary conditions, as demonstrated in this Frequency Selective Surface, Periodic Complementary Split Ring Resonator tutorial model.
With respect to the type of elements used, tetrahedral (in 3D) or triangular (in 2D) elements are preferred over hexahedral and prismatic (in 3D) or rectangular (in 2D) elements due to their lower dispersion error. This is a consequence of the fact that the maximum distance within an element is approximately the same in all directions for a tetrahedral element, but for a hexahedral element, the ratio of the shortest to the longest line that fits within a perfect cubic element is \sqrt3. This leads to greater error when resolving the phase of a wave traveling diagonally through a hexahedral element.
It is only necessary to use hexahedral, prismatic, or rectangular elements when you are meshing a perfectly matched layer or have some foreknowledge that the solution is strongly anisotropic in one or two directions. When resolving a wave that is decaying due to absorption in a material, such as a wave impinging upon a lossy medium, it is additionally necessary to manually resolve the skin depth with the finite element mesh, typically using a boundary layer mesh, as described here.
Manual meshing is still recommended, and usually needed, for cases when the material properties will vary during the simulation. For example, during an electromagnetic heating simulation, the material properties can be made functions of temperature. This possible variation in material properties should be considered before the solution, during the meshing step, as it is often more computationally expensive to remesh during the solution than to start with a mesh that is fine enough to resolve the eventual variations in the fields. This can require a manual and iterative approach to meshing and solving.
When solving over a wide frequency band, you can consider one of three options:
It is difficult to determine ahead of time which of the above three options will be the most efficient for a particular model.
Regardless of the initial mesh that you use, you will also always want to perform a mesh refinement study. That is, rerun the simulation with progressively finer meshes and observe how the solution changes. As you make the mesh finer, the solution will become more accurate, but at a greater computational cost. It is also possible to use adaptive mesh refinement if your mesh is composed entirely of tetrahedral or triangular elements.
Once you have properly defined the problem and meshed your domains, COMSOL Multiphysics will take this information and form a system of linear equations, which are solved using either a direct or iterative solver. These solvers differ only in their memory requirements and solution time, but there are several options that can make your modeling more efficient, since 3D electromagnetics models will often require a lot of RAM to solve.
The direct solvers will require more memory than the iterative solvers. They are used for problems with periodic boundary conditions, eigenvalue problems, and for all 2D models. Problems with periodic boundary conditions do require the use of a direct solver, and the software will automatically do so in such cases.
Eigenvalue problems will solve faster when using a direct solver as compared to using an iterative solver, but will use more memory. For this reason, it can often be attractive to reformulate an eigenvalue problem as a frequency domain problem excited over a range of frequencies near the approximate resonances. By solving in the frequency domain, it is possible to use the more memoryefficient iterative solvers. However, for systems with high Qfactors it becomes necessary to solve at many points in frequency space. For an example of reformulating an eigenvalue problem as a frequency domain problem, please see these examples of computing the Qfactor of an RF coil and the Qfactor of a FabryPerot cavity.
The iterative solvers used for frequencydomain simulations come with three different options defined by the Analysis Methodology settings of Robust (the default), Intermediate, or Fast, and can be changed within the physics interface settings. These different settings alter the type of iterative solver being used and the convergence tolerance. Most models will solve with any of these settings, and it can be worth comparing them to observe the differences in solution time and accuracy and choose the option most appropriate for your needs. Models that contain materials that have very large contrasts in the dielectric constants (~100:1) will need the Robust setting and may even require the use of the direct solver, if the iterative solver convergence is very slow.
Once you’ve solved your model, you will want to extract data from the computed electromagnetic fields. COMSOL Multiphysics will automatically produce a slice plot of the magnitude of the electric field, but there are many other postprocessing visualizations you can set up. Please see the Postprocessing & Visualization Handbook and our blog series on Postprocessing for guidance and to learn how to create images such as those shown below.
Attractive visualizations can be created by plotting combinations of the solution fields, meshes, and geometry.
Of course, goodlooking images are not enough — we also want to extract numerical information from our models. COMSOL Multiphysics will automatically make available the Sparameters whenever using Ports or Lumped Ports, as well as the Lumped Port current, voltage, power, and impedance. For a model with multiple Ports or Lumped Ports, it is also possible to automatically set up a Port Sweep, as demonstrated in this tutorial model of a Ferrite Circulator, and write out a Touchstone file of the results. For eigenvalue problems, the resonant frequencies and Qfactors are automatically computed.
For models of antennas or for scattered field models, it is additionally possible to compute and plot the farfield radiated pattern, the gain, and the axial ratio.
Farfield radiation pattern of a Vivaldi antenna.
You can also integrate any derived quantity over domains, boundaries, and edges to compute, for example, the heat dissipated inside of lossy materials or the total electromagnetic energy within a cavity. Of course, there is a great deal more that you can do, and here we have just looked at the most commonly used postprocessing features.
We’ve looked at the various different formulations of the governing frequency domain form of Maxwell’s equations as applied to solving wave electromagnetics problems and when they should be used. The meshing requirements and capabilities have been discussed as well as the options for solving your models. You should also have a broad overview of the postprocessing functionality and where to go for more information about visualizing your data in COMSOL Multiphysics.
This information, along with the previous blog posts on defining the material properties, setting up metallic and radiating boundaries, and connecting the model to other devices should now give you a reasonably complete picture of what can be done with frequency domain electromagnetic wave modeling in the RF and Wave Optics modules. The software documentation, of course, goes into greater depth about all of the features and capabilities within the software.
If you are interested in using the RF or Wave Optics modules for your modeling needs, please contact us.
]]>