Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Clearly defined bug reports and their fixes
Post Reply
eugene
Posts: 9
Joined: 19 Sep 2020, 16:37
Antispam: Yes

Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Post by eugene »

Hi,

When I look at the calculated fields in .vtu files, I find that “Magnetic Flux Density” is essentially “Magnetic Field Strength” times (Pi * 1E-7). This does not look right because B = mu_r*mu_0*H, mu_0= 4*Pi*1E-7 H/m, and my mu_r=1. It appears that “Magnetic Flux Density” has correct values in units of Tesla, while “Magnetic Field Strength” (in units of A/m) is 4 times larger than it should be? (...Unless of course I misunderstood the units, or missed something).

I get this from VectorHelmholtz module. I tried looking through VectorHelmholtz.F90, but I can’t quite figure out where the actual field calculation happens. Could it be a factor of 4 missing somewhere?
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Post by mika »

Hi,

I found a bug in the reluctivity evaluation when the constant "Permeability of Vacuum" was given by the user in the constants section. This has now been fixed in the devel branch. The error wasn't nevertheless just a multiplication by four, so I'm not sure whether this explains your observations.

-- Mika
eugene
Posts: 9
Joined: 19 Sep 2020, 16:37
Antispam: Yes

Re: Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Post by eugene »

Hello Mika,

Thanks for looking into this.

I didn't have "Permeability of Vacuum" in my code, so I don't think that's the cause.

I've actually done a test now where I set Permeability of Vacuum = Real 1. In the resulting *.vtu I get “Magnetic Flux Density”=(1/4) * “Magnetic Field Strength”, while they should have been equal. So it feels like there is a factor of 4 or 0.25 somewhere in the code.
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Post by mika »

There was another bug in the computation of magnetic field strength. This has now been fixed in the devel branch.

Thanks for reporting,
Mika
eugene
Posts: 9
Joined: 19 Sep 2020, 16:37
Antispam: Yes

Re: Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Post by eugene »

Hello Mika,

I've tried again with the most recent Windows Elmer binaries "Version: 9.0 (Rev: Release, Compiled: 2020-12-13)", downloaded from http://www.nic.funet.fi/pub/sci/physics ... n/windows/.

I still get H=B/(Pi*1E-7), instead of expected H=B/(4*Pi*1E-7). That's puzzling because your bug fix with extra "*Basis(p)" must have made some notable difference. Unless this fix didn't make it into compiled binaries?... Perhaps I'm missing something?
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: Relation between “Magnetic Field Strength” and “Magnetic Flux Density” ?

Post by mika »

Seeing
eugene wrote: 14 Dec 2020, 21:53 "Version: 9.0 (Rev: Release, Compiled: 2020-12-13)"
I doubt your executable has not been compiled using fresh source files from the devel branch. For example, if the source files are the latest versions from Dec 11, 2020, Elmer is expected to output the revision information as

MAIN: Version: 9.0 (Rev: 56cc88c, Compiled: ...)

when running a case. The identifiers for the revisions can be seen at https://github.com/ElmerCSC/elmerfem/commits/devel

-- Mika
Post Reply