Unexpected results with FourierLossSolver
Posted: 05 Jul 2021, 22:23
Hi all,
I got some unexpected results using the FourierLossSolver and I think there might be two problems.I have tried to reproduce the problems with a simple example consisting of a magnetic-ring circuit around a wire with an AC current with frequency f_source. The current is such that the average amplitude of the flux density in the ring is 1 T.
The example (with mesh) is in FourierLossTest1.zip
An experiment takes 2 s. After 1 s, the fourier analysis starts (Fourier Start Time = 1.0)
The "Frequency" of FourierLossSolver is called f_fourier here. Only the first harmonic of the fourier series is considered (Fourier Series Components = Integer 1).
With f_source=1.0 and f_fourier=1.0 (T_phase_1=0.0; Harmonic Loss Field Exponent 1 = Real 2.0), the result in results/fourier_loss.dat is 9.845809E-01, where 1.0 was expected.
Looking at the number of time steps (40) and the mesh size, this is a reasonable results.
Next, we use f_source=0.99999999999 and f_fourier=0.99999999999. In this case, the result is 7.488119E+00, which is completely wrong.
I have no idea about the cause of this problem.
The second problem has to do with the computation of the result.
Again, we may use f_source=1.0 and f_fourier=1.0, but for the example "Harmonic Loss Field Exponent 1 = Real 2.0" is changed into Harmonic Loss Field Exponent 1 = Real 1.0, and "Fourier Start Time = Real 1.0" is changed into "Fourier Start Time = Real 0.05".
In fact we use the amplitude (instead of ampitude**2) for the computation of the loss.
The result is 9.902315E-01, which is close to 1.0, as expected.
Next, T_phase_1 is changed from 0.0 into 0.125 (a phase shift of 45 deg); the amplitude was not changed.
Now, we get 1.400399E+00, which is close to sqrt(2).
Looking at the source code, I found the following possible explanation.
Consider B_x, B_y at one point with B_x and B_y having the same phase:
B_x = B_hat_x * cos(omega*t-phi)
B_y = B_hat_x * cos(omega*t-phi)
So, the magnitude is
B_mag = sqrt(B_x**2+B_y**) = sqrt(B_hat_x**2+B_hat_y**) * cos(omega*t-phi)
and the amplitude is
B_hat = sqrt(B_hat_x**2+B_hat_y**)
So, the amplitude doesn't depend on the angle phi (of course).
If we write "Harmonic Loss Field Exponent" = alpha, I would expect the result B_hat**alpha.
I think, I read in the source of FourierLoss that the cos and sin terms of the fourier series are dealt with separately.
So, B_x, BY are written as (only first term of the fourier series):
B_x = B_hat_x * cos(omega*t-phi) = B_hat_x * [cos(phi)*cos(omega*t) + sin(phi)*sin(omega*t)]
B_y = B_hat_x * cos(omega*t-phi) = B_hat_y * [cos(phi)*cos(omega*t) + sin(phi)*sin(omega*t)]
For j==2 in the source code, the cos terms are dealt with
ValAtIp = sqrt[B_hat_x**2 * cos(phi)**2 + B_hat_y**2 * cos(phi)**2]
= cos(phi) * sqrt[B_hat_x**2 + B_hat_y**2]
= cos(phi) * B_hat
result_cos = ValAtIp**alpha = cos(phi)**alpha * B_hat**alpha
In a similar way (j==3 in the source code), we get for the sin terms:
result_sin = sin(phi)**alpha * B_hat**alpha
The total result is:
result = result_cos + result_sin = [cos(phi)**alpha + sin(phi)**alpha] * B_hat**alpha
For alpha==2, we get the result I would expect:
result = [cos(phi)**2 + sin(phi)**s] * B_hat**2 = B_hat**2
This result doesn't depend on phi.
For alpha==1, we get:
result = [cos(phi) + sin(phi)] * B_hat
For phi==0 or phi==pi/2, we get the result I would expect (result=1), but for phi==pi/4, we get result=sqrt(2)*B_hat,
This was also calculated in the example.
Other values of alpha also give results I wouldn't expect.
If the above behavior was intended, this message may be seen as a waning for other users.
With kind regards,
Martin Hoeijmakers
I got some unexpected results using the FourierLossSolver and I think there might be two problems.I have tried to reproduce the problems with a simple example consisting of a magnetic-ring circuit around a wire with an AC current with frequency f_source. The current is such that the average amplitude of the flux density in the ring is 1 T.
The example (with mesh) is in FourierLossTest1.zip
An experiment takes 2 s. After 1 s, the fourier analysis starts (Fourier Start Time = 1.0)
The "Frequency" of FourierLossSolver is called f_fourier here. Only the first harmonic of the fourier series is considered (Fourier Series Components = Integer 1).
With f_source=1.0 and f_fourier=1.0 (T_phase_1=0.0; Harmonic Loss Field Exponent 1 = Real 2.0), the result in results/fourier_loss.dat is 9.845809E-01, where 1.0 was expected.
Looking at the number of time steps (40) and the mesh size, this is a reasonable results.
Next, we use f_source=0.99999999999 and f_fourier=0.99999999999. In this case, the result is 7.488119E+00, which is completely wrong.
I have no idea about the cause of this problem.
The second problem has to do with the computation of the result.
Again, we may use f_source=1.0 and f_fourier=1.0, but for the example "Harmonic Loss Field Exponent 1 = Real 2.0" is changed into Harmonic Loss Field Exponent 1 = Real 1.0, and "Fourier Start Time = Real 1.0" is changed into "Fourier Start Time = Real 0.05".
In fact we use the amplitude (instead of ampitude**2) for the computation of the loss.
The result is 9.902315E-01, which is close to 1.0, as expected.
Next, T_phase_1 is changed from 0.0 into 0.125 (a phase shift of 45 deg); the amplitude was not changed.
Now, we get 1.400399E+00, which is close to sqrt(2).
Looking at the source code, I found the following possible explanation.
Consider B_x, B_y at one point with B_x and B_y having the same phase:
B_x = B_hat_x * cos(omega*t-phi)
B_y = B_hat_x * cos(omega*t-phi)
So, the magnitude is
B_mag = sqrt(B_x**2+B_y**) = sqrt(B_hat_x**2+B_hat_y**) * cos(omega*t-phi)
and the amplitude is
B_hat = sqrt(B_hat_x**2+B_hat_y**)
So, the amplitude doesn't depend on the angle phi (of course).
If we write "Harmonic Loss Field Exponent" = alpha, I would expect the result B_hat**alpha.
I think, I read in the source of FourierLoss that the cos and sin terms of the fourier series are dealt with separately.
So, B_x, BY are written as (only first term of the fourier series):
B_x = B_hat_x * cos(omega*t-phi) = B_hat_x * [cos(phi)*cos(omega*t) + sin(phi)*sin(omega*t)]
B_y = B_hat_x * cos(omega*t-phi) = B_hat_y * [cos(phi)*cos(omega*t) + sin(phi)*sin(omega*t)]
For j==2 in the source code, the cos terms are dealt with
ValAtIp = sqrt[B_hat_x**2 * cos(phi)**2 + B_hat_y**2 * cos(phi)**2]
= cos(phi) * sqrt[B_hat_x**2 + B_hat_y**2]
= cos(phi) * B_hat
result_cos = ValAtIp**alpha = cos(phi)**alpha * B_hat**alpha
In a similar way (j==3 in the source code), we get for the sin terms:
result_sin = sin(phi)**alpha * B_hat**alpha
The total result is:
result = result_cos + result_sin = [cos(phi)**alpha + sin(phi)**alpha] * B_hat**alpha
For alpha==2, we get the result I would expect:
result = [cos(phi)**2 + sin(phi)**s] * B_hat**2 = B_hat**2
This result doesn't depend on phi.
For alpha==1, we get:
result = [cos(phi) + sin(phi)] * B_hat
For phi==0 or phi==pi/2, we get the result I would expect (result=1), but for phi==pi/4, we get result=sqrt(2)*B_hat,
This was also calculated in the example.
Other values of alpha also give results I wouldn't expect.
If the above behavior was intended, this message may be seen as a waning for other users.
With kind regards,
Martin Hoeijmakers