MgDyn2DHarmonic gives wrong magnetic field value
MgDyn2DHarmonic gives wrong magnetic field value
I have used MgDyn2DHarmonic and MgDyn2Post to solve a simple toroid generated magnetic field on axis. It gives a value which is exactly 4e7 times the actual (analytic) value. Maybe a corrupted mu0 = 4 pi 1e7 is the cause? Or maybe I am missing something...
The real trouble is that it also corrupts the Joule heating and current density calculations, so it is now difficult to use it with thermal stuff as input.
Andy
The real trouble is that it also corrupts the Joule heating and current density calculations, so it is now difficult to use it with thermal stuff as input.
Andy
 Attachments

 toroid.geo
 the geometry file
 (543 Bytes) Downloaded 25 times

 case.sif
 the solver input file
 (3.56 KiB) Downloaded 27 times
Re: MgDyn2DHarmonic gives wrong magnetic field value
Hi,
the models manual says that mu0 is 4 pi 10^7 by default. To be sure, you can set
Permeability of Vacuum = 12.566e7
in the Constants section.
HTH,
Matthias
the models manual says that mu0 is 4 pi 10^7 by default. To be sure, you can set
Permeability of Vacuum = 12.566e7
in the Constants section.
HTH,
Matthias
Re: MgDyn2DHarmonic gives wrong magnetic field value
Thanks, Matthias!
The previously enclosed case.sif file has the extra constant defined as 12.56e7, but it did not change anything, the model output axial Bfield (and also the potential) is still incorrect, the solver  it seems  does not use the vacuum permeability constant! For now, I can just calculate the correct values by dividing the model output vector potential by the permeability, but how do I use it for input to the Heat module?
Andy
The previously enclosed case.sif file has the extra constant defined as 12.56e7, but it did not change anything, the model output axial Bfield (and also the potential) is still incorrect, the solver  it seems  does not use the vacuum permeability constant! For now, I can just calculate the correct values by dividing the model output vector potential by the permeability, but how do I use it for input to the Heat module?
Andy
Re: MgDyn2DHarmonic gives wrong magnetic field value
Hmmm...
I don't have experience with this solver myself.
What I would do is look into the code, search for "Permeability of Vacuum" and try to understand if it is used or not.
Or hope that someone with more knowedge about this solver will take over...
Matthias
I don't have experience with this solver myself.
What I would do is look into the code, search for "Permeability of Vacuum" and try to understand if it is used or not.
Or hope that someone with more knowedge about this solver will take over...
Matthias
Re: MgDyn2DHarmonic gives wrong magnetic field value
Thanks, Matthias!
I don't think the solver uses the permeability at all, as I tried to change the relative permeability to the vacuum value to fool the solver, and it gave the same wrong value as before...It clearly did not care about the permeability at all.
I am not good enough to repair the code, so maybe another Horatio will stand in the gate...
Andy
I don't think the solver uses the permeability at all, as I tried to change the relative permeability to the vacuum value to fool the solver, and it gave the same wrong value as before...It clearly did not care about the permeability at all.
I am not good enough to repair the code, so maybe another Horatio will stand in the gate...
Andy
Re: MgDyn2DHarmonic gives wrong magnetic field value
Peter, could you look into this...?
Re: MgDyn2DHarmonic gives wrong magnetic field value
Hi,
One thing might be that in the sif file a keyword "Permittivity of Vacuum" is given, while the solver reads "Permeability of Vacuum". So try to set
Permeability of Vacuum = 8.8542e12
instead of
Permittivity of Vacuum = 8.8542e12
I'd also change the variable declaration "Variable = Potential[Potential Re:1 Potential:1]" to be
Variable = Potential[Potential Re:1 Potential Im:1]
so that the BC definitions would be compatible with the variable definition.
 Mika
One thing might be that in the sif file a keyword "Permittivity of Vacuum" is given, while the solver reads "Permeability of Vacuum". So try to set
Permeability of Vacuum = 8.8542e12
instead of
Permittivity of Vacuum = 8.8542e12
I'd also change the variable declaration "Variable = Potential[Potential Re:1 Potential:1]" to be
Variable = Potential[Potential Re:1 Potential Im:1]
so that the BC definitions would be compatible with the variable definition.
 Mika
Re: MgDyn2DHarmonic gives wrong magnetic field value
Hi Mika,
Thanks for catching the potential variable definition error. It was generated by the ElmerGui. I have changed to correct the potential Im:1, and added the extra permeability of Vacuum = 12.56e7 to the constants section. Result: zero change to the output magnetic field and potential... So this is not the main cause of the wrong field/vector potential generated.
Andy
Thanks for catching the potential variable definition error. It was generated by the ElmerGui. I have changed to correct the potential Im:1, and added the extra permeability of Vacuum = 12.56e7 to the constants section. Result: zero change to the output magnetic field and potential... So this is not the main cause of the wrong field/vector potential generated.
Andy
Re: MgDyn2DHarmonic gives wrong magnetic field value
Additional info: It seems that the conductivity gets multiplied by mu and muvacuum, correctly, (the skin depth does scale correctly with mu) but the source current density instead of mu * muvacuum gets multiplied by muvacuum squared, thus the giant error in the computed field on axis. The system can be fooled by dividing the source current density in the sif file by muvacuum and multiplying it by mu. I have not checked the calculated joule heat yet, so this may fail...
will do some more sleuthing, but I can't fix it because I don't know how to recompile the solver with the fixed multiplications...
Andy
will do some more sleuthing, but I can't fix it because I don't know how to recompile the solver with the fixed multiplications...
Andy
Re: MgDyn2DHarmonic gives wrong magnetic field value
Hi again,
I believe the model should be set up such that in an inductor (the source part of the model) the magnetic induction B satisfies curl(nu*B) = J, with J being the given source. To achieve this, the electrical conductivity should thus be specified to be zero in the inductor, although the prescribed source is a manifestation of the electrical conductivity. In regions which do not represent sources (none here) the electrical conductivity may be specified normally as a physical property.
So I'd suggest that you set "Electric Conductivity = 0.0" for the material which describes the coil in order to get the equations right. In addition, I think that a right symmetry BC on the axis would be the homogeneous natural BC. That is, for this part nothing needs to be specified in the sif file, so I'd remove the Dirichlet BCs on the axis.
I need to say that at the moment the solver doesn't superimpose the source current density to the current density that is generated by the postprocessing routine.
Best regards,
Mika
I believe the model should be set up such that in an inductor (the source part of the model) the magnetic induction B satisfies curl(nu*B) = J, with J being the given source. To achieve this, the electrical conductivity should thus be specified to be zero in the inductor, although the prescribed source is a manifestation of the electrical conductivity. In regions which do not represent sources (none here) the electrical conductivity may be specified normally as a physical property.
So I'd suggest that you set "Electric Conductivity = 0.0" for the material which describes the coil in order to get the equations right. In addition, I think that a right symmetry BC on the axis would be the homogeneous natural BC. That is, for this part nothing needs to be specified in the sif file, so I'd remove the Dirichlet BCs on the axis.
I need to say that at the moment the solver doesn't superimpose the source current density to the current density that is generated by the postprocessing routine.
Best regards,
Mika