ElmerCSC/elmerfem

Exponent coefficients for loss calculations

jvencels opened this issue · 8 comments

Hi @raback and @juhanikataja,

Calculate harmonic loss relies on coefficients (linear and exponent) to calculate losses that depend on the B-field. It is a convenient way to calculate core losses.

Solver
   Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
...
   Calculate Harmonic Loss = Logical True
   Harmonic Loss Linear Frequency Exponent = Real 1.4629010765548767
   Harmonic Loss Linear Exponent = Real 3.4895656146131433
End

Material has two remaining coefficients

Material 
...
   Harmonic Loss Linear Coefficient = Real 0.0005335826586823117
   Harmonic Loss Quadratic Coefficient = Real 7.146177437369927e-08
End

Existing implementation limits loss calculation to one material.
Would it be possible to move loss exponents to the material section?

Btw, the HarmonicLoss.F90 and CalcFields.F90 use different logic. The latter assumes two components, linear and quadratic, while the former is fully generic allowing more components than two. We should maybe adopt the former in both.

Line ~2005 in CalculateFields.F90, add
.OR. MaterialExponents

to account for losses

           ! No losses to add if loss coefficient is not given
           IF( Found .OR. MaterialExponents ) THEN
             ElemLoss = 0.0_dp
             DO l=1,2

with this fix, it works

@raback
MaterialExponents
now it is MaterialsExponents

I took some steps to harmonize the keywords. FourierLoss solver has been more generic allowing any exponents and more components. You can now use same keywords albeit with two components just... The common stuff was moved to library side. Maybe you could check that it still works. I could then merge.

Line 973 missing the word Loss
OldLossKeywords = ListCheckPresent(SolverParams,'Harmonic Linear Frequency Exponent')
Should be
OldLossKeywords = ListCheckPresent(SolverParams,'Harmonic Loss Linear Frequency Exponent')
With this, the changes are compatible with older cases.
Loss exponents defined in the material section work, too.
I did not check compatibility with FourierLoss

Thanx Juris! Fixed and merged.