Issue with Elmer Simulation Scaling for 3D Transformer

Numerical methods and mathematical models of Elmer
virnaco
Posts: 16
Joined: 29 Feb 2024, 03:03
Antispam: Yes

Issue with Elmer Simulation Scaling for 3D Transformer

Post by virnaco »

Hello everyone,

I'm encountering an issue with simulating a 3D transformer using Elmer. The transformer is approximately 2 meters in size, and I'm applying current density to a coil within it. Initially, I modeled the transformer in millimeters (~2000mm).

However, I noticed that the simulation does not produce accurate results when I scale the modelo to 10e-3 (using Coordinate Scaling = 1e-3) as depicted in the attached figure. The current density vector goes to wrong direction and even if I try to change it using different directions (Coil Normal(3) = Real 0.0 0.0 1.0) it didn't work.
To address this, I experimented with scaling the dimensional units in Elmer. When I scaled the model to 10e-6 (using Coordinate Scaling = 1e-6), the simulation worked correctly.

Additionally, I attempted to mesh the transformer directly in meters, but it only worked when using Coordinate Scaling = 1e-3.

Could anyone provide insights into why such scaling adjustments are necessary? It seems that Elmer's internal expectations for unit scales might differ from the dimensions I initially set up. I would appreciate any suggestions or advice on how to effectively manage dimensional scaling for accurate simulations in Elmer.

Thank you in advance.

Best regards,

Virna
Attachments
Trafo3D_mm.rar
Transformer results and case.sif
(330.67 KiB) Downloaded 16 times
raback
Site Admin
Posts: 4876
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by raback »

Hi,

The logic in CoilSolver should not depend on the scaling. The "Coil Normal" is unitless. However, you could go wrong if you define "Coil Center" which scales with the coordinates and don't apply scaling there. Here you have commented it out so don't really see what would be wrong. "Coil Center" is also easy to compute internally whereas "Coil Normal" is somewhat ambiguous (at least in sign) and therefore the user might help the code to define it.

Elmer does in assume any unit system. Consistency is assumed to be taken care by the user. Almost everybody uses SI units where unit of length is one "m". CAD people usually choose "mm" which requires scaling by 1.0e-3 when using meshes coming from CAD tools.

-Peter
virnaco
Posts: 16
Joined: 29 Feb 2024, 03:03
Antispam: Yes

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by virnaco »

Hello Peter!

Thank you for your response!

I have re-run the simulation again. This time I used the transformer in SI units, approximately 2m in size, and used Coordinate Scaling = 1. In CoilSolver, I removed Coil Center and used Coil Normal(3) = Real 0.0 0.0 1.0. However, I am still getting the same incorrect results, with the current density vector circulating incorrectly.

I conducted another simulation for the same 2m design, but this time I only adjusted Coordinate Scaling = 1e-3 (without Coil Center and with Coil Normal(3) = Real 0.0 0.0 1.0). Surprisingly, the current density vector circulates correctly around the circle.

If I understood correctly your explanation, it was not supose to happen as the CoilSolver should not depend on the scaling.
Could you please help me understand what is happening and how to correct it?
Maybe some issue related to numeric error during calculation?

Unfortunately, I cannot attach the UNV file as it is too large, and even after compressing it, it remains above 1MB. The mesh files also turned out to be very large.

Thank you for your assistance.
Attachments
Trafo3D_m.rar
(34.57 KiB) Downloaded 11 times
WrongResult_Transformer_1m.png
Wrong result with Coordinate Scaling = 1
(188 KiB) Not downloaded yet
Result_Transformer_10e-3m.png
Correct result with Coordinate Scaling = 1e-3
(165.7 KiB) Not downloaded yet
raback
Site Admin
Posts: 4876
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by raback »

Hi,

Could you sent also the mesh files as they are.

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

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by raback »

Hi

There were several issues:

1) You had given "Coil Normal" in Solver section even though when using "Component i" for the coil it is assumed that all coil parameters be given there. The code tried to Warn but that is easily missed

2) For the nonscaled system the code did not work because the coils are tall and the logic in determining the coil normal is to use the axis of maximum inertia, unless decleared tall in which case the minimum inertia axis is used. Now I changed this so that coil is also determined tall if two eigenvalues are nearly the same i.e. there is a clear rotational symmetry. I think this should be a more rosust logic. Still safest to give the "Coil Normal" in component section.

3) For the scaled system the code funnily worked because the 3x3 eigenvalue system used DSYEV from the LAPACK library. For the scaled system the values become so small that DSYEV failed and returned some default diagonal matrix which actually made sense by accident. Now scaling is applied to the 3x3 matrix equation before solving the eigenvectors. This can be done without affecting the eigenvectors.

The fixes/improvements are in devel branch. Attached is a modified sif I used for testing. Have fun!

-Peter
Attachments
case.sif
(6.88 KiB) Downloaded 8 times
virnaco
Posts: 16
Joined: 29 Feb 2024, 03:03
Antispam: Yes

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by virnaco »

Hi Peter,

Thank you very much for sending this revised file.

1- I tried running the case.sif file you sent me, but it returned an error. Could you assist me with this?

ELMER SOLVER (v 9.0) STARTED AT: 2024/06/24 10:25:12

ParCommInit: Initialize #PEs: 1
MAIN:
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: Release, Compiled: 2024-01-02)
MAIN: Running one task without MPI parallelization.
MAIN: Running with just one thread per task.
MAIN: Lua interpreter linked in.
MAIN: =============================================================

MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: case.sif

LoadInputFile: Scanning input file: case.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
ERROR:: LoadInputFile:
ERROR:: LoadInputFile: Unknown specifier: [true]
ERROR:: LoadInputFile: In section: [simulation]
ERROR:: LoadInputFile: For property name:[ascii output]

STOP 1

2- Additionally, I noticed you removed the Body Force from the code. Is it unnecessary?

3- Another question is whether I can obtain the magnetic flux density_e variable integrated over the core volume in Elmer. Is this possible?
raback
Site Admin
Posts: 4876
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by raback »

Hi

1) You can just remove the keyword or cast the type "logical" for it.

2) With many bodies this is obnoxious. The alternative is to say "Use Elemental CoilCurrent = True".

3) SaveScalars.

-Peter
virnaco
Posts: 16
Joined: 29 Feb 2024, 03:03
Antispam: Yes

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by virnaco »

Hello Peter,

Thank you again for providing me with the explanations! I am still learning to work with Elmer and have a few more questions. I appreciate your continued assistance!

Regarding item 1, I tried both removing the line "ascii output = true" and changing it to "ascii output = logical true". However, I encountered a new error when I ran it, as detailed in the attached file "Solver log.txt".

I also want to thank you for clarifying item 2, as I now understand it better.

Regarding item 3, I have studied the ElmerModelsManual and am attempting to write a code to solve my problem of obtaining the integral value of magnetic flux density within the core volume. Is this approach correct, or do I need to adjust something?

Body 13 ! core
Target Bodies(1) = 13
Name = "Body 13"
Equation = 3
Material = 3
End

Equation 3
Name = "Core"
Active Solvers(3) = 2 3 4
End

Solver 4
Equation = SaveScalars
Procedure = "SaveData" "SaveScalars"
Exec Solver = After Timestep
Filename = "resultado.dat"

! Obtain the magnetic flux density_e variable integrated over the core volume. Core is body 13
Variable 1 = Magnetic Flux Density e
Operator 1 = volume
End


Your guidance on these matters would be greatly appreciated!

Best regards,

Virna
Attachments
case.sif
(7.08 KiB) Downloaded 4 times
Solver log.txt
Error while runing case.sif file
(12 KiB) Downloaded 6 times
raback
Site Admin
Posts: 4876
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by raback »

Hi

There has been many fixes. Maybe you could try to use fresh Elmer version.

-Peter
virnaco
Posts: 16
Joined: 29 Feb 2024, 03:03
Antispam: Yes

Re: Issue with Elmer Simulation Scaling for 3D Transformer

Post by virnaco »

Hi Peter,

I'm very grateful for all your help! I reinstalled the latest version of Elmer and it finally ran successfully! I also identified some mistakes I was making, such as only the coil applying current density should have equation = 1 (including Coil Solver). Other coils should remain with equation = 2.

I've attached the case.sif file here for your reference. Thank you again for your assistance!

Best regards,

Virna
Attachments
case.sif
(6.2 KiB) Downloaded 9 times
Post Reply