Magnetic field induced by current in a cylindrical wire

Numerical methods and mathematical models of Elmer
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Magnetic field induced by current in a cylindrical wire

Post by asandip »

Hello,

I am attempting to run the tutorial - magnetic field induced by current in a cylindrical wire/steady state. I found the test case in elmerfem-devel/fem/tests/mgdyn_steady_wire2. In the Elmer GUI, I tried loading the project, but it wouldn't load. So, I then attempted to replicate the test case and generate a case.sif similar to the one in the tests/mgdyn_steady_wire2/ folder. When I run my case, magnetic flux density does not match the results from the original test case.

Please find both .sif files attached with this email (case_original:File from test folder; case.sif: the sif file generated by my attempt to replicate the original). Thank you for any help you can provide.

Ilaj

P.S. I understand that once the Elmer project is created (equation/materials/etc.) and the .sif file is generated, I could edit the .sif file by copy pasting the contents from the original .sif file ( tests/mgdyn_steady_wire2/case.sif) to it. And then re-running the solver. I did this and the results match. But I would prefer to be able to create the Elmer project that generates .sif file that gives the right results.
Attachments
case_original.sif
(3.43 KiB) Downloaded 242 times
case.sif
(4.72 KiB) Downloaded 252 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by kevinarden »

There are several solver options in the test case that are not in your case.sif. I imagine these are important. They are not selectable options in ElmerGUI so you have two options. Use the ElmerGUI edit sif command and edit the sif to add them, or use the ElmerGUI free field text input box like this example:
free field.png
free field.png (29.58 KiB) Viewed 4278 times
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by asandip »

Hello,

I added the options in the ElmerGUI under field free text, and here's the error I get -

ERROR:: Model Input:
ERROR:: Model Input: Unknown specifier: [true]
ERROR:: Model Input: In section: [equation 1]
ERROR:: Model Input: For property name:[linear system symmetric]

I am not sure how to proceed. Thank you for any suggestions you can provide.

Ilaj
Attachments
case.sif
(4.77 KiB) Downloaded 250 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by kevinarden »

That error typically means it should have been

Linear System Symmetric = Logical True

However it is showing up in the Equation section and it should have been in the Solver Section
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by asandip »

Thanks, changing it from True to Logical True worked.

Had one follow up question, I am attempting to extract the max. magnetic flux density. I ran my case.sif file. I get eddy current power and magnetic field strength along with max. magnetic flux density. How can I remove eddy current power and magnetic field strength from the results file?
Attachments
case.sif
(4.78 KiB) Downloaded 234 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by kevinarden »

Page 267 of the Elmer's Model Manual covers output.

http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf

In your Simulation Section;
Post File = case.vtu
creates all of the default outputs to a file named case.vtu

If you do not want the default output then you would add an output solver something like

Solver 3
Exec Solver = after saving
Equation = "result output"
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output File Name = "case"
Vtu Format = Logical True
Binary Output = Logical True ! binary format is the default
Single Precision = Logical True ! double precision is the default
! In the Vtu format all fields are saved if the user does not list them explicitly.
Scalar Field 1 = String Magnetic Flux Density
End
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Magnetic field induced by current in a cylindrical wire

Post by raback »

Hi

To clarify the background a little. It is the same dynamically loaded module. There is just a hack to create the instance for the VTU solution if the suffix of Post File is .vtu. This mimics the logic that was initially built-in for .ep files (ElmerPost). Most often you don't need to provide any additional keyword and sif files stay more compact.

Now any keyword you would give the ResultOutputSolver can also be given for this hack if you use the namespace "vtu: " in front of every keyword. For example,

Code: Select all

vtu: Single Precision = Logical True
Note, there is a similar hack for "Scalars File" with namespace "scalars: ".

-Peter
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by asandip »

Thank you for the suggestions!

I am attempting to extract the results to .txt file using Save Scalars. Is there an option within Save Scalars that would deselect the eddy current power and the magnetic field strength?

results.txt.names:
Elmer version: 8.4
Elmer compilation date: 2020-03-17
Solver input file: case.sif
File started at: 2020/04/01 10:37:20

Variables in columns of matrix: ./results.txt
1: max: magnetic flux density e
2: res: eddy current power
3: res: magnetic field energy

Please find the files attached - case.sif, results.txt. Thanks again!
Attachments
case.sif
(4.71 KiB) Downloaded 220 times
results.txt
(67 Bytes) Downloaded 222 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Magnetic field induced by current in a cylindrical wire

Post by raback »

Hi

Eddy current power is always computed and saved internally to a list with prefix "res:".

You can supress all saving of "res:" stuff by saying for SaveScalars, for example:

Code: Select all

  Scalars Prefix = String "dummy:"
-Peter
asandip
Posts: 92
Joined: 09 May 2019, 22:06
Antispam: Yes

Re: Magnetic field induced by current in a cylindrical wire

Post by asandip »

Peter,

Thanks for the suggestion. I modified the case.sif file (attached)

Scalars Prefix = String "res:"

But I continue to get
Variables in columns of matrix: ./results.txt
1: max: magnetic flux density e
2: max: joule heating
3: res: eddy current power
4: res: magnetic field energy

Is there something that I am missing? Thanks for any help you can provide.

Anjali
Post Reply