# Speed-up of iron losses computations in post-processing while solving with parametric distribution

## Overview

Iron losses computations performed in post-processing with the modified Bertotti model and with the LS model have been drastically accelerated for scenarios containing several varying parameters and solved with parametric distribution (CDE for Windows and Distribution manager for Linux).

Several Flux modules now benefit from this improvement. For instance, the total computation time to create efficiency maps in FEMT decreased significantly. Note that it also affects the Import / Export context: every data collection that is created before solving will be properly collected during resolution (e.g., a force data collection for a multi-speed distributed scenario). Consequently, the collected data will be promptly available after resolution, avoiding its re-evaluation.

## Example

To illustrate this improvement, let us consider a Flux 2D project modeling a three-phase, eight-pole permanent magnet synchronous machine (PMSM) with a Transient Magnetic application. In this example, the simulation scenario controls the rotor's angular position from 0 to 90 degrees in 32 angular steps, with an imposed speed that is time dependent. During parametric distribution, Flux will compute results for all the parameter combinations at each step. The modified Bertotti model is adopted for evaluating the iron losses.

In this example, the parametric distribution is performed over three parameters, namely
• the speed, which is defined as an I/O parameter controlled by the scenario and that is used by the rotating mechanical set;
• the direct-axis and quadrature-axis currents Id and Iq,which are directly used in the coupled circuit to drive the electrical machine.
Table 1. The parameters of the example and their variation ranges.
Current Iq (A) Current Id (A) Speed (rpm)
Minimum value 2 -200 75
Maximum value 200 -2 7500
Number of steps 6 6 8

It follows from Table 1 that the number of parametric steps to be solved is 6x6x8 =288 and the total number of finite element computations will be 288x32=9216 (since there are 32 angular steps for each parametric step).

The distributed solution was performed with 10 parallel instances of Flux that treated the configurations presented in Table 1 simultaneously. Table 2 compares the solving time and the iron losses evaluation time verified with Flux 2022.1 to the times obtained with previous versions.
Table 2. Solving times and iron losses evaluation times with parametric distribution.
Flux 2022.0 and older versions Flux 2022.1
Solving time 1h 30min 2h 13min
Time to compute iron losses in post-processing 1h 25min 3min