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 so-called 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 behind-the-scenes look at what is going on within these interfaces!
We have now introduced methods for modeling the motion of solid objects inside fluid- or vacuum-filled 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 well-posed 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 four-sided domain with straight boundaries.
The first thing that we have to do is subdivide our complicated deforming domain into convex four-sided domains with straight boundaries. One such possible subdivision is shown below.
Subdividing the domain so that the deforming region (red) is composed of four-sided 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 so-called 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 straight-sided 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 fluid-structure 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!
]]>
Based on their operation, magnetic bearings can be classified into one of two groups: active magnetic bearings (AMBs) and passive magnetic bearings (PMBs). AMBs function through an attractive force between a ferromagnetic material and electromagnets (coil and core). PMBs function through a repulsive force between the permanent magnets (PMs) and/or a conducting surface and PMs.
Active magnetic bearings consist of a stationary part — the stator — that contains the electromagnets and the position sensors, and a rotating part — the rotor — that moves with the shaft. Under normal operating conditions, the rotor is ideally centered with an equal gap around the stator. However, in perturbed situations, the rotor’s position is controlled using a closed-loop feedback system. The change in rotor position is measured by the sensor, which is then passed to the digital controller. After processing the data, the controller sends the signals to the power amplifier. The amplifier readjusts the currents in the electromagnets to push the rotor back to its original position. To readjust the rotor, it is important for designers to know the magnetic force at various offset rotor positions as well as the corresponding currents.
A schematic depicting the components of AMBs. Image via Wikimedia Commons.
AMBs are advantageous due to their active control of the rotor position, but this means a higher cost for the electronic circuit as well as greater operational costs. The operational costs can, of course, be reduced by optimizing the design of the electromagnets so that less power is needed to run them. COMSOL Multiphysics is a helpful tool in this optimization process.
The most appropriate way to simulate AMBs, including the stator and the rotor, is with the Rotating Machinery, Magnetic interface in the AC/DC Module. The modeling process is very similar to that of an electric generator or motor, as illustrated in our Generator in 2D tutorial. For general guidelines, you can refer to our previous blog post “How to Model Rotating Machinery in 3D“.
Using the Magnetic Fields interface, you can model PMs as well as conducting coils (single-turn or multi-turn coils). However, you cannot model the induced currents due to rotations. If the induced currents can be neglected, you can set up the model in the stationary or frequency domain and add a parametric sweep study for various rotor positions, computing the magnetic force or torque.
Passive magnetic bearings use permanent magnets and do not require sensor and control circuitry or input power. The constant air gap is maintained by the magnetic repulsion force between the opposite poles of PMs, as demonstrated here, or by the electrodynamic suspension (EDS) between the PMs and the rotating conducting disc or shaft, as illustrated here. The geometry and the simulation results for the passive magnetic bearing using PMs is shown below.
Left: Geometry of an axial magnetic bearing using permanent magnets. The magnetization direction of the permanent magnets is depicted by black arrows. Right: The results plot showing the magnetic flux density (arrow plot) and the surface plot of the magnetic flux density norm.
When rotating in a magnetic field produced by a PM, an electrically conducting rotor induces eddy currents on the conducting rotor. These eddy currents, in turn, generate a magnetic field that opposes the magnetic fields by the magnets and induces a repulsive force between the rotating conductor and the stationary PMs. The displacement of the rotor is always balanced by this repulsive magnetic force. Thus, the rotor is rotating at the center with a uniform gap.
Electrodynamic bearings can be further classified as radial electrodynamic bearings and axial electrodynamic bearings. This is based upon whether the magnetic flux is parallel to the rotor axis or perpendicular to the rotor axis, respectively.
A radial electrodynamic bearing consists of a conducting cylinder affixed to the rotating shaft. The components of the PMs are stacked in between the iron rings, such that the radially inward or outward magnetic flux — with reference to the shaft axis — is created in the air gap between the stator and the rotor. The Electrodynamic Bearing 3D tutorial available in our Application Gallery is solved using the Magnetic and Electric Fields interface. The magnetic forces are computed for various offset positions.
Left: The 3D geometry of a radial electrodynamic bearing. Right: Radial electrodynamic bearing depicting the magnetic flux density in the stator (iron and magnets) and the eddy currents (grayscale) in the conducting rotor for the x-axis offset position of 1.5 mm.
The cross-sectional cut configuration for an axial electrodynamic bearing is shown below. The conducting disc is attached to the rotor and the magnetic material (iron yoke) is used to guide the magnetic fields of the PMs, such that the magnetic flux lines are parallel to the rotor axis. This is where the term axial electrodynamic bearing comes from.
In this design, the magnetic flux path is very effective with a relatively small air gap. The full tutorial is available to download from our Application Gallery.
Left: Cross-sectional cut of an axial electrodynamic bearing. Right: An axial electrodynamic bearing showing the magnetic flux density in the stator and the eddy currents in the conducting rotor. An arrow plot of the magnetic flux density in the stator and the eddy currents in the rotor are also shown.
Both electrodynamic bearing examples discussed above are modeled in COMSOL Multiphysics using the Magnetic and Electric Fields interface. In both cases, the Velocity (Lorentz term) feature is used to prescribe the rotational velocity. By using this approach, you do not need to use the Moving Mesh interface to account for the rotation of the rotor.
Note that the Velocity (Lorentz Term) feature can only be used when the moving domain does not contain magnetic sources like currents or magnetization (fixed or induced) that move along with the material, and the moving domains are invariant in the direction of motion. For instance, the Velocity (Lorentz Term) feature can be used to model conductive (not magnetic) homogeneous spinning disks. Some examples include magnetic brakes, an electrodynamic bearing, a homopolar generator, magnets over a moving infinite homogeneous plane (such as a falling magnet through a copper tube or maglev trains), a flow of homogeneous conducting fluid past a magnet (such as liquid metal pumps or hall generators/thrusters).
Note: The domain assigned to the Velocity (Lorentz Term) feature cannot contain currents or permanent magnets. Additionally, the rotating domain cannot be permeable or saturable materials (i.e., iron) as they would contain induced magnetization. The moving magnetic sources induced in the magnetic material would, in turn, induce an electric field in the surrounding region, which is not modeled by the feature.
In COMSOL Multiphysics, there are two available methods for calculating electromagnetic forces and torques. The most general method is the Maxwell stress tensor method, which is used by the Force Calculation feature in the Magnetic Fields interface; the Magnetic Fields, No Currents interface; the Magnetic and Electric Fields interface; and the Rotating Machinery, Magnetic interface.
For instance, by adding this feature, the spatial component of the magnetic forces (mf.Forcex_0, mf.Forcey_0, mf.Forcez_0
) and the axial torque (mf.Tax_0
) in the Magnetic Fields interface are available for postprocessing. The Force Calculation feature simply integrates the Maxwell stresses, evaluated just outside of the selected domain (or domains) and over the entire outer boundary of the domain selection, which should be a group of domains moving together (a single mechanical body). Since this method is based on surface integration, the computed force is sensitive to mesh size. It is important when using this method to always perform a mesh refinement study to correctly compute the force or torque.
Calculation force will not be correct if the domain applying the Force Calculation feature is touching an external boundary, a periodic boundary, and an identity pair. Furthermore, to compute the force on a magnet attached to a ferromagnetic surface, contact boundaries must have a thin low permeability gap (thin low permittivity gap for the electrostatic equivalent) assigned, as the Maxwell stresses should be evaluated in air rather than in the ferromagnetic (dielectric) material.
The second method — the Lorentz force method — works only in special cases for computing the magnetic force on nonmagnetic, current-carrying domains. The Lorentz force is defined as \mathbf{F = J \times B}, where J is the current density and B is the magnetic flux density. The Lorentz force is very accurate for force calculations in electrically conducting domains as it is evaluated on volume rather than boundaries. Therefore, whenever possible, the Lorentz force method is preferred over the Maxwell stress tensor method.
In addition to those built-in methods referenced above, the magnetic force and torque can also be calculated using the virtual work method, or the principle of virtual displacement. In this technique, the force is calculated by studying the effect of a small displacement on electromagnetic energy. The virtual work method can be employed by using the features for deformed mesh and sensitivity analysis in COMSOL Multiphysics, as demonstrated here.
In solid mechanics, stiffness is the rigidity of an object — the extent to which the object resists deformation in response to an applied force. Similarly, in magnetic bearing applications, the parameter is defined as the magnetic stiffness, and it is the negative of the derivatives of the total magnetic force with respect to position. If the magnetic force is F_z, the magnetic stiffness with respect to position z is given by:
A tutorial illustrating this method for computing the magnetic stiffness in an axial magnetic bearing is available here. This example, however, is limited to 2D axisymmetry. Therefore, the magnetic stiffness in the x- and y-directions cannot be evaluated. To evaluate the magnetic stiffness in all directions, you would need to model the problem in 3D. Here, we will create a 3D version of the same axial magnetic bearing discussed above and determine the stiffness k_x. You can download this example tutorial from our Application Gallery.
This approach primarily involves the use of the Magnetic Fields, Deformed Geometry, and Sensitivity interfaces. As in the 2D model, the Magnetic Fields interface is used. The magnets are modeled using the Ampère’s Law feature with constitutive relation set to a remanent flux density of 1[T]. The Force Calculation feature is added to the inner magnets only, with the geometry parameterized such that the inner magnets are a function of the parameter dX
(an offset in the x-axis). This parameter will later be used for a parametric sweep as well as to specify the prescribed mesh displacement in the Deformed Geometry interface. Only a quarter of the geometry will be used here to compute the magnetic stiffness in the x-direction.
In this configuration, note that only the x-axis forces are correctly computed. Due to the symmetry, the force in the y- and z-directions should be zero. However, due to the fact that only a quarter of the geometry is modeled, the computed force will be quite large. The stiffness in the y-direction can be computed similarly by analyzing a quarter model cut symmetric to the yz- and xy-planes.
Left: The quarter 3D model of an axial magnetic bearing for stiffness calculation. Right: The magnetic flux density norm and the magnetic flux density arrow plot in a half model. The results are plotted using a Mirror 3D data set at the xy-plane.
The Deformed Geometry interface is solved everywhere except in the infinite element domain region. To solve for this region, begin by adding a Free Deformation node on the air region around the magnets. Similarly, you can add a prescribed deformation of dX
on the domains of the inner magnets along the x-axis. Finally, add two Prescribed Mesh Displacement nodes for the inner magnet boundaries and the symmetry cut plane boundaries, as illustrated below.
Settings for prescribed deformation on the inner magnets’ domains.
Settings for prescribed mesh displacement on the inner magnets’ boundaries.
Settings for prescribed mesh displacement on the symmetry cut boundaries.
In the Sensitivity interface, add the Global Objective feature and specify the total force in the x-direction (i.e., 4*mf.Forcex_0
) in the objective expression under the Global Objective settings. Here, mf.Forcex_0
is the x-component of the Maxwell stress tensor force that is being calculated by the Force Calculation feature in the Magnetic Fields interface. Similarly, add the global control variable dX
, as shown below.
Settings for the global objective (left) and the global control variables (right).
Since the Sensitivity (and Optimization) study cannot be combined with a Parametric Sweep study node, the model must be solved in two separate studies. The first study will include the Sensitivity solver and the Stationary solver. The second study will then have a Parametric Sweep study but will use Study 1 as a study reference. Perform the parametric sweep over a parameter dX
using the interval of range(0,1.5/20,1.5), with the settings shown below.
Left: Settings for the Stationary study for sensitivity analysis. Right: Settings for the Parametric Sweep study using Study 1 as a reference.
The magnetic force in the x-axis and the magnetic stiffness in the x-direction are plotted as 1D global plots.
Settings for the magnetic force plot (left) and the magnetic stiffness (right).
Left: The electromagnetic force x-component as a function of offset in the x-axis. Right: The magnetic stiffness k_x as a function of offset in the x-axis.
Here, we have discussed several types of magnetic bearings that can be modeled in COMSOL Multiphysics using interfaces available in the AC/DC Module. Simulation provides a simplified approach to addressing design parameters within these types of bearings, helping to optimize their performance as well as their lifespan.
In the next blog post in this series, we will focus on how COMSOL Multiphysics can be used to model magnetic gears. Stay tuned!
]]>
The entire COMSOL® software product suite is built on top of the general-purpose software platform, COMSOL Multiphysics. This platform contains all of the core preprocessing, meshing, solving, and postprocessing capabilities, as well as several physics interfaces. (See our Specification Chart for complete details about what is available in each product.)
With COMSOL Multiphysics®, you can import 2D DXF™ files and 3D STL and 3D VRML files. You can use the 2D DXF™ file format to import profiles and extrude, revolve, or sweep them along a path to create 3D geometry.
The STL and VRML formats are best suited for simple shapes; complex CAD data does not transfer reliably since these formats lack the sophistication of modern CAD file formats. To work with STL files containing 3D scans, we recommend that you import those as a mesh and use the built-in functionality to convert the imported mesh to geometry. Depending on the complexity and quality of the 3D scan, the resulting geometry can then be combined with other geometric objects that are either imported or created in COMSOL Multiphysics.
Also part of the core COMSOL Multiphysics capabilities, the Virtual Operations approximate the CAD data for meshing purposes and are useful for cleaning up all imported CAD data, or even COMSOL native geometry.
The LiveLink™ products allow you to work with the data directly from your CAD program. Supported CAD packages include SOLIDWORKS® software, Inventor® software, Autodesk® AutoCAD® software, PTC® Creo® Parametric™ software, PTC® Pro/ENGINEER® software, Solid Edge® software, and the building information modeling (BIM) software Autodesk® Revit® Architecture software. Both LiveLink™ for SOLIDWORKS® and LiveLink™ for Inventor® offer the One Window interface, which directly embeds the COMSOL® modeling environment within the CAD software user interface. The list of version compatibility with these products is maintained here.
When using these LiveLink™ tools, you must have both COMSOL Multiphysics and the CAD program installed and running on the computer you are using. The CAD data as well as materials definitions and other selections will be bidirectionally synchronized between your CAD package and COMSOL Multiphysics, with full associativity. You can read more about that here. This means that any modifications that you make within the CAD package will be available within the COMSOL environment, and you can use COMSOL Multiphysics to change any of the dimensions within your CAD file. The functionality of each of these modules is described here.
Since the data is transferred with associativity, as you change the dimensions in your CAD program to reshape the part, the COMSOL software will track these changes and appropriately re-map all of the boundary conditions and other geometry- and selection-based settings. To see a demonstration of this, please watch the relevant videos in our Video Gallery. You will find this functionality useful when you want to perform parametric sweeps over the dimensions in your CAD file or perform dimensional optimization using the COMSOL Optimization Module.
In addition to synchronizing CAD data between a CAD software and COMSOL, the LiveLink™ products also include support for file import of the full range of CAD file formats supported by the CAD Import Module. If you are solving problems where you actually want to model the volume inside of the CAD domain (such as for fluid flow models), you can also use the Cap Faces command to create enclosed volumes based upon an existing geometry, as described here. You will also be able to perform repair and geometric clean-up (defeaturing) operations on your CAD data and write out the resultant geometry, or any geometry you create in COMSOL Multiphysics®, to the Parasolid® software or ACIS® software file format.
The LiveLink™ products are the best option for you if you can have your CAD software and COMSOL software installed on the same computer and you want to take advantage of the benefits offered by the included integration. However, if you are working with CAD data that is coming from someone else and don’t have their CAD software on your computer, then you may want to use the CAD Import Module or the Design Module instead.
The CAD Import Module and the Design Module will allow you to import a wide range of CAD file formats. You can find the complete list of formats and versions that are importable here.
If you are planning to make many design iterations, then the relative drawback of both the CAD Import Module and the Design Module compared to the LiveLink™ products is that the data import is one-way and there is no associativity that is maintained between the CAD data and the COMSOL model. That is, if you make a modification to the CAD file and have to re-import the geometry, the physics features and other geometry-based settings in the COMSOL model may not reflect these changes. You will need to manually check all settings and re-apply them to the modified geometry. Additionally, the dimensional data in the original CAD file is not accessible, so you will not be able to perform parametric sweeps or optimization.
It is possible to work around this limitation as described in the “Parameterizing the Dimensions of Imported CAD Files” blog post, but this technique is usually only practical for simpler geometries.
The Design Module provides additional functionality for creating geometry. It includes all of the capabilities of the CAD Import Module, but also provides extra geometric modeling tools. The Parasolid® software Kernel functionality is used to provide 3D Fillet, 3D Chamfer, Loft, Midsurface, and Thicken operations. You can learn more about these operations in this introduction to the Design Module.
The CAD Import Module is recommended only if you are certain that you will never be using COMSOL Multiphysics in conjunction with any of the CAD packages for which there is a LiveLink™ product and if you do not want to create any complex CAD geometries within the COMSOL environment. The Design Module is recommended over the CAD Import Module since it provides all of the same functionality, but will also allow you to create more complex CAD geometries within COMSOL Multiphysics. These geometries can then be exported to the Parasolid® software or ACIS® software file formats. Both modules include the full suite of defeaturing operations as well as the Cap Faces operation.
In addition to the products mentioned here, there is also the File Import for CATIA® V5 Module, which can import CATIA® V5 software files and is an add-on to any of the LiveLink™ products for CAD packages, the CAD Import Module, or the Design Module.
The ECAD Import Module is used for the import of ECAD data, which are files that are typically meant to describe the layout of an integrated circuit (IC), micro-electro-mechanical systems (MEMS) device, or printed circuit board (PCB) and thus contain planar layouts, and in some cases thickness and elevation information.
While the data transfer with this module is without associativity, you can take advantage of selections created by the import functionality to preserve model settings after importing a changed file. Also, the layered structure of the generated geometric objects makes the use of coordinate-based selections for model settings especially suitable to automate model set-up with imported ECAD files. Look out for a future blog post on how to do this.
We recommend the LiveLink™ products if you have your CAD software and COMSOL simulation software installed on the same computer. The Design Module or the CAD Import Module can be used if you only want to import files, and the Design Module is preferred since it has enhanced functionality. The add-on File Import for CATIA® V5 Module is only needed for that specific file type. Finally, to incorporate geometry from ECAD layout files into your simulations, you will need the ECAD Import Module.
If you have any other questions about how best to interact with your CAD data, please contact us.
ACIS is a registered trademark of Spatial Corporation.
Autodesk, the Autodesk logo, AutoCAD, DXF, Inventor, and Revit are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.
CATIA is a registered trademark of Dassault Systèmes or its subsidiaries in the US and/or other countries.
Parasolid and Solid Edge are trademarks or registered trademarks of Siemens Product Lifecycle Management Software Inc. or its subsidiaries in the United States and in other countries.
PTC, Creo, Parametric, and Pro/ENGINEER are trademarks or registered trademarks of PTC Inc. or its subsidiaries in the U.S. and in other countries.
SOLIDWORKS is a registered trademark of Dassault Systèmes SolidWorks Corp.
]]>
In December, I came across an article from the BBC drawing the public’s attention to computer-aided design in architecture. The article cites a number of essential contributions of modeling, which include the structural analysis of Jørn Utzon’s radical design for the Sydney Opera House and a fluid-structure (facade pressure) study of the Burj Khalifa in Dubai. Additionally, fluid flow, microclimate, and acoustic studies are also referenced.
The Sydney Opera House.
From this article, it is clear that architecture benefits from software outside the traditional fields of drawing tools and structural analysis. The way that modern architects use modeling software is underlined by the breadth of interests discussed in the “Building Design Simulation” user presentation session at the COMSOL Conference 2014 Cambridge. Some of this research includes mass transport and flow in the determination of cleanroom quality, acoustic development of soundproof windows, thermal analysis towards “Energy Zero Building”, and so on.
One of the poster prize winners at the COMSOL Conference 2014 Cambridge was Carmelo Galante of Newtecnic (London, UK). He presented his work using COMSOL Multiphysics to study the heat transfer performance of a facade, specifically a double-glazed window in which the air cavity also contains “solar control devices”. These are essentially blinds that can reflect a proportion of the incident solar radiation. You can read the details of his analysis here.
Galante’s study used the Heat Transfer Module to investigate the combined influence of all three modes of heat transfer: conduction, convection, and radiation. The cavity is mechanically ventilated so fluid flow can arise due to forced convection as well as natural convection. On the basis of a “U-value” that quantifies thermal performance, the design was optimized by changing the number and position of forced flow inlets and outlets. By combining fluid and thermal physics with radiation in a single modeling environment, the interplay of the different physical effects can be evaluated.
In the Model Gallery, you can find an assortment of other examples from the world of architecture. Many architects will be interested in thermal analysis, as in the conference work mentioned above. Additionally, in the Heat Transfer Module, there are several examples related to the building and construction industry. One of them considers the thermal performance of a window, illustrating the effect of different glazing configurations.
Below, you can see the material configuration of an ISO standard sliding window, together with the temperature profile from a COMSOL Multiphysics analysis. The predicted heat loss of 0.65 W/(m.K) is quite large due to the high thermal conductivity of the aluminum structure.
The geometry of the sliding window.
Temperature distribution in the sliding window.
Structural stability analysis is still important, too. In the Geomechanics Module, there is a model of a concrete beam in which a mechanical model is used to assess the additional structural rigidity due to steel “rebars”. Rather than assuming that the concrete is just a linear elastic material, the empirical Ottosen plasticity model is used to describe the concrete.
My colleague Bridget recently wrote about a larger-scale study of facade reflectivity and coupled thermal effects: the formation of a caustic surface due to the concave glass facade of the Vdara® hotel in Las Vegas. Here, COMSOL Multiphysics was used to investigate a harmful consequence of the building design “after-the-fact” using the ray tracing functionality of the new Ray Optics Module.
Just as ray tracing allows us to study light paths and reflection at the building scale, ray acoustics can be used for acoustic analysis in the limit where the acoustic cavity is much larger than the wavelength of the sound. This is typically the case for large rooms, such as theaters and concert halls, where a clear understanding of the acoustic properties is essential. In the Model Gallery for the Acoustics Module, you can find an example of a small concert hall with the pressure and energy impulse responses computed.
With the release of COMSOL Multiphysics version 5.0, we introduced a new product that is designed to integrate architectural designs with multiphysics simulations: LiveLink™ for Revit®. This integration tool and interface transfers design elements from Autodesk® Revit®, a leading software within architectural design, to the COMSOL Multiphysics software.
Using LiveLink™ for Revit®, you can take geometries for particular rooms and architectural elements within a building and then synchronize them with your COMSOL Multiphysics model. You can add additional physical effects to the model as needed, just as if the geometry were built in COMSOL Multiphysics. By choosing which details you would like to include, you can ensure an accurate simulation.
With multiphysics modeling for architecture active in the news and the scientific community, we encourage you to learn more about these different architectural models and download them from our Model Gallery:
Autodesk and Revit are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries.
]]>
Heat transfer computation often needs to include surface-to-surface radiation to reflect reality with accuracy. The numerical tools used to simulate surface-to-surface radiation differ significantly from those used for conduction or convection. Whereas the latter are based on local discretization of partial differential equations (PDEs), surface-to-surface radiation relies on non-local quantities — the view factors between diffuse surfaces that emit and receive radiation.
When surface-to-surface radiation is activated, the heat interface creates a set of operators that are evaluated like the irradiation variables in surface-to-surface radiation. Thanks to these operators, it is possible to retrieve the irradiation variable values and to compute the geometrical view factor in a given geometry.
In this blog post, I’ll explain how to compute geometrical view factors in a simple 3D geometry where analytical values of the view factor are available.
The new operators in COMSOL Multiphysics version 5.0 offer full access to all of the information used to generate surface-to-surface radiation equations. This is true for even the more advanced configurations, such as radiation on both sides of a shell and multiple spectral bands with different opacity properties.
Let’s start with the simplest case where we assume that surfaces behave like gray surfaces. In this case, we don’t need to distinguish between the spectral bands. We have two operators, one for each face (up or down) of the surfaces. They are as follows:
radopu(expr_up,expr_down)
radopd(expr_up,expr_down)
These two operators are designed to be evaluated on a boundary where the surface-to-surface radiation is active. Assuming that the heat interface tag is ht
, ht.radopu(ht.Ju,ht.Jd)
returns the mutual surface irradiation, ht.Gm_u
, that is received at the evaluation point on the upside of the boundary.
Note that ht.Ju
and ht.Jd
define the radiosity on the up- and downsides of the boundaries, respectively. Similarly, ht.radopd(ht.Ju,ht.Jd)
returns the mutual surface irradiation, ht.Gm_d
, on the boundary downside.
When multiple spectral bands are considered, a given boundary can be opaque for a spectral band and transparent for another band. Hence, one pair of operators is needed per spectral band. They work exactly like the operator for gray surface and are named as follows:
ht.radopB1u(expr_up,expr_down)
and ht.radopB1d(expr_up,expr_down)
ht.radopB2u(expr_up,expr_down)
and ht.radopB2d(expr_up,expr_down)
ht.radopB3u(expr_up,expr_down)
and ht.radopB3d(expr_up,expr_down)
Let’s consider two diffuse gray surfaces: S1 and S2. We’ll assume that radiation occurs only on the upside of these surfaces. From a thermal perspective, the view factor between S1 and S2, F_{S1-S2}, is the ratio between the diffuse energy leaving S1 and intercepted by S2 and the total diffuse energy leaving S1.
Using the operators described above, we have
(1)
Note that for clarity, the ht.
prefix has been removed.
Assuming that radiosity is the same value on all surfaces, the above definition can be simplified and no longer depends on J. In that case, F_{S1-S2} depends only on the geometrical configuration and no longer on the thermal configuration. Let’s call this a geometrical view factor to distinguish it from the view factor based on thermal radiation.
We now have
(2)
where S1 represents either the surface name or its area and I_{\textrm{S1}} is the function indicator of the surface S1, which returns 1 when it is evaluated on S1 and 0 elsewhere.
In order to get used to the new operators and check their accuracy, I chose a simple configuration. The geometry consists of two concentric spheres of radius R_{int} and R_{ext} (with R_{int} < R_{ext}), as shown below:
The radiation occurs between the external side of the small sphere and the internal side of the large sphere. The geometrical view factors are:
Here, S_{int} and S_{ext} represent the interior and exterior sphere, respectively.
To compute the geometrical view factor in the COMSOL Multiphysics simulation software, we need to add a heat interface with surface-to-surface radiation activated, then draw the geometry and build the mesh.
Then, we don’t really need to run a heat transfer simulation since we are interested in the geometrical view factor. To have access to the radopu
and radopd
operators is enough to get initial values.
Before doing that, though, we’d better prepare a few tools that will help us with the postprocessing.
In the geometrical view factor expression, we have used the surface indicators I_{\textrm{S1}} and I_{\textrm{S2}}. These are defined as Variables in COMSOL Multiphysics and use the Geometric Entity Selection, so that it is 0 everywhere except on the corresponding surface where it is 1. Let’s name them ext
and int
.
Screenshots of the Geometric Entity Selection settings for the surface indicators.
Next, we define the integration operators intop_ext
and intop_int
. They will make it easy to compute surface integrals; for example, the surface of S_{ext} can be evaluated as intop_ext(1)
.
Screenshots of the settings for the integration operators.
We have seen that radiation may occur on the upside, downside, or on both sides of the boundaries. The radiation operators are designed to be able to distinguish the radiation coming from each side. Therefore, we need to check the sides on this model.
We can do this easily via the Diffuse Surface feature, where the radiation direction can be set to “Negative normal direction” (downside) or “Positive normal direction” (upside). Using this option prompts arrows to be automatically displayed to show the direction of radiation leaving the surface. In our example, the radiation occurs on the downside for S_{ext} and the upside for S_{int}.
With all these tools available to us, evaluating the view factor using an expression similar to (1) is direct. For example,
(3)
is evaluated in COMSOL Multiphysics syntax with intop_ext(comp1.ht.radopd(0,ext))/intop_ext(1)
.
Note that the use of radopd
is due to the fact that the radiation occurs on the downside of S_{ext}. The first argument of radopd
is 0 for the same reason.
(4)
is evaluated with intop_ext(comp1.ht.radopd(int,0))/intop_int(1)
, where radopd
is due to the fact that the radiation occurs on the downside of S_{ext}. But this time, the second argument of radopd
is 0 because radiation occurs on the upside of S_{int}.
I’ve gathered all the results in a table:
Analytical value | Computed value | Error | |
---|---|---|---|
F_{S_{\textrm{int}}-S_{\textrm{int}}} | 0 | 0 | 0 |
F_{S_{\textrm{int}}-S_{\textrm{ext}}} | 1 | 0.998 | 2e^{-3} |
F_{S_{\textrm{ext}}-S_{\textrm{ext}}} | 0.91 | 0.9102 | 2e^{-4} |
F_{S_{\textrm{ext}}-S_{\textrm{int}}} | 0.09 | 0.09 | 1e^{-6} |
Thanks to the radiation operators, we were able to retrieve the geometrical view factor.
With COMSOL Multiphysics 5.0, it is possible to compute geometrical view factors between diffuse surfaces, thanks to dedicated operators. This offers a solution for the requests we received since the surface-to-surface features have been released. But, these operators can do much more. They are flexible enough to provide all terms of the surface-to-surface radiation equation. They may also be used to formulate equations for other quantities.
Let’s look at a model of a bent copper wire. You have applied a voltage of 5 mV between its ends, and the model computes the resulting total current running through it. With the default Normal mesh, you get a current of 490 A. You decide to try a few other mesh settings in order to determine the accuracy of this current. The results vary only by a few mA and there is markedly less variation between the finer mesh cases. You judge that the result is mesh convergent and sufficiently accurate for your needs.
Wire model set-up (left) and computed electric potential distribution in mV (right).
Next, you would like to evaluate the maximum current density in the wire. It is important that this value isn’t too high. If it is, the resulting heat production risks wearing out the protective jacket and can even be a potential fire hazard.
The normal mesh gives you a maximum current density of 6.2 A/mm^{2}. It is clear that this value appears at the inside corner of the bend, so this time you take care to refine the mesh within that area. The graph below shows the (quite alarming) results: Even if you refine the mesh by a factor of 100, the maximum current density is still growing and there is no indication that it will ever stop.
Singular current density at the inside corner (left) and calculated maximum current density vs. local mesh density (right).
What you have run into is a geometrically singular result. The current density is proportional to the electric field, which in turn is (the negative of) the gradient of the electric potential. While the electric potential itself remains smooth and well-defined at a sharp corner, its gradient is in theory infinite. Numerically, it will tend towards infinity as you refine the mesh. In reality, there are of course no perfectly sharp edges. However, the sharper the edge, the greater the local current density.
If you give the edge a finite radius of curvature, you can limit the current density in the model to simulate reality far better.
Here’s how you do it:
With the fillet in place, the model now returns a smooth current distribution, with a convergent maximum value of 5.1 A/mm^{2}.
Smooth current density distribution (left) and calculated maximum current density vs. mesh density on the fillet (right).
If you would have been interested only in the total current, voltage distribution, or the current density some distance away from the singularity, you would have received good results even without the fillets. This, importantly, also goes for lumped parameters such as resistances and impedances. In an electromagnetic heating model, even a small thermal conductivity is sufficient to give a smooth temperature distribution and a convergent maximum temperature despite a locally singular current density.
Still, if you want to ensure that you get your local fields and currents right, keeping it smooth is a good idea. In general, edges and corners in 3D, as well as corners in 2D, may give you singular electric or magnetic fields. This holds true if they both demark the outer limits of your model or if they separate materials with different properties. If the fields are singular, so are most of the variables that depend explicitly and locally on them.
The next image shows the Maxwell stress tensor on the surface of an iron bar next to a horseshoe magnet. As the stress tensor is proportional to the magnetic field squared, it becomes singular if the bar has sharp corners and edges.
Magnetic flux density around a horseshoe magnet and Maxwell stress tensor distribution on a nearby iron rod. The close-ups show the local flux density on the iron bar without (left) and with (right) fillets.
Outside of electromagnetics, many other solution-variable gradients (heat fluxes, stresses, strains, etc.) exhibit similar singularities and will become smooth if you fillet your edges and corners. You can read more about singularities in Walter’s blog post on the same topic.
Last but not least: Don’t cut corners! It may be tempting to keep the total mesh count down by using the simpler Chamfer operation instead of applying fillets. This, however, gives you a straight section instead of the smooth bend and literally replaces each singularity you remove with at least two additional ones.
Fillets (and chamfers) in 2D are included in all installations of COMSOL Multiphysics version 5.0. In 3D, you need the new Design Module.
]]>
The Loft operation comes in handy when Extrude or Sweep won’t do the job because they do not support multiple cross sections. You can create solid or surface objects from cross sections defined by a face or a profile curve. The profile can be closed or open. For start and end profiles, you can specify the direction of the loft in relation to the profile or adjacent faces. To further control the shape of the loft, you can include guide curves that connect the profiles.
The highlighted regions of this bracket geometry are generated using the loft command by joining the two cross-sectional faces. The loft shape is controlled by guide curves and a setting that keeps the loft direction perpendicular to the profile faces.
The Fillet and Chamfer operations do not need much introduction; they do exactly what we expect them to do — now in 3D. You can create fillets and chamfers with constant radii on edges on 3D solids and surfaces. The fillet or chamfer can automatically propagate to edges that are tangent to the selected edges, which makes the selection of the input entities quite easy.
The fillets on this turbine stator geometry are created using the Design Module. On the enlarged detail (bottom of the image), the fillet propagates to edges tangent to the selected edge (marked with a red arrow). The tool automatically handles the overflow of the fillet into the adjacent fillet in the front.
Setting up a finite element model on the midsurface of a solid object is an analysis technique that is used quite often for parts with a very thin geometry (e.g., something made out of sheet metal). The Design Module enables the calculation of the midsurface of a solid object. The inverse of the Midsurface operation, called thicken, allows you to add material to a surface to convert it to a solid. You can add the thickness in the default normal direction to the surface or specify a direction. The Thicken operation can be symmetric, where an equal amount of volume is added on each side of the surface. It can also be asymmetric, which allows you to specify the thickness on each side.
The geometry of this imported speaker cone is reduced from a solid to a surface object by the Midsurface tool.
All of the newly added geometric tools are fully integrated into the parametric geometry modeling framework in the COMSOL Multiphysics® simulation software. You can use parameter-based expressions in the settings for the operations and thereby control the geometry from the parametric solver or an optimization solver (requires the Optimization Module).
The Design Module also includes all the functionality of the CAD Import Module, such as the file import of widely used CAD file formats and tools to repair and defeature imported geometry. To share your designs, you can export to the Parasolid® software and ACIS® software formats. Read more about the functionality of the Design Module here.
Now that we have introduced you to the Design Module, we will continue with additional blog posts focusing on specific aspects. Stay tuned.
In the meantime, check out the product page for the Design Module.
ACIS is a registered trademark of Spatial Corporation.
Parasolid is a registered trademark of Siemens Product Lifecycle Management Software Inc. or its subsidiaries in the United States and in other countries.
When we use the term CAD geometry, we are referring to a set of data structures that provide a very precise method for describing the shapes of parts. This method is called boundary representation, or B-rep. A B-rep model for solids consists of topological entities (faces, edges, and vertices) and their geometrical representation (surfaces, curves, and points). A face is a bounded portion of a surface, an edge is a bounded segment of a curve, and a vertex lies at a point.
In the B-rep data structures, surfaces are often represented by Non-Uniform Rational B-Splines, or NURBS. The B-rep model of a part is used as the basis for other operations, such as generating tooling paths in Computer Aided Manufacturing software, creating Rapid Prototyping files, and — most importantly — for your COMSOL Multiphysics modeling, generating the finite element mesh.
Your first choice in terms of element type will usually be the tetrahedral mesh for 3D models or a triangular mesh in 2D models. Any 3D geometry can be meshed with tetrahedral (“tet”) elements and any 2D geometry can be meshed with triangles. Additionally, these are the only elements that support Adaptive Mesh Refinement.
For the rest of this blog post, we will focus on the 3D case, since it is the most computationally challenging. At a very conceptual level, the COMSOL tetrahedral meshing algorithm first applies a mesh on all of the surfaces of an object. This mesh is then used to “seed” the volume mesh from which tetrahedral elements “grow” elements inwards. As these tetrahedral elements intersect, their sizes are adjusted with the objective of keeping the elements as isotropic (similar edge lengths and included angles) as possible and to have reasonably gradual transitions between smaller and larger elements.
An issue that you can run into with this algorithm is that the meshing is done based upon the underlying topological entities. There is no way for the meshing algorithm to insert larger elements if the underlying entities are small. As we saw in the previous blog post “Working with Imported CAD Designs,” we can use the CAD repair and defeaturing tools to simplify the geometry.
However, when these algorithms attempt to remove topological entities, they often need to modify the underlying NURBS surfaces and are therefore somewhat limited. An alternative in COMSOL Multiphysics software is to use Virtual Operations, which can keep the existing geometrical representations as a basis for constructing a new alternative topological structure purely for the purposes of meshing and defining the physics.
Let us take a look at the virtual operations and see what you can do with them through a series of examples. The first ten options in the Virtual Operations menu actually only represent five unique capabilities, but they can be used in different ways.
The Virtual Operations menu.
Let’s look at a quick example for each of these five.
The below image demonstrates the Ignore Vertices feature (top) and the Form Composite Edges feature (bottom), which result in the same geometry.
Below is a demonstration of the Ignore Edges feature (top) and the Form Composite Faces feature (bottom), which result in the same geometry.
The following image demonstrates that the Ignore Faces feature (top) can be used to ignore any faces that lie between two adjacent domains, resulting in a single domain. The Form Composite Domains feature (bottom) will also combine multiple domains into a single domain.
As shown next, the Collapse Edges feature (top) and the Merge Vertices feature (bottom) will result in the same geometry. The Merge Vertices feature gives the additional option of choosing which vertex to remove and which one to keep.
The Collapse Faces command (top) and the Merge Edges command (bottom) stand out, since they have been designed to work even in those cases where the faces are not continuous. A useful application for these commands is to get rid of slivers resulting from the union of components that are slightly misaligned or do not fit for other reasons.
Lastly, the Mesh Control Points, Edges, Faces, and Domains features will hide points, edges, faces, or domains during the set-up of the physics; however, these geometric entities will still be present during the meshing step. By using these operations, you can gain greater control over the meshing process by designating geometric entities for the control of the mesh size and distribution. The physics set-up is kept simple by excluding the control entities. A typical area of application is in CFD simulations, where regions of steep gradients in a volume need a high mesh density.
It appears that we have a lot of options here, and you may wonder which of these features you should be using. In practice, the Form Composite Faces can usually be your first choice. Almost all of the issues that you will typically run into, with the exception of forming composite domains, can be handled with this feature.
Let’s look at a case from the COMSOL Multiphysics Model Library: the stresses and strains in a wrench. This is a structural model of a combination wrench. The provided CAD geometry has some relatively complex sculpted surfaces and fillets and blends, which result in small faces in some parts of the model. These small faces force the tet mesher to use smaller elements, but we can see that Virtual Operations can be utilized to avoid this.
A detailed view of a CAD file shows that small faces result in a fine mesh. Using the Virtual Operations allows larger elements in these regions.
We can use the Form Composite Faces feature to abstract whole sets of faces. You can simply select all of the faces and then deselect those faces that you do not want to abstract. This is acceptable and recommended if you know you do not need high fidelity of the mesh in certain regions where there are many small faces.
Virtual Operations can be used to combine sets of surfaces and significantly simplify some parts of the geometry.
We have now seen why you would want to use these Virtual Operations and the many ways in which they can be used. If you want to see a step-by-step guide for using these features to simplify your geometry, please see the Model Library example on using Virtual Operations on a Wheel Rim Geometry.
]]>
Computer Aided Design (CAD) has a long history that almost dates back to the very first electronic computers. For most companies, the original motivation behind adopting CAD software was to automate a product’s design, documentation, and manufacturing process in order to clearly and effectively communicate engineers’ designs to production facilities.
Before 3D CAD models, products were created from 2D designs that came in the form of 2D drawings. Later on, designers started to generate 3D models, based on 2D drawings. CAD designs have played an important role in a product’s life cycle over the years.
Today, 3D CAD models can be found in a wide range of documents and applications, spanning from service manuals to analyses. Some organizations have gravitated toward completely eliminating the production and distribution of traditional 2D drawings. With the elimination of 2D drawings, 3D CAD models are a product’s sole information source, which forces these models to streamline even more processes in a product’s life cycle.
It can be a challenging task to use the same 3D data set for the various stages in a product’s life cycle. This is especially true for finite element analysis, as it typically requires a very high-quality 3D geometry.
For example, to create a volume mesh for a component, we would need a watertight surface geometry that can be made into a solid with an interior region. Usually, this is something we don’t need to worry about, because the imported geometric data contains the 3D solid object and the mesh is automatically created.
Sometimes, however, due to the complexity of the design and/or repeated translations from one CAD format to another, data may be lost or become inaccurate, which can result in incomplete surfaces with gaps. In this scenario, we would need to rely on either automatic repair during the import process or use the provided repair tools, which are described in further detail below.
Various types of analyses may also require widely different representations of the same design.
Before starting a COMSOL Multiphysics model, it is important to determine the level of detail necessary to obtain desired results. A good understanding of the scope of the study and the involved physics greatly helps in determining the most efficient path to an analysis’ appropriate geometry.
For instance, to receive a detailed analysis of a bolt thread’s load carrying capacity, you would use a geometric representation of the bolt that differs from the one you’d use for a heat conduction simulation in a large assembly that contains many bolted connections.
In the first scenario, a detailed representation of the bolt thread is important, while in the second scenario, a simple cylinder that fills the bolt holes would suffice. Depending on how the bolt is represented in the CAD files, you would need to either simplify its geometry or add details to it in order to run the simulation.
We often face these situations where some components may need simplification (also referred to as defeaturing), more detail, or repair before generating the mesh.
To understand the tools available for the repair and defeaturing of a geometry, it helps to factor in the size and nature of the removed details.
In most cases, details such as fillets, chamfers, holes, and fasteners are important for a product’s functionality. However, they may be deleted from the geometry, depending on the scope of the analysis. When we remove these features, a considerably sized gap, or “wound”, will remain. This gap needs to be covered by a replacement surface, so that we can restore a solid object, allowing us to create a volume mesh.
When using the defeaturing tools in COMSOL Multiphysics, gaps are automatically covered as part of the operation (e.g., extending adjacent faces over the gap). There is, of course, always the possibility of manually deleting faces and drawing a new geometry to cover the gaps.
Many of the geometric features that we would like to remove are small enough that they can be deleted by collapsing them into a point or line segment. This can be done without causing a noticeable change to the surrounding faces, which is usually a lot easier than figuring out how to construct a larger face to cover a gap.
Very small surface patches are often introduced into a CAD model with a complex shape to ensure a sufficiently smooth surface. Sometimes, the CAD model can also contain fillets of a very small radius or the placement of a larger feature, which leaves a very thin sliver in the geometry.
The smaller the feature that is to be deleted, the easier it is to cover the resulting gap without causing unexpected changes in the surrounding geometry. Collapsing a very small edge or face into a point only necessitates a very small local change to the neighboring faces and edges. The same holds true for collapsing a sliver into an edge.
These two operations are, in fact, part of a whole range of repair and cleaning operations, which are done by default when importing a CAD file. The CAD file’s model contains a collection of the mathematical descriptions of the surfaces and information about how they are connected.
Since the various CAD formats represent surfaces differently, there is always a possibility that problems will be introduced when going from one format to another. This can happen when exporting and importing CAD files. An import algorithm includes a repair functionality that can find and fix a whole range of problems, such as incorrect or missing connectivity information, erroneous shape information, tolerance issues, and more.
During import, the repair algorithm detects and deletes short edges.
During import, you can control how surfaces are treated, as well. By default, COMSOL Multiphysics tries to knit, or stitch, surfaces together to form a solid object. While the software does this, the code tries to cover any gaps by creating new surfaces. For large gaps, this could lead to unexpected results. If this happens, change the setting to import surfaces without stitching or forming solids. You can then draw new surfaces in the COMSOL software to cover the gaps.
For most cases, the default import tolerance does not need modification, but it is good to know that it can be changed if you’re importing very large or small objects. In the former case, the tolerance could be too small, leaving many slight details and other errors in the geometry. In the latter case, the tolerance could be too large, causing the loss of important details.
The automatic repair and knit operations, performed during import, are also separately available in the COMSOL software’s user interface. You will find these operations in the Geometry toolbar, under Defeaturing and Repair, when you use the CAD Import Module, Design Module, or any of the LiveLink™ for CAD products.
These tools come in handy when importing an assembly that contains both larger and smaller components and when the same tolerance setting is not suitable for all components.
To do this, first import the assembly, using a tolerance setting tuned for the smallest component. After the import, run the “Repair” and “Knit to Solid” tools with a larger tolerance to fix the bigger components. The Knit to Solid tool can heal gaps between faces and, when possible, make a solid object. It is good to use these tools with caution as we increase the tolerance, since they might result in unexpected changes to the geometry.
The Repair tool finds and deletes faces and edges that are smaller than the repair tolerance. To gain precise control over what is deleted, we can use the tools to detect and delete short edges, spikes, slivers, and small faces. These tools work well for relatively small features that can be collapsed to an edge or a point.
During this process, the curvature of surrounding faces is slightly modified to allow for the change in geometry. This is why these tools should not be used to delete large faces. For some simulations, it can be important that the original surface curvature of the geometry is kept, in which case it is better to use the virtual geometry operations for defeaturing the geometry (this will be the topic of a future blog post).
Deleting sliver faces, spikes, and short edges by collapsing them into edges and points.
In the image above, the highlighted region of the fastener detail contains two sliver faces and a spike. These can be detected and removed by using the “Delete Sliver Faces” and “Delete Spikes” tools. While a sliver face is a face with a high aspect ratio, a spike is a region with a high aspect ratio inside a face. As illustrated in the schematic above, small features like these often occur where several fillets of different radii meet. After deleting the sliver faces and the spike, a short edge remains that can also be detected and deleted by using the Delete Short Edges tool.
The mesh for the highlighted region of the fastener before and after defeaturing.
The method of removing features works well for small features only. To close a gap after a larger detail, other methods are needed. The “Delete Fillets” and “Delete Faces” tools allow you to select the faces you wish to delete. These tools close the resulting gaps by extending or shrinking the surrounding faces. For this to succeed, it is important that there is enough information in the adjacent faces to cover the gap. The delete operations also have an option to create a cover for the gap, based on its edges.
A large detail is deleted by using the Delete Faces tool.
Up until now, we have looked at the tools to repair and defeature an imported geometry. With the Detach Faces tool, which is also found under the Defeaturing and Repair menu, we can detach a set of faces into a new solid object. This can be very useful if we’d like to assign different material properties to a region of the imported object (the fastener detail highlighted in the previous figure, for example).
Using this tool, a through hole can be detached into a solid object by selecting its walls. Another method for creating domains for flow regions through a solid object is to use the Cap Faces tool, which can be found in the Defeaturing and Repair menu, as well.
A new domain is created for the hole with the Cap Faces tool.
The edge loops around the cavity’s inlets and outlets or the through hole are this tool’s inputs. Based on the edges, cover surfaces are constructed to cap the holes, thus creating a new domain in the solid. Given that there is an appropriate set of edges around a solid, this tool can also be applied to create a new surface that partitions the solid into different regions.
]]>
As I’m writing this, it’s Friday and we’ve had a long and very productive week. Like me, you’re probably wondering what type of IPA you will order with your nachos later. We are quite lucky to have such a wide selection of beers available in the U.S., thanks to the recent rise of craft beers. But rather than going to our local micro brewery, we could take it a step further and attempt to make our own beer.
Here, we give you a crash course on beer brewing and explain how you can improve the brewing process with CFD simulations. The main purpose is to find out how to cool down five gallons of boiling water as quickly as possible. But, first: Some context.
Making your own beer is relatively straightforward. If you can make tea, you can probably make beer.
Here’s my list of seven steps to brewing beer:
That’s the standard procedure. But, why settle for standard when we can improve the process? Most of the above steps can be optimized with simulations. Let’s start with the most crucial one — Step 3: Cooling the wort.
In Step 3, the boiling wort needs to be cooled down very quickly for several reasons.
First of all, it needs to be cool enough for the yeast to survive. Second, cooling it limits the production of sulfur compounds and other contaminants during the cooling process. These compounds are associated with off-flavors in the finished beer. Finally, some proteins need to be thermally shocked in order for them to precipitate.
We won’t go into these reasons in detail, as we prefer to focus on the engineering aspect of the process. The size of a typical home brew batch is between five and ten gallons. The problem of cooling down the liquid quickly becomes even harder in an industrial set-up, where the amount of wort to be cooled down is massive.
I’ve seen on YouTube that you might try throwing ice in the boiling kettle. I would not recommend this as it might introduce contaminants in the beer and will dilute it.
How about placing the boiling kettle in an ice bath in our kitchen sink? While this is the cheapest way, it is not the most efficient. I will let you find that out on your own using our Conjugate Heat Transfer interface (included in the CFD Module and the Heat Transfer Module.)
The cooling of the kettle in an ice bath can modeled very similarly to the Free Convection in a Water Glass model tutorial, found in our Model Gallery.
Free convection in a glass of water.
This model treats the free convection and heat transfer of a glass of cold water heated to room temperature. Initially, the glass and the water are at 5°C and are then put on a table in a room that’s 25°C warm. The boiling kettle cooling problem could be modeled the same way by setting the initial wort temperature to 100°C and the external wall temperature to 0°C.
Alternatively, we could use a wort chiller. Basic wort chillers consist of a long helicoidal pipe that you immerse in the kettle at the end of the boiling process. You will then run cold water from your sink into the pipe to cool down the wort.
Sketch of a wort chiller.
As you can deduce by the shape, the modeling procedure for this wort chiller is identical to the one found in our geothermal heating problem model of a pond loop:
In this example, a pond is used as a thermal reservoir and fluid circulates underwater through polyethylene piping in a closed system. The model finds out how much heat is transferred from the pond to the working fluid in the pipes. To this end, the Non-Isothermal Pipe Flow interface sets up and solves the equations for the temperature and fluid flow in the pipe system.
In the pipe flow physics interface, the pipes are represented by 1D lines, rather than actual 3D pipes, which drastically reduces the computational load of such a model. The following snapshot shows a possible design for the wort chiller, immersed in the boiling kettle, and the corresponding temperature field within the pipes:
We could also combine method 2 and 3 for faster results, i.e., use a wort chiller while the kettle is in an ice bath.
Another option is to use a flat plate or counterflow heat exchanger. A heat exchanger is a device that transfers heat from one fluid to another. Water, initially at a low temperature and used as the coolant, is being heated up while the wort is being cooled down. The following picture shows a flat plate heat exchanger.
Flat plate heat exchanger used to cool down beer at a local “brew-your-own-beer” establishment. (You might recognize it from a similar picture on our Instagram account, COMSOL_.)
These types of heat exchangers are very popular due to their compact size. Many brewers also use counterflow heat exchangers.
You can model these devices by following the step-by-step instructions in the Shell-and-Tube Heat Exchanger model, which shows the basic principles of setting up a heat exchanger model. In the model, two separated fluids at different temperatures flow through the heat exchanger, one through the tubes (tube side) and the other through the shell around the tubes (shell side).
Using a heat exchanger is not only the fastest way to cool down your wort, it is also the most efficient. Indeed, most of the heat taken form the wort is transferred to the water. This water can then be reused to steep the next batch of malted barley. This way, no energy is wasted!
Here, we have discussed conjugate heat transfer problems, a pipe flow model, and a heat exchanger model. I encourage you to try modeling these different cooling strategies in COMSOL Multiphysics and find out what works best. You can set up and solve these models using the CFD Module, Heat Transfer Module, and Pipe Flow Module.
After all this modeling, your beer must be pretty tasty and your friends are probably asking for more. It’s time to scale up and use a larger mixer tank, so that you don’t need to stir it manually anymore. Mixing tanks can be modeled using the Mixer Module, an add-on to the CFD Module that allows you to analyze fluid mixers and stirred reactors.
Model of a turbulent mixer with a three-bladed impeller. The model also considers the shape of the free surface.
If you have any questions about the models that I’ve presented here, contact our Technical Support team. If you are not yet a COMSOL Multiphysics user and would like to learn more about our software, please contact us via this form — we’d love to connect with you.
]]>