Whitney solver - Wire test case total current calculation

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

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

Many thanks Peter,
some good progress here as Elmer now exports the total current
1: boundary int: current density re 3 over bc 3
2: boundary int: current density im 3 over bc 3
3: res: eddy current power
4: res: electromagnetic field energy

I got this result with the following commands
Variable 1 = current density re 3
Operator 1 = boundary int
Variable 2 = current density im 3
Operator 2 = boundary int

the values reported for 2:, 3: and 4: are spot on
however, there is a big discrepancy on 1: which is the real part of the total current... I need to investigate a bit more, make sure the problem is not at my end.
Thanks for the effective support, I will get back to you with some more results soon
laurent
Posts: 11
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

Hi Peter,
I confirm the values returned by SaveScalars for the total current have some errors

The true values for the total current are: Re=0.16 and Im=-2.95 whereas Elmer returns Re=0.0465 and Im=-2.86
note: potential applied to the wire is 0.01V at a frequency of 160kHz
the Imaginary part of the total current is close, but the real part of the current returned by Elmer is wrong.

I know Re=0.16 and Im=-2.95 are correct as they agree with the analytical calculation;
Also, the total current calculated from Paraview matches perfectly with the analytical calculations too (method used in Paraview: integration of the current densities over the section of the wire). This implicitly proves that Elmer returns the right current densities to Paraview and therefore the problem is somehow within SaveScalars...

any thoughts?
Laurent
raback
Site Admin
Posts: 4812
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

This is what I got after changing the V & f:

Code: Select all

2.952119423550E+000  -1.588912894031E-001
I used the elemental field with "e" (discontinous galerkin basis). The standard nodal fields smooth the discontinuities and make the results of the integral less accurate.

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

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

Hi Peter,
fab! that is really good news.
Can you please share your .sif file as I'm still struggling and failed to get to your results.

look forward to seeing your .sif file.
Thanks

Laurent
laurent
Posts: 11
Joined: 24 Apr 2018, 17:47
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by laurent »

PROBLEM RESOLVED:

Hi Peter,
I uploaded the latest build of Elmer and my .sif file now returns the correct values for the total current!
Many thanks for your help! really appreciated.

Here is a brief summary of the solution so that the Elmer community can beneficiate from this experience

Solver 2
Equation = "MGDynamicsCalc"
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
.....
! make sure the Elemental fields are calculated
Calculate Elemental Fields = Logical True
End

Solver 5
Equation = "SaveScalars"
Exec Solver = After All
Procedure = "SaveData" "SaveScalars"
Filename = Integrals.dat
! integrate the z component of the current density over the specified boundary
Variable 1 = current density re e 3
Operator 1 = boundary int
Variable 2 = current density im e 3
Operator 2 = boundary int
End

! save scalars (i.e surface integral on this boundary <=> total current) calculated on the 'wire end' boundary)
Boundary Condition 3
Name = "WireEnd"
Target Boundaries(1) = 3
! calculate the total current on this specific boundary
Save Scalars = True
Coil End = Logical True
AV re {e} 1 = Real 0.0
AV re {e} 2 = Real 0.0
AV re = Real 0.01
AV im {e} 1 = Real 0.0
AV im {e} 2 = Real 0.0
AV im = Real 0.0
End

Elmer will compute the total current through the 'wire end' boundary and will save the Real and Imaginary parts in a text file called Integrals.dat
using the wire test case geometry, a voltage differential of 0.01V at a frequency of 160kHz will return for the total current Re= -1.608873670102E-001 and Im= 2.968420465030E+000 . These values are correct.
lazyTom
Posts: 56
Joined: 05 Jun 2013, 01:32
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by lazyTom »

Hi Peter,

would it be possible to have more details on the following:
  • Solver 5
    • How does Operator 1 know that it has to integrate Variable 1?
    • How does operator 1 know what BC must be used to integrate Variable 1?
  • Coil End = Logical True
    • in the models manual I have seen it specified only for coilSolver BC. What is its purpose for WhitneyAVHarmonicSolver?
  • Save Scalars = True
    • Does this enables the use of the BC (where "Save Scalars" is declared) with Operator 1 (Solver 5)?
    • If so, how is this information passed to Solver 5? I'm asking this because I'm not sure I understood how the integration process works. For example
      • Assume I have two scalar quantities (each defined on a different BC) and I want to integrate them over their respective BC. How can I implement this?
Regards,

Marco
raback
Site Admin
Posts: 4812
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

"Operator i" and "Variable i" are married. You can also define "Mask Name i" such that you can use different masks for different operators. The default mask name is "Save Scalars". Historically SaveScalars only operated on one geometric entity and then this default name made sense but if you would like to integrate over different BCs you would use different mask names for them.

"Coil End" and "Coil Start" are specific keywords for CoilSolver only. CoilSolver is a specific solver that automates generation of current density vector fields for open and closed coils.

-Peter
lazyTom
Posts: 56
Joined: 05 Jun 2013, 01:32
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by lazyTom »

Hi Peter,

thanks for the explanation.

Marco
lazyTom
Posts: 56
Joined: 05 Jun 2013, 01:32
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by lazyTom »

Hi all,

about the mesh file of this testcase (wire.grd, see https://github.com/ElmerCSC/elmerfem/tr ... monic_wire)

I'm trying to generate the mesh but I'm not able to make it work :( .

I have tried to convert it to a mesh by saying: ElmerGrid 1 2 wire.grd
and I got the following error

Code: Select all

Starting program Elmergrid
Elmergrid reading in-line arguments
Output will be saved to file wire.

Elmergrid loading data:
-----------------------
Loading the geometry from file 'wire.grd'.
Unable to activate matc as it is not even compiled.
Reached the end of command file
Found 1 divisions for grid

Loading ElmerGrid commands from file 'wire.grd'.
Reached the end of command file
Read commands from a file

Elmergrid creating and manipulating meshes:
-------------------------------------------
0 cells were created.
Numbered 0 knots in 0 4-node elements.
Numbering order was <x><y> and max levelwidth 2.
Allocation impossible in imatrix: 1 0 0 3
I tried also: ElmerGrid wire.grd
This returned the following error

Code: Select all

Starting program Elmergrid
LoadCommands: opening of the file 'wire.eg' wasn't successful !

Thank you for using Elmergrid!
Send bug reports and feature wishes to elmeradm@csc.fi
Any suggestion on what am I doing wrong?

Regards,

Marco
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Whitney solver - Wire test case total current calculation

Post by kevinarden »

The first format of the command is correct
ElmerGrid 1 2 wire.grd

but this result is not good
Unable to activate matc as it is not even compiled.

Sounds like an installation issue
Post Reply