Setting Up the Electromagnetics Interface
In the previous part of this course, we discussed the process of starting to build a magnetohydrodynamics (MHD) model in COMSOL Multiphysics® by adding the required geometry, materials, physics interfaces, and Magnetohydrodynamics coupling. Over the next two parts of the course, we will discuss how to set up interfaces with the required domain and boundary conditions for MHD modeling. Here, we will focus on setting up the Magnetic Fields or Magnetic and Electric Fields interface for solving the electromagnetic side of the problem. We will go over defining materials as solids or fluids, applying uniform magnetic background fields, and handling different conductivities of walls containing fluid. Setting up the fluid flow interface will be covered in Part 5 of this course.
The Magnetic Fields Interface
When the Magnetic Fields interface is added to an MHD model via the Magnetohydrodynamics coupling, the default external boundary condition Magnetic Insulation and the Free Space and Ampère's Law in Fluids nodes are added. These features define the equations that are being solved for.
The Magnetic Fields node and the default subnodes.
Defining Free Space, Solids, and Fluids
The Magnetic Fields interface includes three formulations of the equations for Ampère's law that are designed to be used in different materials:
- Free Space, which is designed to handle Ampère's law in air, which has a conductivity very close to zero. It applies stabilization techniques to handle this very low conductivity
- Ampère's Law in Fluids, which is designed to handle fields in liquid materials that can move without their external boundaries moving
- Ampère's Law in Solids, which handles fields in solid materials where motion involves a deformation of the mesh due to the deformation or translation of the structure
The Free Space feature is normally the default feature defining the equation that is solved in all domains, with Ampère's Law in Solids and Ampère's Law in Fluids nodes added to override it in solid and fluid domains. However, by selecting the Magnetohydrodynamics interface, an initial Ampère's Law in Fluids feature is added and applied to all domains, as the Magnetohydrodynamics coupling is only valid in domains selected in an Ampère's Law in Fluids feature.
The first step in setting up the Magnetic Fields interface is removing any nonfluid domains from the Ampère's Law in Fluids selection and adding an Ampère's Law in Solids node that is assigned to solid domains.
A magnetohydrodynamics pump model using the Free Space, Ampère's Law in Fluids, and Ampère's Law in Solids features to define Ampère's law in the air, fluid, and solid regions.
Field Components Solved For Feature
The Magnetic Fields interface can only be used in either 2D or 2D axisymmetric models for magnetohydrodynamics modeling. In these formulations, there is a choice of how many components of should be solved for — its in-plane components, its out-of-plane components, or the full vector of three components. Any nonsolved components of
are set to zero. The directions the current can flow is determined by the nonzero entries of
. Because of this, since only out-of-plane currents are allowed for MHD models using the Magnetic Fields formulation, only the out-of-plane option is allowed for the Field components solved for setting when creating MHD models. This selection generates an in-plane magnetic field.
Only the Out-of-plane vector potential option can be used in the Field components solved for setting to preserve the assumption that the induced current is out of plane.
Defining Uniform Background Fields
A common feature of MHD models is the presence of a uniform background magnetic flux density, which is the source for the magnetohydrodynamic motion. This uniform background field can be applied in the Magnetic Fields interface by using the Reduced Field formulation in the settings for the Background Field in the Magnetic Fields node.
The Reduced Field formulation specifies that the total magnetic vector potential in the model can be written as the sum of a potential for a known background field
and a component that is solved for, known as the reduced potential
, that relates to a reduced field
. The total field can then be calculated as
.
In a linear model, this simplifies to the idea that a solution for the field can be decomposed into a linear supposition of component fields — the background field and the reduced field.
Demonstrating the reduced field formulation. A bar magnet is placed inside a uniform background field, and the total field is solved for using the reduced field formulation. The background magnetic flux density (left); the reduced field (middle), which consists of the field from the magnet, plus any corrections that need to be added to the background field for the total field to satisfy the boundary conditions; and the resulting total magnetic flux density (right).
By choosing the Reduced Field formulation option in the Magnetic Fields interface, it is possible to specify the background field by either specifying the magnetic vector potential or by specifying a uniform magnetic flux density in the model. This allows the uniform background flux density to be directly inserted.
Defining a uniform background field using the Reduced Field formulation.
When working with the Reduced Field formulation, it is recommended to use the External Magnetic Vector Potential feature instead of the Magnetic Insulation feature when defining the external boundaries. The External Magnetic Vector Potential feature ensures that the total magnetic field normal to the boundary is equal to the background field normal to the boundary — it acts as an insulation condition only for the reduced field and does not truncate the background field. The Magnetic Insulation condition acts on the total field and truncates the field instead of allowing the uniform background field to extend outside the model.
The External Magnetic Vector Potential boundary condition applied to the external boundaries.
In the results evaluation, variables exist for all of the background field, reduced field, and total field.
Accessing the variables for the total, reduced, and background magnetic fields in the results evaluation when working with the reduced field formulation.
Defining the Walls Around the Fluid for Flow Between Infinite Conducting Plates
When modeling the flow of liquid metal between infinite plates in a transverse uniform background magnetic field, the standard approach is to focus only on the fluid domain if the plates are perfect conductors.
The plates' behavior, as perfectly electrically conducting, is handled automatically when defining the uniform background field using the reduced field formulation. By applying the External Magnetic Vector Potential to the external boundaries where the fluid contacts the plates, the induced magnetic field is constrained to be tangential to the plates, acting as a magnetic insulation condition for the induced magnetic field. This is equivalent to the plates being perfectly conducting at a floating potential. This correspondence is discussed further in the article "Understanding the Magnetic Insulation Boundary Condition".
The Magnetic and Electric Fields Interface
When added to an MHD model, the Magnetic and Electric Fields interface uses an Ampère's Law and Current Conservation node to define the equations that are being solved for. The default external boundary condition is that the boundary is magnetically insulated and grounded.
The Magnetic and Electric Fields node and default subnodes.
As both and
are solved for, all boundary conditions have to define how they relate to both of these variables. Additionally, only certain combinations of constraints are physically realistic. For this reason, all constraints on
are applied as attributes to a constraint on
. This is seen in the default external boundary conditions where the Ground feature is an attribute to the Magnetic Insulation feature. For more information, including a list of all the available combinations of magnetic and electric boundary conditions and what they represent physically, see pages 380–383 of the AC/DC Module User's Guide.
Defining Free Space, Insulators, and Conductors
The Magnetic and Electric Fields interface includes three formulations of the equations for Ampère's law and current conservation in the model:
- Free Space , which is designed to handle calculation of magnetic and electric fields in air.
- Ampère's Law , which is designed to handle calculations of magnetic and electric fields in materials with no conduction currents. This one feature can be configured to handle either solid or fluid materials by adjusting the Material Type node. Solid materials should have the Solid material type, and fluid materials should have the Nonsolid material type.
- Ampère's Law and Current Conservation in Fluids and Ampère's Law and Current Conservation in Solids , which are designed to handle fields in conducting materials. In these domains, the current conservation equation is defined, allowing an electric potential and conduction current to be defined and solved for.
The Free Space feature is normally the default feature defining the equation that is solved in all domains, with Ampère's Law and Ampère's Law and Current Conservation nodes added to override it in insulating and conducting domains, respectively. However, by selecting the Magnetohydrodynamics interface, an initial Ampère's Law and Current Conservation in Fluids feature is added and applied to all domains, as the Magnetohydrodynamics coupling is only valid in domains selected in this feature.
The first step in setting up the Magnetic and Electric Fields interface is ensuring that the correct equation formulations are used in each domain. The Ampère's Law and Current Conservation in Solids feature should be applied to solid conductors; the Ampère's Law feature, with the correct material type, should be applied to non-air insulators; and the Free Space feature should be applied to any air domain.
Applying the Ampère's Law feature to a domain in the model to prevent conduction currents flowing in it.
Discretization
The Discretization option in the settings for the Magnetic and Electric Fields interface defines the order of the function used to discretize the continuous physics into a discrete problem. The discretization for both and
can be set independently. The default discretization for both
and
is quadratic, but for highly nonlinear problems, such as MHD models, it can be useful to decrease the order to linear. If the Magnetic and Electric Fields interface was created by adding the Magnetohydrodynamics interface to the model, the discretization will have been reduced to linear.
The Discretization setting in the Magnetic and Electric Fields interface, showing the discretization for the Magnetic Vector Potential and Electric Potential options set to Linear.
When a higher degree of accuracy is needed in the model, it is possible to increase the discretization of one or both of the dependent variables. The model will take longer to solve on the same mesh as it would at a lower discretization, but there will also be reduced error.
Defining Uniform Background Fields
In the Magnetic and Electric Fields interface, a background field is defined using the Background Magnetic Flux Density feature. Adding this feature defines the magnetic flux density in the entire model to be equal to , where
is a specified uniform flux density. In addition, on the boundaries where the Background Magnetic Flux Density feature is added,
is constrained to have no component normal to the wall so that the component of
normal to the wall is equal to the component of
normal to the wall. That is,
on the boundaries.
This is very similar to defining the relative field formulation in the Magnetic Fields interface along with the External Magnetic Potential feature on the boundaries. However, in this case, it is still the total field, which is solved for rather than the relative field.
Additional Information Note: The Background Magnetic Flux Density feature is a boundary condition, however it effects the fields in the domains of the model.
The mathematical constraint used in the feature is that for the magnetic vector potentials corresponding to
and
,
. The boundary condition only guarantees that the tangential components of
and
are equal. Their normal components might deviate depending on specific situations.
While the normal components are only equal on the boundaries, the feature has the effect of generating a uniform background flux density across the entire modeling domain by using the principle of superposing fields. This is because a flux density, which can be written as , satisfies both the equations and the boundary condition that
as long as
on these boundaries. This functions very similarly to the reduced field formulation in the Magnetic Fields interface; however, it is still the total field that is solved for in this case.
Applying the Background Magnetic Flux Density boundary condition.
The Background Magnetic Flux Density feature includes the option to define a constraint on to give a boundary condition on the electric field. The default is Ground, which can be interpreted as the model being enclosed in a perfectly conducting box.
Available constraints on V that can be used in combination with the Background Magnetic Flux Density condition.
Choosing the appropriate condition on depends on the physical context of the model:
- If the boundary is the inlet or outlet, and the flow is normal to the boundary, then the EMF current flow must be tangential to the boundary. The Electric Insulation condition is then appropriate.
- If the boundary is a physical electrode, one of the Ground, Electric Potential, Floating Potential, or Terminal features should be used as appropriate.
- If it is the boundary between conducting wall domains that is physically modeled, and a nonmodeled infinite air domain is assumed to be perfectly insulating, the Electric Insulation feature should be used.
- In the case of pipe or duct flow models, where only the fluid is modeled and the walls are a mixture of perfectly insulating and perfectly conducting materials that will be handled through boundary conditions, the choice is dependent on the wall conductivity and placement.
Defining Wall Behavior When Only Fluid is Modeled
In the case where only the fluid domain is modeled, the wall conductivity is defined by which constraint on is added to the Background Magnetic Flux Density node. The following features can be used: Electric Insulation, Ground, or Floating Potential. Which of these features is required can be identified by considering the conductivity of the physical wall material:
- If a wall is electrically insulating, then the Electric Insulation condition is required.
- If all of the walls are conducting, then the Ground condition is required for all of them.
- If some of the walls are conducting, then the Ground condition is required for one wall, while either the Floating Potential or Ground condition is required for the other conducting walls depending on whether the solution to the physics requires them to be at 0 V relative to the first wall that was grounded or at a nonzero potential relative to it.
In cases where only some of the walls are conducting, it can be very difficult to assess which walls need to be grounded and which need a floating potential — a fixed, nonzero potential that the model will solve for — assigned to them. The easiest method for evaluating this is to solve a version of the model that uses a finite but very high conductivity for the wall material and plot the potential across the cross section of the duct. If on the fluid boundary in this version of the model evaluates to zero, then it should be grounded in the version using the perfect conductors; otherwise, it should have a Floating Potential condition assigned to it. One Floating Potential should be used for each set of connected conducting boundaries.
For flow in a rectangular duct with a vertical background magnetic field, there are four common combinations of wall conductivity: all conducting; all insulating; conducting side walls with insulating Hartmann walls; and insulating side walls with conducting Hartmann walls. Assuming that is aligned with the z-axis, the Hartmann walls are the top and bottom walls of the duct, and the side walls are the vertical walls. The combinations of Ground, Electric Insulation, and Floating Potential conditions that are required for each of these arrangements of walls are shown below, along with the distribution of
they generate on the cross section.
Identifying the boundary conditions for different wall conductivity combinations for square duct flow by considering the value of on each of the boundaries.
Using Symmetry
Capitalizing on symmetries in a system to reduce the modeling domain can significantly reduce computation time and memory costs by decreasing the size of the geometry and the resulting number of degrees of freedom. Many interfaces include Symmetry boundary conditions; however, because the Magnetic and Electric Fields interface constrains both the magnetic and electric fields on the symmetry plane, it does not include a Symmetry boundary condition. Instead, you need to identify how the symmetry is reflected in the magnetic and electric fields and choose a combination of boundary conditions that will give the desired field shape.
There are two forms of symmetry for electromagnetic fields. For a symmetry plane with normal , these are:
- Symmetry,
, so that the current is normal to the symmetry plane and the magnetic field is tangential to it
- Antisymmetry,
, so that the magnetic field is normal to the symmetry plane and the current is tangential to it
The relationship of and
to the symmetry plane for the case of symmetry (left) and antisymmetry (right).
Boundary conditions can be used to constrain and
to be tangential or normal to the boundary as is appropriate for whether it is a symmetry or antisymmetry condition:
- Symmetry: Magnetic Insulation condition to constrain
to be tangential, with a Ground attribute that constrains
to be normal
- Antisymmetry: Perfect Magnetic Conductor condition to both constrain
to be normal and
to be tangential
In the case where there is a uniform background magnetic field, the background field must already obey the symmetry or antisymmetry condition, and so it is possible to use the Background Magnetic Flux Density node with an appropriate constraint on V to define the symmetry plane:
- Symmetry: Background Magnetic Flux Density and Ground
- Antisymmetry: Background Magnetic Flux Density and Electric Insulation
The easiest method of identifying whether a symmetry plane is a symmetry or antisymmetry plane is to plot and
in the system and identify whether they are normal or tangential to the plane. If the perfect insulator and perfect conductor wall conditions described here are being used, it is also necessary to plot
and identify if the conducting walls will have the Ground or Floating Potential feature applied to them.
Identifying the boundary conditions required to use the two planes of symmetry in a square duct flow model by considering the value of and whether the symmetry plane is a symmetry or antisymmetry plane.
Combining Uniform Background Fluxes and Periodic Systems
When modeling the flow of liquid metals in long ducts, it is advantageous to utilize the periodicity of the system to model only a small section of the larger system. The Periodic Condition feature allows periodic structures to be modeled by enforcing that the magnetic vector potential and the scalar potential
match on the source and destination boundaries. It can also be used in combination with the Background Magnetic Flux Density feature to model periodic systems within uniform background fields. However, you need to note how the two features interact and make some changes to the default settings to ensure they contribute together correctly.
The first boundary condition that should be applied to the system is the Periodic Condition, which is applied to the faces on either side of the periodic cell. These faces must be parallel, and the displacement vector between them defines the axis of periodicity. The modeling is simplest if this axis is aligned with the x-, y-, or z-axis.
Applying the Periodic Condition to a duct flow model. The periodicity and the motion of the fluid is along the x -axis.
The Background Magnetic Flux Density condition is then applied to the external boundaries that are not the periodic faces. The necessary constraints on V can be applied with it.
Adding the uniform background field in the z direction to the duct flow model by defining a Background Magnetic Flux Density feature on the nonperiodic faces.
The Background Magnetic Flux Density node applies the field by identifying a magnetic vector potential that corresponds to the specified background flux density
,
. The boundary condition then applies this as a constraint on the solved for vector potential
by specifying that
, where
is the surface normal. For any
, there are infinitely many possible
, and it is thus necessary to make a choice of which one to use.
The default choice used by the equations is to use
This is generally a good choice, as it does not introduce a preferred direction into the equations, splitting the contribution to evenly between
and
, and similarly for
and
. However, it interacts poorly with the periodic condition, where specific directions in the model have to be considered.
If it is assumed that the periodic axis lies along the x-axis, and the periodic cell runs over the range , then evaluating
on either side of the periodic cell gives
It is seen that any term in that involves the coordinate parallel to the periodicity axis will not meet the periodicity requirement. This has the effect of inducing an additional contribution to
that will cancel out these terms to maintain the periodicity. The effective background field that is then applied is effectively
when the periodicity axis is the x-axis, with similar expressions for if the periodicity axis follows the y- or z-axis.
This effective potential has the effect that while a background field aligned with the periodicity axis is applied at full strength, any field normal to it only contributes at half of its full strength. To resolve this issue, it is possible to adjust the vector potential used by the Background Magnetic Flux Density to a potential that defines the flux density while also meeting the periodicity requirement. When the periodic axis is along the x -axis, the vector potential should be set to:
Similar definitions can be made for when the periodic axis aligns with the y- or z-axis.
To set this as the vector potential used by the Background Magnetic Flux Density feature, it is necessary to enable Equation View to have access to the equations used by the feature and edit them. This is accessed by enabling the Show Equation View setting in the Show More Options menu accessed from the top of the model tree. An Equation View node is then generated under the Background Magnetic Flux Density node. Opening the settings for this Equation View node, the equations defining the background vector potential are then available. The expressions can then be edited to be defined as the corrected potential.
Editing the expressions for the background vector potential to the corrected form for a system that is periodic along the x -axis.
Constraining Models for Convergence
Since the electric and magnetic fields are defined as the gradient and curl of and
, respectively, it is possible to add an appropriate term to each and still have the same electric and magnetic field before boundary conditions are considered. This means that in many cases, the solution to the problem is not unique. This can cause issues with the solver not converging.
To resolve this issue, it is necessary to ensure the choices of and
are constrained in some way.
To constrain , it is necessary to fix the electric potential in the model in some way. If there is already a Ground, Electric Potential, or Terminal boundary condition in the model to connect the model to an electrode at a known potential, then this will also provide the constraint on
, ensuring the unique solution for the solver.
If is not constrained to a known value on a boundary, it is necessary to constrain it at a point in the model, using the Ground point feature. This will constrain
by acting as a reference point for measuring the potential in other parts of the model, without it acting as a source or sink of current.
If is not constrained, it is still possible to solve the Magnetic and Electric Fields interface, but an iterative solver is required. If it is desired to use a Direct solver, it is necessary to constrain
by applying gauge fixing via a Gauge Fixing for A-Field node. This introduces an additional variable that is used to fix the model in the Coulomb gauge.
For more information on gauge fixing, see the following blog posts: "What Is Gauge Fixing? A Theoretical Introduction" and "How Do I Use Gauge Fixing in COMSOL Multiphysics®?".
Additional Resources
Want to see additional applications of working with magnetic fields in COMSOL Multiphysics®? Check out these resources:
- Learning Center course: Modeling Electromagnetic Coils
- Blog post: Modeling Ferromagnetic Materials in COMSOL Multiphysics®
Envoyer des commentaires sur cette page ou contacter le support ici.