Problems learning ELMER, help is much appreciated..

General discussion about Elmer
Post Reply
Jaron
Posts: 3
Joined: 09 Feb 2023, 16:13
Antispam: Yes

Problems learning ELMER, help is much appreciated..

Post by Jaron »

Hello,

I want to learn how to use ELMER, the last few weeks i've done quite a few tutorials, read a lot of documentation, watched the lectures on ELMERs youtube channel etc.
I've got to admit it's a lot and I don't understand everything but I have to start applying it and hopefully it will make more sense then.
The challange I have given myself now is to model a piece of copper, add a dc voltage potential to the ends and model the current, voltage potential on the copper and electromagnetic fields that come from it.

I'm now stuck I think on selecting the appropriate solvers for this problem. (Or maybe I use the right solvers but I'm missing some settings)
I'm not yet comfortable creating a sif from scratch by text editing so I'm using the GUI, i've tried adding all sorts of solvers, parameters and settings to the model to get what I want but I don't get any results that resemble what I'm looking for. It seems that I modelled the volume current with my last attempt but the current seems to be way off.
I was expecting around 50000A of current through the copper but in Paraview I see around 4-8e8 volume current magnitude (It's a circle with OD of 4cm, ID of 2cm and 1cm high, I put a potential of 1 at one end and 0 at the other. I presume a potential of 1 means 1v).
EDIT: The current density seems to be correct, the unit of volume current is apparently A/m^2 so this part works out :D

Also the potential seems to go very much into the air in my results which is not what I was expecting..

I've added my model underneath, I'm only using body 1 at the moment, rest is set to air. (Other bodies I want to use for other materials and things In the future)

https://drive.google.com/file/d/1N72H3q ... pzced/view
Last edited by Jaron on 09 Feb 2023, 18:58, edited 1 time in total.
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Problems learning ELMER, help is much appreciated..

Post by kevinarden »

Looks like you did great. I checked the modeling, mesh files, and sifs. Did not see any big issues.
I normally set the far field boundary on the outer surface of the air.

Did you see these cases on github?

https://github.com/ElmerCSC/elmer-elmag
Jaron
Posts: 3
Joined: 09 Feb 2023, 16:13
Antispam: Yes

Re: Problems learning ELMER, help is much appreciated..

Post by Jaron »

Hi Kevin,

Thanks!
I have seen those come by once, thanks for the reminder.

They don't help me with my current problem though, do you maybe know why my magnetic field is 0 everywhere eventhough there is a current going through the copper?
I would expect there to be a magnetic field around it but it's not showing or calculating..
The same for the temperature which is 0 everywhere but I would like to see some resistive heating.

(See attached pictures, Glyph is showing the current in green)
Screenshot 2023-02-09 155559.png
(205.74 KiB) Not downloaded yet
Screenshot 2023-02-09 160224.png
(202.59 KiB) Not downloaded yet
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Problems learning ELMER, help is much appreciated..

Post by kevinarden »

Perhaps having BCs for the magnetic calculation part?
magfield.png
(135.02 KiB) Not downloaded yet
mcase.sif
(6.64 KiB) Downloaded 37 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Problems learning ELMER, help is much appreciated..

Post by raback »

Hi Jaron,

Study1 is somewhat confusing:

Code: Select all

  elmeruser@elmeruser-VirtualBox:~/ElmerWrk/CoilModel/Study1$ grep Procedure *.sif
  Procedure = "HeatSolve" "HeatSolver"
  Procedure = "MagnetoDynamics" "WhitneyAVHarmonicSolver"
  Procedure = "StatElecSolve" "StatElecSolver"
  Procedure = "MagnetoDynamics" "WhitneyAVSolver"
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
So you have both transient and harmonic solver and heat solver is solved upfront.

Study2 looks better:

Code: Select all

  elmeruser@elmeruser-VirtualBox:~/ElmerWrk/CoilModel/Study2$ grep Procedure *.sif
  Procedure = "CoilSolver" "CoilSolver"
  Procedure = "StatElecSolve" "StatElecSolver"
  Procedure = "HeatSolve" "HeatSolver"
  Procedure = "MagnetoDynamics" "WhitneyAVSolver"
So here you indeed can start with CoilSolver, you don't need the StatElecSolver for anything though. HeatSolver could be the last one. The solvers are solved in the order of their index. You can change that with "exec solver" but that is the default here:

Code: Select all

elmeruser@elmeruser-VirtualBox:~/ElmerWrk/CoilModel/Study2$ grep Exec *.sif
  Exec Solver = Always
  Exec Solver = Always
  Exec Solver = Always
  Exec Solver = Always

Even the this case cannot work. The CoilSolver should only be run on the Coil, not everywhere. Also the main purpose of CoilSolver is to enable closed coils. You can use it for non-closed coils as well but they are not ideal for modelling since you introduce a current source in the domain that cannot be divergence free. These must be compensated for mathematically.

The problems in "elmer-elmag" could provide a useful starting point. Try to get solvers working one-by-one starting with CoilSolver+WhitneyAvSolver.

-Peter
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Problems learning ELMER, help is much appreciated..

Post by raback »

Hi

To summarize I would do the following:

0) Make a mesh where the coil is closed (optionally)
1) CoilSolver to be solved in the coil only
2) WhitneyAVSolver to be solved everywhere. Use "Use Elemental CoiCurrent" + set AV to zero on external BCs.
3) Finally CalcFieldsSolver.

Ensure that you really do those in correct order. You can use priority in ElmerGUI or the exec solver flag.

-Peter
Jaron
Posts: 3
Joined: 09 Feb 2023, 16:13
Antispam: Yes

Re: Problems learning ELMER, help is much appreciated..

Post by Jaron »

Hello mister Rabeck,

Thank you very much for your reply,

I've tinkered with this problem some more and I have Three questions now that I hope someone can help me with.

I'm now using the "Static current conduction" solver since it seemed to be the easiest to make things work for now. From the current it calculates I want to calculate the magnetic fields. I'm also interested in the voltage at all points on the conductor and also the heat of the conductor so i'm using heat equation and electrostatics, Electrostatics might not be neseecary but couldn't hurt I thought

The file I've tried stuff on can be found here:
https://drive.google.com/file/d/14R8mVf ... xtpKNgOiCo
(@Kevin I've also tried adding a boundary for the outside but did not have any success making this work in the GUI)

Problem 1.
I tried to look into the execution order as you proposed but I can't figure out what index changes the excecution order and what it means to do so.

*I think I see now that The priority number gets reversed and only the number behind solver initiation gets used for the order in the SIF.
What is quite confusing is that the numbers behind the "Active Solvers" also get changed in order so it seemed this mattered.
Besides this, Changing the order of the priority number doens't make sense to me. Having 1 be first like in the SIF is way easier to remmeber and use. Maybe an Idea to change this in the next version of the GUI?


I've tried experimentally changing the priority and see what changes in the SIF file, I'm trying to have the order be:
Static current conduction (Priority 5)
Electrostatics (Priority 4)
HeatEquation (Priority 3)
MgDynPost (Priority 2)
MgDyn (Priority 1)

The SIF file is a bit confusing tho, the active solvers are numbered

Code: Select all

Active Solvers(5) = 1 5 3 2 4
With solvers being numbered

Code: Select all

Solver 1
  Equation = Static Current Conduction

Code: Select all

Solver 5
  Equation = MgDyn

Code: Select all

Solver 3
  Equation = Heat Equation

Code: Select all

Solver 2
  Equation = Electrostatics

Code: Select all

Solver 4
  Equation = MgDynPost
I've now set the max steady state iterations to 3 which I think will cycle max 3 times through the 5 solver calculations. (I could be wrong, but I was hoping the solver excecution order would then not matter)

The Solver order in the sif file that is generated seems wrong, I have no idea what numbers or index are used for excecution order.(Numbers of the solver, order that they are initiated from top to bottom, or order that they are called in the Equation section with the active solvers)
But no way I puzzle it it does what I try to tell it to do in the GUI's priority number it seems.

Problem 2:

It seems there are different places where you can set the potential of a boundary condition. I want to for instance set a voltage potential as a boundary condition. It seems this is possible in boundary conditions of the "Electrostatics" segment and "static current conduction"
From the ModelsManual it also seems like "AV" in MgDyn will set a voltage Boundary condition but i am not familiar with the A-V form of the maxwell equations (Honestly I'm vague on a lot of the maxwell equation math)
Are these 2/3 setting the same variable and do the same thing or are there differences to take into account?


Problem 3:
after seeing the different places to set the same variable I got a theory why my Magnetic field solver is not doing what I am expecting, I'm calculating the current with the "static current conduction" and in paraview this is visible under "Volume Current". When I add the MgDyn and have it show what it thinks the current is it makes a new variable called "Current density" which I would expect to be the same as Volume Current but Current density is 0.
Is it possible that MgDyn is not sharing the same name for the current variable and I have to link these manually?
I'm new to ELMER so I don't have a clear understanding of how variables are shared between solvers..
Post Reply