# Parametric distribution in Flux

## Introduction

This chapter discusses the establishment of a parametric distribution in Flux on a single machine. The distributed computing allows the user to save computation time while distributing several independent configurations of a same Flux project. For example a Magnetic Transient project may be distributed regarding different values of parameters such as the geometrical parameters (size, shape etc...) or physical parameters (supply current values, speed...) varying in the scenario. Several projects will run at the same time simulating all those configurations, the main parameter of a distributed computation is the following one:
• The number of cores (i.e the number of running Flux in parallel);
The following topics are covered in this documentation:
• Principles;
• How to set up a parametric distribution on a single machine;
• Define a parametrized scenario in Flux
• Example of application.
Note: For more informations about distribution & parallel computing in Flux (ie: using PBS), please consult the How to Use Solver Parallelization and Parametric Distribution with Flux? .

## Principles

The parametric distribution allows the user to save computation time by parallelizing several independent configurations of a finite element problem with different values of I/O or geometric parameters varying in the scenario instead of running them sequentially. To set-up a distributed computation, a primary Flux project is mandatory in order to compute all its sub-projects having an independent configuration.

The primary Flux project controls all the others secondaries projects (distribution) and is in charge of the gathering of all the results obtained during the solving process by all the sub-projects Flux as depicted in Figure 1 below:
For this configuration, each secondary Flux has the same properties:
• They all ran with the same number of cores which has been configured in Supervisor Options;
• The amount of memory assigned to the secondary Flux is set to the same value as the primary Flux, if the memory is setted to Dynamic for the primary Flux, the secondary Flux will also start with dynamic memory.

## How to set up a parametric distribution on a single machine

In Flux 2D and in Flux 3D, the parametric distribution options (number of secondary Flux in parallel) may be setted in the Supervisor's options or by clicking on the button Distribution manager in the bottom right of the Supervisor. For the Flux Skew module, this feature is not yet available and will run automatically in sequential mode.

In any case, the parametric distribution may be setted as follows:

• The Distribution manager may be started in the Supervisor's options, in the Parallel Computing menu, in the section Distributed Computing and then Parametric Distribution click on the button Set local ressources as shown below;
• An additional window Distribution manager should appears and is asking to allow some resources (Number of secondary Flux in parallel) for the parametric distribution, click on Allow;
• The Distribution manager then asks for the Number of concurrent Flux as follows:This number is directy linked to the number of cores available on the machine, the numbers of varying parameters are automatically distributed over the number of concurrent Flux. The secondary Flux are automatically run in monocore mode but may be changed by using the slider of Number of cores per concurrent Flux.
• Finally, click on Use to complete the parametric distribution
• The parametric distribution may be started by clicking the button Distribution manager in the bottom right of the Supervisor as shown below.

## Define a parametrized scenario in Flux

Once that the distribution has been setted in the Supervisor, it may be employed as follow in a Flux scenario:
• Check the box Parametric distribution in the selected Scenario.
Note: All the varying parameters should be declared as Controlled parameters in the Control parameters tab of the scenario as depicted below in Figure 5.

## Example of application

To show the interest of the parametric distribution, let us consider a project modeling a three-phase, eight-pole permanent magnet synchronous machine (PMSM) using a Flux 2D Transient Magnetic application. This simulation will be controlled by the angular position of the rotor from 0 to 90 degrees with imposed speed which is a time dependant scenario. During the parametric distribution Flux will compute the results for all the parameters combination for each time step.
The goal is to do a parametric distribution over two parameters:
• The speed which is declared as an I/O parameter controlled by the scenario and that is used by the rotating mechanical set
• The shape of the magnet with the magnet outer arc value α setted with a geometrical parameter as depicted below.
Both parameters may have an influence on the performance of the electrical machine. A table summarizing all the parameters is available below:
Table 1. Table summarizing the parameters, and their variation range
Magnet outer arc α (degrees) Speed (rpm)
Minimum value 130 1300
Maximum value 170 1700
Step value 10 100
According to the previous, table the number of steps to solve is about 2525 (5*5*101) with five values for the speed, five values for the magnet outer arc over a scenario with 101 time steps.
Note: Be aware that the time steps cannot be separated in concurrent Flux, a strong time relation between the steps is required to solve a Transient Magnetic application. This relation does not exist in the Magneto Static application.
The results yielded by differents types of distribution using a different Number of concurrent Flux setted in the Distribution manager are plotted in Figure 8 while solving the same scenario with 2525 time steps with a different value of Number of concurrent Flux. The computation time with only 1 concurrent Flux (sequential computing) is considered as the reference and is setted to 100% of the solving time.