Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hello Elmer community,
I want to integrate the current density over a wire's cross section in a steady state 2Daxi simulation.
To do so, I followed the following post:
viewtopic.php?f=3&t=7521&hilit=boundary+integrals
Unfortunately I don’t get results.
In the name output of savescalars, the boundary integral is listed but the magnitude is zero.
I work on windows and use Version: 9.0 (Rev: Release, Compiled: 20210615)
Could anybody be so kind and have a look at my case? Your help would be much appreciated.
Felix
I want to integrate the current density over a wire's cross section in a steady state 2Daxi simulation.
To do so, I followed the following post:
viewtopic.php?f=3&t=7521&hilit=boundary+integrals
Unfortunately I don’t get results.
In the name output of savescalars, the boundary integral is listed but the magnitude is zero.
I work on windows and use Version: 9.0 (Rev: Release, Compiled: 20210615)
Could anybody be so kind and have a look at my case? Your help would be much appreciated.
Felix

 Site Admin
 Posts: 4173
 Joined: 22 Aug 2009, 11:57
 Antispam: Yes
 Location: Espoo, Finland
 Contact:
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hi Felix,
Did you use the last setup as verified by laurent on May 31st in that thread? I see some small differences in the SaveScalars operation.
Peter
Did you use the last setup as verified by laurent on May 31st in that thread? I see some small differences in the SaveScalars operation.
Peter
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hi Peter,
thank you for your fast reply.
Yes, as far as I see it is pretty equal. Please see my code below:
As you can see I use the command
I also tested it with
But in both versions the numerical output is zero.
What is diffrernt from laurent, is that I use
But when I enable Save Scalars or curr there is no output (dat.names) at all.
Any ideas what went wrong?
Best regards,
Felix
thank you for your fast reply.
Yes, as far as I see it is pretty equal. Please see my code below:
Code: Select all
Solver 2
Equation = MgDynPost
Calculate Magnetic Field Strength = True
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Potential Variable = String "Potential"
Calculate Nodal Fields = False
Calculate Elemental Fields = True
Calculate Nodal Forces = True
Calculate Magnetic Field Strength = True
Calculate Electric Field = True
Calculate Current Density = True
End
Solver 3
Exec Solver = After All
Equation = SaveScalars
Procedure = "SaveData" "SaveScalars"
Filename = "data2d.dat"
Save Component Results = logical true
File Append = Logical True
Variable 1 = current density e
Operator 1 = boundary int
Mask Name 1 = curr
End
Boundary Condition 3
Target Boundaries(1) = 1
Name = "excitation"
!save scalars = Logical True
curr=logical true
End
As you can see I use the command
Code: Select all
Mask Name 1= curr
Code: Select all
save scalars = Logical True
What is diffrernt from laurent, is that I use
Code: Select all
Body Force 1
Current Density = 828736! J=1.1 A / (pi* rW^2) > Radius of Wire > rW=0.65e3
! curr=logical true
!Save Scalars = Logical True
End
Any ideas what went wrong?
Best regards,
Felix
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Would you please post your solver log file? The log file is always helpful.
Thanks, Rich.
Thanks, Rich.
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hi Rich,
sure! I am suspicious about the following line:
but when I skip the command of mask name 1 in SaveScalars
and implement the following:
The numerical output is still empty.
Can you see something else form solver.log?
I would highly appreciate if you could have a look.
sure! I am suspicious about the following line:
Code: Select all
CheckKeyword: Unlisted keyword: [curr] in section: [boundary condition 3]
and implement the following:
Code: Select all
Boundary Condition 3
Target Boundaries(1) = 1
Name = "excitation"
save scalars = Logical True
! curr=logical true
End
Can you see something else form solver.log?
I would highly appreciate if you could have a look.
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
This post viewtopic.php?f=9&t=4114 shows how you found a way to integrate the current density over a surface using Paraview. Nicely done!
It seems that SaveScalars and SaveLine aren't suited to provide results over a surface in 2D? One could select a boundary, such as the circle outlining the conductor, which in your case sums to zero since no current crosses the circle. In this 2D case, selecting the body (the conductor) would provide a surface to integrate over, but when you tried to add 'save scalars' to the body, it didn't work. Maybe someone who knows more about the inner workings of SaveScalars and SaveLine could shed some light on this topic?
Rich.
It seems that SaveScalars and SaveLine aren't suited to provide results over a surface in 2D? One could select a boundary, such as the circle outlining the conductor, which in your case sums to zero since no current crosses the circle. In this 2D case, selecting the body (the conductor) would provide a surface to integrate over, but when you tried to add 'save scalars' to the body, it didn't work. Maybe someone who knows more about the inner workings of SaveScalars and SaveLine could shed some light on this topic?
Rich.
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hi all,
Yes in Paraview i get plausible results:)
I did some further tests with the integration of the Bfield of the enclosing air.
Please see I get some values of the BField integration where the Flux = 9.0E008
(see fluxdata2d.dat.names and fluxdata2d.dat of )
I believe the must be multiplied by 2*pi
Hence the result is around 5.6e07
The energy of the 2Daxi simulation is around 3.6E009*2*pi=2.2619e08 J
The integration of the current density is still zero. I included the solver.log with a Max Output Level = 32
1. I have no clue why this is the case for the integration of current density. Does anybody know?
I did an equal integration of the Bfield with the 3D case.
Please see corresponding sif in The mesh is too big to upload it here. Hence, I provide the .hdf of Salome. You can compute the mesh there and export it to .unv
Then use the command:
in the Command Prompt of Windows
If you want to compare the Boundary Numbers of the mesh with the sif use the command
in the Command Prompt of Windows and observe it in gmsh.
In 3D case, the simulated flux is 4.22E008 Wb
I had the chance to simulate this also in comsol and get an equal result of 4.23E8 Wb
2. Why do I have the deviation in the 2D case?
The energy in the 3D case is similar to the 2Daxi case of elmer with around 2.3E008 J
In 3D I also get an eddy current power of around 1.02E003
3. Shouldn’t the eddy current power be zero for a stationary simulation?
I highly appreciate if somebody could have a look at my simulations and/or provide an answer to my 3 questions above.
Felix
Yes in Paraview i get plausible results:)
I did some further tests with the integration of the Bfield of the enclosing air.
Please see I get some values of the BField integration where the Flux = 9.0E008
(see fluxdata2d.dat.names and fluxdata2d.dat of )
I believe the must be multiplied by 2*pi
Hence the result is around 5.6e07
The energy of the 2Daxi simulation is around 3.6E009*2*pi=2.2619e08 J
The integration of the current density is still zero. I included the solver.log with a Max Output Level = 32
1. I have no clue why this is the case for the integration of current density. Does anybody know?
I did an equal integration of the Bfield with the 3D case.
Please see corresponding sif in The mesh is too big to upload it here. Hence, I provide the .hdf of Salome. You can compute the mesh there and export it to .unv
Then use the command:
Code: Select all
elmergrid 8 2 Mesh_1.unv
If you want to compare the Boundary Numbers of the mesh with the sif use the command
Code: Select all
elmergrid 8 4 Mesh_1.unv
In 3D case, the simulated flux is 4.22E008 Wb
I had the chance to simulate this also in comsol and get an equal result of 4.23E8 Wb
2. Why do I have the deviation in the 2D case?
The energy in the 3D case is similar to the 2Daxi case of elmer with around 2.3E008 J
In 3D I also get an eddy current power of around 1.02E003
3. Shouldn’t the eddy current power be zero for a stationary simulation?
I highly appreciate if somebody could have a look at my simulations and/or provide an answer to my 3 questions above.
Felix
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hi everybody,
I found the answer to my Question 2 of my previous post.
The problem was the mesh resolution of the edge. See the picture of my changes. Now I get a coinciding flux of 4.44E008 Wb
Here you have the updated simulation file with the integration of the Bfield only. The eddy current power (Question 3) changed back to 0.
Does anybody has further information how eddy current power did appear in the first place?
How to conduct the integration of the current density in the 2Daxi case (Question 1 from previous post) remains still a mystery to me.
I appreciate any hints!
Best regards!
Felix
I found the answer to my Question 2 of my previous post.
The problem was the mesh resolution of the edge. See the picture of my changes. Now I get a coinciding flux of 4.44E008 Wb
Here you have the updated simulation file with the integration of the Bfield only. The eddy current power (Question 3) changed back to 0.
Does anybody has further information how eddy current power did appear in the first place?
How to conduct the integration of the current density in the 2Daxi case (Question 1 from previous post) remains still a mystery to me.
I appreciate any hints!
Best regards!
Felix

 Site Admin
 Posts: 4173
 Joined: 22 Aug 2009, 11:57
 Antispam: Yes
 Location: Espoo, Finland
 Contact:
Re: Integration of current density in 2D Axi symmetric steady state to obtain current in circular wire
Hi Felix,
There is nothing to worry about the code not finding "curr". It was just a temporal tag that we know to look for because we given the same in "mask name 1". This way we can refer to the boundaries where we want to operate in.
If you follow my example, the possible problems are:
1) Too old version of code
2) You try to integrate over wrong or nonexisting boundary
3) The variable you're interested in does not exist.
You could also try with variable "current density" (without the "e").
The coordinate system should be accounted for in the integration.
Peter
There is nothing to worry about the code not finding "curr". It was just a temporal tag that we know to look for because we given the same in "mask name 1". This way we can refer to the boundaries where we want to operate in.
If you follow my example, the possible problems are:
1) Too old version of code
2) You try to integrate over wrong or nonexisting boundary
3) The variable you're interested in does not exist.
You could also try with variable "current density" (without the "e").
The coordinate system should be accounted for in the integration.
Peter