Understanding the Fields Calculator in Ansys Maxwell
Hello everyone, this is Ian from Ozen Engineering, Inc. In this video, we'll be discussing the Fields Calculator in Ansys Maxwell. We'll explore what it is, the basics of how to use it, and go through a few examples.
Opening the Fields Calculator
To open the Fields Calculator:
- Right-click on Fields Overlays.
- At the bottom of the menu, click on Calculator.
Tour of the Fields Calculator
At first glance, the Fields Calculator might seem intimidating, but once you learn how to use it, you'll find it quite manageable. Let's take a tour through each of the areas:
Named Expressions Area
Located at the top right, this area contains several built-in named expressions. These can save steps when creating your own expressions. You can:
- Create your own named expressions.
- Plot them as fields or 2D reports.
- Import and export expressions using the buttons below.
Context Area
Also on the top right, this area provides context for the calculations, such as:
- Which solution they're based on.
- What type of field is being used.
- Options for specific time steps or phases, depending on the solver.
Calculator Stack
In the center is the stack, a versatile tool that can hold:
- Field quantities
- Constants
- Scalars
- Vectors
- Geometries
Basic operations involve loading a field quantity into the stack and performing mathematical operations on it.
Calculator Buttons
At the bottom, the calculator buttons are organized into categories:
- Input: Choose inputs for your calculation, such as field quantities, geometries, constants, and functions.
- Operations: Perform calculations with operations that work on scalars and vectors.
- Output: Compute or evaluate expressions and output data to the stack.
Examples and Usage
Let's go through a couple of examples to demonstrate the calculator's capabilities:
Example 1: Average B Field Value
- Open the calculator and clear existing entries.
- Select the named expression Mag B and copy it to the stack.
- Choose the geometry, such as a non-model object like a dummy box.
- Select Mean from the scalar category to evaluate the average B field value.
Example 2: Without Named Expressions
- Clear the stack and select the B vector (BX, BY, BZ).
- Smooth and take the magnitude of the B vector.
- Select the dummy box geometry and integrate.
- Divide the integral by the volume to find the average value.
In future videos, I'll cover how to create your own named expressions and plot them on color maps and rectangular plots. Until then, this has been Ian from Ozen Engineering, Inc. Thank you for watching.
Hello everyone, this is Ian from Ozen Engineering and in this video we'll be talking about the fields calculator in Ansys Maxwell. We'll take a look at what this thing is, the basics of how to use it, and go through a few examples. To open up the fields calculator, right click on field overlays.
At the bottom of this menu, click on calculator. At first, this tool might look intimidating, but once you learn how to use it, you'll see that it's really not that bad. Let's take a tour through each of the areas. Starting here at the top right, we have the named expressions area.
Here we can see several built-in named expressions. These can be used to save a few steps when creating our own. The ability to create our own named expressions and then plot them as fields is what makes this tool so powerful.
The buttons below the expressions will be used to create our own named expressions or to import and export some. And over on the top right is the context area.
This will give us the context of the calculations we're performing, such as which solution they're based on, what type of field is being used, and depending on what solver you're using, it can also have areas where you choose specific time steps or phases of the calculation.
So if you're using a field or a field, you can use the field overlays or phase values. The field type mentioned is a broad term used across Ansys Electromagnetics products, and it varies depending on the solution type. Ansys Maxwell 2D and 3D, you can select between fields or time average fields.
If you choose time average fields, there will be additional options which allow you to calculate time average losses. There's also a change variable values button, which lets you modify the variable values from the default nominal design. In the center is the stack.
This is a stack of registers that can each hold field quantities, constants, scalars, vectors, geometries of any type. They're very versatile.
We're going to cover this in greater detail later in the video, but the basic way to approach a calculator stack calculation is load a field quantity into the stack. Once it's in a register, you start using mathematical operations on it. Underneath are the stack commands.
We'll go through each of these when we start making expressions. Finally, at the bottom we have the calculator buttons. They're organized into different categories. The input category is where you'll choose the inputs for your calculation. There's a lot here, so let's just go down the line.
The top folder allows you to choose the quantity you're interested in, such as certain fields, losses, temperatures, etc. Next up is where you select your geometry. You get to choose from any geometry that you've created, model or non-model. Next up are some constants.
Pi, permittivity, permeability, speed of light, and this last one, which lets you choose from a large number of conversion constants. Number is what you'll use to input a scalar, vector, or complex quantity.
Function will allow you to enter scalar or vector functions and this has some predefined variables as well. These will all be relative to the global coordinate system, just keep that in mind if you use them.
You can enter your own functions here, they just have to be defined before using this operation. Geometry settings, which is really just one setting, allows you to change this value called line discretization. Like it sounds, it's the number of points used to integrate fields on a line.
At the bottom, the read button will allow you to read in a disk file that you've saved by using the write command. This will copy the contents of the disk file into the top register of your stack. The next three categories contain all of the operations you'll need for calculations.
The first category has operations that work on both scalars and vectors, whereas the next two categories are either scalar or vector operations. I would like to show you a few examples of these. I would like to show you a few examples of these. I would like to show you a few examples of these.
I won't go through every button here, just a few I find useful or important to know about. Such as this one, smooth. This, of course, will smooth the quantity in the top register, but what does that mean and why do so many of the built-in expressions use it?
Well, because of the numerical simulation technique used, it's not uncommon to find areas in your mesh where the field crossing the boundary of individual elements is not continuous. If you smooth it, it'll make the field continuous across every mesh boundary.
It's a good habit to smooth before plotting a quantity. Vector at the top of the scalar category is going to turn the scalar quantity that's at the top of the stack into a vector component.
The scalar at the top of the vector category is going to turn the vector that's at the top of the stack into a scalar. Domain will let you limit a calculation to a volume that you specify. You need the top two entries of the stack to be a volume geometry and a field quantity for this to work.
The last category, output, has commands that will compute or evaluate our expressions and will output the data to the top of the stack.
evгеtخت,па documents Raum, ψ, dean, cello,0- Smells, Jimmy, Big Fitzl, At Studio, Archanel, Starting with the value command, this will compute the value of a field quantity at a certain point. This needs a point geometry and a field quantity at the top of the stack to work.
Eval will numerically evaluate and then put the result at the top of the stack. Write, we talked about already, it saves whatever is at the very top register of our stack to a disk file. Export will save field quantities at specific points.
These points can be defined in a grid in the dialog box that pops up, or they can be imported using a .pts or a points file. I'll cover exactly how to do that in a future video, so make sure you're subscribed to the Ozen Engineering YouTube channel so you don't miss it.
Alright, now we're finally ready to cover how to use the stack commands. Let's add one of the named expressions at the top. Click on the one you're interested in, and copy it to the stack. It'll appear on the stack as a register label followed by the name.
The register label is helpful in knowing what types of operations will work on the quantity in the register. In this case, it's labeled scl for a scalar. Now let's try some stack commands.
Starting on the left with push, this will push your entire stack down a register and copy whatever was at the top of the stack into the new top register. So the top two registers will always be identical to each other when you run this command. Next is pop. Pop is your delete.
It will delete the quantity at the top of the stack and shift all of the registers up. The next two, rl up and rl down, they roll the stack. rl down will send the bottom register to the top register.
rl up will send the top register to the bottom of the stack and everything will shift around accordingly. Exchange will swap just the top two registers in the stack. Clear will delete your entire stack. Last is undo.
Use it to undo the effect of the last operation you performed on the top register, but this won't be your classic ctrl-z type of undo. It'll only work on previous operations that aren't simple operations like loading something in.
Now I'm going to show you how to use the calculator to find the average B field value and the standard deviation of the B field. Here I am in the Hall sensor simulation from last video. I'm going to right click on field overlays and open the calculator. Click on the field overlays.
Clear what's there. To take the average magnetic field, there's the easiest way. Let's use some named expressions. Mag B is already ready for us. We'll copy to the stack. Average with respect to what geometry? Let's choose that as well.
This Hall effect sensor simulation, it comes with this box surrounding the sensing device itself. This is a non-model object. Let's take the average of the B field inside of that volume. So, geometry. It's called the dummy box. I will select it.
And in the scalar category, we're going to go ahead and select mean. And at the top register, we now have everything we need to evaluate. And it's going to give us our answer in SI units always. So, now that we have that value, let's try something else.
Let's come to this value without using any named expressions. Let's try something else without using any named expressions. Just as a way to prove to ourselves that we understand how to use this calculator. So, I'm going to clear the stack. The quantity that we're interested in, of course, is B.
This is a vector BXBYBZ. Let's smooth it. And we're going to take the magnitude of this. So, now we have the magnitude of the B vector. And the quantity we're still interested in is our dummy box. And let's integrate this. The goal, right now what we have is the integral of B.DV in our top register.
So, if we divide the integral of B.DV by the volume, we're going to be left with the average value. Unfortunately, at this point, we're not able to just open our geometry, select the dummy box, and divide. Stack contents are incompatible with the current operation.
That's because here we have a scalar and a volume, and it confuses us. So, let's take this volume and make it the scalar we need. So, we're just going to integrate V. It needs to be like dotted with something, right? Like whenever you integrate. So, we're just going to dot it with one.
And it's going to spit out our volume. Watch what I mean. So, let me pop this off the stack. And I'm going to grab a number. Scalar with a value of one. And now, open my geometry. And I'll select a volume I'm interested in. And this integral at the top is my volume.
So, what I have on the bottom, my second register, is the integral of B.DV. On the top, I have just my volume, because this interval has to be dotted with something. And when you dot it with one, it just spits out your volume.
When you divide this, it's going to divide this second register by the first register. So, the first register will be in the denominator. Let's divide this. A little bit more complicated looking than the previous one. But if we evaluate it, it gives us the exact same value that I calculated before.
I'm going to go through some more examples in the next video. I'll cover how to create your own named expressions and plot them on color maps, rectangular plots, etc. Until then, this has been Ian from Ozen Engineering. Thank you for watching.