Total Current - Surface Integral computation - saveScalars

Numerical methods and mathematical models of Elmer
Post Reply
Matrixrifle
Posts: 20
Joined: 27 Mar 2023, 13:58
Antispam: Yes

Total Current - Surface Integral computation - saveScalars

Post by Matrixrifle »

Hi,
I am a newbie and i am trying the following example
https://github.com/ElmerCSC/elmer-elmag ... /transient

I can run it successfully but now i want to compute the total current in each of the two terminals. Since i am using the circuits i can lookup the currents in the scalers files however, I wanted to learn how to use integrals in savescalers to compute the currents as an exercise to understand it in a simple use case. So, the following is my failed attempt.

Code: Select all

Solver 6
   Exec Solver = After Timestep
   Procedure = "SaveData" "SaveScalars"
   Filename = res/f1.dat
   Variable 1 = String "current density e 3"
   Mask Name 1 = String "Terminal1"
   Operator 1 = String "body int"

   Variable 2 = current density
   Mask Name 2 = Terminal2
   Operator 2 = body int
End
But running this all i get is a zeros as the computed current in the savescalers file.

I have looked at some of the forum posts like viewtopic.php?t=7521&hilit=boundary+integrals&start=10 which mentions using boundary integral so i tried that but the following gave an error and the solver stopped.

Code: Select all

Solver 6
   Exec Solver = After Timestep
   Procedure = "SaveData" "SaveScalars"
   Filename = res/f1.dat
   Variable 1 = current density
   Mask Name 1 = "Terminal1"
   Operator 1 = boundary int

   Variable 2 = current density
   Mask Name 2 = Terminal2
   Operator 2 = boundary int
End
Tried convective flux as suggested in viewtopic.php?p=25313&hilit=current+con ... lux#p25313 although for a different solver, i gave it a try but elmer solver threw an error and stopped.

Code: Select all

   Variable 1 = current density	
   Mask Name 1 = "Terminal1"
   Operator 1 = convective flux
I looked at chapter 60 of the Elmer models manual but i could not figure out why the computation was not working.

Finally i saw this post https://www.elmerfem.org/forum/viewtopi ... int#p25457 and there also it seems some confusion over trying to calculate the current using the body int resulted in zeros. So is this a known bug with no solutions ? or i have done some mistake in my sif file. ?

I wanted to also know which variables are valid names for MagnetoDynamics2D, for example if i put in Variable1 = current density re e 3 as suggested in viewtopic.php?t=7521&hilit=boundary+integrals&start=10, elmer solver throws an error.

Any help, pointers are appreciated.
Attachments
massive_coil.sif
(3.75 KiB) Downloaded 25 times
Matrixrifle
Posts: 20
Joined: 27 Mar 2023, 13:58
Antispam: Yes

Re: Total Current - Surface Integral computation - saveScalars

Post by Matrixrifle »

Any hints / comments for debugging will be very helpful please
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Total Current - Surface Integral computation - saveScalars

Post by raback »

Hi

What are the fields you see in paraview? You have to pick among them. Maybe you have the elemental current density (with suffix 'e') rather than the nodal one you try to use.

-Peter
Matrixrifle
Posts: 20
Joined: 27 Mar 2023, 13:58
Antispam: Yes

Re: Total Current - Surface Integral computation - saveScalars

Post by Matrixrifle »

Hi,
Both current density and current density e are shown in paraview and have been tried with result being zero in both cases.

Variable 1 = String "current density e 3"
Mask Name 1 = String "Terminal1"
Operator 1 = String "body int"

Variable 2 = current density
Mask Name 2 = Terminal2
Operator 2 = body int
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Total Current - Surface Integral computation - saveScalars

Post by raback »

Hi,

And what do you get with:

Code: Select all

Variable 1 = String "current density e 3"
Mask Name 1 = String "Terminal1"
Operator 1 = String "boundary int"
The tag "Terminal1 = Logical True" being set at the boundary pushing the current in?

And make sure that you run SaveScalars after CalcFields.

-Peter
Matrixrifle
Posts: 20
Joined: 27 Mar 2023, 13:58
Antispam: Yes

Re: Total Current - Surface Integral computation - saveScalars

Post by Matrixrifle »

Hi Peter,
The tag "Terminal1 = Logical True" being set at the boundary pushing the current in?
This was the issue!. I could not find in the documentation where this is mentioned.. Can someone point me in the right direction (where to look in the documentation)? I could not find it in the elmersolver manual
Matrixrifle
Posts: 20
Joined: 27 Mar 2023, 13:58
Antispam: Yes

Re: Total Current - Surface Integral computation - saveScalars

Post by Matrixrifle »

Found an old post that might be helpful for others to refer to which give a link to the savescalers example in the elmercsc test

https://elmerfem.org/forum/viewtopic.php?t=7670
Post Reply