Hi, how can I derive the magnetic co-energy in elmer? I have been using femm so far, which has the co-energy build in. I found some hints how to define scalar observables in the sif file, but it was not exactly the co-energy. Could you please help me?
Best regards, Tobias.
Derivation magnetic co-energy
Re: Derivation magnetic co-energy
Hi,
I made a small change to the Calcfields postprocessor (available in the devel branch of the code repository). Now, if you give "Separate Magnetic Energy = True" for this solver, then the solver should also output the magnetic coenergy.
Best regards,
Mika
I made a small change to the Calcfields postprocessor (available in the devel branch of the code repository). Now, if you give "Separate Magnetic Energy = True" for this solver, then the solver should also output the magnetic coenergy.
Best regards,
Mika
Re: Derivation magnetic co-energy
Hi, thank you for your reply. I have compiled the current development version and verified that your changes are included. I use the following code in my sif file:
Unfortunately, I am not able to find the energy in the output file. The file reads the following:
Do you know where to find the value of the co-energy?
Best regards Tobias
Code: Select all
Solver 2
Equation = MgDynPost
Calculate Magnetic Field Strength = True
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Potential Variable = String "Potential"
Calculate Nodal Fields = False
Calculate Elemental Fields = True
Calculate Nodal Forces = True
Separate Magnetic Energy = Logical True
Calculate Magnetic Flux = Logical True
Nonlinear System Max Iterations = 1
Linear System Solver = Iterative
Linear System Iterative Method = CG
Linear System Max Iterations = 1000
Linear System Convergence Tolerance = 1.0e-10
Linear System Preconditioning = ILU0
Linear System Abort Not Converged = False
Linear System Residual Output = 10
End
Code: Select all
ASCII 3
!File started at: 2020/11/04 23:37:40
Degrees of freedom:
magnetic flux density e[magnetic flux density e:3] : 56412 18804 3 : mgdynpost
magnetic field strength e[magnetic field strength e:3] : 56412 18804 3 : mgdynpost
nodal force e[nodal force e:3] : 56412 18804 3 : mgdynpost
potential : 3167 3167 1 : mgdyn2d
magnetic flux density e 1 : 18804 18804 1 : mgdynpost
magnetic flux density e 2 : 18804 18804 1 : mgdynpost
magnetic flux density e 3 : 18804 18804 1 : mgdynpost
magnetic field strength e 1 : 18804 18804 1 : mgdynpost
magnetic field strength e 2 : 18804 18804 1 : mgdynpost
magnetic field strength e 3 : 18804 18804 1 : mgdynpost
nodal force e 1 : 18804 18804 1 : mgdynpost
nodal force e 2 : 18804 18804 1 : mgdynpost
nodal force e 3 : 18804 18804 1 : mgdynpost
Total DOFs: 10
Number Of Nodes: 3167
Time: 1 1 1.00000000E+000
potential
Perm: 3167 3167
1 318
2 935
3 1218
4 466
5 922
6 1596
7 708
8 203
Best regards Tobias
Re: Derivation magnetic co-energy
Looking at your code, there should be a result
I have an scalar output file created by
the result is *.names
I hope this information is helpful.
Code: Select all
CALL ListAddConstReal(Model % Simulation,'res: Magnetic Coenergy',Energy(3))
Code: Select all
Solver 3
Exec Solver = After All
Equation = SaveScalars
Procedure = "SaveData" "SaveScalars"
Filename = "f2d.dat"
Save Component Results = Logical true
File Append = Logical True
Show Norm Index = 5
End
Code: Select all
1: res: eddy current power
2: res: magnetic field energy
3: res: air gap torque
4: res: inertial volume
5: res: inertial moment
Re: Derivation magnetic co-energy
Hi,
To have an example I updated the test case
https://github.com/ElmerCSC/elmerfem/tr ... s/mgdyn_bh
so that the coenergy is evaluated. This produces to standard output the lines
SaveScalars: Showing computed results:
SaveScalars: 1: res: eddy current power 0.000000000000E+000
SaveScalars: 2: res: electric field energy 0.000000000000E+000
SaveScalars: 3: res: magnetic field energy 2.204992777961E-005
SaveScalars: 4: res: total joule heating 8.053113825555E-003
SaveScalars: 5: res: effective resistance 1.241755700542E-004
SaveScalars: 6: res: totalcurrent 8.053113825555E+000
SaveScalars: 7: res: currentsolver scaling 1.552194625678E+000
SaveScalars: 8: res: magnetic coenergy 5.184122312083E-005
If I direct the same scalars to a specified file, I get
Variables in columns of matrix: ./tmp.dat
1: res: eddy current power
2: res: electric field energy
3: res: magnetic field energy
4: res: total joule heating
5: res: effective resistance
6: res: totalcurrent
7: res: currentsolver scaling
8: res: magnetic coenergy
so I think this should work.
-- Mika
To have an example I updated the test case
https://github.com/ElmerCSC/elmerfem/tr ... s/mgdyn_bh
so that the coenergy is evaluated. This produces to standard output the lines
SaveScalars: Showing computed results:
SaveScalars: 1: res: eddy current power 0.000000000000E+000
SaveScalars: 2: res: electric field energy 0.000000000000E+000
SaveScalars: 3: res: magnetic field energy 2.204992777961E-005
SaveScalars: 4: res: total joule heating 8.053113825555E-003
SaveScalars: 5: res: effective resistance 1.241755700542E-004
SaveScalars: 6: res: totalcurrent 8.053113825555E+000
SaveScalars: 7: res: currentsolver scaling 1.552194625678E+000
SaveScalars: 8: res: magnetic coenergy 5.184122312083E-005
If I direct the same scalars to a specified file, I get
Variables in columns of matrix: ./tmp.dat
1: res: eddy current power
2: res: electric field energy
3: res: magnetic field energy
4: res: total joule heating
5: res: effective resistance
6: res: totalcurrent
7: res: currentsolver scaling
8: res: magnetic coenergy
so I think this should work.
-- Mika
Re: Derivation magnetic co-energy
Hi Mika,
thank you very much for your help. Your example is working fine. It took me some time to integrate it into a 2D example. I obtain reasonable values and can compare with my femm results from before. Thank you.
Best regards Tobias
thank you very much for your help. Your example is working fine. It took me some time to integrate it into a 2D example. I obtain reasonable values and can compare with my femm results from before. Thank you.
Best regards Tobias
Re: Derivation magnetic co-energy
Hi,
this thread is rather old, but I have a further question. I only simulate 1/4th of a PMSM. Therefore I expect, that I have to multiply the torque by a factor of 4 to obtain the real torque. However, I also calculated the torque from the co-energy. There, I see, that the co-energy does not need a factor of 4 to give the physical torque. This seems somehow strange to me. Could you maybe confirm or clarify my findings?
Regards,
Tobias
this thread is rather old, but I have a further question. I only simulate 1/4th of a PMSM. Therefore I expect, that I have to multiply the torque by a factor of 4 to obtain the real torque. However, I also calculated the torque from the co-energy. There, I see, that the co-energy does not need a factor of 4 to give the physical torque. This seems somehow strange to me. Could you maybe confirm or clarify my findings?
Regards,
Tobias
Re: Derivation magnetic co-energy
As further information, is this a simulation done in the frequency domain?