My Purpose is to extract the airgap flux density per timestep. I have 3 layers mesh in the airgap and I'd like to get the data in the layer near the stator bore radius. I tried several ways to do it: 1. Extracting the data from the vtu files
The magnetic flux densities are stored as CellData in the vtu files. I did it in Python using package vtk to extract all the flux densities from every cell and calculated the cell center. So that I can filter the data with the radius. It works, but it doesn't look very nice. 2. SaveLine
I tried to export the data using SaveLine. The Line is an existing line that is the sliding boundary. It did the work. But it is not the layer I need.
I tried to export the data using a defined Polyline. But I didn't succeed to make it work. The idea is to make a circular polyline and get the data along this line. I used the following code:
Exec Solver = after timestep !
Equation = "SaveLine_1"
Procedure = "SaveData" "SaveLine"
Filename = line.dat
Variable 1 = Magnetic Flux Density 1
Variable 2 = Magnetic Flux Density 2
Variable 3 = Magnetic Flux Density 3
Variable 4 = Magnetic Flux Density e 1
Variable 5 = Magnetic Flux Density e 2
Variable 6 = Magnetic Flux Density e 3
! Put all data in the same file
! File Append = True
! Number the files [1,2,...] starting from 1st free number
Filename Numbering = True
Coordinate Transformation = String "cartesian to cylindrical"
Coordinate Transformation Use Degrees = Logical True
Polyline Coordinates(2,3) = Real 0.13475 0.0 0.0 0.13475 90.0 0 ! 0.13475, radius of the stator airgap
Polyline Divisions(1) = Integer 768
Or could I export the flux density elementwise of a body? For example, I define a layer airgap as a body, how can I output the flux density of this body elememtwise per timestep in a transient simulation? Now I work with SaveLine and output the flux density along an existing line. But the discontinuities don't look so nice.
They should be available in SaveLine. Maybe plot it rather with matlab/octave/gnuplot. Data that is only at boundaries is not easily restored from VTU files.
Does this look smoother (apart from the end points)? It does not look similar than the earlier fluxes.
So what this is the the reaction force that comes after the FEM equations have been resolved. It is the best estimate for \int \phi (1/mu)dA/dn dS, where \phi is the nodal basis function. It is analogous to computing reaction forces for elasticity or heat equation (in term of N or W). So the flux need to be divided by the respective effective area of the nodes. Luckily for airgap the material law is simple so just multiply the result with permeability of vacuum, pi*4e-7.
I don't know whether this looks better on slave or master side. You could try both, I think there probably is not a huge difference.
Thanks for the reply. I understand what you mean. And here is a comparison between two mesh grades: 180 Elements and 360 Elements in the airgap. It should be fine enough. And the flux density and loads/weights come from the same "SaveLine" results. The x-axis is the atan2(coordinates) from the "SaveLine" results, which is the angle of the nodes. After inspecting the results, I find why I have these discontinuities. The plot with the name "angle" is the geometrical angle of the exported nodes. angle(nodes(1)) almost equals angle(nodes(2)). And I exported the results from an existing line.
For example, with the model having 180 elements in the airgap, the length of the exported result with "SaveLine" is 360.
I'm a little puzzled where you get these discontinuities. I could see that the elemental fields are discontinuous (they use internally Discontinuous Galerkin basis) but certainly the loads and weights should not be.
Could you maybe post a minimal version of your setup. Or at least "mesh.header" and the sif file.
I figured out where the discontinuities come from. The problem is, with the SaveLine, every node on this line will be exported twice. Here is an example from this forum. It reproduces the same results that I have. After running this example, you will find the node index in column 4 of the line.dat. The same node will be always exported twice. But the flux densities of the 1st export and 2nd export are not the same.