Whitney solver - Wire test case total current calculation

Numerical methods and mathematical models of Elmer
laurent
Posts: 10
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Whitney solver - Wire test case total current calculation

Post by laurent »

Hello everyone,
With regards to the 'wire' test case sitting at https://github.com/ElmerCSC/elmerfem/tr ... monic_wire, can someone please advise on how to get Elmer to compute the following values:
* the total current across the wire
* the resistance of the wire
* the inductance of the wire

Elmer does return the correct ' Eddy current power' as well as the correct 'ElectroMagnetic Field Energy'. From these values, I can manually work out the total current as well as the real (resistance) and imaginary (inductance) parts of the total impedance.
However, it would be so nice to have Elmer compute these values automatically (i.e total current across the wire, resistance of the wire, and inductance of the wire).
If the calculation of the resistance and the inductance are not possible, having the total current in its imaginary form would be great.

Browsing through the forum it looks like it is not the first time this question about total current calculation is asked, but I have not found a clear answer to this problem yet.
Your help would be much appreciated.
thanks
Laurent
raback
Site Admin
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney solver - Wire test case total current calculation

Post by raback »

Hi Laurent,

There are plenty of things that could be computed inside the solvers. The list is quite long and as Elmer is a multiphysics code there has often not been much effort to do this for each application area.

Also, for a wire it is easy. But generally you cannot define a single resistance or impedance. The energy is natural since it is the full volume integral. These require that you have just single input/output port. What kind of logic would you suggest if we were to add some lumping features?

Probably you have read about SaveScalars and some integral operators for obtaining these. I agree that it is rather cumbersome.

-Peter
laurent
Posts: 10
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

Hi Peter,
One way of tackling this would be to run the surface integral of the current densities over the model boundary.
I tried SaveScalars by adding a solver to the .sif file

Solver 5
Equation = "SaveScalars"
Exec Solver = After All
Procedure = "SaveData" "SaveScalars"
Filename = b.dat

Variable 1 = current density re e3
Operator 1 = boundary int
Variable 2 = current density im e3
Operator 2 = boundary int
End

and I also added the following line in the 'wire start' boundary condition (I also tried at the 'wire end')
Save Scalars = True

I was expecting to get the Z-component of the current (both REAL and IMAGINARY parts) written to the file b.dat...
but I end-up having the following outputs: :(
1: res: eddy current power
2: res: electromagnetic field energy

I agree that asking for a simple resistance or inductance is a bit over the top and would apply mainly for wire or coil type cases.
However, being able to calculate the total current flowing through a surface is key... and this is what I am desperate to do with the Whitney solver.

Could you please help and guide me through a method for calculating the total current that flows through a defined surface?

Laurent
raback
Site Admin
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney solver - Wire test case total current calculation

Post by raback »

Hi

Maybe you can try

Code: Select all

Variable 1 = current density re e
Operator 1 = convective flux
It is like velocity vector going through surface.

-Peter
laurent
Posts: 10
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

Thanks for your prompt reply Peter

I tried your suggestion and the solver returns an error:

ERROR:: SaveScalars: For convective flux of a scalar we need the convective field!
raback
Site Admin
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney solver - Wire test case total current calculation

Post by raback »

Hi,

Ok, there was some glitch in the code. The code had some trouble in getting DG values for boundaries (the boundary elements themselves do not have DG indexes). I made some fixes to the code + added your suggested format to the consistency test.

Changes are in devel and maybe the were in time for nightly build.

-Peter
laurent
Posts: 10
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

okay thanks
let me know when the new version will be available and I'll give it a try.
Laurent
raback
Site Admin
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney solver - Wire test case total current calculation

Post by raback »

Where do you get your binary? Or what platform do you use?
laurent
Posts: 10
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

I work on Windows10
raback
Site Admin
Posts: 4173
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Whitney solver - Wire test case total current calculation

Post by raback »

Hi,

The binaries appear every night here:
https://www.nic.funet.fi/pub/sci/physic ... s/?C=M;O=D

Perhaps I just missed this build but it should be updated again in ~7 hours or so.

-Peter
Post Reply