Download as pdf or txt
Download as pdf or txt
You are on page 1of 302

 

Flux is a registered trademark.

Copyright © 1983 – 2018 Altair Engineering, Inc.

This user’s guide was published on 18 January 2018

KF 1 01 - 181 - EN - 01/18

Altair
15 Chemin de Malacher - Inovallée
38246 Meylan Cedex
France

Phone: +33 (0)4 76 90 50 45


Fax: +33 (0)4 56 38 08 30

Web: http://www.altair.com
Flux TABLE OF CONTENTS VOLUME 1

TABLE OF CONTENTS

Volume 1: General tools,


Geometry and mesh
Volume 2: Physical description, Solving, Post-
processing, Time dependant study,
parametric study
Volume 3: Physical applications:
Magnetic, Electric, Thermal, …
Volume 4 Circuit coupling, Kinematic coupling,
Multiphysic coupling and Skew application

USER GUIDE PAGE A


TABLE OF CONTENTS VOLUME 1 Flux

PAGE B USER GUIDE


Flux TABLE OF CONTENTS VOLUME 1

TABLE OF CONTENTS VOLUME 1

1. Flux documentation ............................................................................................................ 1


1.1. Flux documentation: whatever is available so far ......................................................... 2
1.2. User guide ................................................................................................................... 3
1.3. User guide: versions (on paper and on line) ................................................................ 4
1.4. Tutorials for 2D applications ........................................................................................ 6
1.5. Tutorials for 3D applications ........................................................................................ 7
2. Supervisor ........................................................................................................................... 9
2.1. General presentation ................................................................................................. 11
2.1.1. Environment of Flux Supervisor ...................................................................................... 12
2.1.2. Contexts of the Supervisor.............................................................................................. 14
2.2. Options ...................................................................................................................... 17
2.2.1. General option ................................................................................................................ 18
2.2.2. System options ............................................................................................................... 19
2.2.3. Access paths options ...................................................................................................... 20
2.2.4. Flux options ..................................................................................................................... 22
2.3. Memory requirements management .......................................................................... 23
2.3.1. Management of the memory space: definitions .............................................................. 24
2.3.2. Memory size management: allocated space................................................................... 26
2.4. Quantities and units manager .................................................................................... 27
2.5. License manager ....................................................................................................... 29
2.6. User guide ................................................................................................................. 31
3. Environment and graphic representation ....................................................................... 33
3.1. Working environment: role of different zones ............................................................ 35
3.1.1. Presentation of working environment.............................................................................. 36
3.1.2. Modifying the environment .............................................................................................. 41
3.1.3. Improvement of the display of error messages............................................................... 44
3.2. Graphic representation: a graphic view ...................................................................... 47
3.2.1. Concepts of view ............................................................................................................. 48
3.2.2. Modifying the view........................................................................................................... 49
3.2.3. Predefined views (3D specificity) .................................................................................... 52
3.2.4. Four views ....................................................................................................................... 54
4. Flux project and Flux object management...................................................................... 55
4.1. Flux project ................................................................................................................ 57
4.1.1. Flux project: definition, type of data storage ................................................................... 58
4.1.2. Creation, opening and storage of projects ...................................................................... 59
4.2. Flux object ................................................................................................................. 61
4.2.1. Flux object: user guide .................................................................................................... 62

USER GUIDE PAGE C


TABLE OF CONTENTS VOLUME 1 Flux

4.2.2. Importation of Flux objects ..............................................................................................63


4.3. Binary / Formatted save ............................................................................................. 65
5. General operation: data management ............................................................................. 67
5.1. Data organization: Flux database ............................................................................... 69
5.1.1. Concept of “data” and “data structure” ............................................................................70
5.2. Data presentation: dialog boxes ................................................................................. 71
5.2.1. Project data (entities) ......................................................................................................72
5.2.2. Dialog boxes: specialized box .........................................................................................74
5.2.3. Dialog boxes: data array .................................................................................................75
5.3. Entity Management .................................................................................................... 77
5.3.1. Manipulation of the entities: Creating, Editing, … ...........................................................78
5.3.2. Information on the entities: Display PyFlux , List and Entity used by ..............................82
5.3.3. Export of entities .............................................................................................................83
5.3.4. Entity selection: circumstances and selection modes .....................................................86
5.3.5. Entities selection: selection filter .....................................................................................88
5.3.6. Entities selection: selection by criterion ..........................................................................89
5.4. Visualization of entities ............................................................................................... 93
5.4.1. Display and appearance of entities .................................................................................94
5.4.2. Visualization of entities: displaying the entities and displaying filter ................................95
5.4.3. Visualization of entities: graphic appearance ..................................................................96
5.4.4. Visualization of entities: saving and restoration of the graphic properties ......................97
6. PyFlux language, command files and macros ................................................................ 99
6.1. PyFlux and Python languages .................................................................................. 101
6.1.1. PyFlux language syntax ................................................................................................102
6.1.2. Python language syntax ................................................................................................104
6.1.3. PyFlux in interactive mode - Python editor ....................................................................107
6.1.4. How to find out the syntax of PyFlux expressions? .......................................................111
6.1.5. How to Activate/inactivate the writing of graphic commands ........................................114
6.1.6. Other available PyFlux commands ...............................................................................115
6.2. Command files ......................................................................................................... 121
6.2.1. Overview .......................................................................................................................122
6.2.2. Structure of a command file ..........................................................................................123
6.2.3. Management and execution of command files .............................................................124
6.2.4. Example 1: automatic creation of a series of mesh lines ..............................................126
6.2.5. Example 2: automatic preparation of a series of Flux projects ready to be solved .......130
6.3. Macros ..................................................................................................................... 135
6.3.1. Overview .......................................................................................................................136
6.3.2. Structure of a macro file ................................................................................................137
6.3.3. Management and execution of macros .........................................................................138
6.3.4. Example: creation of points starting from a file .............................................................140
7. Formulas and mathematical functions .......................................................................... 143
7.1. Formulas .................................................................................................................. 145
7.1.1. Concepts of formula and formula type ..........................................................................146
7.1.2. Formula with geometric parameters .............................................................................147
7.1.3. Formula with I/O (input/output) parameters ..................................................................148
7.1.4. Formula with spatial quantities ......................................................................................149
7.1.5. Formula editor ...............................................................................................................150
7.2. List of available functions ......................................................................................... 153
7.2.1. Functions.......................................................................................................................154
7.3. Functions for handling complex quantities ................................................................ 157
7.3.1. Field concept, scalar fields and vector fields ................................................................158
7.3.2. Reminder on complex numbers ....................................................................................159
7.3.3. Functions for handling quantities expressed by complex numbers ..............................160
7.3.4. Modulus functions: ModV, ModC and Mod ...................................................................161
7.3.5. Example: flux density in Steady state AC Magnetic applications ..................................164
7.4. Specific functions Modulo, Valid, Trapez, Trapezper and a function of substitution .. 165
7.4.1. Modulo function .............................................................................................................166

PAGE D USER GUIDE


Flux TABLE OF CONTENTS VOLUME 1

7.4.2. Valid function ................................................................................................................ 167


7.4.3. Trapez function ............................................................................................................. 168
7.4.4. Trapezper function ........................................................................................................ 169
7.4.5. Function of substitution or [ ] operator .......................................................................... 170
8. Geometry: principles ...................................................................................................... 173
8.1. Modeling strategies.................................................................................................. 175
8.1.1. 2D plane study, 2D axisymmetric study, 3D study ........................................................ 176
8.1.2. 2D Example: Geometry and mesh tutorial .................................................................... 179
8.1.3. 3D Example: Geometry and mesh (Tutorial) ................................................................ 181
8.2. Study domain ........................................................................................................... 183
8.2.1. Study domain limits, generalities .................................................................................. 184
8.2.2. Truncation method ........................................................................................................ 187
8.2.3. The infinite box transformation ..................................................................................... 188
8.2.4. Reduction of the study domain: symmetries and periodicities ...................................... 190
8.2.5. Periodicity property and periodicity conditions on the boundaries ................................ 192
8.2.6. Symmetry and symmetry conditions on the boundaries ............................................... 193
8.3. Characteristics of geometry building module ........................................................... 195
8.3.1. Presentation of the geometry building module .............................................................. 196
8.3.2. Lines and faces: authorized shapes ............................................................................. 198
8.3.3. Lines and faces: superpositions and intersections ....................................................... 199
8.3.4. Limits of the geometry building module ........................................................................ 201
8.3.5. Another functionality: nature of points, lines and faces ................................................. 202
8.4. Tools of geometry building module .......................................................................... 205
8.4.1. Parameterization ........................................................................................................... 206
8.4.2. Concepts of propagation and extrusion ........................................................................ 208
8.5. Geometry building: general steps ............................................................................ 209
8.5.1. Geometry building process ........................................................................................... 210
9. Mesh: principles ............................................................................................................. 213
9.1. Mesh: Overview ....................................................................................................... 215
9.1.1. Introduction to meshing process ................................................................................... 216
9.1.2. A valid mesh: rules to follow ......................................................................................... 218
9.2. Mesh generators (shape of mesh) ........................................................................... 221
9.2.1. Automatic mesh generator ............................................................................................ 222
9.2.2. Mapped mesh generator ............................................................................................... 223
9.2.3. Linked mesh generator ................................................................................................. 227
9.2.4. Extrusive mesh generator ............................................................................................. 228
9.2.5. Mesh generator of the « No mesh » type...................................................................... 230
9.2.6. Fully automatic meshing or mixed meshing: comparison ............................................. 231
9.3. Adjustments (mesh size) ......................................................................................... 235
9.3.1. Adjustment: meshing by point discretization (on the points) ......................................... 236
9.3.2. Adjustment: meshing by linear discretization (on the lines) .......................................... 237
9.3.3. Adjustment: meshing by deflection (on the lines/ non flat faces) .................................. 238
9.3.4. Adjustment: meshing by relaxation (on the geometric entities) .................................... 240
9.3.5. Adjustment: meshing by shading (on the close faces in 3D) ........................................ 241
9.3.6. Aided mesh ................................................................................................................... 242
9.3.7. Combination of various adjustments ............................................................................. 244
9.4. General steps of the mesh process ......................................................................... 247
9.4.1. The mesh process (Aided mesh) .................................................................................. 248
9.4.2. The mesh process (advanced user) ............................................................................. 249
9.5. Automatic mesh parameters (options) ..................................................................... 253
9.5.1. Face mesh regularization.............................................................................................. 254
9.5.2. Algorithms of volume meshing ...................................................................................... 256
9.5.3. Advice for specific mesh ............................................................................................... 258
9.5.4. Help for meshing of the sliding surface ......................................................................... 259
9.5.5. Mesh of solid conductor with skin effect ....................................................................... 261
10. Geometry / mesh importation: principles ..................................................................... 263
10.1. Geometry / mesh importation: overview ................................................................... 265

USER GUIDE PAGE E


TABLE OF CONTENTS VOLUME 1 Flux

10.1.1. Types of imports ...........................................................................................................266


10.1.2. Import formats ...............................................................................................................267
10.2. Geometry imports (standard formats) ....................................................................... 269
10.2.1. Process of geometry importation ..................................................................................270
10.2.2. Stage of conversion with options ..................................................................................271
10.2.3. Stage of geometry checking: concept of geometric defect ...........................................273
10.2.4. Stage of geometric defects correction / geometry simplification ...................................275
10.2.5. Geometry importation: strategies ..................................................................................278
10.3. Import of geometry called « advanced mode » ......................................................... 279
10.3.1. About import « advanced mode » .................................................................................280
10.3.2. Import process ..............................................................................................................281
10.4. Mesh importation ...................................................................................................... 283
10.4.1. Process of mesh importation ........................................................................................284
10.4.2. Stage of conversion with options ..................................................................................285
10.4.3. Stage of fusion ..............................................................................................................287
10.4.4. Stage of positioning.......................................................................................................290
10.4.5. Mesh importation: strategies .........................................................................................291

PAGE F USER GUIDE


Flux Flux documentation

1. Flux documentation

Introduction The software documentation associated to version 2018 is presented in this


chapter.

Contents This chapter covers the following topics:


• Flux documentation: whatever is available so far
• User guide
• User guide: versions (on paper and on line)
• Tutorials for 2D applications
• Tutorials for 3D applications

USER GUIDE PAGE 1


Flux documentation Flux

1.1. Flux documentation: whatever is available so far

Whatever is The Flux documentation includes:


available so far • an installation guide
• a user guide (which is the document you are reading now)
• two categories of tutorials*:
• basic examples : one detailed tutorial for the preprocessor (First steps in
using Flux, geometry and mesh tutorial ) and three other tutorials
permitting an assisted initial implementation of the software for various
physical applications (magnetostatics, electrostatics, and thermal)
• technical examples which provide support in the modeling of more
complex devices
• Best practices: documents supplying advices on specific points

*a tutorial comprises a pdf document and a folder including command files (.py)
enabling to realize the whole scenario of the actions described on the pdf file.

Where can the The documents are available (in pdf format):
documents be • on your working post in the installation folder
found? C:\Program Files\Altair\2018\flux\Flux\DocExamples\...

PAGE 2 USER GUIDE


Flux Flux documentation

1.2. User guide

Structure The general structure of the user guide is presented in the table below.

Flux (2D and 3D applications)


General tools
Volume 1 (Flux environment)
Geometry and mesh
Volume 2 Solving, Posprocessing
The physical applications:
Volume 3
Magnetic, Electric, Thermal, …
Physical description,
Volume 4 Cinematic coupling, Circuit coupling,
Multiphysics coupling, Skew

USER GUIDE PAGE 3


Flux documentation Flux

1.3. User guide: versions (on paper and on line)

Introduction The user guide appears in two versions:


• one version corresponding to the document on paper (or pdf)
• one version corresponding to the online help

Why two The two versions of the user guide are not identical:
versions? • The document on paper comprises the necessary information in order to
understand well what can be carried out with Flux (pre-required
knowledge)
• The online help includes the information mentioned above, to which the
necessary information is added in order to make a good use of the
software tools.

In order to For each important description stage of a finite elements project, the
identify information has been therefore split into two:
information
• the ‘theoretical’ aspects (or principles)
easily …
• the ‘practical’ aspects (or implemented at the level of the software)
The two aspects are described in different chapters, as presented in the table
below.
The chapters headed … comprise information as follows …
• general information, reminder on physics
Geometry: principles • modeling principle (with Flux)
Mesh: principles
• software operation (its strengths and limits)
Physics: principles
… • advice in modeling: strategy, choice, …
• general steps, flowcharts
Geometry: software aspects • structure of Flux objects
Mesh: software aspects
Physics: software aspects • handling of Flux objects
… • description of commands for specific actions

PAGE 4 USER GUIDE


Flux Flux documentation

Concretely … The contents of the two versions of the user guide are presented in the table
below.
Document on paper Online help
The theoretical aspects: The theoretical aspects:
Chapters headed: Chapters headed:
” …: principles” ” …: principles“
The practical aspects:
Chapters headed:
” …: software aspects”

USER GUIDE PAGE 5


Flux documentation Flux

1.4. Tutorials for 2D applications

Definition Tutorials are technical examples with the objective to demonstrate the
features of the software on a realistic device (emphasizing the interesting
results which can thus be obtained). All the technical data are presented in the
document, but the commands are not described in details.

Basic examples The available basic examples for the 2D applications are listed in the table
(2D) below.

Tutorial : 2D Application Goals


First steps in using Flux - Description of the Flux environment,
Geometry and mesh tutorial geometry and mesh
Magneto Static application tutorial
Electro Static application tutorial Description of basic applications
Thermal applications tutorial

Technical The technical examples available for the 2D applications are listed in the table
examples (2D) below.

Tutorial : 2D Application Goals


Translating Motion Description of magnetic application
Brushless IPM Motor tutorial with kinematic coupling and circuit
Brushless SPM Motor tutorial coupling
Coupled application
Induction Heating tutorial
(magnetothermal)
Description of steady state AC
Induction Heating with multiphysics magnetic and transient thermal
tutorial application using multiphysics co-
simulation

PAGE 6 USER GUIDE


Flux Flux documentation

1.5. Tutorials for 3D applications

Definition Tutorials are technical examples with the objective to show the software
features on a realistic device (emphasizing the interesting results which can
thus be obtained). All the technical data are presented in the document, but
the commands are not described in details.

Basic examples The available tutorials for the 3D applications are listed in the table below.
(3D)

Basic example: 3D application Description


Generic tutorial of geometry and mesh Environment, geometry and mesh
Magnetostatics Basic application
Magnetic application with
Translating motion kinematic coupling,
circuit coupling
Magnetic application with
Rotating motion kinematic coupling,
circuit coupling

Technical The technical papers available for the 3D applications are listed in the table
examples (3D) below.

Technical example: 3D application


Rear-view mirror motor analysis with Flux 3D
End winding characterization with Flux 3D
Conduction heating with multiphysics coupling
Magneto-thermal
Nondestructive testing with Flux 3D

USER GUIDE PAGE 7


Flux documentation Flux

PAGE 8 USER GUIDE


Flux Supervisor

2. Supervisor

Introduction This chapter presents the Flux Supervisor.

Contents This chapter contains the following topics:


• General presentation
• Options
• Memory requirements management
• Quantities and units manager
• License manager
• License manager

USER GUIDE PAGE 9


Supervisor Flux

PAGE 10 USER GUIDE


Flux Supervisor

2.1. General presentation

Introduction This section describes the Flux Supervisor, with which you can run Flux
modules and manage your Flux project files and directories.

Contents This section contains the following topics:


• Environment of Flux Supervisor
• Contexts of the Supervisor

USER GUIDE PAGE 11


Supervisor Flux

2.1.1. Environment of Flux Supervisor

Access To start the Flux Supervisor from the Windows taskbar, proceed as follows:
• point on Start/ All programs/ Altair (or your installation directory) and
click on Flux

The Supervisor The Flux Supervisor window is divided into several zones. The different
Window zones are identified in the figure below and then detailed in following blocks.

Modules

How to
Proceed?
procéder?

Contexts

Working Customized
directory Zone

Cross-functions

Continued on next page

PAGE 12 USER GUIDE


Flux Supervisor

Zones of the The different zones of the Flux Supervisor and their functions are presented in
Supervisor the table below.

Zone Function
The user selects the module in which he wishes to
Dimensions
model his project: 2D, 3D, Skew or PEEC
The user have the choice between several use
contexts of supervisor:
• New project
Contexts • Open un project
• Open example
• Python for Flux
• Batch solve
The user chooses a working directory. The path of
this directory is displayed.
Working directory It is possible to manage folders and files by
Directory selector clicking on button :

The content of this zone is adapted according to the


Customized zone context of use chosen.

The action button is also customized.


The process of use of each context is in this zone.
How to proceed ? It is possible to hide/display this zone by clicking
on
The user also has access by the supervisor at cross-
functions:
Cross functions
• Specific functions to Flux : Options, License,
Materials, Units, Distribution…
This icon allows to access to :
• Help (HTML documentation)
• PDF documents (user guide, tutorials, new
features document…)
• User portal (sharing plateform)
•…

USER GUIDE PAGE 13


Supervisor Flux

2.1.2. Contexts of the Supervisor

Introduction The supervisor contains several contexts of use:


• New project
• Open un project
• Open example
• Python for Flux
• Batch solve
To change the context, just click on the desired context.

New Project This context allows the user to directly open the Flux software with a new
context project in the selected dimension. The project is created in the working
directory selected.

To start a new project, click on:

Open project This context allows the user to d’open an existing Flux project.
context The customized zone contains several subzones:
• List of current projects contained in the working directory selected
• List of recently opened projects
• Graphic view: preview of model associated with the *.FLU project selected
• Informations on selected *.FLU project: Application, State, Comment
entered by the user (to enter in this zone), …

To open an existing selected project, clicking on:


(or double click on the *.FLU project)

Open example This context allows to open one of the proposed example in the same
context required state (model with mesh, with physics, solved, post-processed).
The opened example is automatically saved in the working directory
selected.
La zone personnalisée contient plusieurs sous-zones:
• Example tree with an tree structure with several levels:
Group (basics, technicals, textbook cases)
Studied Tutorial
Example (several examples are available in a same model)
Running state
• Viewing the summary of the selected tutorial
• Search function that allows filtering the examples in the tree structure
It is also possible to open the PDF document of the full tutorial by clicking
on Readme.

Continued on next page

PAGE 14 USER GUIDE


Flux Supervisor

To open an example in the running state selected, clik on:


(or double click on the running state)

Python for Flux This context allows manipulating python scripts contained in the selected
context working directory:
• Create files *.py
• Edit files *.py
• Execute files *.py

The customized zone contains several subzones:


• List of python scripts contained in the selected working directory
• Python Editor

Batch Solve This context allows to solve in batch mode (allows for example to reduce the
context computed time for complex models)
It is also possible to plan several resolutions of *.FLU projects( ready to
solve) contained in the selected working directory.

USER GUIDE PAGE 15


Supervisor Flux

PAGE 16 USER GUIDE


Flux Supervisor

2.2. Options

Introduction The user will find in this section information regarding the options available.

Contents This section contains the following topics:


• General option
• System options
• Access paths options
• Flux options

USER GUIDE PAGE 17


Supervisor Flux

2.2.1. General option

Access to General options are available by clicking on:


General options

This directory includes the options described in the following blocks.

Language The user can choose the interface language (French or English) for Flux and
the supervisor.

Recent files The user can choose the maximal number of files that he wants to display in
the Recent files area of the supervisor. He can also choose the maximal
number of stored files.
When one or various recent files are deleted, the software will display the
following stored files.

File types The user can choose the type of files that he wants to be displayed in the
Current project of Open project context. By default, *.FLU files are
displayed. To add another formats to display in the Current project area, just
add extensions (for example: *.py, *.txt, …).

Shortcuts The user can consult / edit / delete the default shortcuts available in Flux. To
carry on a modification, the user has to select a command in the list.
He has the opportunity to :
• delete a shortcut by clicking on the icon
• modify a shortcut
• by entering the complete shortcut in the field or
• by entering the principal key in the field and selecting the linked modifier
• select one or more linked modifier (Ctrl, Shift, Alt)
• create a shortcut for the selected command (using the same process as for
the modification)

Macros For each of the four applications (2D, 3D, Skew, PEEC) the user can choose
one or more macros loaded by default when creating new projects.

PAGE 18 USER GUIDE


Flux Supervisor

2.2.2. System options

Access to
System options System options are available by clicking on:

This directory includes the options described in the following blocks.

Memory The user can modify the memory repartition allocated by default by Flux.
More information about memory is available in 2.3 Memory requirements
management.

Parallel The user can choose :


computing • To choose the number of cores that he wants to use with Flux. More
information about multi-cores is available in Volume 2, Chapter 3, Solving:
principles.
• To configure machines to distributed computing

Graphic mode The user can choose to start Flux in non optimized mode.

Debug The user can choose among options for an advanced used of Flux.

USER GUIDE PAGE 19


Supervisor Flux

2.2.3. Access paths options

Access the
access paths Access paths options are available by clicking on:
options
This directory includes the options described in the following blocks.

User version The user has the possibility to use Flux with an user version. This version is
(before V11.2) composed by user Fortran subroutines compiled with an older Flux version
prior to 11.2.
In this option, the user selects the directory path
(example: Name_Directory.f3d_usr) in which is stored the user version (the
corresponding dll) that he wishes to use.
Flux will start taking into account the user version chosen.

Reminder: Since the 11.2 Flux version, it is not necessary to compile in Fortran user
subroutines to create an user version. The subroutines are now written in Groovy
language (java) and used directly in Flux (http://groovy.codehaus.org/).

Coupled The user must identify the access path of the installation path of Matlab
software Simulink.
In order for the Flux coupling component to be loaded into Simulink's library,
the user must start the Matlab Simulink application from the interface of the
supervisor options by clicking on the button .

Continued on next page

PAGE 20 USER GUIDE


Flux Supervisor

Materials from Since 11.2 Flux version, the manager of material databases (CSLMAT)
CSLMAT has been replaced by a new tool called Material Manager.
(before V11.2)
The material databases created using the old tool CSLMAT have as
extension: *. DAT.
From 11.2 version for users who have material databases *. DAT, it is
possible to choose material databases *. DAT will be available in Flux to
import materials (old format).
To import a material of material databases *. DAT (old format), firstly the
user must select in the supervisor options the directory of material database
*.DAT that he wants to use.
The user can select material databases in a directory:
• current (working directory)
• AND / OR local (defined by user)

The list of material databases whished is displayed in the options window (under the
select of directories)

Extension The user can determine the access path for the directories containing the
macros and overlays (user context to easily create geometry and mesh for
motors).

USER GUIDE PAGE 21


Supervisor Flux

2.2.4. Flux options

To access the
Flux options Flux options are available by clicking on:

This directory includes the options described in the following blocks.

Sketcher / The user has the possibility to:


Modeler • choose the background color for 2D sketcher: blue or grey (as Flux
background)
• choose the grid parameters of the Sketcher 2D at the opening of a new
project.
• open or not the sketcher when creating new a project
• open or not the modeler context when creating a new project

Geometric For each of the four modules (2D / 3D / Skew / PEEC), the user can
construction determine relative precision for the distance between two points when
creating a new project.

Mesh For each of the three modules (2D / 3D / Skew), the user can:
generation • determine relative precision for the distance between two points when
creating a new project
• activate or inactivate Aided mesh
These two options are applied when creating new projects.

Solving For each of the three modules (2D / 3D / Skew), the user can determine
precision and maximal number of iterations for Newtown -Raphson algorithm
when creating new projects.

PAGE 22 USER GUIDE


Flux Supervisor

2.3. Memory requirements management

Introduction This section contains the information relating to the memory requirements
and its management.

Contents This section contains the following topics:


• Management of the memory space: definitions
• Memory size management: allocated space

USER GUIDE PAGE 23


Supervisor Flux

2.3.1. Management of the memory space: definitions

On the topic of Several reminders on the memory :


memory • the central memory (also named primary storage) permits to temporarily
(general) memorize the data during the execution of the programs. The central
memory corresponds to what is named RAM
• the mass memory (also named secondary storage) permits to store data on
the long term, including during the computer turn of period. The mass
memory corresponds to the magnetic storage devices, such as the hard disk,
to the optic storage devices, corresponding for example to the CD-ROMs
or to the DVD-ROM, as well as to the dead memories.

Central memory Volatile memory Physical memory


(primary storage) (RAM)

Mass memory Pagefile.sys / SWAP


Hard drive
(secondary storage)

Non volatile
memory (ROM)

CD-ROM
DVD -ROM

The virtual memory corresponds to the "reunion of the physical memory (RAM) and
the pagination files (SWAP, pagefile.sys)".

About memory From a point of view of computer science, Flux has :


memory (Flux) • two major components:
• one ”computation” component (invisible part), in Fortran language
• one “GUI” component (visible part), in Java language,
• one connection between these two components, in Java.
A memory space must therefore be allotted for the Flux program (the
executable), for the operation of each of the components, and the connection
between the components.
The distribution is presented in the figure below and explained in the
following sections.

Computation
memory GUI memory System memory

Numerical memory Mémoire IHM Executable memory

Character memory Cache memory

Continued on next page

PAGE 24 USER GUIDE


Flux Supervisor

Calculus As regards the calculus part (in Fortran), Flux uses a pseudo-dynamic*
memory management tool of the memory. This tool manages a global memory space
comprising two Fortran tables, one for the numeric memory, the other one
for the character memory. The size of each of these tables is controlled by a
Fortran parameter inscribed in the main program.
*
Definitions :
Dynamic allotting: the size of the reserved memory is set by the user (it is therefore
modifiable).
Pseudo-dynamic allotting : Flux utilizes numeric tables and characters allotted in a
dynamic manner in order to emulate a dynamic memory

Numerical Numerical memory is the memory employed for the various modeling
memory: actions. 3D meshing and solving process (in 2D and in 3D) are the processes
put a large demand on the memory size.
The memory size to be allocated is a function of the application type
(real/complex) and of the solving process matrix size.

Character Character memory:


memory: Character memory is the memory used for storage of entity names
(parameters/transformations/regions/…) and of project names presented in the
directory.

GUI memory: GUI memory is the memory used for everything concerning the graphical
user interface (graphic display, etc.).

In the graphic window, the flag located bottom left gives an image of the
utilization of the graphic memory. When it is red, you can double-click on it
to force the process to release the memory.

System memory The system memory corresponds to the memory allotted for the good
operation of the system ; it comprises :
• the « executable » memory : memory space for the program Flux (the
executable) : of the order 250 Mo
• the « cache » memory : memory space for the transfers of data between the
calculus component (Fortran) and the component IHM (Java)
This memory is difficult to quantify, it can generate errors during the
recovery of data.

USER GUIDE PAGE 25


Supervisor Flux

2.3.2. Memory size management: allocated space

Allocated The allocated memory size is defined for each application (Flux 2D / Flux 3D
memory size / Flux Skew / Flux PEEC).
The values are defined by means of the memory manager.

Access the
memory Memory options are available by clicking on:
manager

Standard values are assigned by default in Flux and depend on a certain number of
criteria (application, computer characteristics, etc.)
This values by default evaluate with each version and technology improvements of
machines.

PAGE 26 USER GUIDE


Flux Supervisor

2.4. Quantities and units manager

Introduction In Flux, the user can have:


• a list of the most current, usual quantities directly upon analysis (the list is
different, in function of the treated application)
• the units associated to the quantity visible upon analysis (curve, calculation
on a point, isovalues, arrows, exports of results…)

Quantities and Quantities and units manager, available in Flux supervisor, enables the user
units manager to:
• be able to choose the desired measurement unit for the analysis of his own
Flux project
• be able to add one measurement unit to one of the available default
quantities
• be able to define the personalized user quantities

Open the To open the quantities and units manager , click on:
quantities and
units manager

Reading advice The user will find more information on the quantities and units manager in
the “User guide, Volume 2”.

USER GUIDE PAGE 27


Supervisor Flux

PAGE 28 USER GUIDE


Flux Supervisor

2.5. License manager

Tools to To manage the license, two tools are available for the user :
manage the
license

Tool Description
The license The license viewer is used to display the authorized
viewer applications, authorized versions, the expiration date, the
total number of tokens used ...
Le license The License manager is used to configure the license
manager server and connect it Flux to the license system.

Open the
license viewer To open the license viewer, click on:

Le licence viewer is presented below.

Continued on next page

USER GUIDE PAGE 29


Supervisor Flux

The possible The license is composed by several applications; the license viewer gives the
states state of each application. The possible states are:

• means that the application is included in the licence file and is valid,
so available..

• means that the application is included in the licence file but not valid,
so not available.

• means that the application is not included in the licence file so not
available.

Open the To open the license manager :


license manager • Start from the license viewer, click on the button Start License Manager
The license manager is presented below.

Reading advice The user will find detailed information about license manager in the
“Installation guide”.

PAGE 30 USER GUIDE


Flux Supervisor

2.6. User guide

Access to the To access to the user guide:


user guide
• Click on icon and on :
• Help 2D 3D Skew (Html documentation)
• Help PEEC (Html documentation)

Note: In version Flux 2018, the module PEEC (Legacy InCa3D) has been
integrated in Flux, but the corresponding user guide has not been merged with
the main Flux user Guide. So it exist 2 accesses for each user guides. The
merge will be done with the next version.

Flux Help When the user guide is opened, click on hyperlink to overrun the document.

USER GUIDE PAGE 31


Supervisor Flux

PAGE 32 USER GUIDE


Flux Environment and graphic representation

3. Environment and graphic representation

Introduction This chapter presents:


• working environment: description and role of zones in Flux window
• representations of devices in the graphic zone (graphic views)

Contents This chapter contains the following topics:


• Working environment: role of different zones
• Graphic representation: a graphic view

Reading advice All aspects related to the data organization, manipulation and display are
treated in the chapter “General operation: data management”.

USER GUIDE PAGE 33


Environment and graphic representation Flux

PAGE 34 USER GUIDE


Flux Environment and graphic representation

3.1. Working environment: role of different zones

Introduction This section concerns the working environment i.e.:


• the description and role of zones presented in the Flux window
• customization possibilities proposed to the user

Contents This section contains the following topics:


• Presentation of working environment
• Modifying the environment
• Improvement of the display of error messages

USER GUIDE PAGE 35


Environment and graphic representation Flux

3.1.1. Presentation of working environment

Flux window The general Flux window consists of several zones. These zones are
identified in the figure below.

Configuration Flux desktop is automatically configured depending on:


of the window • dimension of the application (2D or 3D)
• the physical application defined (no physics defined, magnetostatics,
electrostatics…)
• the context: Geometry / Mesh / Physics / Solver / Post-processing (toolbars)
• or sub context (healing context for the CAD geometry…)

Continued on next page

PAGE 36 USER GUIDE


Flux Environment and graphic representation

Role of zones The zones and their principal roles are briefly described below:

Element Function
Title bar General information:
• Software name, version number
• Application (Magneto Static 3D)
• Project name (CASE1.FLU)
Menus bar Access to the different menus:
• Project, Application, Geometry,
Mesh, Physics
• Parameter/Quantity, Solving
process, Post-processing
• Display, View, Select, Tools,
Extensions, Help
Context icons Access to the toolbars corresponding
to the contexts:
• Geometry, Mesh, Physics, Solving
process, Post-processing

Element Function
Menus Toolbars
Project Commands of the Project menu:
• New, Open a project
• Execute a command file, Save,
Close, Exit
Tools Commands of the Tools menu:
Undo, Close all open dialog boxes

Element Function
Contexts toolbars:
Geometry context Commands of the Geometry context:
• Enter on Sketcher context (2D and
Skew) r the Modeler context (3D)
to create the geometry
• Create geometric entities
• Propagate / Extrude
• Build faces / volumes
• Measure
• Check of the geometry, Healing
context of CAD geometry

Continued on next page

USER GUIDE PAGE 37


Environment and graphic representation Flux

Element Function
Contexts toolbars:
Mesh context Commands of the Mesh context:
• Create mesh entities
• Mesh domain, lines / faces / volumes,
Generate 2nd order elements
• Delete the mesh
• Assign mesh information
• Structure the mesh
• Check the mesh
Physics context Commands of Physics context:
• Create physical entities
• Create I/O parameters / spatial
quantities
• Import materials, Orient a material,
Assign regions, Import a circuit
• Check physics
Solving process context Commands of Solving process context:
• Create a scenario,
Solving process options
• Check the project
• Solve a scenario,
Continue the solving process
• Delete results
Post-processing context* Commands of Post-processing context:
• Create post-processing entities
• Curves
• Isovalues
• Arrows
• Compute quantities on points /
predefined quantities
• Evaluate sensors

* only for a solved problem

Continued on next page

PAGE 38 USER GUIDE


Flux Environment and graphic representation

Element Function
Menus Toolbars (in the graphic zone):
View Commands of the View menu:
• Refresh view, Zoom all, Zoom region
• Standard view 1, Standard view 2, X plane
view, Y plane view, Z plane view,
Opposite view, Four-view mode
• View direction,
Save / Restore graphics properties
Display Commands of the Display menu:
• Display geometric entities
• Display point numbers / line numbers
• Display mesh entities
• Display physical entities
• Display post-processing entities
Selection Commands of the Select menu:
• No selection, Free selection
• Select geometric entities
• Select physical entities
• Select solving process entities

Continued on next page

USER GUIDE PAGE 39


Environment and graphic representation Flux

Element Function
Data tree Entities tree of the Flux project

Graphic Geometric representation of the


studied device and graphic results
(isovalues, curves, arrows…)

Information concerning different


Output current actions (project evolution):
• restoring of data during a project
opening,
• comments about the current actions,
• advance of computation during the
solving process, …
PyFlux Command Access to the new python editor and
the memory of actions achieved in the
project

PAGE 40 USER GUIDE


Flux Environment and graphic representation

3.1.2. Modifying the environment

Introduction It is possible to modify the look of the Flux window on the screen, i.e.:
• modify the background color
• display / hide certain zones
• resize (reduce / enlarge) zones

Modify the To modify the background color (reverse video):


background • in the View menu, click on Reverse video
color

Display / hide To display / hide zones:


zones • Use the icons located on the right of the “Title” bar of the window.

Minimize a To minimize (or hide) a window :


window • click on
or
• double click on the blue barre
This button is transformed in and the other windows are automatically
resized

In this example to display only the graphic view, the user must minimize :
• the pyFlux command window
• the Output window

Continued on next page

USER GUIDE PAGE 41


Environment and graphic representation Flux

Resize a To Resize a minimized window :


minimized • click on
window or
• double click on the blue barre
This button is transformed in and the other windows are automatically
resized

In this example to display the three window, the user must resized the minimized windows :
• the pyFlux command window
• the Output window

Maximize a To maximize a window :


window • click on
This button is transformed in and the other windows are automatically
minimized.

In this example to display only the graphic view in the full screen, the user must click on

Continued on next page

PAGE 42 USER GUIDE


Flux Environment and graphic representation

Reduce a To reduce a maximized window :


maximized • click on
window
This button is transformed in and the other windows are automatically
resized.

In this example to display the three window, the user must reduce the maximized graphic view
window.

Resize a view To resize (reduce / enlarge) the zone:


(with the • click on the side of concerned zone when the resizing handle (  ) appears
mouse) (with the left button of the mouse)
• move the side of the concerned zone in the new position (keep the left
button pressed).

Resizing
handle

USER GUIDE PAGE 43


Environment and graphic representation Flux

3.1.3. Improvement of the display of error messages

Error message An error messages is composed by:


• User message (if the case is managed in the code)
• Technical information, in particular, to guide the developer in the code to
locate the reason for the message

Separation of The dialog box returning the error message is composed by:
user / tech info • A Message tab containing the user message part.
message • A Advanced tab containing the technical info.

If the configuration is not managed in the code, in this case there will be no
user error message but only a generic message "Failed execution"

Example of an error message non-managed (so any user message)


“Message” tab “Advanced” tab

The output In the output window, the same filter was applied. The technical information
window is no longer displayed to note pollute this window intended to inform the user.
Warning messages now appear in orange and are also stacked (see next
block).

PAGE 44 USER GUIDE


Flux Environment and graphic representation

Warning The warnings are stored and accessible via the icon (bottom right):
management

By clicking on the icon, the warning list


is unstacked.

Each warning is:


• editable by clicking on it
• can be deleted by clicking on

By editing the warning, a dialog box is


opened with the user message.

The tab « Advanced » contains techniclal


informations of the warning which allows
givining necessary indications for the
developer ,and the support team..

Flux3D.log and All operations done in Flux give a result. These results visible in the output
Flux3D.report window are saved in the Flux3D.log file.
files The full details (the contents of the Flux3D.log + the information contained in
the "advanced" tabs of the error / warning messages) are present in the
Flux3D.report file

Best practice:
Usually, the Flux3D.log file is sent to the Support team when the user encounters a
problem. We advice you to send the Flux3D.report to give all details.

USER GUIDE PAGE 45


Environment and graphic representation Flux

PAGE 46 USER GUIDE


Flux Environment and graphic representation

3.2. Graphic representation: a graphic view

Introduction This section concerns the graphic representation of the modeled device.
When referring to the graphic representation of a device, we are interested:
• on one hand, in the different entities and their appearance: points and their
visibility, lines and their color, faces, surface elements….
• on the other hand, in the type of displayed view: side view, top view,
bottom view, global view, … in its position and dimensions in the graphic
display zone.
The first aspect of the graphic representation (called visualization of entities)
is treated in chapter “General operation: data management”.
The second aspect (called graphic view) is treated in this chapter.
This section presents the following:
• concepts of graphic view
• possibilities to modify the view (displacement, rotation, zoom, etc.)
• presentation of predefined views (standard view, base plane views, opposite
view, etc.)

Contents This section contains the following topics:


• Concepts of view
• Modifying the view
• Predefined views (3D specificity)
• Four views

USER GUIDE PAGE 47


Environment and graphic representation Flux

3.2.1. Concepts of view

The graphic The graphic zone is a zone where a graphic representation of the modeled
zone device is displayed.

Scale of
transparency

The coordinate system displayed in the left bottom of the zone gives the principal
axes direction to orient the figure.

Concept of view The 2D or 3D view of a device in the graphic zone is called graphic view.

View The graphic view of the device can be displayed with more or less clear faces
transparency and volumes. This functionality controls the level of transparency of faces
and volumes. It gives the possibility to visualize the inside of the device
geometry, without setting faces and volumes invisible.

Scale of The transparency level of faces and volumes can be set using a scale of
transparency transparency located on the right bottom of the graphic zone.

Transparent Opaque

Scale of transparency Graphic view of device


minimal value (T) transparent faces and volumes
maximal value (0) opaque faces and volumes
intermediate value (by default) more or less clear faces and volumes

PAGE 48 USER GUIDE


Flux Environment and graphic representation

3.2.2. Modifying the view

Options It is possible to:


• move a view (translation)
• resize a view (enlarge / reduce)
• rotate a view (3D only)

How to modify The modifications can be made:


a view • using the mouse
• using commands from the View menu (or the corresponding icons)
• using keyboard shortcuts

Move a view To move a view (translate) in the graphic zone (cursor ):


(with the • click on the view in the graphic zone with the right button of the mouse
mouse)
• drag the view at the new location keeping the right button pressed

Move a view To move a view (translate) in the graphic zone:


(with keyboard • click on the graphic zone with the left button of the mouse
shortcuts) • move the view in the required direction by clicking the arrow key
(← ↑ → ↓)

Resize a view To resize a view (i.e. reduce / enlarge the device):


(with the • click on the graphic zone with the left button of the mouse
mouse) • reduce / enlarge the view with the mouse wheel

Resize a view To resize a view (i.e. reduce / enlarge the device):


(with keyboard • click on the graphic zone with the left button of the mouse
shortcuts) • reduce the view by clicking the ‘ – ‘ key or enlarge the view by clicking the
‘+ ‘ key

Continued on next page

USER GUIDE PAGE 49


Environment and graphic representation Flux

Rotate a view: To rotate a view of the 3D device:


3D only (with • click on the view with the left button of the mouse
the mouse) • rotate the view in the new position keeping the left button pressed
Flux 3D provides three modes for rotating geometries, described in the table
below. The user can see the active mode thanks different cursors.

Mode Mode activation Cursor


planar rotation about the Left button of the mouse and mouse
center of the view. far away from the view center
3D rotation about the center Left button of the mouse and mouse
of the object close to the view center
3D rotation about the point Left button of the mouse and Shift
defined by mouse cursor button pushed

Rotate a view: To rotate a view of the 3D device about an axis:


3D only (with • click on the graphic zone with the left button of the mouse
keyboard • rotate the view about the required axis in counter-clockwise or clockwise
shortcuts)
direction by clicking the keys presented in the table below.

Mode View Keyboard shortcut


Rotation about the Inser / Suppr
horizontal axis in the
graphic zone

Rotation about the vertical / Fin


axis in the graphic zone

Rotation about the /


perpendicular axis to the
graphic zone

Continued on next page

PAGE 50 USER GUIDE


Flux Environment and graphic representation

Change the To change the view direction:


view direction:
3D only Step Action
1 In the View menu:
• click on View direction …
or on the icon
2 In the View direction box:
• enter the values:
• x, y and z corresponding to the camera position
• x, y and z corresponding to the target point position
• rotation angle
• zoom scale

Resize a view To resize (enlarge / reduce) a zone:


(with • click on one of the commands in the View menu
commands) (or on the corresponding icon)
The available commands and their corresponding icons are presented in the
table below.

Command Icon
Zoom all Total view
Zoom in - Enlarge the view
Zoom out - Reduce the view
This option enables the user to set with the
Zoom region
mouse the rectangular zone to enlarge.

USER GUIDE PAGE 51


Environment and graphic representation Flux

3.2.3. Predefined views (3D specificity)

Options It is possible to choose one (more) view(s) from a list of predefined views:
• standard view 1 and 2
• views on the reference planes X, Y, Z
• opposite view

Standard views The standard views 1 and 2 are presented in the figures below.

Standard view 1 Standard view 2

Views on the The views on the reference planes X, Y, Z are presented in the figures below.
reference
planes

X plane view Z plane view

Y plane view

Continued on next page

PAGE 52 USER GUIDE


Flux Environment and graphic representation

Opposite view The opposite view is presented in the figure below

Standard view 1 Opposite view

Choose a view To choose a predefined view:


(with • click on one of the commands in the View menu
commands) (or on the corresponding icon).
The commands for predefined views and their corresponding icons are
presented in the table below.

Command Icon
Standard view 1
Standard view 2
Opposite view

X plane view
Y plane view
Z plane view

Choose a view To choose a predefined view:


(with keyboard • click on the graphic zone with the left button of the mouse
shortcuts)
choose the view by clicking the corresponding keyboard shortcut presented in
the table below.

Command Keyboard shortcut


Standard view 1 F1
Standard view 2 F2
Opposite view -
X plane view F4
Y plane view F5
Z plane view F3

USER GUIDE PAGE 53


Environment and graphic representation Flux

3.2.4. Four views

Options The views on the reference planes X, Y, Z and also the standard view 1 can
be displayed in four independent windows. Only one window is active
(surrounded by a border of different color).
You can also display two windows from the four proposed.

Swap one view / To swap one-view mode to four-view mode / four-view mode to one-view
four views mode:
• click on Four-view mode in the View menu
or on the icon .

Change the To change the number of views:


number of • use the arrows located on the sides of zones
views

PAGE 54 USER GUIDE


Flux Flux project and Flux object management

4. Flux project and Flux object management

Introduction This chapter presents:


• the concept of Flux project and the commands of Project menu (New,
Open, Save, Close)
• the concept of Flux object and the commands for object importation
(Importation of Flux object)

Contents This chapter contains the following topics:


• Flux project
• Flux object
• Binary / Formatted save

USER GUIDE PAGE 55


Flux project and Flux object management Flux

PAGE 56 USER GUIDE


Flux Flux project and Flux object management

4.1. Flux project

Introduction The user will find in this section the definition of a Flux project, and the
description of commands of project management (New, Open, Save, Close).

Contents This section contains the following topics:


• Flux project and Flux object management
• Creation, opening and storage of projects

USER GUIDE PAGE 57


Flux project and Flux object management Flux

4.1.1. Flux project: definition, type of data storage

Flux project: A Flux project is the data ensemble corresponding to a Flux study.
definition

Storage type From the storage point of view, a Flux project consists in:
• a repertory, which includes the project name completed by the suffix
“.FLU".
• a files ensemble, whose names are fixed and whose content is explained in
the table below.

File name File content


PROBLEM_FLU.PFL general description of the problem
GEOM_FLU.PFL visualization modes of the geometry
MESH_FLU.PFL nodes of the mesh

Solved files For a FLUX study, the repertory corresponding to the project contains also a
file(s) that contains the result(s).

File name File content


SOLVE_FLU.EFL results of a static application
or or
SOLVE_FLU_i.EFL results of a transient or a parameterized application
The index i gives the information about the value of the time step or of the
parameter.

PAGE 58 USER GUIDE


Flux Flux project and Flux object management

4.1.2. Creation, opening and storage of projects

Project Menu Creating, opening and saving projects are carried out by usual commands for
file management. These commands are available by Project menu or by
Project toolbar.
The operation of these commands is briefly pointed out below.

Project Menu Project Toolbar

Create a new To create a new project:


project • click on New from the Project menu
or on the icon from the Project toolbar.

Result: Flux recovers a lot of information from the database model, in order to build
the proper database of the new project. The new project is temporarily named
ANONYMOUS.

Open an To open an existent project, proceed as follows:


existent project • click on Open project … from the Project menu
or on the icon from the Project toolbar.
• select the existing project (file) from the Open dialog box.

Result: When a project built with an old version is opening, Flux performs the update
of the database.

Continued on next page

USER GUIDE PAGE 59


Flux project and Flux object management Flux

Save as a To save as a project in progress:


project • click on Save as … from the Project menu.
• enter the project name in the Save dialog box

Save a project To save a project in progress:


in progress • click on Save from the Project menu
or on the icon from the Project toolbar

Close a project To close a project:


• click on Close from the Project menu
or on the icon from the Project toolbar.

Result: When a project is closing, storage of project will be automatically proposed


to the user if the project has been modified.

PAGE 60 USER GUIDE


Flux Flux project and Flux object management

4.2. Flux object

Introduction The user will find in this section the definition of a Flux object, the operation
modes of Flux objects and the use of the importation object command.

Contents This section contains the following topics:


• Flux object: user guide
• Importation of Flux objects

USER GUIDE PAGE 61


Flux project and Flux object management Flux

4.2.1. Flux object: user guide

Overview Before begin the description of a device, it is possible to appear the following
question:
Portions of this device can be used for the modeling of others devices?

Basic idea If the answer is yes, the geometric building of a device can be considered as a
structure in lego.
Then, the general principle of construction is as follows:
• Description of different pieces of the structure in the independent Flux
projects (base lego or Flux objects).
• Construction of the complete device in a new Flux project, by means of
already built bricks (Flux objects).

Example Geometric construction of a motor performed importing stator and rotor parts
already build.

Rotor object: rotor geometry Stator object: stator geometry


(ROTOR.FLU project) (STATOR.FLU project)

New object:
motor geometry
(MOTOR.FLU project)

Main interest: This type of construction presents certain constraints, but also offers the
bank of objects possibility to realize a bank of objects that can be used for different studies.

PAGE 62 USER GUIDE


Flux Flux project and Flux object management

4.2.2. Importation of Flux objects

Principle By importation of Flux objects we understand incorporating a Flux object in


the project in progress (new or existent project).
This operation can be realized in different modes. The user has the possibility
to import the entirely Flux object (all the entities) or to use the filters
(selection of entities).

Import an To import an object, proceed as follows:


object

Step Action
1 From the Project menu:
• point on Import and click on Import Flux object
2 In the Import Flux object box:
• choose the file name to import
• choose the filter

USER GUIDE PAGE 63


Flux project and Flux object management Flux

PAGE 64 USER GUIDE


Flux Flux project and Flux object management

4.3. Binary / Formatted save

The user can save his files in formatted mode or binary mode. The advantages
of the binary save are:
Introduction • Use less memory
• Use less storage space
• Speed up the opening of projects (reading faster Binary files)

From the 12.2 version, projects are saved in binary mode by default.

Binary save To write files in binary mode, please follow these steps:

Step Action
1
Click on
2 Click on [Debug] and not tick the case [Write files in formatted mode]:

3 Click on OK
4 Open a project (or click on Start a new project) and save it.
 The project .FLU is saved in binary mode

Here is an example:

Continued on next page

USER GUIDE PAGE 65


Flux project and Flux object management Flux

Formatted save To write files in formatted mode, please follow these steps:

Step Action
1
Click on
2 Click on [Debug] and tick the case [Write in formatted mode]:

3 Click on OK
4 Open a project (or click on Start a new project) and save it.
 The project .FLU is saved in formatted mode

Here is an example:

PAGE 66 USER GUIDE


Flux General operation: data management

5. General operation: data management

Introduction A finite element project contains a great volume of data, diverse and
interrelated.
In terms of Flux software, these data (points, lines, …) are called entities and
depend on project context (geometry, mesh, …).
This chapter presents the mode of general operations of Flux software
(independent of context), i.e.:
• the general organization of data (Flux database)
• the data presentation (dialog boxes)
• management of the entities
(handling, information, export and selection of entities)
• the tools of graphic entities visualization
(display and appearance of graphic entities in the graphic zone)

Contents This chapter contains the following topics:


• Data organization: Flux database
• Data presentation: dialog boxes
• Entity Management
• Visualization of entities

Reading advice This chapter presents the mode of general operation of Flux software
(independently of context). For specific detail of geometry, mesh, physics,
solver and post-processing modules refer to the corresponding chapters.

32USER GUIDE PAGE 67


General operation: data management Flux

PAGE 68 USER GUIDE


Flux General operation: data management

5.1. Data organization: Flux database

Introduction This section presents the general information on data structure in the Flux
database.

Contents This section contains the following topics:


• Concept of “data” and “data structure”

32USER GUIDE PAGE 69


General operation: data management Flux

5.1.1. Concept of “data” and “data structure”

Introduction A finite elements project contains a great quantity of information, i.e. a


significant volume of data. These data are saved in a database, managed by
specific tools.

Data and data The Flux database makes a logical distinction between data structure (or
structure data type) and data themselves (see blocks below).

Definitions The principal terms, used in this document to make a distinction between
data and data structure, are presented in the table below.

Term Definition
Entity-type an entity-type is a logical data structure defined by a name
and a certain number of fields (attributes, relations, cases)
Entity an entity is an object corresponding to an entity-type
characterized by an identifier (number/name) and fields
(attributes, relations, case)
Caution on the vocabulary: the terms “entity” and “occurrence of entity” can be also
used instead of “entity-type” and “entity”.

Example For points:


• the entity-type Point is a data structure of the database, that contains:
- an identifier (a number)
- cases: parameterized or propagated point
- attributes: color, visibility
- …
• the entities (Point[1], Point[2], …) are the objects (data) of Flux project

In practice From a practical point of view:


• during the creation of a new project the file (F3D_STR.SBD), which
describes the data structure, is read by the program
• during the project saving the data structures and the data of the project are
stored in the project directory (*.FLU).

Software A new software version often corresponds to a development of the data


version / structures.
compatibility
The logical distinction between data structure and data makes it possible to
ensure compatibility between an old Flux project and the more recent Flux
version: during the old project opening, with a new software version the
database is automatically updated.

PAGE 70 USER GUIDE


Flux General operation: data management

5.2. Data presentation: dialog boxes

Introduction This section treats the data and the data presentation, i.e. dialog boxes:
specialized box and data array.

Contents This section contains the following topics:


• Project data (entities)
• Dialog boxes: specialized box
• Dialog boxes: data array

32USER GUIDE PAGE 71


General operation: data management Flux

5.2.1. Project data (entities)

What are the The handled data (entities) depend on the phase of the finite elements project
handled data? description: geometry, mesh, physics.
They are listed in the data tree (figure below) and are detailed in the different
corresponding chapters: Geometry / Mesh / Physics / Solver / Post-
processing.

Continued on next page

PAGE 72 USER GUIDE


Flux General operation: data management

Classification It is possible to distinguish two families of entities (graphic / non-graphic), as


presented in the table below.

Entity-type Identifier Entity (examples)


Point, Number Point[1], Point[2]
graphic
Line, … allocated by the software Line[25], Line[26], …
non Coordinate system, Name [CoordSys_1]
graphic Transformation, … given by the user [RotZ_90], …

32USER GUIDE PAGE 73


General operation: data management Flux

5.2.2. Dialog boxes: specialized box

How are the The interaction with the database is done using specific dialog boxes:
data? specialized box, data array.
This paragraph presents an example of specialized box.

Specialized box In this box the user can enter/check/modify information relating to the data.
A specialized box is presented in the figure below.
Entity-type:
Coordinate system Entity:
[CORE]
Title
bar Name
Tag: Comment
Definition
Type (1)

Type (2)

Characteristics

Buttons
bar
The required fields (necessary and sufficient for the definition of the entity) are
marked by an asterisk *.

General tools The general tools - available to carry out the data entry - are presented in the
table below.
Button Function
allow the direct access to the non-filled required fields
OK validate information and close the dialog box
Apply validate information without closing the dialog box
Cancel close the dialog box
access to the online help concerning the entity

Specific tools The user can create a missing entity using the button in a specialized box.

PAGE 74 USER GUIDE


Flux General operation: data management

5.2.3. Dialog boxes: data array

How are the The interaction with the database is done using dialog boxes: specialized box,
data? data array.
This paragraph presents an example of data array.

Data array In a data array, the user can:


• quickly check information relating to all data
• easily carry out a "grouped" modification
(ex: to assign the same color to all regions, …)
A data array is presented in the figure below.

Entity-type :
Coord. Syst. Entities :
[CORE], [MAIN]
Title
bar
Name
Comment
Structure
(Database) Type (2)

Characteristics

Type (1)

Buttons
bar
de boutons
Information Information Information
relating to the relating to the relating to the
group of entities entity [CORE] entity [MAIN]

The boxes clear gray are active boxes (data entry fields).
The boxes dark gray are inactive boxes (general information).

General tools The general tools - available to carry out the data entry - are presented in the
table below (idem specialized box).
Button Function
allow the direct access to the non-filled required fields
OK validate information and close the dialog box
Apply validate information without closing the dialog box
Cancel close the dialog box
access to the online help concerning the entity

Continued on next page

32USER GUIDE PAGE 75


General operation: data management Flux

Specific tools The specific tools, available in a data array are presented in the table below.

Box in the … Function


Entities to open a specialized box
line Ex : by double-click on [CORE] in the Entities line, the user
opens the specialized box corresponding to this entity.
Modify all to carry out a "grouped" modification:
column modification in only one step of all values on the same line
Ex : by click on Initial values in the SubTypes line, the user
can modify the coordinate system type of all coordinate
systems in the array: [CORE] and [MAIN].

PAGE 76 USER GUIDE


Flux General operation: data management

5.3. Entity Management

Introduction Building a Flux project consists of the application and manipulation of


entities.
This section describes the manipulation of entities (creation, selection,
editing/modification, deletion, information and export)

Contents This section contains the following topics:


• Manipulation of the entities: Creating, Editing, …
• Information on the entities: Display PyFlux , List and Entity used by
• Export of entities
• Entity selection: circumstances and selection modes
• Entities selection: selection filter
• Entities selection: selection by criterion

32USER GUIDE PAGE 77


General operation: data management Flux

5.3.1. Manipulation of the entities: Creating, Editing, …

Introduction This paragraph presents the commands for manipulation of the entities:
New / Edit / Edit array / Delete / Force delete.

Commands of The basic procedures required to manipulate the entities are the operations of
data creating, editing/modification and deletion of data.
manipulation
These operations are carried out by means of the commands presented in the
table below.

Operation Command Function


creation New Creation of a new entity
Editing/modification of one* entity in a
Edit
editing/ Specialized box
modification Edit Editing /modification of an array of entities in
array a Data Table
Deletion of an entity if it is independent (no
Delete
associated entities)
deletion
Force Deletion of an entity and of all the entities
deletion associated to it

*it is equally possible to edit several entities in a specialized box (only


common characteristics are edited)

Modes of To build the Flux project, the user must create the entities corresponding to
creating the project data.
Giving consideration to a chronological order of entity creation generally
facilitates the description process: points before lines, materials before
regions … Consequently, if some entities have been ‘forgotten’, it is
beneficial to have the option of creating them a posteriori.
Therefore, there are two modes of creation:
• the direct creation is the « standard » mode of creation (the most natural)
• the indirect creation is a mode of creation a posteriori. This is carried out
in a specialized dialog box by means of a button that facilitates the
creation of a supporting entity.

Continued on next page

PAGE 78 USER GUIDE


Flux General operation: data management

Modes of To check the data, the user must edit (and modify if necessary) the entities
editing that he has created.
There are two modes of editing:
• editing in a Specialized box (generally), used to modify the characteristics
of one* entity
• editing in a Table of data is used (in general) in order to verify the
characteristics of an array of entities
* it is equally possible to edit several entities in a specialized box (then only
the common characteristics are edited)

Modes of The user may have to delete entities. He can easily destroy an independent
deletion entity. It is often the case that the entity is related to other entities. The
deletion of the original entity can result in the deletion of all related entities.
Therefore, there are two destruction modes:
• the simple deletion:
is carried out on independent entities (not related to other entities)
• the force deletion :
is carried out on an entity and on all other related entities.
These two modes are described in the table below:

Mode Destructible entity What is deleted


simple independent selected entity
forced any type selected entity + connected entities

Function It is necessary to make a distinction between two function processes that


Processes differ for two distinct commands. The command Create does not require the
selection of entities, while the commands (Edit/Edit array and Delete/Force
delete) require the selection of entities.
The two function types are presented below and details are provided in the
sections to follow:
• the command Create does not require selection:
simply the activation of the (1) command
• the other commands require selection of the entities
(Edit/Edit array and Delete/Force delete) :
the user can choose:
- either: to select the entities and then activate the command (2)
- or: to activate the command and then select the entities (2’)
These two function types are presented in the sections to follow.
The selection and selection filtering is treated in the following paragraph.

Continued on next page

32USER GUIDE PAGE 79


General operation: data management Flux

Access to the For the command Create, which does not require selection of entities, the
Create access to the command can be carried out:
command • from the menu bar (1)
• from the tool bar (2)
• from the data tree* (3)
The command activations options are presented in the figure below.

* The creation of graphic entities can also be carried out from the graphic
zone. The corresponding selection filter must be activated previous to the
creation command (see § « Entities selection: selection filter »).

Continued on next page

PAGE 80 USER GUIDE


Flux General operation: data management

Access to other For the commands Edit/Edit array and Delete/Force delete, which require
commands selection of entities, the access to the command can be carried out:
• from the menu bar (1) :
- activation of the command then selection via a drop down menu (1)
• from the data tree * (2 et 2’) :
- activation of the command then selection via a drop down menu(2)
- direct selection then activation of the command (2’)
The command activation options are presented in the figure below .

Selection
via
1 a drop down
menu

2 Selection
via
a drop down
menu

2’

* The editing can equally be carried out from the graphic zone for the graphic
entities. The corresponding selection filter must be activated preceding the
edit (see §Entities selection: selection filter).

32USER GUIDE PAGE 81


General operation: data management Flux

5.3.2. Information on the entities: Display PyFlux , List and Entity


used by

Introduction This paragraph presents the different commands that equip the user to display
information regarding the entities: Displaying the PyFlux expression, Listing
and Using by.

Role of The role of each of the information commands of an entity is described


information below.
commands

Command Function/Use
Display PyFlux This command permits the display of the Pyflux
command expression associated with an entity.
The user can recover it to use in a python sequence.
List This command permits the list of the contents of an
entity type to be displayed.
This command is accessible only starting from the
contextual menu of an entity type.
Entity used by This command permits the user to know all the entities
related to an entity

Access to entity The information commands are accessible starting from the contextual menu
information of each entity or entity-type.
commands

PAGE 82 USER GUIDE


Flux General operation: data management

5.3.3. Export of entities

Introduction This paragraph presents different formats for the export of entities.

Interest The export permits the user to extract information related to an entity. This
information is an image of the contents of the database.
Once exported the information may be used outside the FLUX software.

Export The export formats and their applications are presented in the table below:
formats

Format Applications
Export XML
Programming
Export python
Export TXT
Presentation, storage, information,
Export Excel
administration of results
Export Clipboard

Example The results for the export of a point, under two different formats, are
presented in the table below:

Export Python Export TXT


PointCoordinates(color=Color['White'], 02/03/09 17:05:24
visibility=Visibility['VISIBLE'],
coordSys=CoordSys['CENTER'],
uvw=['-60', PointCoordinates (1)
'0', color = Color (White)
'0'], visibility = VISIBLE (VISIBLE)
nature=Nature['STANDARD'], coordSys = CoordSysCartesian
mesh=MeshPoint['E_SHAPE']) (CENTER)
uvw =-60 0 0
globalCoordinates =
-0.06
0.0
-0.05
nature = Nature (STANDARD)
inAirPointFaceLocation =None
inAirPointVolumeLocation =None
region =None
mesh = MeshPoint (E_SHAPE)
domain = DomainType3D (DOMAIN1)
ETAT =0
surface =None

Continued on next page

32USER GUIDE PAGE 83


General operation: data management Flux

Writing mode In the dialog box corresponding to the export of an entity the user can choose
between different modes of writing in a file:

Export to
Writing mode
an existent file a new file
Adding values The values are added
(by default) following the contents
The values are added
The file contents is
Replacing file
replaced

Access to The export commands are accessible from the contextual menu of each entity
export or entity-type.
commands Starting from the contextual menu of an entity type, the user must choose the
entity which he wants to export by means of a dialog box.

Continued on next page

PAGE 84 USER GUIDE


Flux General operation: data management

Exporting one In order to export an entity:


entity

Step Action
1 In the data tree, select the entity to be exported and activate the
command Export format XXX in the contextual menu
 A dialog box is open.
2 In the box Export format XXX
• Choose the path and the file name for the export
3 Choose one of the following actions:
• If the file is existent:
pass to step 4
• If not:
pass to step 5
4 Choose the writing mode: add value or replace file
5 Validate the export
• Click on OK
 The export has been carried out to the specified file.

32USER GUIDE PAGE 85


General operation: data management Flux

5.3.4. Entity selection: circumstances and selection modes

Introduction The most part of actions for handling the entities require the selection of
entities.
Indeed:
• to modify the coordinates of a point, you should select the corresponding
point
• to add a line (segment), you should define extremity points and then select
starting point and ending point
•…
The different selection circumstances and selection modes are presented in
this paragraph.

Selection Selection of entities can be done before or after the activation of a command;
circumstances: it can also be done, during an operation of creation.
overview
These selection scenarios are presented through examples in the table below.

Selection before activation of a command


… Activation of a command:
• Edit
• Edit array
Graphic selection
(with the mouse) • Delete
• Force delete

Selection after activation of a command (via selection box)

Activation of a command: Selection by name


• Edit (choice in the list box)
or by other mode
• Edit array
• Delete
• Force delete

Selection during an operation of creation

Activation of a command:
• New
Selection by number
(choice in the list)
or by other mode

Continued on next page

PAGE 86 USER GUIDE


Flux General operation: data management

Selection Selection of entities could be done with the following different selection
modes: modes:
overview
• graphic selection (directly with the mouse)
- in the data tree for all entities
- in the graphic area for graphic entities
• identifier selection (by name / by number)
• advanced selection* (by criterion / by …choice)

* the advanced selection is detailed in § “Entities selection: selection by criterion”.

Summary The different selection modes proposed function of selection circumstances


are gathered in the table below.

Selection circumstances … Selection modes


Selection before
- graphic
activation of a command
graphic
Selection after Selection
by identifier (name/number)
activation of a command box
by criterion
Selection during Specialized graphic
an operation of creation box by identifier (name/number)

32USER GUIDE PAGE 87


General operation: data management Flux

5.3.5. Entities selection: selection filter

Selection filter: During the selection of entities, only one entity-type is identified as being
definition selectable:
• it is possible
to select the points 1 and 2
or to select the lines 4 and 5
• it is not possible
to select the points 1 and the line 5
A selection filter makes it consistently possible to identify the selectable
entity-type.

Selection filter: How the selection filter is actualized?


actualization
For all the entities (graphic and non graphic), the selection filter is brought up
to date with the operations of selection. i.e.:
• with the choice of an entity-type in the data tree
• with the opening of a selection box
•…

For the graphic entities, the selection filter can be activated directly by the
user with the commands in the menu Selection or in the toolbar Selection.

Menu Selection The proposed choices in the menu Selection or in the toolbar Selection, relate
to the graphic entities; they are presented in the figure and the table below.

No Selection
selection Point / Line / Face / Volume

Free Selection
selection Face region / Volume region

Choice Description
No selection nothing selectable
all is selectable
Free selection The first entity which will be selected by the user will
determine the entity-type selectable
Select points the points are selectable
… …

PAGE 88 USER GUIDE


Flux General operation: data management

5.3.6. Entities selection: selection by criterion

Relation All the entities are connected one to another by relations.


between entities
• a volume is connected to the bordering faces
• a face is connected to the bordering lines
• a line is connected to the ending points, …
Thus, it is possible to select all the lines bordering a face by selecting this
face, or all faces bordering a volume by selecting this volume.
The user can also plan to select entities via common characteristics:
• lines with the same visibility, or with the same color, ...
• points carrying the same mesh point

Definition / use One speaks about selection by criterion when the selection is carried out by:
• the intermediary of the existing relations between the various entities
(points belonging to a line...)
• or the intermediary of characteristics common to several entities (faces
with the same color, faces on the same surface...)
•…

Operation The selection by criterion is available to the level of selection boxes and is
mode carried out in three phases as that is presented in the table below (and on the
example presented in the following block).

Stage Description
0 From a selection box …
1 The user :
• open the criteria list (with the button )
• and select a criterion to carry out his selection
 The specific selection box (with logical operators) is open
2 Then, he selects the entities which interested him
(He chooses one of the proposed selection modes:
graphic selection, by identifier or criterion)
3 And applies the selection operator to the group of entities

Continued on next page

32USER GUIDE PAGE 89


General operation: data management Flux

Example To select all the lines belonging to the face 23:

1a. Click on

1b. Click on
Selection by face

2. Enter the face number


following by the Enter key

3. Click on Union

The stages of selection and management of the entities can be overlapped and
reiterated.

Selection An outline of the selection criteria is presented in the tables below.


criteria
General criteria
The option … allows …
Select all selection of all entities
Clean selection deselection of all the entities previously selected
Select last instance selection of the last selected entity
Selection by selection of
coordinates the nearest entity to the entered coordinates

Specific criteria (implying the use of the operators)


The selection by … allows the selection of all the entities …
line / face / volume belonging to a line / face / volume
surface belonging to a surface (defined by a face)
linear / face / volume
belonging to a line / face / volume region
region
mechanical set belonging to a mechanical set

The selection by … allows the selection of all the entities …


color defined by a color (…)
visibility defined by a visibility (visible or invisible)
nature defined by a nature (standard, in air, no exist)
discretization characterized by a discretization (point or line)

Continued on next page

PAGE 90 USER GUIDE


Flux General operation: data management

Selection To manage the logical operations on the groups of the selected entities, the
operators user disposes the selection operators introduced in the table below.

Operator Function
Exclude to remove entities from the list
Union to add entities in the list
Intersect to carry out the intersection of two groups of selection

32USER GUIDE PAGE 91


General operation: data management Flux

PAGE 92 USER GUIDE


Flux General operation: data management

5.4. Visualization of entities

Introduction This section deals with the graphic representation of the modeled device.
When referring to the graphic representation of a device, we are interested:
• in the type of displayed view: side view, top view, bottom view, global
view, … in its position and dimensions in the graphic display zone
• in the different entities and their appearance: points and their visibility, lines
and their color, faces, surface elements….
The first aspect of the graphic representation (called graphic view) is treated
in chapter “Environment and graphic representation”
The second aspect of the graphic representation (called visualization of
entities) is treated in this chapter.

Contents This section contains the following topics:


• Display and appearance of entities
• Visualization of entities: displaying the entities and displaying filter
• Visualization of entities: graphic appearance
• Visualization of entities: saving and restoration of the graphic properties

32USER GUIDE PAGE 93


General operation: data management Flux

5.4.1. Display and appearance of entities

Introduction The graphic representation of different objects is not the same during the
different steps of building the numerical model of the device.
From a step to another, we are interested in one kind of representation, or
another:
• representation of points and lines during the geometry building
• representation of nodes and surface elements during the mesh building, ….

Examples

Possibilities to To control the graphic representation, Flux provides default settings, but the
modify the user has the option to modify this representation.
visualization
User options are:
• option one, use the display filters in order to decide what entity types he
wishes to see in the graphic zone: the assembly of points, or the points and
the lines, or only the faces, … (see §5.4.2 «Visualization of entities:
displaying the entities and displaying filter»)
• option two, modify, in a selective manner, the graphic appearance (namely
the visibility and/or colour) of certain entities (see § 5.4.3 Visualization of
entities: graphic appearance)

PAGE 94 USER GUIDE


Flux General operation: data management

5.4.2. Visualization of entities: displaying the entities and displaying


filter

Problem How to make the desired image of the device, in terms of displayed entities,
appear in the graphic zone on screen: the assembly of points, or the points and
the lines, or only the faces, …

Displaying
filter
The display filters categorize the entity types displayed in the graphic zone:
the points, or the points and the lines, or only the faces, …
The display filters are accessible by means of the Display menu (or the tools
bar Display)

Displaying The list of the display filters available in the Display menu are presented
menu below. The filters present the working context (geometry, meshing, physical,
exploitation).

Filters associated with


geometry

Filters associated with mesh

Filters associated with


physical regions

Filters associated with post-


processing supports

Filters associated with


computation results (isovalues,
arrows…) during post-
processing (only available in a
solved project)

32USER GUIDE PAGE 95


General operation: data management Flux

5.4.3. Visualization of entities: graphic appearance

Subject How to make appear the desired representation of the device in the graphic
window, in terms of graphic appearance of entities: visibility, color.

Appearance The possible appearances are presented in the table below:

Appearance Characteristics
color white, cyan, yellow, magenta, black, red, turquoise and green
visibility visible or invisible

Appearance in The entities in the graphic window are displayed according to their
the specialized appearance characteristics (visibility and color)
box
For each entity, the characteristics are saved in the Appearance tab of the
specialized box.

PAGE 96 USER GUIDE


Flux General operation: data management

5.4.4. Visualization of entities: saving and restoration of the graphic


properties

Introduction This function permits to the user to:


• save a configuration of the display filters activated/inactivated for a specific
time
• restore the configuration initially filed of the display filters
activated/inactivated at another time

Saving the In order to save the graphic properties:


graphic • Click on icon
properties

Restoring the In order to restore the graphic properties:


graphic • Click on icon
properties

Remark The function of saving and restoring of the graphic properties exclusively
takes into consideration the display filter.
Consequently, the position of the view and the zoom performed are not taken
into consideration by this function.

32USER GUIDE PAGE 97


General operation: data management Flux

PAGE 98 USER GUIDE


Flux PyFlux language, command files and macros

6. PyFlux language, command files and


macros

Introduction A specific programming language is provided by Flux, which enables the


automation of certain recurrent actions or the generation of new functions.
This language, named PyFlux, is a language based on the Python
programming language.
By means of this language, the user can:
• edit and execute command files (scripts)
• edit, load and execute macros

Contents This chapter contains the following topics:


• PyFlux and Python languages
• Command files
• Macros

USER GUIDE PAGE 99


PyFlux language, command files and macros Flux

PAGE 100 USER GUIDE


Flux PyFlux language, command files and macros

6.1. PyFlux and Python languages

Introduction PyFlux is a Flux specific language, which can be defined in the following
manner:
PyFlux =
Python programming language +
Flux command language
PyFlux is therefore an overload of Python to which Flux commands are
inserted.
This section refers to information covering the PyFlux and Python languages,
which should be reviewed before going over the various examples.

Contents This section contains the following topics:


• PyFlux language syntax
• Python language syntax
• PyFlux in interactive mode - Python editor
• How to find out the syntax of PyFlux expressions?
• How to Activate/inactivate the writing of graphic commands
• Other available PyFlux commands

USER GUIDE PAGE 101


PyFlux language, command files and macros Flux

6.1.1. PyFlux language syntax

PyFlux: what is PyFlux is a Flux specific language, which can be defined in the following
it? manner:
PyFlux =
Python programming language +
Flux command language
PyFlux is therefore an overload of Python into which Flux commands are
added.

PyFlux syntax The PyFlux syntax is based:


• on the syntax of the Python programming language (see § 6.1.2)
• on the Flux database structure (Flux entities and commands)

Flux entities PyFlux is an object-oriented programming language. There is a PyFlux type


and PyFlux (class) corresponding to each Flux type-entity. The Flux entities are PyFlux
objects objects (instances). The structure of the object is defined by fields called
attributes, which possess a set of methods. The methods form the object
interface.
A PyFlux type can have sub-types, which inherit the attributes and methods
from their parent type. The sub-types are distinguished from their parent type
by means of the supplementary attributes and methods.

Example: Point The structure of the Flux entity in the PyFlux language is presented in the
type example of the Point entity.

Type Point Name


color
visibility
mesh
nature Fields
region
globalCoordinates
computePosition
computePointDistance Methods
propagate

Sub-types PointInfiniteBox PointCoordinates PointPropagated

uvw point
coordSys transf

Continued on next page

PAGE 102 USER GUIDE


Flux PyFlux language, command files and macros

Flux entities / Some examples of the Flux type-entity and its corresponding PyFlux type are
PyFlux types presented in the table below.

Flux type-entity PyFlux type


Domain Type DomainType
Infinite Box InfiniteBox
Periodicity Periodicity
Symmetry Symmetry
Coordinate System CoordSys
Transformation Transf
Line Line
Point Region RegionPoint
Line Region RegionLine
Face Region RegionFace
Mesh Point MeshPoint
Mesh Line MeshLine
Mesh Generator MeshGenerator
… …

Other PyFlux The PyFlux types corresponding to the basic data types are presented in the
types table below.

Basic data type PyFlux type


Integer I04
Real R08
String C80

File File

USER GUIDE PAGE 103


PyFlux language, command files and macros Flux

6.1.2. Python language syntax

Python: what is “Python is a portable, dynamic, extensible, free language, which allows a
it? modular and object-oriented approach to programming. Python has been
developed since 1989 by Guido van Rossum and several voluntary
contributors” (Gerard Swinnen “Learn to program with Python”, pg. 6,
2005).
All the information about this language is accessible on the Python site:
http://www.python.org.
The Python language is interpreted in Flux by Jython.
Additional information about this interpreter is available on the Jython
website: http://www.jython.org.

File Python files have the record extension *.py.

General rules General rules:


• A line should contain only one instruction
• All the comments begin with the character # and continue until the end of
the line
• Names of variables must follow some simple rules:
• names should begin with a letter or a _, and may contain letters (accented
letters, cedillas, spaces, special characters are prohibited), numbers and
the character _
• the case is significant (upper and lower case letters are differentiated)
• Blocks are marked by indentation (in standard version, 4 spaces; do not
combine spaces and tabulations for indentation)

Variables and
types Declaration, assignment of variables:
• It is not necessary to declare the variables. A variable is created at its first
assignment by means of = operator
• The type of a variable is not explicitly declared and can change in time. The
type of a variable is the type of the value that is assigned to it.

Types of standard data:


• numerical types: integer, real, complex
312 3.13e10 0.1256 3.2+0.5j
• strings: between apostrophes or quotation mark
'hello' "followed by information"
• sequences: lists, sets, dictionaries
['a', 'b', 'c'] (1,2,3) ('a','b','c') {'jack' : 409, 'andy' : 860}

Continued on next page

PAGE 104 USER GUIDE


Flux PyFlux language, command files and macros

Tests The statement if is used to test a value


if test 1 :
# test 1 true
elif test 2 :
# test 2 true
else :
# default

Comparison The condition after the if statement can contain the following comparison
operators operators:

Element Function
x == y x is equal to y
x != y x is not equal to y
x>y x is greater than y
x<y x is less than y
x >= y x is greater than or equal to y
x <= y x is less than or equal to y

Loops There are two types of loop:


• for loop, to reiterate on the values of a sequence
for variable in sequence :
# loop block
• while loop, to reiterate as long as a condition is satisfied
while test :
# loop block

range() fonction The range() function turns out to be very useful to manage iterations in loops.
It generates a list of integers
>>> range(8)
[0, 1, 2, 3, 4, 5, 6, 7]

Functions A new function is defined using the keyword def.

Example :

The add() function , defined below, gives a sum of 2 numbers or concatenates


two strings.
def add (a,b) :
return a+b

Continued on next page

USER GUIDE PAGE 105


PyFlux language, command files and macros Flux

Error handling The Python language has built-in system for exception handling. The program
can contain various types of errors: syntax errors, semantic errors (of logic)
and errors of execution (exceptions). When an exception occurs, the program
execution is stopped and the exception is handled.
To handle syntax errors and exceptions, Python uses the following statement:
try :
# instructions to execute (to raise exceptions)
except exception_class :
# instructions to execute if the exception of the above class occurs
else :
# instructions to execute if there is no exception
finally :
# instructions to execute in all the cases
Python enables:
• to catch several types of exceptions in same treatment
• to raise the exceptions with the keyword raise

PAGE 106 USER GUIDE


Flux PyFlux language, command files and macros

6.1.3. PyFlux in interactive mode - Python editor

Introduction A programming language can be used:


• in interactive mode, directly in the Flux window (pyhon editor)
• in script mode, via command files
Operation in interactive mode is presented in this paragraph. Operation in
script mode is presented in section 6.2.

Different zones The Flux main window consists of several zones (graphic zone, data tree,
etc.). The principal zones are presented in § 3.1 “Working environment: role
of different zones”.
The zones concerning the use of PyFlux in interactive mode are the zones
presented in the figure below.

History zone

Command Python editor zone Echo zone


prompt zone

Zone Function
History Result of executed PyFlux commands
This area is composed by three parts:
PyFlux • Command prompt
Command • Python Editor
• Echo

Continued on next page

USER GUIDE PAGE 107


PyFlux language, command files and macros Flux

« Echo » zone This zone contains two log.py files is available (in read only):
• the “Flux[XX]_log.py” : all commands performed by the user during
a session are recorded in this file.*
• the “Project_PyFlux_log.py”: all commands performed by the user
during the beginning of the project up to the end of the project are
recorded in this file.

«Editor With python editor, user can read, write, run totally or only some selected
python » zone command of the python script.

Notes :
• It is possible to open several py script file (one tab by file)
• This zone allows displaying automatically the groovy file when the user use
subroutine in groovy language
• An editor python similar is available directly on the supervisor (script
python context)

Continued on next page

PAGE 108 USER GUIDE


Flux PyFlux language, command files and macros

“Command In this zone, the user can launch and test a python command (or more python
prompt” zone commands) directly, without create a new .py file. It’s an operating direct
mode, useful when you need to work quickly or debug your python
command.

Example You can enter a line of PyFlux / Python command directly into the
Command zone, the answer is then displayed in the History zone.
An example of use of the Command zone as calculator is presented below.

Command prompt
History zone Echo zone
zone

Echo of
Python commands
commands Résultats

Continued on next page

USER GUIDE PAGE 109


PyFlux language, command files and macros Flux

Drag and drop User can “Drag and drop” between different windows by selecting command
with the mouse. It is equivalent to a copy + paste

Hide/display User can hide or display one of these three zones in the “PyFlux command”

window by clicking on

PAGE 110 USER GUIDE


Flux PyFlux language, command files and macros

6.1.4. How to find out the syntax of PyFlux expressions?

Introduction To write in PyFlux language, the user needs to know the syntax of the PyFlux
expressions (Flux commands in the PyFlux language).

How to find out There are five methods to find out the syntax of the PyFlux expressions.
the PyFlux These methods are presented in the table below and explained in the
syntax following blocks.

Method Description
1 recover the syntax in a command file
2 recover the syntax in the Echo zone
3 activate the entity command Display PyFlux command
(contextual menu, right click on item in the menu tree)
3’ apply the Python type() method to the entity (Command prompt
zone)
4 apply the Python help() method to the entity (Command
prompt zone)

(1) …in a To recover the PyFlux expression of a Flux command applied during the
command file session:
• use the command file*to save the Flux commands** while the Flux
program is running

* Details on management of command files are presented in section: § 6.2.3


Management and execution of command files.
** The ‘graphic’ commands are not automatically written in the command
file created by default.
To recover these commands the user must activate the writing of the graphic
commands. This command is described in section: § 6.1.5 How to How to
Activate/inactivate the writing of graphic commands.

(2) … in the To recover the PyFlux expression of a Flux command:


Echo zone • activate the Flux command
• directly recover the syntax within the Echo zone

Example:
Echo of the command Open project / CASE1.FLU:
loadProject('case1.flu')

Continued on next page

USER GUIDE PAGE 111


PyFlux language, command files and macros Flux

(3) Command In order to find out the PyFlux expression of a Flux entity (the type and
Display the attributes):
PyFlux • in the contextual menu of the Flux entity, click on the Display PyFlux
expression command
• recover the syntax within the History zone
Example:
Display of the PyFlux expression of the command Point[1]:
Typing Point[1]
PointCoordinates(color=Color['White'],
visibility=Visibility['VISIBLE'],
coordSys=CoordSys['CENTER'],
uvw=['-60',
'0',
'0'],
nature=Nature['STANDARD'],
mesh=MeshPoint['E_SHAPE'])
End typing Point[1]

(3’) type() In order to find out the PyFlux expression of a Flux entity (the type and
method attributes):
• in the Command zone, apply the Python type() method to the Flux entity
• recover the syntax within the History zone
The Python type() method is equivalent to the Flux command Display
PyFlux command
Example:
Result of the command Point[1].type():
PointCoordinates(color=Color['White'],
visibility=Visibility['VISIBLE'],
coordSys=CoordSys['CENTER'],
uvw=['-60',
'0',
'0'],
nature=Nature['STANDARD'],
mesh=MeshPoint['E_SHAPE'])

(4) help() In order to find out the PyFlux syntax of the complete structure of a Flux
method type-entity (its attributes, sub-types, methods, selection method):
• in the Command zone, apply the Python help() method to the Flux type-
entity (type PyFlux).
• recover the syntax within the History zone

PAGE 112 USER GUIDE


Flux PyFlux language, command files and macros

Example:
Result of the command ParameterGeom.help():
ParameterGeom (Entity for parametrizing a geometry) : Type
Entity (read write)
Fields :
- ParameterGeom[id name].expression (Expression for the
parameter) : [1...1] of C80 (read write)
- ParameterGeom[id name].name (Name of Parameter)
: [1...1] of C80 (read write)
- ParameterGeom[id name].value (parameter value)
: [1...1] of R08 (read)

USER GUIDE PAGE 113


PyFlux language, command files and macros Flux

6.1.5. How to Activate/inactivate the writing of graphic commands

Introduction The user can activate or inactivate the writing of graphic commands. The
commands called ‘graphic’ are associated with various display filters as
described in section: § 5.4.

Writing the Activation of the writing of graphic commands ensures that the graphic
graphic commands corresponding to the graphic operations will be written in the
commands History zone and in the PyFlux command file created automatically.

Activate/ To activate or inactivate the writing of the graphic commands:


Inactivate • click on the icon situated to the left of the transparency bar

Icon to activate/inactivate the


graphic commands output

Transparency Bar

Icon state
activated inactivated

By defaut By default the the graphic command icon is inactivated.

PAGE 114 USER GUIDE


Flux PyFlux language, command files and macros

6.1.6. Other available PyFlux commands

Introduction There are additional commands available to the user that are not accessible by
recopying a sequence of PyFlux.

Commands The available commands are as follows:


• startMacroTransaction() / endMacroTransaction()
• getProjectName()
• [ALL]
• getHelp()
• getPyFluxCommande()
These commands are described in the next sections.

startMacroTra The description and applications of this command are explained in the table
nsaction()/end below.
MacroTransact
ion()

Command startMacroTransaction() / endMacroTransaction()


Function Permits the regrouping of a set of commands in a block.
Use startMacroTransaction()
# set of PyFlux commands
endMacroTransaction()

Continued on next page

USER GUIDE PAGE 115


PyFlux language, command files and macros Flux

Example : Creation of a triangle :


Pyflux startMacroTransaction()
PointCoordinates(color=Color['White'],
sequence visibility=Visibility['VISIBLE'],
coordSys=CoordSys['XYZ1'],
uvw=['0',
'0',
'0'],
nature=Nature['STANDARD'])
PointCoordinates(color=Color['White'],
visibility=Visibility['VISIBLE'],
coordSys=CoordSys['XYZ1'],
uvw=['0',
'0',
'10'],
nature=Nature['STANDARD'])
PointCoordinates(color=Color['White'],
visibility=Visibility['VISIBLE'],
coordSys=CoordSys['XYZ1'],
uvw=['10',
'0',
'0'],
nature=Nature['STANDARD'])
LineSegment(color=Color['White'],
visibility=Visibility['VISIBLE'],
defPoint=[Point[1],
Point[2]],
nature=Nature['STANDARD'])
LineSegment(color=Color['White'],
visibility=Visibility['VISIBLE'],
defPoint=[Point[2],
Point[3]],
nature=Nature['STANDARD'])
LineSegment(color=Color['White'],
visibility=Visibility['VISIBLE'],
defPoint=[Point[3],
Point[1]],
nature=Nature['STANDARD'])
endMacroTransaction()
Example : The commands are evaluated and the graphics refreshed at
note the end of the sequence, permitting the acceleration of the
process.

getProjectNam The description and applications of this command are explained in the table
e() below.

Command getProjectName()
Function Permits the recovery of the name of the project open in Flux
Use Name=getProjectName() permits the storage of the project
name in the ‘Name’ variable
Example : Display of the Flux project name in a file :
PyFlux file = open("Name of project","a")
file.write("Name of project :")
sequence
file.write(getProjectName())
file.flush()
file.close()

Continued on next page

PAGE 116 USER GUIDE


Flux PyFlux language, command files and macros

[ALL] The description and applications of this command are explained in the table
below.

Command [ALL]
Function Creates a the list of all entities of the same type which
facilitates the storage of this list in a ‘Flux variable’
Use Points = Point[ALL] creates a list of all entities of the point
type and enables the storage of this list in the « Points »
variables.
Reminder / The command List_instance(typeId='Point')* results in the
Comparison display of all entities of the point type displayed in the
History zone.
* syntax equivalent to the command List described under § 5.3.2
Information on the entities: Display Pyflux, list, and entitiy used by.
Example : Display of a detailed list of entities belonging to the same
PyFlux entity type in a file:
sequence file = open("List of entities", "a")
file.write("Detailed list of points")
for I in Point[ALL] :
file.write("\n\nInstance : ")
file.write(repr(I))
for field in Point.__fields.keys() :
file.write("\n")
file.write(field)
file.write(" : ")
file.write(repr(I.__getattr__(field)))
file.flush()
file.close()

USER GUIDE PAGE 117


PyFlux language, command files and macros Flux

Example : Content of the created file:


result Detailed list of points:

Instance : PointCoordinates[1]
visibility : 'VISIBLE'
surface : None
color : 'White'
domain : 'DOMAIN1 : Domain.'
nature : 'STANDARD : Topologie standard'
inAirPointFaceLocation : None
region : None
globalCoordinates : [-0.06, 0.0, -0.05]
ETAT : 0
mesh : 'E_SHAPE : E_SHAPE VOLUMES'
inAirPointVolumeLocation : None

Instance : PointCoordinates[2]
visibility : 'VISIBLE'
surface : None
color : 'White'
domain : 'DOMAIN1 : Domain.'
nature : 'STANDARD : Topologie standard'
inAirPointFaceLocation : None
region : None
globalCoordinates : [-0.04, 0.02, -0.05]
ETAT : 0
mesh : 'E_SHAPE : E_SHAPE VOLUMES'
inAirPointVolumeLocation : None

Continued on next page

PAGE 118 USER GUIDE


Flux PyFlux language, command files and macros

getHelp() The description and applications of this command are explained in the table
below.

Command getHelp()
Function Permits to stor the help text dealing with an entity type in a
« Flux variable ».
Use Point = Point.getHelp() retrieves the syntax describing the
« Point » entity type in order to support storage in the
« Point » variable.
Reminder / The command Point.help() permits the display of the support
Comparison storage of the Point entity in the history zone.
Example : Display of support related to an entity type in a file:
PyFlux file = open("Aid PyFlux","a")
file.write("Aid on the point :")
sequence file.write(Point.getHelp())
file.flush()
file.close()
Example : File created comprising all of the supporting Pyflux
result command syntax associated with the « Point. » entity type.

getPyFluxCom The description and applications of this command are explained in the table
mand() below.

Command getPyFluxCommand()
Function Permits the storage of ann entity in a « Flux variable ».
Use P1=Point[1].getPyFluxCommand() permits the storage of
the Point[1] entity in the « P1 » variable
Reminder / The command Point[1].type() permits the display of the
Comparison entity Point[1] in the history zone
Example : Display of an entity in a file:
PyFlux file = open("Entities of the Flux project ","a")
file.write("Point P1 :")
sequence file.write(Point[1].getPyFluxCommand())
file.flush()
file.close()
Example : Content of created file:
result Point P1:PointCoordinates(color=Color['White'],
visibility=Visibility['VISIBLE'],
coordSys=CoordSys['CENTER'],
uvw=['-60',
'0',
'0'],
nature=Nature['STANDARD'],
mesh=MeshPoint['E_SHAPE'])

USER GUIDE PAGE 119


PyFlux language, command files and macros Flux

PAGE 120 USER GUIDE


Flux PyFlux language, command files and macros

6.2. Command files

Introduction The command files, also called command programs or scripts, make possible
the automation of a certain number of specific actions.
Instead of manually executing a series of actions within Flux, you can save
the sequences of commands, which you can later replay.
The saved sequences can be improved due to the Python language which
authorizes the utilization of variables, the implementation of loops,
conditional or unconditional connections, …
A command file is therefore of interest as it can:
• accelerate the most frequent operations
• automate a series of complex tasks

Contents This section contains the following topics:


• Overview
• Structure of a command file
• Management and execution of command files
• Example 1: automatic creation of a series of mesh lines
• Example 2: automatic preparation of a series of Flux projects ready to be
solved

Example The command files for the tutorials papers are provided on the DVD with the
software. By executing these command files, the user can quickly build the
Flux projects described in the tutorials.
For example, the command file GeoMeshPhys.py builds the whole geometry,
generates the mesh of the computation domain and describes the physical
properties for the technical example “Rotating Motion”.

USER GUIDE PAGE 121


PyFlux language, command files and macros Flux

6.2.1. Overview

Definition A Flux command file is a text file, which contains one or more commands in
the PyFlux language. It uses the filename extension *.py.

Use A command file simplifies monotonous or repetitive tasks.


There are different levels of use:
• the first level consists in saving and then replaying a «spied» sequence of
Flux commands
• the second level consists in saving and then improving the «spied»
sequence of Flux commands by implementing loops and functions
• the third level consists in directly writing the code in the programming
language

General The more general operating mode is presented in the table below.
operation

Stage Description Context


1 Saving in a command file a sequence of Flux
Flux
commands
2 Modification of the previous command file by Flux
writing the code in the programming language (python
editor) or
Text editor
3 Execution of a command file Flux

Location The command files can be stored in any directory chosen by the user. The
default command file created when the Flux program running (see § 6.2.3) is
stored in the directory of current project.

PAGE 122 USER GUIDE


Flux PyFlux language, command files and macros

6.2.2. Structure of a command file

Structure The structure of a command file (*.py) is presented in the example below.

Part Description
1 Header of an executable Flux program
2 One or more commands in a programming language

(1) Program The Flux program header is compulsory. It specifies which Flux program (2D
header and/or 3D) will execute the command file and its version*.

* The indicated version can correspond to the current software version or be of a


previous version.

(2) Sequence of The sequence of commands can comprise four types of principal instructions:
commands assignment, loops, conditional statements, and statements without condition.

Note: A command file can contain the instructions to open another command file and
so on up to 15 levels.

USER GUIDE PAGE 123


PyFlux language, command files and macros Flux

6.2.3. Management and execution of command files

Management of The command files are managed:


command files • either by Flux, in automatic manner (default files)
• or by the user

Automated Two files are automatically managed:


management • the “Flux[XX]_log.py” : all commands performed by the user during a
session are recorded in this file.
This file is stored on the current working directory.
• the “Project_PyFlux_log.py”: all commands performed by the user during
the beginning of the project up to the end of the project are recorded in this
file.
This file is stored with the save of the project at the following link :
…\project.FLU\persistent\Jython_log
Flux module Current session file Previous session file*
2D Flux2D_log.py Flux2D_log_bak.py
3D Flux3D_log.py Flux3D_log_bak.py
Skew FluxSkewed_log.py FluxSkewed_log_bak.py
2D, 3D and Project_PyFlux_log.py -
Skew
* In order that the file Flux[XX]_log.py should not be reinitialized (rewritten) upon
the opening of a new session, the file is renamed by Flux (*_log_bak.py).

User The user can manage command files by means of the Flux commands from
management the Project \ Command file menu.
Flux command Function
New creation / opening of a file
Interrupt break of the sequence saving
Resume resumption of the sequence saving
Close end of the sequence saving / closing the file
Note: It is unable to open two command files at the same time for a Flux session.

Continued on next page

PAGE 124 USER GUIDE


Flux PyFlux language, command files and macros

Modes of There are two modes to execute a command file. These two modes are
execution presented in the table below.
Mode Description
direct mode with graphic refreshment
batch mode without graphic refreshment (faster execution)

Execute a To execute a command file, you can use one of the two following methods.
command file
Method 1: from the supervisor (only batch mode):
• double-click on the file name
Method 2: from the Flux window (batch mode or direct mode):
• in the Project menu, point on Command file and click on Execute in
batch mode or Execute in direct mode
• in the dialog box, enter the file name
• in the python editor, open the file and execute it (direct mode)
All the PyFlux instructions from the command file are executed.
Warning: For a correct process of operations, it is necessary to execute the command
file in the appropriate context (expected by the command file).

USER GUIDE PAGE 125


PyFlux language, command files and macros Flux

6.2.4. Example 1: automatic creation of a series of mesh lines

Objective The objective is to show, in a simple example, how to write a command file
to automatically create a series of mesh lines.

Example The command file allows the creation of eight Mesh lines A1, …, A8 of the
description arithmetic type with 1, …, 8 elements for different Flux projects (2D / 3D).

Process The process includes the following stages:


Stage Description Context
1 Saving in a command file the sequence of creation of
Flux
a Mesh line
2 Modification of the previous command file using the
Text editor
PyFlux language
3 Executing this file to test it Flux

Continued on next page

PAGE 126 USER GUIDE


Flux PyFlux language, command files and macros

Stage 1 To save in a command file the sequence of creation of a Mesh Line:


Step Action
1 Create a new command file from a Flux Project :
• in the Project menu, point on Command file
and click on New
• in the dialog box, enter the file name CreateMeshLine.py
2 Create a mesh line:
• in the data tree, double-click on Mesh line
• in the New Mesh line dialog box, fill out different zones:

• click on OK
• in the new dialog box, click on Cancel
3 Save and close the command file:
• in the Project menu, point on Command file and click on Close

Continued on next page

USER GUIDE PAGE 127


PyFlux language, command files and macros Flux

Stage 1: file The command file CreateMeshLine.py containing the saved sequence is
explanation presented as follows:

Element Function
#! Preflu3D 9.33 indication on the executable program (the #! symbol)
this file was saved by
MeshLineArithmetic creation of a Mesh Line with the following
(name=A1,
color=Color['White'],
characteristics of the Flux command:
number=1) • name = A1;
• color = white;
• number = 1

Stage 2 To modify the previous command file using the PyFlux syntax:

Step Action
1 Rewrite the command file CreateMeshLine.py by using a for
loop and a variable
2 Save the file

Continued on next page

PAGE 128 USER GUIDE


Flux PyFlux language, command files and macros

Stage 2: file The command file CreateMeshLine.py containing the new instructions is
explanation presented as follows:

Element Function
#! Preflu2D 10.3 indication of the two programs in which the file
#! Flux3D 10.3
can be executed
(the Preflu2D program is added in order to use
this command file in Flux 2D)
for i in range(8) : carrying out a for loop to reiterate on the values
of the sequence [0, …, 7]
name = 'A' + str(i+1) creation of a variable name which takes for
successive values the strings:
A1, A2, …, A8
(the method str() converts the numerical type in
string)
MeshLineArithmetic creation of a series of Mesh lines with the
(name=name,
following characteristics:
color=Color[i+1],
number=i+1) • name = A1; A2; A3; A4; A5; A6; A7; A8
• color = black; white; yellow; blue; turquoise;
magenta; red; green
• number = 1; 2; 3; 4; 5; 6; 7; 8

Stage 3 Execute the command file directly from a Flux project :


• in the Project menu, point on Command file and click on Execute in
direct mode
• in the dialog box, select the file name CreateMeshLine.py

Stage 3: final After executing the command file, the user will have 8 mesh line entities
result available in the current Flux project: A1 = 1, A2 = 2, …, A8 = 8

USER GUIDE PAGE 129


PyFlux language, command files and macros Flux

6.2.5. Example 2: automatic preparation of a series of Flux projects


ready to be solved

Objective The objective is to study 3 specific configurations of a parameterized device.

Example The studied device is a simple geometrical figure (quadrilateral) defined using
description 6 parameters: X1, Y1, X2, Y2, X3, Y3.
This command file could be used to create different Flux projects in 2D.

Process The process includes the following stages:

Stage Description Context


1 Preparing a Flux project which contains the base
Flux
geometry
Saving in a command file the sequence of the
Flux
geometry modification with mesh rebuilding
2 Modification of the previous command file using the
Text editor
PyFlux language
3 Executing this file to test it Flux

Stage 1 To build the basic geometrical figure on which the modifications will be
carried out, follow the following procedure:

Step Action
1 Open a new Flux project
2 Build the geometry:
• create the following 6 geometric parameters:
X1 = 20, Y1 = 0, X2 = 0, Y2 = 10, X3 = 20, Y3 = 10
• create the following 4 points:
(0, 0); (X1, Y1); (X2, Y2); (X3, Y3);
• create the 4 lines to close a rectangle with these 4 points
• build the faces
3 Mesh the device:
• modify the value of the MEDIUM Mesh line (value: 1 mm)
• assign the MEDIUM Mesh line to the 4 points
• mesh the faces
4 Save the project under the name BASE.FLU

Continued on next page

PAGE 130 USER GUIDE


Flux PyFlux language, command files and macros

Stage 1: final The project BASE.FLU


result contains:
• 6 parameters,
• 4 points ((3 are
parameterized))
• 4 lines (segments)
• 1 meshed face

Stage 2 To save in a command file the sequence of modification:

Step Action
1 Create a command file ModifParam.py
2 Carry out the modification actions:
• delete the mesh (to enable the geometrical modification)
• modify the value of a geometric parameter
• mesh the faces
• save the project under another name
3 Close the command file

Stage 2: final The command file ModifParam.py containing the saved sequence is
result presented as follows:

Stage 3 To modify the previous command file using the PyFlux syntax:

Step Action
1 Write a function in the PyFlux language, which enables the
automatic creation of a Flux project (corresponding to a set of
parameters) starting from a base project BASE.FLU.
2 Write the calls of the previous function to create the 3 desired
cases
3 Save the command file

Continued on next page

USER GUIDE PAGE 131


PyFlux language, command files and macros Flux

Stage 3: file The command file ModifParam.py containing the modify() function and the
explanation calls of this function is presented as follows:

Element Function
#! Preflu2D 9.33 indication on the executable program
def modify(VX1,VY1,VX2,VY2, definition of the modify() function having as
VX3,VY3,case) :
input 7 parameters
(6 numerical values to define the geometric
parameters X1, Y1, X2, Y2, X3, Y3 and 1
string to define the name of the project)
deleteMesh() deletion of the mesh
ParameterGeom['X1'].expression=str(VX1) modification of geometric parameter

(X1 takes the value VX1, converted into
string by the method str(),
…)
meshFaces() meshing faces
saveProjectAs(case) saving the project under the name defined by
the input parameter case
modify(10,0,0,10,20,10,"Case1") call of the function to build the first case,

Continued on next page

PAGE 132 USER GUIDE


Flux PyFlux language, command files and macros

Stage 4 Execute the command file.

Stage 4: final After executing the command file, the user has in his/her working directory 4
result Flux projects, whose characteristics are given in the table below.
BASE.FLU CASE1.FLU CASE2.FLU CASE3.FLU
P3 P4
2

P1 P2
P1: ( 0, 0) P1: ( 0, 0) P1: ( 0, 0) P1: ( 0, 0)
P2: (20, 0) P2: (10, 0) P2: (10, 0) P2: (10, 0)
P3: ( 0, 10) P3: ( 0, 10) P3: (10, 10) P3: ( 0, 10)
P4: (20, 10) P4: (20, 10) P4: (20, 10) P4: (15, 5)

USER GUIDE PAGE 133


PyFlux language, command files and macros Flux

PAGE 134 USER GUIDE


Flux PyFlux language, command files and macros

6.3. Macros

Introduction The macros enable the user to regroup the frequently used commands in an
extension integrated into the software.
You can build up a macro instead of manually executing a series of repetitive
actions in Flux, which you will then be able to call regularly.
A macro is interesting because it can encapsulate within a new command a
series of repetitive operations and thus improve the quality and efficiency of
the user-software interaction.

Contents This section contains the following topics:


• Overview
• Structure of a macro file
• Management and execution of macros
• Example: creation of points starting from a file

List of The list of macros available (after having installed Flux) is available at the
delivered following path:
macros C:\Program Files\Altair\2018\flux\Extensions\Macros\macros_list_EN.pdf

(If Flux is installed a the path proposed by default C:\Program Files\Altair)

USER GUIDE PAGE 135


PyFlux language, command files and macros Flux

6.3.1. Overview

Definition A macro is a high-level command, added to the Flux application, which


regroups several commands in a given order. It receives (upon entry) one or
more parameters and executes (upon exit) a series of predefined actions.
A macro file (*.py) is a text file, which defines the macro-function in the
PyFlux language.

Use A macro improves the quality and efficiency of the user-software interaction
due to:
• the regrouping of the repetitive commands
• its dialog box especially designed for the entrance of the parameters

General The operation mode of the most general type is presented in the table below.
operation

Stage Description Context


1 Creation of the macro definition file Text editor
Creation of the image-formatted file for the
Image editor
associated icon (optional)
2 Loading of the macro into the Flux project Flux
3 Execution of the macro Flux

Some rules Within the storage on the disk, a macro corresponds to a directory which
includes:
• a file of the macro
• a file of the associated icon (optional)
The directory, the file of macro and the icon must be named after the macro-
function.
Example:
• Name of the function: Polypoint3D
• Name of the directory of macro: Polypoint3D.PFM
• Name of the file of macro: Polypoint3D.py
• Name of the file of the associated icon: Polypoint3D.gif

Location The macros can be stored in any directory chosen by the user. The macros
provided by Flux are stored within the specific directory extensions.

PAGE 136 USER GUIDE


Flux PyFlux language, command files and macros

6.3.2. Structure of a macro file

Structure The structure of a file defining the macro (*.py) is presented in the example
below.
1

Part Description
1 Header of an executable Flux program
2 Description of input parameters of the macro
3 Definition of a parameterized function in the PyFlux language

(1) Program The Flux program header is compulsory. It specifies which Flux program (2D
header and/or 3D) will execute the macro and its version*.
* The indicated version can correspond to the current software version or be of a
previous version.

(2) Description This second part deals with the description of the input parameters of the
of parameters macro.
For each parameter it is necessary to define:
• a parameter name
• a PyFlux type (see § 6.1.1)
• minimal and maximal cardinalities (numbers of minimal and maximal
values corresponding to the data structure)
• a default value or a keyword None
• a label associated to the parameter
(this label appears in the dialogue box for the running macro, see § 6.3.3)

(3) This second part deals with the description of the parameterized function.
Parameterized
function For this function it is necessary to define:
• a function name (= name of the macro)
• input parameters of the de function
• a body of the function (PyFlux instructions)

USER GUIDE PAGE 137


PyFlux language, command files and macros Flux

6.3.3. Management and execution of macros

Management of The user can load or unload macros within the project. The macro can be
macros reloaded into the project, if the file of the macro loaded into the project has
been modified for example.
The Flux commands for the management of macros are located:
• Either directly in one of the menus Geometry, Mesh, Physics and
Advanced
• Or indirectly in the menu Extensions

Flux command Function


Load loading a new macro into the project
Unload unloading the macro from the project
Update updating the macro

Integration All the macros loaded into the Flux project appear:
within Flux • in the Extensions/ Macros node of the data tree
• in the toolbar (icons)
The loaded macros are saved with the project.

Run a macro The user can run a macro by using the Run command from the macro
contextual menu or by clicking on the corresponding icon. The dialog box
associated to the types of parameters is then displayed.

PAGE 138 USER GUIDE


Flux PyFlux language, command files and macros

Direct access by With the aim to highlight and facilitate access to the macros provided with
menu Flux, a menu Load and run macro is implemented in each menu Geometry,
Mesh, Physics and Advanced.
The user has the possibility via this menu to :
• load and execute a macro
• consult the PDF documentation
• point and click on a macro in the menu, then click on the button “I”

• or point on the macro in the menu and CTRL+ right click on the macro

* In the next versions, new macros will be added to enrich to the current list.

USER GUIDE PAGE 139


PyFlux language, command files and macros Flux

6.3.4. Example: creation of points starting from a file

Objective The objective is to show on a simple example how to write and use a macro.
This macro makes the repetitive tasks to enter the coordinates during the
creation of points easier.

Example The Polypoint3D macro is designed to automatically create 3D points


description starting from a series of coordinates previously saved in a text file. The file
name and the coordinate system for definition of the points are selected by the
user during the execution of the macro.

Process The process includes the following stages:

Stage Description Context


Writing the definition of the macro into the *.py
1* Text editor
file using the PyFlux language
2 Writing the coordinates of points into the text file Text editor
3 Loading the macro into the Flux project Flux
4 Running the macro Flux

* The definition of macro requires good knowledge of the Flux database structure
and concepts of programming.

Stage 1 To define the macro in the PyFlux language:

Step Action
1 Type a header of executable Flux program
2 Describe input parameters of the macro
3 Define the Polypoint3D parameterized function in the PyFlux
language
4 Save the file of the macro under the name Polypoint3D.py in the
Polypoint3D.PFM directory.

Continued on next page

PAGE 140 USER GUIDE


Flux PyFlux language, command files and macros

Stage 1: file The file of the macro Polypoint3D.py is presented as follows:


explanation

Element Function
#! Preflu3D 9.33 indication on the executable program
@param parameter statement using the keyword @param
filename parameter names: filename, coordSys
coordSys
File PyFlux types: File, CoordSys
CoordSys
1 1 minimal and maximal cardinalities
points.txt default value points.txt
None
keyword None
File of points coordinates labels of parameters
Coordinate system for definition
def Polypoint3D(filename,coordSys) : definition of the Polypoint3D function with 2
parameters
(parameters to define the file name and the
coordinate system)
f = file(filename) creation of a variable f which takes for values
the data of the filename file
for line in f : realization of a for loop to reiterate on the file
lines
coords = line.split() creation of a variable coords which takes for
values the list of strings for each file line
PointCoordinates creation of the points with the following
(color=Color['White'],
characteristics:
visibility=Visibility['VISIBLE'],
coordSys=coordSys, • color = white
uvw=coords, • visibility = visible
nature=Nature['STANDARD']) • coordinates = (0, 0, 0); (3, 0, 0); (3, 2, 0);
(2, 2, 0); (2, 1, 0); (1, 1, 0); (1, 2, 0); (0, 2, 0)
• nature = standard

Continued on next page

USER GUIDE PAGE 141


PyFlux language, command files and macros Flux

Stage 2 To save the coordinates of points in the text file:


• type data in the form of table
• save the file under the name point.txt

Stage 2: file The point.txt file is presented as follows:

Stage 3 To load the macro:


• click on the Load command in the Extensions/ Macro menu
or in the contextual menu of the macro

Stage 4 To run the macro:


• click on the Run command in the contextual menu of the macro
• fill out the fields in the dialog box Polypoint3D

Stage 4: final After running the Polypoint3D macro, the user has the following 8 points in
result his Flux project:
(0, 0, 0), (3, 0, 0), (3, 2, 0), (2, 2, 0), (2, 1, 0), (1, 1, 0), (1, 2, 0), (0, 2, 0).

PAGE 142 USER GUIDE


Flux Formulas and mathematical functions

7. Formulas and mathematical functions

Introduction This chapter contains:


• different formula types in Flux and their use in different contexts
(geometry, …),
• mathematical functions available for writing these formulas

Contents This chapter contains the following topics:


• Formulas
• List of available functions
• Functions for handling complex quantities
• Specific functions Modulo, Valid, Trapez, Trapezper and a function of
substitution

USER GUIDE PAGE 143


Formulas and mathematical functions Flux

PAGE 144 USER GUIDE


Flux Formulas and mathematical functions

7.1. Formulas

Introduction This section presents the formula concept in Flux, as well as the distinction
between different formula types.

Contents This section contains the following topics:


• Concepts of formula and formula type
• Formula with geometric parameters
• Formula with I/O (input/output) parameters
• Formula with spatial quantities
• Formula editor

USER GUIDE PAGE 145


Formulas and mathematical functions Flux

7.1.1. Concepts of formula and formula type

Formula Generally speaking, a formula is an expression that allows handling the data
concept using mathematical functions.

Data There are different types of parameters to handle, depending on the working
context: geometric parameters, input/output parameters, space quantities.
Consequently, there are different formula types: formulas with geometric
parameters, formulas with input/output parameters, and formulas with spatial
quantities.

The different formula types and their use are specified in the following sections.

PAGE 146 USER GUIDE


Flux Formulas and mathematical functions

7.1.2. Formula with geometric parameters

Definition A formula with geometric parameters is an expression that allows


handling geometric parameters in different contexts - geometry, mesh,
physics.

Use A formula with geometric parameters is used to define:


• a geometric parameter
• a parameterized quantity: the coordinate of a point, the position of a
coordinate system, …

Evaluation The parameterized expression is “directly” evaluated during the creation of


concerned entities.

Example The example below shows the use of a formula in the geometry context
The circumference of a circle is equal with 2**R, where R is the radius of
the circle.
The geometric parameter CIRC can be written as function of another
geometric parameter (RADIUS) by using the following formula (or
expression):
CIRC = 2*PI*RADIUS

Formula and The use of these formulas in different working contexts is explained in the
context table below.

In the context
the formulas are used to define …
of …
• geometric parameters
• coordinate systems
Geometry
• transformations
• points
• mesh points
• mesh line of type:
Mesh
• Length of line elements at extreme points
• Geometric with minimum distance
• coordinate systems for anisotropic materials, non-meshed
Physics coils, field sources
• non-meshed coils

USER GUIDE PAGE 147


Formulas and mathematical functions Flux

7.1.3. Formula with I/O (input/output) parameters

Definition A formula with I/O parameters is an expression that allows handling I/O
parameters in different contexts – physics, kinematics, circuit, results post-
processing.

Use A formula with I/O parameters is used to define:


• another I/O parameter
• the current in a coil, a sensor, …

Evaluation The formula is evaluated:


• during the solving process by using information on control of the parameter
• during the evaluation of sensors in the context of results post-processing

Example The example below shows the use of a formula in the physical context for a
magnetic application.
The value of the current in a coil is given by I = I0 sin ( t)
The I/O parameter CURRENT_VAL can be expressed as function of other
I/O parameters (I0, FREQ, TIME) by using the following formula:
CURRENT_VAL=I0*(2*PI*FREQ*TIME)

Additional Additional information on I/O parameters and corresponding formulas is


information available in chapter “Time dependent / parametric analysis: principles”
(volume 2).

PAGE 148 USER GUIDE


Flux Formulas and mathematical functions

7.1.4. Formula with spatial quantities

Definition A formula with spatial quantities is an expression that allows handling


space quantities in different contexts – physics, circuit, results post-
processing.

Use A formula with spatial quantities is used to define:


• another space quantity
• the modulus of flux density, …

Evaluation A formula with spatial quantities is evaluated during the application using the
space quantity.

Example The example below shows the use of a formula in the context of results post-
processing for a magnetic application.
In a Magneto
 Static
 application
 the flux density is a vector quantity:

B  Bx i  By j  Bz k ,
   
where Bx, By, Bz are the three components of B on the axis i , j and k .
In this example we are interested in the By component of flux density
The spatial quantity (BY) can be expressed as function of other spatial
quantities (B) by using the following formula:
BY = Comp(2,B)
The function Comp(i,V) returns the i component of the vector V.

Additional Additional information on spatial quantities and formulas is available in


information chapter “Results post-processing: principles” (volume 2).

USER GUIDE PAGE 149


Formulas and mathematical functions Flux

7.1.5. Formula editor

Formula editor Throughout the construction of a Flux project, numerous information items
can be entered as formulas: expression of a geometric parameter, current
value in one coil, etc.
To facilitate the user’s work, a new interactive formula entering tool is
provided with Flux version 10: the formula editor. This tool is accessible by
means of button: .
Examples:

Formula Generally speaking, a formula is an expression consisting of data and


operators or mathematical functions.

Data The data are functions of the working context. They can be constants,
geometric parameters, I/O parameters, spatial quantities, etc. as presented in
the tables below.
Geometric parameters

Physical parameters (I/O parameters)

Data concerning the kinematic coupling

Data concerning the circuit coupling

Continued on next page

PAGE 150 USER GUIDE


Flux Formulas and mathematical functions

Operators or Available operators are presented in the tables below.


mathematical
functions

Numerical Mathematical Trigonometrical

Vector Complex Signal Const.

Writing a A formula is edited by simple click on data and operators or mathematical


formula functions.
The formula is displayed in PyFlux language in the Expression zone. A
syntactical corrector corrects the syntax errors, as well as the data errors.

Correct formula Incorrect formula

New features New data are available for the formula editor. They are the following
constants:
• : mathematical constant (Pi)
• 0: permeability of vacuum; 0= 4 10-7 [H/m]
• 0: reluctivity of vacuum; 0 = 1/0 = 1/(4 10-7) [m/H]
• 0: permittivity of vacuum; 0 = 1/(3610-9) [F/m]

Caution: these constants are considered as functions and presented in form Pi(),
Mu0(), Nu0(), Eps0() within the PyFlux language.

USER GUIDE PAGE 151


Formulas and mathematical functions Flux

PAGE 152 USER GUIDE


Flux Formulas and mathematical functions

7.2. List of available functions

Introduction This section presents the functions available in Flux for writing the formulas.

Contents This section contains the following topics:


• Functions

Reading advice This section deals with the list of the available functions and with their
syntax.
For the “simple” functions do not exist specific difficulties; for the “more
complex” functions, detailed information are contained in the following
sections “Functions for handling complex quantities”, “Specific functions
Modulo, Valid, Trapez, Trapezper and a function of substitution”.

USER GUIDE PAGE 153


Formulas and mathematical functions Flux

7.2.1. Functions

Introduction The available functions are:


• arithmetic operators
• usual mathematical functions admitted by Fortran
• functions for treatment of complex quantities
• functions for treatment of vector quantities
• other specific functions (Modulo, Valid, Trapez, …)

Operators The arithmetic operators are described in the table below.

Operator Description
+ add two values
- subtract two values
* multiply two values
/ divide two values
raise the left operand to the power specified by the right hand
** or ^
operand

Mathematical The usual mathematical functions are gathered in the tables below.
functions

Square function and absolute value


Sqrt(x) Square root of the expression x
Abs(x) Absolute value of the expression x

Logarithm and exponential functions


Exp(x) Exponential function of the expression x
Log(x) Natural logarithm of the expression x
Log10(x) Common logarithm of the expression x

Other functions
Int(x) Integral part of the expression x
Modulo(x,x1) Remainder of the division of x by x1
Min(x1,x2) Minimum of the expressions x1 and x2
Max(x1,x2) Maximum of the expressions x1 and x2
Sign of the expression x:
Sign(x)
Sign(x)=+1 if x>0; = -1 if x<0; = 0 if x=0

Continued on next page

PAGE 154 USER GUIDE


Flux Formulas and mathematical functions

Trigonometry The usual trigonometric functions are gathered in the tables below.

Trigonometric functions
Sin(x) Sine of the angle x expressed in radians
Cos(x) Cosine of the angle x expressed in radians
Tan(x) Tangent of the angle x expressed in radians
Asin(x) Arcsine in radians of the expression x; x  [-1,1]
Acos(x) Arccosine in radians of the expression x; x  [-1,1]
Atan2(x,y) Arctangent in radians of the expression (x/y)
Sind(x) Sine of the angle x expressed in degrees
Cosd(x) Cosine of the angle x expressed in degrees
Tand(x) Tangent of the angle x expressed in degrees
Asind(x) Arcsine in degrees of the expression x; x  [-1,1]
Acosd(x) Arccosine in degrees of the expression x; x  [-1,1]
Atan2d(x,y) Arctangent in degrees of the expression (x/y)
Sinh(x) Hyperbolic sine of the expression x
Cosh(x) Hyperbolic cosine of the expression x
Tanh(x) Hyperbolic tangent of the expression x
Asinh(x) Arcsine hyperbolic of the expression x; x  [-1,[
Acosh(x) Arccosine hyperbolic of the expression x; x  ]-,[
Atan2h (x,y) Arctangent hyperbolic of the expression (x/y); x  [-1,1]

Treatment of The functions for treatment of the complex quantities are gathered in the table
complex below.
quantities

Functions for treatment of the complex quantities


ModC(z) Complex modulus of the complex expression z
Arg(z) Argument (in radians) of the complex expression z
Inst(z,t) Value at the instant t (in degrees) of the complex expression z
Real(z) Real part of the complex expression z
Imag(z) Imaginary part of the complex expression z
Conj(z) Conjugate of the complex expression z
Complex expression built starting from the real expressions
Cmplx(x,y)
x and y

Continued on next page

USER GUIDE PAGE 155


Formulas and mathematical functions Flux

Vector The functions for treatment of the vectors are gathered in the table below.
treatment

Functions for vector treatment


ModV(v) Vector modulus of the vector expression v
Comp(i,v) Component i of the vector expression v
PVec(v1,v2) Vector product of 2 real vector expressions
Vec2(x,y) 2D vector built starting from the real expressions x and y
Vec3(x,y,z) 3D vector built starting from the real expressions x, y and z
General modulus of the expression x:
Mod(x)
Mod(x)=ModV(ModC(x))

Modification of The modification of a coordinate system is obtained with the functions in the
the coordinate table below.
system

Component i of coordinates in the local coordinate system r


CLCS(r,i)
(i=1, 2 or 3)
VLCS(r,v) Vector v in the local coordinate system r

Other functions The other functions (or specific functions) are gathered in the table below.

Other functions
if x1x<x2: Valid(x,x1,x2)= 1
Valid(x,x1,x2)
else: Valid(x,x1,x2)= 0
if x1xx1+x2: Trapez(x,x1,x2,x3)= 1
Trapez(x,x1,x2,x3)
if x<0 or x>x1+x2+x3: Trapez(x,x1,x2,x3)= 0
Periodic trapezoidal function
Trapezper(x,x1,x2,x3,x4,x5,x6,x7)
see § 7.4.4 “Trapezper function”

PAGE 156 USER GUIDE


Flux Formulas and mathematical functions

7.3. Functions for handling complex quantities

Introduction This section recalls the concept of scalar field and vector field.
It contains the functions for handling complex quantities that are used in the
steady state AC applications (Steady state AC Magnetic, Steady state AC
Electric or Magneto Thermal).

Contents This section contains the following topics:


• Field concept, scalar fields and vector fields
• Reminder on complex numbers
• Functions for handling quantities expressed by complex numbers
• Modulus functions: ModV, ModC and Mod
• Example: flux density in Steady state AC Magnetic applications

USER GUIDE PAGE 157


Formulas and mathematical functions Flux

7.3.1. Field concept, scalar fields and vector fields

Field concept In mathematics, a field is an item used to model the phenomena concerning
the "extended" objects. In a simplified meaning, a field is the association of a
value of parameter to every point in the space. In the largest sense, the term
"value of the parameter" represents a tensor.

Scalar field / We remark:


vector field • the scalar fields (0 order tensor): to each point of space is associated a
number, e.g. the temperature, the pressure, or the density…
• the vector fields (1st order tensor): to each point of space is associated a
vector, e.g. the vector of gravity field, the vector of electric field, the local
velocity of a fluid …
A vector field associates to each point of space a vector quantity defined by
three real numbers, while a scalar field associates a real quantity expressed by
only one real number.

Quantities The quantities handled by Flux are scalar quantities and vector quantities.
handled by Depending on physical application, these quantities can be expressed by real
Flux or complex numbers.

Functions The functions available in Flux allow the handling of the scalar and vector
handled by quantities expressed by real or complex numbers. These functions are
Flux generally described in the previous section.
The functions for handling quantities expressed by complex numbers are
described in the following section.

PAGE 158 USER GUIDE


Flux Formulas and mathematical functions

7.3.2. Reminder on complex numbers

Form of a A complex number I can be written in different forms:


complex • in Cartesian form:
number
I = Ir + j Ii
where:
Ir: real part of I
Ii: imaginary part of I
j: pure imaginary number with j² = –1

• in Polar form (or exponential form):


I = Imod e j 
where:
Imod: modulus of I
: argument of I (or phase)
j: pure imaginary number with j² = –1

Conjugate of a The conjugate of I is defined by:


complex
number I* = Ir – j Ii

Modulus of a The modulus of I is defined by:


complex
number I  I 2r  I i2  I  I *

USER GUIDE PAGE 159


Formulas and mathematical functions Flux

7.3.3. Functions for handling quantities expressed by complex


numbers

Definition In Flux 3D, a complex scalar or vector quantity is defined by its real part and
its imaginary part.

Use The functions for handling the complex quantities can be used in the formulas
with I/O parameters and in the formulas with spatial quantities.

Principal The functions of treatment of the complex quantities are gathered in the table
functions below.

Functions for treatment of the complex quantities


ModC(x) Complex modulus of the complex expression x
Arg(x) Argument (in radians) of the complex expression x
Inst(z,t) Value at the moment t (in degrees) of the complex expression z
Real(x) Real part of the complex expression x
Imag(x) Imaginary part of the complex expression x
Conj(x) Conjugate of the complex expression x
Complex expression built starting from the real expressions
Cmplx(x,y)
x and y

x, y, z could be scalar or vector quantities

Other functions Two other functions of Flux 3D applied to complex quantities are described
in the following paragraph. These are the vector modulus (ModV) and the
general modulus (Mod) functions.

PAGE 160 USER GUIDE


Flux Formulas and mathematical functions

7.3.4. Modulus functions: ModV, ModC and Mod

Before starting The modulus functions, i.e. the vector modulus, the complex modulus and the
general modulus, allow the computing of the modulus of scalar and vector
quantities, expressed by real or complex numbers
Before describing the modulus functions, a recall of the notations is described
in the following blocks.

Scalar To define the modulus functions of the scalar quantities expressed by real and
quantities: complex numbers, we use the following notations:
notations • for a real scalar: A
• for a complex scalar: I
expressed by I = Ir + j Ii

where Ir and Ii are real scalars

Vector To define the modulus functions of the vector quantities expressed by real and
quantities: complex numbers, we use the following notations:
notations • for a real vector: V
   
expressed by V  Vx u  Vx v  Vx w

where Vx, Vy and Vz, are real scalars

• for a complex vector: Vc


   
expressed by Vc  Vcx u  Vcx v  Vcx w

where Vcx, Vcy and Vcz are complex scalars


It is also possible to describe a complex vector in the form:
V   Vxi   Vxr  j Vxi   Vcx 
    xr       
Vc  Vr  j Vi   Vyr   j  Vyi    Vyr  j Vyi    Vcy 
V   V   V  jV  V 
 zr   zi   zr zi   cz 
where Vxr, Vyr, Vzr, Vxi, Vyi and Vzi are real scalars.

Continued on next page

USER GUIDE PAGE 161


Formulas and mathematical functions Flux

Vector The ModV(X) function returns the vector modulus of the X vector, which
modulus: can be a real vector or a scalar vector.
ModV function
• If V is a real vector, ModV(V) is a real scalar expressed by

ModV(V)  Vx2  Vy2  Vz2

• If Vc is a complex vector, ModV(Vc) is a complex scalar expressed by:


ModV(Vc )  ModV(Vr )  j ModV(Vi )
 Vxr2  Vyr2  Vzr2  j Vxi2  Vyi2  Vzi2

Complex The ModC(X) function returns the complex modulus of the complex
modulus: argument X, which can be a complex scalar or a complex vector.
ModC function
• If I is a complex scalar, ModC(I) is a real scalar expressed by:

ModC( I)  I mod  I 2r  I i2  I  I *

• If Vc is a complex vector, ModC(Vc) is a real vector expressed by:

 M odC( Vcx )   Vxr  Vxi 


2 2

 
M odC( Vc )   M odC( Vcy )    Vyr2  Vyi2 
 M odC( V )   2 

 cz  V
 zr
2
 Vzi 

General The Mod(X) function returns the general modulus of the argument X.
modulus: Mod Whatever is type of the argument X (scalar or vector, real or complex), the
function result Mod(X) is a real scalar.
• If I is a complex scalar, Mod(I) is a real scalar expressed by:

Mod(I)  ModC(I)  I mod  I 2r  I i2  I  I *

• If Vc is a complex vector, Mod(Vc) is a real scalar expressed by:

Mod(Vc )  ModV(ModC(Vc ))  Vxr2  Vxi2  Vyr2  Vyi2  Vzr2  Vzi2

Continued on next page

PAGE 162 USER GUIDE


Flux Formulas and mathematical functions

Overview The results of the modulus functions (ModV, ModC and Mod) are described
in the tables below.

Scalar Vector modulus Complex modulus General modulus


quantity ModV ModC Mod
real scalar
no interest
A
complex scalar no interest real scalar real scalar
I = Ir + j Ii not authorized I 2r  I i2 = I 2r  I i2

Vector Vector modulus Complex modulus General modulus


quantity ModV ModC Mod
real vector real scalar no interest real scalar
V Vx2  Vy2  Vz2 returns Vr = Vx2  Vy2  Vz2
complex scalar real vector real scalar
= ModV (Vr) = ModV
complex + j ModV (Vi)  M odC( Vxc )   Vxr  Vxi  (ModC(Vc))
2 2

vector  
 M odC( Vyc )    Vyr  Vyi 
2 2
 Vxr2  Vyr2  Vzr2  Vxr2  Vxi2  Vyr2 
Vc = Vr + j Vi  M odC( V )   
2 
 zc 
 V 2
 V 
 j Vxi2  Vyi2  Vzi2
zr zi
...Vyi2  Vzr2  Vzi2

USER GUIDE PAGE 163


Formulas and mathematical functions Flux

7.3.5. Example: flux density in Steady state AC Magnetic applications

Introduction In the Steady state AC Magnetic applications the flux density (B) is a
complex vector.

Computation of It is possible to compute:


flux density • The vector modulus of the flux density ModV(B), which is a complex
scalar:
At the phase t = 0°: ModV (Inst(B,0) = ModV(Real(B))
At the phase t = 90°: ModV (Inst(B,90) = ModV(Imag(B))
• The complex modulus of the flux density:
ModC(B) is a real vector
• The general modulus of the flux density:
Mod(B) = ModV(ModC(B) is a real scalar

Physical To compare the Flux results with the measurement results, we can use one of
meanings of the following methods:
modulus
functions 1st possibility:
The measurement of flux density is carried out in three main directions X, Y,
Z. The result is a vector, defined by the three components: Bx, By, Bz
• The ModC(B) formula of Flux returns a real vector as result whose
components are Bx, By, Bz.
• The formula ModV(ModC(B)) returns a real scalar as result; this is the
modulus of the previously result, i.e. the peak value of the flux density.

2nd possibility:
The measurement of the flux density is carried out along a given direction.
The Flux formulas Mod(B*Vec3(i, j, k)) and ModC(B*Vec3(i, j, k)) return as
result a real scalar that is the peak value of flux density.
(Vec3(i,j,k is the unit vector that provide the measurement direction)

Example:

If the measurement is carried out along the OX axis, the formula


ModC(B*Vec3(1, 0, 0)) yields the peak value of the flux density on OX
direction.

PAGE 164 USER GUIDE


Flux Formulas and mathematical functions

7.4. Specific functions Modulo, Valid, Trapez, Trapezper and a


function of substitution

Introduction This section describes the functions Modulo, Valid, Trapez, Trapezper and a
function of substitution.
These functions are used in formulas with I/O parameters (for the transient
applications or parameterized analysis). These functions can be also used in
other formulas (arithmetic expression in the geometry context, …)
In case of transient applications, these functions allow to define signals with
various form: periodic, pulse, trapezoidal, ...

Contents This section contains the following topics:


• Modulo function
• Valid function
• Trapez function
• Trapezper function
• Function of substitution or [ ] operator

USER GUIDE PAGE 165


Formulas and mathematical functions Flux

7.4.1. Modulo function

Interest The Modulo function allows to create periodic signals.

Definition The Modulo(X,X1) function returns:


• the remainder of the division of X by X1

Note: The arguments X and X1 can be formulas.

Operation In case of transient application it is possible to define the triangular pulse


mode function described in the figure below.

Operation mode: 1
Create an I/O parameter:
PE = Modulo(TIME, TP) ,
where:
• TIME is the time parameter
• TP is the period value
0 Tp 2Tp T

PAGE 166 USER GUIDE


Flux Formulas and mathematical functions

7.4.2. Valid function

Interest The Valid function allows creating square wave signals.

Definition The Valid(X,X1,X2) function returns:


• 1, if X is in [X1, X2[
• 0, otherwise

Notes:
• The arguments X1 or X2 can be omitted.
In this case, X1 is replaced by - and X2 by +.
• The arguments X and X1 and X2 can be formulas.

Operation In case of transient application it is also possible to define a rectangular pulse


mode function described in the figure below.

Operation mode:
Create an I/O parameter: 1

PE = Valid(TIME, T1, T2)


where:
• TIME is the parameter time
• T1 is the instant of the pulse start
0 T1 T2 T
• T2 is the instant of the pulse end

Example An example of the Valid function is presented below.

A Rump function RP(t)


20
truncated by a gate
function: 10

RP(t) = t*Valid(t,10,20)
10 20 t

USER GUIDE PAGE 167


Formulas and mathematical functions Flux

7.4.3. Trapez function

Interest The Trapez function allows creating signals of a trapezoidal shape.

Definition The Trapez(X,X1,X2,X3) function returns:


• 1, if X is in [X1, X1+X2]
• 0, if X is in ]-, 0] or [X1+X2+X3, + [
• an interpolated value between 0 and 1
if X is in [0, X1] or [X1 + X2, X1+ X2 + X3].

Note: The arguments X, X1, X2 and X3 can be formulas.

Operation In case of transient application it is possible to define the trapezoidal pulse


mode function shown in the figure below.

Operation mode:
Create an I/O parameter:
PE = Trapez(TIME, T1, T2, T3) 1
where:
• TIME is the time parameter
• T1 is the time interval of linear
increase of the function
• T2 is the time interval of constant
T1 T2 T3 T
value of the function
• T3 is the time interval of linear
decrease of the function

Example An example of the Trapez function is presented below.

Trapeze function: T2(t)


2 3
T2(t) = Trapez(t,0,2,3) 1

2 5 t

PAGE 168 USER GUIDE


Flux Formulas and mathematical functions

7.4.4. Trapezper function

Interest The Trapezper function allows creating periodic trapezoidal signals.

Definition The Trapezper(X,X1,X2,X3,X4,X5,X6,X7) function is a periodic trapezoidal


function whose arguments X, X1, X2, X3, X4, X5, X6 and X7 are explained in
the block below.

Note: The arguments X, X1, X2, X3, X4, X5, X6 and X7 can be formulas.

Operation In case of transient application it is possible to define the periodic trapezoidal


mode pulse function shown in the figure below.

Operation mode:
Create an I/O parameter:
PE = Trapezper(TIME, A, B, Tp, T1, T2, T3, Td)
Tp
B

Td T
T1 T2 T3
where:
• TIME is the time parameter
• A is the minimal value
• B is the maximal value
• Tp is the period
• T1 is the time interval of linear increase of the function
• T2 is the time interval of constant value of the function
• T3 is the time interval of linear decrease of the function
• Td is the value of initial time delay

Example An example of the Trapezper function is presented below.

Periodic trapezoidal pulse function: 10


10
PA(t) = Trapezper(t,0,10,10,2,3,2,1)

0
1 t
2 3 2

USER GUIDE PAGE 169


Formulas and mathematical functions Flux

7.4.5. Function of substitution or [ ] operator

Interest The function of substitution, represented by the [ ] operator, enables to


replace in an existing function the value of a parameter by a formula.
This function has several possibilities described in the examples below.

Definition The syntax of the function of substitution is the following:


PEs = PEi [X = Formula (X, …)]
where:
• PEi is the I/O parameter “carrying” the initial function
• PEs is the I/O parameter “carrying” the function of substitution

The function of substitution PEi[X=Formula(X, ...)] returns the value of the


function PEi , where the argument X is replaced by the formula
Formula(X, ...).

Operation The operation mode is presented on an example of a transient application.


mode

We suppose that the following initial 1


function was already created:
PEi = Trapez(TIME, T1, T2, T3)

T1 T2 T3 T

Create an I/O parameter: 1

PEs = PEi[TIME=TIME-Td]
where:
• TIME is the time parameter
• Td is the value of time delay 0 Td T

Continued on next page

PAGE 170 USER GUIDE


Flux Formulas and mathematical functions

Examples Examples of using the substitution function are presented below.

Initial function:
Fi(t) 2
Fi(t) = Trapez(t,2,0,0)
1

2 t

The function of substitution:


Fs(t)
Fs(t) = Fi(t)[t=t-2]
delay with 2 seconds the initial 1
function Fi(t)

2 t

The function of substitution:


Fs(t)
Fs(t) = Fi(t)[t=t*2]
increases two times the time of 1
initial function Fi(t)

4 t

The function of substitution:


Fs(t)
Fs(t) = Fi(t)[t=Modulo(t,4)]
periodize the initial function 1
Fi(t) with the period of 4
seconds.
2 4 6 t

USER GUIDE PAGE 171


Formulas and mathematical functions Flux

PAGE 172 USER GUIDE


Flux Geometry: principles

8. Geometry: principles

Introduction This chapter gives the necessary knowledge to describe the geometry: study
domain definition and symmetry or periodicity use, Flux geometry building
module, geometry building tools …
This chapter also presents the general principles of geometry building and
some considerations on the modeling strategy.

Contents This chapter contains the following topics:


• Modeling strategies
• Study domain
• Characteristics of geometry building module
• Tools of geometry building module
• Geometry building: general steps

USER GUIDE PAGE 173


Geometry: principles Flux

PAGE 174 USER GUIDE


Flux Geometry: principles

8.1. Modeling strategies

Introduction This section presents some considerations on the modeling strategy.


It is about properly defining the study type to be carried out (2D plane, 2D
with revolution symmetry, 3D) before choosing the 2D or 3D Flux
application.

Contents This section contains the following topics:


• 2D plane study, 2D axisymmetric study, 3D study
• 2D Example: Geometry and mesh tutorial
• 3D Example: Geometry and mesh (Tutorial)

USER GUIDE PAGE 175


Geometry: principles Flux

8.1.1. 2D plane study, 2D axisymmetric study, 3D study

Preliminary Before starting the description of a device, it is necessary to answer the


consideration following questions:
• What type of study is possible to carry out on this device?
• What application should be used: 2D or 3D?

Different study It is possible to distinguish the following different study types.


types
Study type Device characteristics Geometric representation
device supposed infinitely long in
2D plane in a cross section plane
one direction
2D axi device having a revolution
in a cross section plane
symmetric symmetry around an axis
3D unspecified complete

2D plane study: It is possible to carry out a 2D plane study if the device is supposed infinitely
characteristics long in one direction.
The geometric representation of the device is carried out in a cross section
plane (normal to this direction).
The device depth is taken into account (at physical level) to compute the
global quantities (force, energy, …)

Example

y
y

x
x

z
real object 2D plane geometry

Continued on next page

PAGE 176 USER GUIDE


Flux Geometry: principles

2D plane study: Working assumptions:


working
assumptions The device is supposed infinitely long along a direction (depth).
The magnetic flux is concentrated on the cross section plane, there is no
extremity effect (magnetic flux leakage) in the 3rd direction (depth).
Possible interpretations of these working assumptions:
• The air gap thickness is reduced with respect to the device depth.
• The magnetic flux leakage in the 3rd direction is neglected.

Example: 2D Two devices are represented in the figure below. These two devices are built
plane study or on the same support (from the geometric point of view), but they do not
3D study? function in the same way (from physical point of view).

Device consisting of: Device consisting of:


• two magnets in opposition • two inductors
• two magnetic cores (2 yokes) • a magnetic circuit

Long device, but important 3D Long device and magnetic flux


effect (leakage at extremities) concentrated in the magnetic circuit

Discussion on the 2D / 3D choice:


• From geometric point of view:
These two devices can be described on cross section planes. Thus, a 2D
study can be considered in both situations.
• From physical point of view:
- a 3D study is recommended in the 1st situation, because there is an
important magnetic flux leakage at the back and in the front of the device
(due to the magnets in opposition).
- a 2D study is recommended in the 2nd situation, because the magnetic
fluxes, created by the inductors, have the same orientation. Thus, the
magnetic flux is strongly confined in the magnetic circuit, and therefore in
the cross section plane.

3D study In this type of study any geometry can be represented, but within the software
possibilities limits.

Continued on next page

USER GUIDE PAGE 177


Geometry: principles Flux

2D It is possible to carry out a 2D axisymmetric study if the device has


axisymmetric revolution symmetry around one of the axis.
study:
characteristics The geometric representation of the device is carried out on a cross section
plane.
Pay attention, the revolution axis of the geometry should be obligatorily
vertical and should pass through the origin of the coordinate system.
Although we speak about a 2D study (plane geometric representation), we
deal in fact with a 3D study. The device is entirely modeled, the global results
being provided for the whole volume of the device.

Example

y
Z
x
R
z

real object 2D axisymmetric geometry

Choice of The choice of the application (2D or 3D) is carried out at supervisor level
the application (Flux 2D or Flux 3D tabs).

PAGE 178 USER GUIDE


Flux Geometry: principles

8.1.2. 2D Example: Geometry and mesh tutorial

Foreword This paragraph is a summary of cases treated in detail in the 2D example:


"Geometry and mesh tutorial - First steps in using Flux".
The files relating to the studied cases are available in the documentation
directory of the Flux DVD.

Realized study The study proposed in the Geometry and mesh tutorial is the study of a
variable reluctance speed sensor. Only the geometry model and mesh of the
device are studied in this tutorial.

Studied device The variable reluctance speed sensor consists of a cogged wheel, a magnet
and a coil connected to a measuring resistance.

Functionality The rotation of the target wheel near the tip of the sensor changes the
magnetic flux, creating an analog voltage signal that can be recovered in
probes.

Continued on next page

USER GUIDE PAGE 179


Geometry: principles Flux

Geometric The device is described in Flux as follows:


structure in • one cogged wheel with three teeth
Flux • two probes with a magnet and a coil around

COIL 1+

MAGNET 1 PROBE 1
WHEEL
COIL 1-

COIL 2+

MAGNET 2 PROBE 2

COIL 2-

Strategy Two strategies of description exist:


• one-phase description:
• description of the whole device in only one Flux project
• two-phase description:
• independent description of separated parts of the device in several Flux
projects
• merging the independent projects into one
The second strategy is selected in this tutorial.
Of course, the geometry can be built in ways other than the presented one. The
sensor geometry is defined in this particular way in order to introduce you to
the most used PreFlux features.

PAGE 180 USER GUIDE


Flux Geometry: principles

8.1.3. 3D Example: Geometry and mesh (Tutorial)

Foreword This paragraph is a summary of cases treated in detail in the technical


document: "3D Generic Tutorial".
Flux files, relating to these various cases, are available on the CDROM of
documentation of the software.

Realized study The study proposed in the 3D Generic Tutorial of Geometry and Mesh is the
study of a variable reluctance speed sensor. Only the geometry model and
mesh of the device are studied in this tutorial.

Studied device The variable reluctance speed sensor consists of a cogged wheel, a magnet
and a coil connected to a measuring resistance.

Functionality The rotation of the target wheel near the tip of the sensor changes the
magnetic flux, creating an analog voltage signal that can be recovered in
probes.

Continued on next page

USER GUIDE PAGE 181


Geometry: principles Flux

Geometric The device is described in Flux as follows:


structure in • one cogged wheel with three teeth
Flux • two probes with a magnet and a coil around

WHEEL

COIL 1
PROBE 1
MAGNET 1

COIL 2
PROBE 2
MAGNET 2

Strategy Two strategies of description exist:


• one-phase description:
• description of the whole device in only one Flux project
• two-phase description:
• independent description of separated parts of the device in several Flux
projects
• merging the independent projects into one
The second strategy is selected in this tutorial.
Of course, the geometry can be built in ways other than the presented one. The
sensor geometry is defined in this particular way in order to introduce you to
the most used Flux features.

PAGE 182 USER GUIDE


Flux Geometry: principles

8.2. Study domain

Introduction This section refers to the definition of the study domain, i.e.:
• the definition of the study domain limits (device model)
• the possibilities of reduction the study domain with respect to the real
device by taking into account the repetitive patterns like periodicities and/or
symmetry planes of the studied device.

Contents This section contains the following topics:


• Study domain limits, generalities
• Truncation method
• The infinite box transformation
• Reduction of the study domain: symmetries and periodicities
• Periodicity property and periodicity conditions on the boundaries
• Symmetry and symmetry conditions on the boundaries

USER GUIDE PAGE 183


Geometry: principles Flux

8.2.1. Study domain limits, generalities

Electromagnetic In the study of electromagnetic phenomena it is necessary to model both


phenomena the device and the surrounding air. In fact, the quantities studied in
electromagnetics (electric fields, magnetic fields), are not considered null in
air or in a vacuum, contrary to other physics disciplines, mechanics, for
example, where air is not taken into account.

Finite element The finite element method is based on the subdivision of the entire study
method domain in a finite number of sub domains of finite size.

The physical problem is governed by a differential equation or with partial


derivatives that should be satisfied on all the points of a domain. To ensure
the uniqueness of the solution, boundary conditions on the outer edges
must be imposed.

Thus, to solve a problem with the finite element method, it is necessary to:
• set limits on the device model, i.e. to define the limits or boundaries of the
domain,
• impose boundary conditions on the edges, i.e., to define the values of the
state variable (potential, temperature) on the boundaries of the domain.

Apparent The finite element method requires limits on the problem region, while the
contradiction electromagnetic phenomena are unlimited.
In other words, open domains cannot be modeled by the finite element
method, because it is impossible to subdivide an infinite domain into a finite
number of finite sub-domains.

Study domain To offset this contradiction, different methods can be used.


limits: different
methods The first method (the truncation method) consists of closing the study
domain with an outer boundary sufficiently far away from the device so
as not to interfere with the results.
The second method consists of using a transformation that converts the open
domain into a closed domain.
These two methods are described in the following paragraphs.

Continued on next page

PAGE 184 USER GUIDE


Flux Geometry: principles

Study domain The truncation method consists of closing the study domain with an outer
limits: boundary sufficiently far away from the device so as not to interfere with
truncation the results.
method
The device is placed inside an air–filled box, and infinity is approximated by
a closed and remote truncation boundary. The size of the air-filled box is
adjusted so that the effects of the truncation boundary approximation can be
neglected.
The user must determine the quantity of air to model around the device, i.e.,
he or she must evaluate the distance at which the computed fields become
negligible.

Truncation The truncation method has certain disadvantages:


method:
• relatively high cost in terms of numbers of unknowns
disadvantages
• negligible field values near the truncation boundary

Modeling To compensate for these disadvantages, a second method consists of using a


infinity: using a transformation that converts the open domain into a closed domain.
transformation
The basic idea is to transform the open domain into a closed domain because
the open domain cannot be meshed.

Use of a The intial space is decomposed into two domains:


transformation,
• a closed interior domain, Eint
principle
• an open exterior domain, Eext
The initial space, with open borders, is transformed into a final space with
closed borders, in the following way:
• the interior domain (Eint) is not modified
• the exterior domain (Eext) is linked to a closed domain (Eext_image) through
a spatial transformation T.
Thus, the final space is composed of two domains:
• a closed interior domain Eint
• a closed exterior domain Eext_image
These two (closed) domains are meshed with classical finite elements.
Illustration Transformation T
Transformation T

m ( x, y, z ) M ( X, Y, Z )

Eext
Eext_image
Eint

Eint

Continued on next page

USER GUIDE PAGE 185


Geometry: principles Flux

Use of a To take into account the transformations in the equations, we suppose that :
transformation,
• the finite elements formulations are not modified (the state variable of the
principle
(continued)
initial domain and the state variable of the image domain are equal)
• new types of finite elements (transformed finite elements) are able to model
infinity.
Illustration Transformation
T
M ( X, Y, Z )
Representation m ( x, y, z )
of the exterior
domain

y Inverse Y
transformation
T -1
M (x, y) M (X, Y)

x X

Transformed finite element Image element

Choice of the Theoretically several space transformations can be used. The transformation
transformation of the real space into an image space must be bijective. It must also have
properties of continuity and derivability on and between the elements, etc.
In practice, the transformations used in the software take into account various
efficiency criteria: quality of the solution obtained for a number of elements
or unknown factors, simplicity of implementation and so on.

PAGE 186 USER GUIDE


Flux Geometry: principles

8.2.2. Truncation method

Introduction The truncation method consists of closing the study domain with an outer
boundary sufficiently far away from the device so as not to interfere with
the most important results.

At what To evaluate at what distance one should place the boundary, it is necessary to
distance should take into account the studied phenomena.
be placed the Generally we can say that:
border ?
• when the field is strongly confined within the structure (flux directed by
flux concentrators, Faraday cages, capacitor, etc.), a small quantity of air is
sufficient. The boundary can be placed directly on the device outline or near
it.
• when the field spreads strongly outside the structure (EMC, etc.), a large
quantity of air is necessary. The difficulty consists in the estimation of this
quantity.

Example Some rules for the positioning of the boundary for an open boundary
magnetic problem (device surrounded by air) are as follows:
• for a 2D plane study or a 3D study:
the boundary should be placed at a distance ranging between 5 to 10 times
the longest dimension of the device.
• for a 2D axi-symmetric study:
in the direction normal to the revolution axis, the boundary should be
placed at a distance ranging between 10 to 20 times the longest dimension
of the device, the variable r*AZ decreasing slowly in this direction.

Boundary The user must impose boundary conditions on the external boundaries of the
conditions study domain.

USER GUIDE PAGE 187


Geometry: principles Flux

8.2.3. The infinite box transformation

Infinite box: In the terminology of the software, using a transformation to model an infinite
definition domain is called the infinite box technique or method.
The exterior domain (infinite) is linked to an image domain (called the
infinite box) through a space transformation.
The use of the infinite box implicitly assumes a null field at infinity.

Infinite box, The transformation used in Flux 3D, said to be in a parallelipipedic layer (not
Flux 3D a skewed surface), is described by two superimposed parallelepipeds or
cylinders. The faces of the exterior parallelepiped or cylinder are the image of
the infinite, where the potential and field are equal to zero.

Interior domain Exterior image domain, Representation of the two


i.e., infinite box domains by the software

Infinite box, For Flux 2D, the infinite box is described by two superimposed discs (crown
Flux 2D shaped). The external circle is the image of the infinite.

External image domain, i.e. Representation of the two


Interior domain
infinite box domains by the software

Continued on next page

PAGE 188 USER GUIDE


Flux Geometry: principles

How to The dimensions of the infinite box are defined by the user. This requires a
choose the certain experience because there is no general rule.
dimensions ?
We can, however, give some advice:
• the distance between the device and the interior surface of the infinite box is
at least equal to the dimension of the device in this direction
• the dimensions of the infinite box are related to the mesh. In Flux 3D, the
number of elements on the thickness of the box must be roughly equal (at
least) to two (second-order elements) or to three (first-order elements).

The mesh and the size of the infinite box must take into account the
phenomena studied, and the computations to be performed as follows:
• if one is interested in computing a global or a local quantity inside the
device, it is unnecessary to refine the mesh of the infinite box;
• if on the contrary, one is interested in computing the field created outside
the device, one should define a box of more significant size and refine the
mesh inside.

It is recommended to parameterize the dimensions of the infinite box to


adjust its size during the meshing.

Boundary Flux automatically assigns boundary conditions on the infinite box.


conditions

USER GUIDE PAGE 189


Geometry: principles Flux

8.2.4. Reduction of the study domain: symmetries and periodicities

The main ideas: In most cases, a preliminary analysis of the device highlights the presence of
decrease the repetitive patterns (periodicities) or symmetry planes.
study domain
Under these conditions, it is possible to reduce the study domain as follows:
• representation of a fraction of the device
• assignment of appropriate boundary conditions on the model boundaries
that reflect the periodicity property or symmetry conditions.

Interest The consequences of a reduction of the device model are as follows:


• a simplification of the geometrical description
• a reduction of the finite element problem size (and thus the file size).
The rationale for reducing the problem size is the reduction of the
computation time. The computation time is roughly proportional to the
square of the number of unknowns.
Example: If a problem comprises N unknowns, but after reduction of the
model only N/2 unknowns, the global computation time will be reduced by a
factor of 4.

Reduction of It is possible to simplify the device model if it has geometrical and physical
study domain periodicities and/or symmetries at the same time.
and boundary
conditions In other words, it is possible to simplify the device model, when specific
conditions applied on the state variable (potential) allow the representation of
a fraction of the device.
The boundary conditions are physical concepts. These concepts are briefly
illustrated through a magnetic example (magneto-static, transient magnetic or
magneto-harmonic application).

Continued on next page

PAGE 190 USER GUIDE


Flux Geometry: principles

Example: The modeled device is a magnetic levitation device. It consists of a group of


presentation coils, a magnetic flux concentrator and a plate.
Problem analysis:
This device can be described as a group of repetitive linear patterns: a
succession of coils in opposition.
• from the geometrical point of view, the base pattern includes only one coil
• from the physical point of view, the base pattern includes two coils in
opposition.

Example: The authorized subdivisions of the model depend on the various types of
different boundary conditions set on the model boundaries.
models
The various possible models are shown in the figures below. The boundary
conditions set on the boundaries in these different configurations are
explained in the following paragraphs.

USER GUIDE PAGE 191


Geometry: principles Flux

8.2.5. Periodicity property and periodicity conditions on the


boundaries

Periodicity When a device has repetitive patterns, it is possible to model a fraction of the
device (the basic pattern), and to impose appropriate periodicity conditions on
the periodicity planes.
From a physical point of view, periodicity boundary conditions are set via the
state variable (potential).

Periodicity condition Anti-periodicity condition


(or cyclic) (or anti-cyclic)

Identical values of the variable on the Opposite values of the variable on


homologous nodes the homologous nodes

Example Let’s reconsider the preceding example.


The boundary conditions to impose on boundaries 1 and 2 are periodicity
conditions:
• periodic type (or cyclic)
in the 1st case (study domain 1)
• anti-periodic type (or anti-cyclic)
in the 2nd case (study domain 2 and 2')

PAGE 192 USER GUIDE


Flux Geometry: principles

8.2.6. Symmetry and symmetry conditions on the boundaries

Symmetry When a device has symmetry planes, it is possible to represent a fraction of


the device, and to set appropriate symmetry conditions on the symmetry
planes.
From a physical point of view, the symmetry boundary conditions are set on
the state variable (potential).

Symmetry condition Anti-symmetry condition

Example Let’s reconsider the preceding example.


The boundary conditions applied on the device boundaries are symmetry
conditions (tangential field) on boundary 1 and anti-symmetry (normal field)
on boundary 2.

USER GUIDE PAGE 193


Geometry: principles Flux

PAGE 194 USER GUIDE


Flux Geometry: principles

8.3. Characteristics of geometry building module

Introduction This section deals with the operation of the geometry building module:
principle of construction algorithms, authorized shapes, difficulties that may
occur during the construction of geometry, ...

Contents This section contains the following topics:


• Presentation of the geometry building module
• Lines and faces: authorized shapes
• Lines and faces: superpositions and intersections
• Limits of the geometry building module
• Another functionality: nature of points, lines and faces

NEW TOOLS: Starting from Flux 12 version, to CAD tools have been added to facilitate the
Sketcher / geometry description, the Sketcher 2D and the Modeler 3D. To consult the
Modeler functionalities of these tools, please consult chapter in the online help
accessible directly from Flux software in the menu Help  Help (HTML
Documentation)

The previous method always exists and is presented in the following


paragraphs. But we recommend that you change the method and use the
Sketcher in 2D and Modeler in 3D, which will become the default tools in the
future.

USER GUIDE PAGE 195


Geometry: principles Flux

8.3.1. Presentation of the geometry building module

Introduction The geometry building module of Flux is of boundary type, which means
that a volume is described by the bordering faces and a face is described by
the bordering lines and a line is described by points.

Outline of the The geometry is created in ascending way: first the points, then the lines, and
different steps finally the faces and the volumes.
The table below gives a first outline of the description mode of the device
geometry.

Step Description
1 Creation of points Manually by the user
2 Creation of lines Manually by the user
3 Identification/construction
Automatically by the software
of faces
4 Identification/construction
Automatically by the software
of volumes

Creation of The points and lines are defined manually (input of point coordinates,
points and lines selection of the ends of the lines, …).

Construction of The faces and the volumes are automatically identified and created
faces and (algorithms of automatic construction).
volumes
(new Principle of automatic construction of faces:
algorithms) • Flux computes all the existing surfaces and it determines to which surfaces
belong the points and the lines (A surface contains faces but it is not limited
and it is defined by three points linked by two lines).
• The automatic creation of faces is then realized with the aid of a technique
of identification of closed outlines.
The principle of the construction of volumes is similar, but more complex,
due to the 3D effect.

Construction of In case of difficulties at automatic construction of faces and volumes, the old
faces and algorithms of automatic construction are available.
volumes
(old algorithms) With the old algorithm, each surface is automatically meshed with very loose
meshes. By grouping the topological surface elements, the software identifies
the faces inside each surface.
The principle of the construction of volumes is similar, but more complex,
due to the 3D effect.

Continued on next page

PAGE 196 USER GUIDE


Flux Geometry: principles

Specificities of To define the geometry description possibilities offered by the geometry


the geometry building module, it is necessary to answer to the following questions:
building
module
• What are the different authorized shapes of lines and faces?
• How are managed the intersections / superpositions of lines, of lines with
faces?
• What are the limits of the algorithms of identification and of automatic
construction of faces and volumes?
These different items are treated in the following paragraphs.

USER GUIDE PAGE 197


Geometry: principles Flux

8.3.2. Lines and faces: authorized shapes

Lines and faces Lines and faces can be:


• created by Flux
• or imported within a CAD file.
Their shapes depend on their origin.

Lines created The shape of line depends on the tool used by Flux to build the geometry. The
by Flux lines created by Flux are as follows:

Shape of line Construction


• segment • by entering extremity points of lines (mainly)
• arc of circle • by propagation
• by extrusion
• helical line • by extrusion only

Lines imported Within the CAD file importation into Flux project, the lines of an unspecified
in Flux shape can be imported.

Faces built by The shape of face depends on the tool used by Flux to build the geometry.
Flux The faces built by Flux are as follows:

Shape of face Construction


• planar • with the aid of automatic construction algorithm
• cylindrical
• conical
• planar • by propagation
• cylindrical • by extrusion
• conical
• spherical
• toroidal
• helical

Faces imported Within the CAD file importation into Flux project, the faces of an unspecified
in Flux shape can be imported.

PAGE 198 USER GUIDE


Flux Geometry: principles

8.3.3. Lines and faces: superpositions and intersections

Intersections The bordering property of the geometry building module entails the
and interdiction of the intersections of lines, of faces and of lines with faces.
superpositions
The superpositions of line/face type, i.e. lines belonging to a face, or face/face
type, i.e. faces belonging to a face, are authorized.
These different cases are presented below.

Intersections, The intersections and partial or total superpositions of the lines presented in
superpositions the figure below are not authorized and in this case the construction of faces
of lines is not possible.

Lines belonging The lines belonging to faces are authorized. An example is presented in the
to faces next figure.

Lines L5 and L6 are L1


internal lines of face F1. F1 L7

L2 L6
F2 L10 L4
L8
L9 L5

L3

Intersections of The intersections of line/face type are not authorized, but they do not block
line/face type the construction of faces and volumes.

Faces belonging Faces belonging to faces are authorized. An example is presented in the figure
to faces below.
FACE 1 described by 8 lines

FACE 2 described by 4 lines

Continued on next page

USER GUIDE PAGE 199


Geometry: principles Flux

Intersections of The intersections of faces are not authorized and thus the construction of
faces volumes is blocked. An example is presented in the figure below.

The faces of the parallelepiped


intersect the circular face of the inner
cylinder of the torus.
Thus, the faces and the volumes
cannot be built.

Intersections of To avoid the previous problem, it is possible to ignore some faces in the
faces: to avoid moment of volumes building.
problems This method is presented in paragraph 8.3.5 “Another functionality: nature of
points, lines and faces”.

Available Flux owns tools to correct the intersections and superposed entities in
corrections automatic or manual manner, presented in section 9.2 “Geometry importation
(IGES, STEP, DXF, STL, FBD, INTER formats)”

PAGE 200 USER GUIDE


Flux Geometry: principles

8.3.4. Limits of the geometry building module

Introduction The algorithms of automatic construction of faces and volumes are powerful,
but difficulties can however arise, being determined:
• either by a «bad» geometrical description: problems of intersection or
superposition of entities, …
• or by numerical problems, ….

Construction Construction problems may occur in the presence of:


problems
• overlapping points, or lines of null length;
connected to
intersection/ • intersection or superposition of lines;
superposition of • intersection of faces.
objects
These different items are treated in the preceding paragraph.

Numerical Numerical problems of recognition of faces or volumes can also occur in the
problems of presence of faces characterized by too important numerical waves.
recognition of
faces or What is the problem ?
volumes The algorithm of automatic construction of faces identifies in the first step all
the existing surfaces, then, it determines to which surfaces belong the points
and the lines. A surface is defined by four coefficients computed from the
coordinates of three points. The test of association of points to surfaces is
defined with an error criterion (epsilon tolerance criterion) and it may occur
that the points and lines that the user consider in the same surface will not be
considered in the same surface by the software. In this case, we speak about
significant numerical waves.
This kind of situation may occur when the points are described by a "cascade"
of parameters, of local coordinate systems and of transformations. When the
point coordinates are evaluated in a global coordinate system, there is an
accumulation of numerical errors and the tolerance is then exceeded.
In spite of a very particular care taken for solving these numerical problems,
it may occur, in case of complex geometries, that the automatic construction
of faces or volumes raises difficulties.

USER GUIDE PAGE 201


Geometry: principles Flux

8.3.5. Another functionality: nature of points, lines and faces

Problems There is a certain number of situations where the user may want to modify the
consideration of the entities (points, lines, faces) during the automatic
construction of the faces and/or volumes.
Two examples are given hereafter to illustrate this type of situation.

Example 1 The first example reconsider the problem of intersection between faces
(blocking for building the volumes). This example has already been
presented.
In this example (figure to the right) the
constitutive faces of the internal
parallelepiped intersect the internal circular
face of the torus. The volume of the bar
inside the torus cannot be built.
To avoid this difficulty, it is necessary to
ignore the two circular faces during the
automatic construction of volumes.

Example 2 The second example consists in the numerical modeling of a ship (“La
Fayette” frigate of the French Marine represented in the figure below).
The ship structure is only made up of bars, which are represented and
modeled via the lines (line regions). For this type of structure that is relatively
complex, the use of the algorithm of faces and volumes construction is
expensive, it often takes a long time and it generates many useless faces and
volumes.
To avoid this difficulty, we should place the lines within an air volume
without building the group of faces and volumes that will not be used.

Continued on next page

PAGE 202 USER GUIDE


Flux Geometry: principles

Solution: the To allow the user to modify the consideration of entities when building the
nature attribute faces and volumes, a specific feature (called nature) is attached to the points,
lines and faces.

Attribute The nature attribute allows us to set the following functions:


nature
The entity is taken into account for:
Nature
the geometry the mesh
Standard (STANDARD) yes Yes
in air (IN_AIR) no Yes
ignored (NO_EXIST) no No

Return to To ignore the annoying circular faces, the user should modify the nature of
example 1 these faces (“ignored”) and restart the automatic building of volumes. These
faces are then ignored at the geometry level (and also at the mesh level).
Note: These faces are not destroyed. They still exist and are visible on the
screen (in the visibility conditions that allow their visualization).

Return to To avoid the building of faces and volumes of the ship, the user should
example 2 modify the nature of the points and lines of the ship (“in air”) and then start
the construction of faces and volumes. Thus, a single group of faces
(boundaries of the study domain) and one volume (air volume that includes
the group of lines and faces) will be built.
The points and the lines:
• are not taken into account during the construction of faces and volumes
• are taken into account during the mesh building and assignment of line
regions
The simplified geometry in a wire-mesh shape of the “La Fayette” frigate
consists of about 3 300 points and 8 556 lines on which the (“in air”) nature
has been imposed. These points and lines are placed within an air volume
surrounded by the infinite box (24 faces and 7 volumes).

USER GUIDE PAGE 203


Geometry: principles Flux

PAGE 204 USER GUIDE


Flux Geometry: principles

8.4. Tools of geometry building module

Introduction This section deals with the assisting tools for geometry building: parameter
setting, tools for rapid construction of particular patterns, ...

Contents This section contains the following topics:


• Parameterization
• Concepts of propagation and extrusion

USER GUIDE PAGE 205


Geometry: principles Flux

8.4.1. Parameterization

Introduction The parameterization of the geometry is one of the strong points of the
geometry building module.
It is possible to parameterize:
• dimensions of workpieces
• relative displacements of pieces (variable air-gap, …).

Parameterization A geometrical object can be parameterized:


tools
• on one hand, using the geometrical parameters,
• on the other hand, using the local coordinate systems (coordinate
systems defined with respect to a reference coordinate system).
These concepts are presented in the example below.

Example The example refers to the study of a contactor, concerning the force acting
on the moving part for various values of the air-gap.

The fixed part is defined in a local coordinate system REP1 of center (0, 0,
0), and the moving part in a local coordinate system REP2 of center (0, 0,
AIR-GAP). AIR-GAP is a parameter whose value is equal to the air-gap
thickness.

To study various positions of the moving part, and thus various values of
the air-gap, it is enough to modify the value of the corresponding parameter
(AIR-GAP) and to treat the corresponding case.

Continued on next page

PAGE 206 USER GUIDE


Flux Geometry: principles

Principle and Each time that a geometrical entity is modified, all the entities depending on
limits this geometrical entity are automatically reevaluated through the database
tools.
Modifying a parameter or a coordinate system entails the modification of the
points, then of the lines, and then of the faces and volumes that are attached to
this parameter.
Important: the coherence of the topology (intersection, superposition, …)
is not verified by the software. This verification is a user task.
In the previous example, a null value of the AIR-GAP parameter leads to a
modification of the geometry topology that can not be realized due to
superposed points and lines. This limit case cannot be treated by
parameterization.

Advice Defining local coordinate systems using a first coordinate system allows the
user to define a "father coordinate system", to which is attached a series of
"children coordinate systems". By modifying the "father coordinate system"
the user will modify the series of "children coordinate systems" attached to
this first coordinate system and thus, the group of points, lines, …attached to
it.
The user can also define a coordinate system in another coordinate system,
and the latter defined in a third coordinate system, ... This description of
intermediary coordinate systems “in cascade” can be useful, especially in case
of multiple rotations. However, in this case, the risk of numerical problems
for the algorithms of identification and construction of faces is more
important.

USER GUIDE PAGE 207


Geometry: principles Flux

8.4.2. Concepts of propagation and extrusion

Introduction To facilitate the geometrical description, various tools for automatic


construction are proposed.They allow the duplication of repetitive geometrical
patterns, or the fast construction of structures presenting symmetries, ...
Using the Flux vocabulary we speak about construction by propagation or
extrusion. These concepts are clarified below.

Propagation, The basic idea is to automatically generate new objects, based on the objects
extrusion: already created (points, lines, faces) by using transformations; transformations
definition are geometrical functions of translation, rotation, or affinity type.
At the vocabulary level, we speak about propagation when the created objects
(images) are not connected to the basic objects (sources) and about extrusion
when these objects are connected among them by connection elements. The
connection elements can be of rectilinear or curvilinear type (straight segments
or circle arcs).
These concepts are illustrated in the example below.

Example In the figure below, the basic face, a rectangle, is propagated/extruded using a
transformation of vectorial translation type.
• The propagation automatically generates 2 new rectangles (4 points and 4
lines).
• The rectilinear extrusion automatically generates 2 new rectangles (4 points
and 4 lines) as well as 8 connection elements (8 straight lines).

PAGE 208 USER GUIDE


Flux Geometry: principles

8.5. Geometry building: general steps

Introduction This section presents the general steps for building the device geometry

Contents This section contains the following topics:


• Geometry building process

USER GUIDE PAGE 209


Geometry: principles Flux

8.5.1. Geometry building process

Outline An outline of the geometry building process is presented in the table below.
The different steps are detailed in the following blocks.

Step Description
1 Device analysis
2 Definition of the study domain
3 Preparation of the geometric construction tools
4 Ascending construction of the geometry
5 Regrouping in regions

Device analysis The first step of the geometry building process is the device analysis:
(1)
• to define the study domain, and
• to prepare the geometric description
The questions that could arise at this level, before starting the description
itself, are grouped in the tables below (non exhaustive list).

Analysis to: Device features


• Does the device have geometric and/or physical
define the study symmetries or periodicities?
domain • Can it be studied using the infinite box feature or should
we limit the study domain in a different way?

Analysis to: Device features


• Can the device be simplified without consequences on
the study physics: approximation of complex shapes,
prepare the
removal of rounded corners, chamfered edges,
geometric
holes, …?
description
• Does it have moving parts, variable thickness, repetitive
patterns, …?

Analysis to: Is it necessary


prepare the mesh • to add points, lines, or faces in order to make easy the
mesh building (skin depth, …)?

Analysis to: Device features


prepare the • Does the device have specific shapes (such as thin bars,
physical air gaps or magnetic armatures, …) that can be replaced
description by points, lines or faces (considered as point, line or
surface regions)?

Continued on next page

PAGE 210 USER GUIDE


Flux Geometry: principles

Next steps The other steps of the geometry building process are described in the table
(2, 3, 4, 5) below.

Step of The user


… creates … builds … assigns …
the symmetries
Defining the
the periodicities
study domain (2)
the infinite box
the geometric
Preparing the parameters
geometric the local coordinate
building tools (3) systems
the transformations
Ascending
the points the faces
construction of
the lines the volumes
the geometry (4)
the point regions the regions to
Regrouping in the line regions points, lines,
regions (5) the face regions faces, volumes
the volume regions respectively

Operations The different steps were presented in a “chronological” building order.


order
In practice, the geometry building process is not always linear and the user
proceeds by successive steps. In this case, he makes “go and return” between
different steps.

USER GUIDE PAGE 211


Geometry: principles Flux

PAGE 212 USER GUIDE


Flux Mesh: principles

9. Mesh: principles

Introduction This chapter presents necessary information for mesh construction using
Flux: presentation and definition of the meshing process, different mesh
generators and different setting tools …
It also presents general operations of the mesh construction (choice of mesh
generator, mesh adjustment …) and examines specific mesh utilization (skin
effect, mechanical sets …).

Contents This chapter contains the following topics:


• Mesh: Overview
• Mesh generators (shape of mesh)
• Adjustments (mesh size)
• General steps of the mesh process
• Advice for specific mesh

Additional Complementary elements (advanced user)


elements
• Automatic mesh parameters (options)

Reading advice The user who wishes to read targeted information on automatic mesh can
consult section « 9.3.6 Aided mesh».

USER GUIDE PAGE 213


Mesh: principles Flux

PAGE 214 USER GUIDE


Flux Mesh: principles

9.1. Mesh: Overview

Introduction This section contains the definition of a mesh and basic rules to apply in order
to carry out an optimal mesh.

Contents This section contains the following topics:


• Introduction to meshing
• A valid mesh: rules to follow

USER GUIDE PAGE 215


Mesh: principles Flux

9.1.1. Introduction to meshing process

Definition The meshing process consists of dividing the study domain into mesh
elements.
The summit of a mesh element is called a node.
Mesh or elements are called:
• volume elements, for a volume domain
• surface elements, for a surface domain
• line elements, for a line domain

Meshing and The meshing process is a key step in the finite element method The finite
finite elements element method calculates and gives an approximation of the state variables
on each node of the mesh, (scalar or vector potentials, temperature,…) and of
the fields which are derived from (magnetic field and induction, electric field,
flux thermal density,…)

Mesh and The mesh is an important factor of the result quality. Thus, the quality of the
results solution depends on:
• the number and the dimensions of the finite elements,
• the interpolation functions in each element, which can be 1st or 2nd order
polynomial functions,
• the continuity conditions imposed on the sub-domain boundaries.

Mesh elements The different forms of the mesh elements are presented in the table below.
form

Face mesh Volume mesh

Tetrahedron
Triangle
Pentahedron

Hexahedron
Rectangle
Pyramid

PAGE 216 USER GUIDE


Flux Mesh: principles

Structure of a In terms of the geometry, a volume element is characterized by its vertices,


mesh element edges and faces.
vertice
hedge

face

Elements of 1st Different types of finite elements are available to the user: these are called 1st
and 2nd order order elements or 2nd order elements.
Specific information about these elements is presented in the following table.

Type of Position of nodes Interpolation function


element
1st order Vertices Linear (1st order polynomial)
2nd order Vertices + middle of edges Quadratic (2nd order polynomial)

Field Using 1st order elements: the potentials are approximated linearly and the
calculation: 1st fields derived from the potentials are constant.
and 2nd order Using 2nd order elements: the potentials are approximated quadratically and
approach the fields are approximated linearly.

Element Potentials Field


st
1 order Linear approximation Constant
2 nd order Quadratic approximation Linear approximation

Note: more memory is needed to solve a problem meshed with second order
elements but the quality of the results is more precise.

USER GUIDE PAGE 217


Mesh: principles Flux

9.1.2. A valid mesh: rules to follow

Introduction Quality of results depends on mesh element quality. Some recommendations


on how to obtain a good quality mesh in Flux are described in the following
blocks.

General rules We can establish some general rules:


• The finite elements should be “well proportioned”. The ideal elements for
a surface mesh are equilateral triangles and squares. The ideal elements
for a volume mesh are regular tetrahedrons and cubes. However, thanks
to the second-order transformation used, the elements can be deformed
within certain limits. The above table describes the geometry quality criteria
for face elements (triangle, quadrangle).

Triangle
 > 15°

Quadrangle
L / l < 5 ;  > 20°

• The mesh should not be unnecessarily fine. A fine mesh requires a longer
computation time. One may need to find a compromise between an
accurate geometrical representation of the study domain and a
reasonable computation time.
• Mesh elements located close to the study domain limits (i.e. close to the
Infinite box) can be more relaxed.
• To mesh a complex shaped domain is an iterative process. One should try to
utilize the available mesh tools in order to obtain a satisfying result.

Continued on next page

PAGE 218 USER GUIDE


Flux Mesh: principles

Mesh and the It is necessary to adapt the mesh to the physics of the problem, as much as
physics of the possible. The mesh refinement depends on the geometrical constraints, e.g.,
problem the mesh of a very thin region, but also on the physical constraints of the
problem, such as a high variation in the permeability within an element, skin
depth, etc.
As a general rule, a strong variation of the state variable requires the use
of smaller elements.
When one has some idea about the final result, he can decide on a relaxed
mesh in certain regions and a fine mesh in others. Analysis of the
computation results may lead one to restart the computation with a new and
better-adapted mesh.
Thus, one should always consider the mesh while the geometry is being
constructed.

Examples of Different physics criteria may be used to validate a mesh. One can verify the
criteria to following points:
validate a mesh • Once solved, if the field lines form cracks in the same region, the
neighboring elements are too large.
• On a rotating machine, if the reaction force is different from the action
force, the mesh on the air-gap region should be refined for more accurate
precision.
• With circuit equations, if the current through a coil computed by several
methods differs significantly, the mesh on the coil region should be
refined.
• The mesh of a solid conductor must contain at least two element in the skin
depth (cf. § 9.5.5. Mesh of solid conductor with skin effect).

USER GUIDE PAGE 219


Mesh: principles Flux

PAGE 220 USER GUIDE


Flux Mesh: principles

9.2. Mesh generators (shape of mesh)

Introduction This section presents the different mesh generators available in Flux and their
use.
A mesh generator is a tool that subdivides the geometry into finite elements.
A mesh generator permits the user to define the shape of the elements used
to mesh the different sub-domains of the project.

Contents This section contains the following topics:


• Automatic mesh generator
• Mapped mesh generator
• Linked mesh generator
• Extrusive mesh generator
• Mesh generator of the « No mesh » type
• Fully automatic meshing or mixed meshing: comparison

USER GUIDE PAGE 221


Mesh: principles Flux

9.2.1. Automatic mesh generator

Definition This mesh generator, based on the Delaunay method, is the basic mesh
generator in Flux.
It permits the meshing :
• in triangles, of any face, starting from the meshed lines of the face contour
• in tetrahedrons, of any volume, starting from the meshed faces of the
volume.
The mesh refinement is controlled by the node distribution on the boundary
contours.

Use This mesh can be used in all situations (complex shapes, etc.). It is robust,
simple and fast to use. It ensures low distortion of triangles and tetrahedrons.

Limitation This mesh generator generates more elements than a mapped mesh generator.

Example The meshing of a face and of a volume by means of an automatic mesh


generator is illustrated in the figure below:

Triangle Tetrahedron

Optimisation There are algorithms that permit automatic meshing


for the • race mesh regularization
automatic mesh • automatic volume meshing Delaunay method/advancing front method
• Mesh optimization for volumes
These optimization algorithms are presented in detail in section 9.5
Automatic mesh parameters (options).

PAGE 222 USER GUIDE


Flux Mesh: principles

9.2.2. Mapped mesh generator

Definition This mesh generator allows one to mesh :


• the rectangular faces in rectangles (or quadrangular elements)
• parallelepiped volumes in « bricks » (hexahedral elements)
The contour of a face is divided into four lines, each one meshed so that two
opposite lines have the same number of elements. The surface to be meshed is
topologically equivalent to a rectangle. For the mapped mesh of a volume, the
volume is topologically equivalent to a parallelepiped form.
The user has full control over the number and the quality of the elements.

Illustration The meshing of a face and of a volume by means of a mapped mesh generator
is illustrated in the figure below.

Example

Rectangle, “Brick”
Quadrangle Hexahedron

Note: it is possible to use a mapped mesh generator on a face with more than four
lines. It is necessary to define the structural boundary of the face by identifying the
four principal points of the face.
P1
P2

P4 P3

Use This mesh generator is particularly useful to mesh thin regions (air gaps, thin
laminations, skin depth).
It permits the reduction of mesh disturbance effects (noise) on results by
using the symmetries of the device.
It is economic (reduction of the number of nodes).

Limitation This mesh generator takes longer and more difficult to implement than the
automatic mesh generator.

Continued on next page

USER GUIDE PAGE 223


Mesh: principles Flux

3D specificity The mapped mesh generator for volumes is less powerful than the mapped
mesh generator for faces. The geometry of the volume to be meshed must be
close to the geometry of a cube in order that the mesh quality is good.
Note that a degradation of the mesh can be observed in cylindrical volumes.
The mapped mesh generator does not accept volumes having cylindrical faces
of 180 degrees or more. If the elements are too fine, the mesh may become
unusable for the computational process..

2D Examples Examples of faces meshed with the mapped mesh generator are presented
below.

Mapped meshing of 4-line faces

The first face is a quadrilateral. The top and


bottom lines are geometrically meshed and the
mesh is perfectly propagated inside of the
face.

The second face is a 180-degree piece of ring.


A geometric line subdivision is used in the
radial direction. The mesh is perfectly
propagated inside of the face.

Continued on next page

PAGE 224 USER GUIDE


Flux Mesh: principles

Mapped meshing of 5 or more-line faces


The face shown below is composed of twelve
lines and points. It is characterized by
significant concavities. The structure is
formed using the four end points on the left
and on the right. The other eight points are
angular. The resulting mesh is incorrect.
To obtain a valid mesh, this face should be
subdivided, e.g., into five faces.

Two examples of mapped mesh of a concave


face bordered by six lines. Depending on the
mesh discretization, the mesh will be correct
or not. Subdivision of the face into two faces
is recommended to insure a quality mesh.

3D example Some examples of volumes meshed with the mapped mesh generator are
presented below.

Volume meshed with the mapped mesh generator

Mapped mesh of a hexahedron with planar


faces: the elements are of good quality.

Continued on next page

USER GUIDE PAGE 225


Mesh: principles Flux

The mesh of the first tile is not perfect, but the


deformation of the elements stays within
acceptable limits, so the mesh is correct.

The second tile is thinner. It has a thinner


mesh across the volume. The elements are
very distorted and most of the elements that
touch the internal face are not correct. To
obtain a correct hexahedral mesh, one can
either sub-cut the volume, or, (preferable for
this geometry), use an extrusive geometric
mesh generator with a mapped base.

PAGE 226 USER GUIDE


Flux Mesh: principles

9.2.3. Linked mesh generator

Definition The linked mesh generator allows the user to impose the same meshing on all
the linked faces by means of a geometric transformation. This means that the
meshing of the base face is copied on the linked faces.

Illustration The meshing of three faces by means of a linked mesh generator is illustrated
in the figure below.

Example Linked mesh on the two right faces by means of a


linked mesh generator defined by a transformation
of translation type.

Use The linked mesh generator is used to :


• accelerate and parameterize the meshing of repetitive 2D structures. This
function is very useful for the meshing of motor slots.
• diminish the meshing noise on the results by taking advantage of the device
symmetries
The linked mesh generator must necessarily be used to apply conditions of
periodicity on the faces in the 3D models. A periodicity condition requires
having the same number of nodes on the linked faces.

Restriction This mesh generator can be used only on faces.

Example Linked mesh of rotor and stator slots of a motor.

This motor is described in detail


by the technical paper “End
winding characterization with
Flux 3D”.

USER GUIDE PAGE 227


Mesh: principles Flux

9.2.4. Extrusive mesh generator

Definition The extrusive mesh generator permits the meshing in regular layers of the
faces or of the volumes obtained by extrusion.
A base meshed line is « shifted » along a meshed path, following a simple
motion of translation or rotation. Thus, a meshed face in quadrangles is
generated. The same method is used for the extrusive meshing of volumes. In
this case, a base meshed surface is « shifted ».
The obtained elements of the extrusive mesh are :
• Quadrangles, on faces
• prisms or hexahedrons on volumes, following the type of meshing of the
base faces (triangles or rectangles)

Illustration The meshing of a face and of a volume by means of an extrusive mesh


generator is illustrated in the figure below.

Example Meshing of a face with an extrusive mesh generator


defined by a transformation of rotation type

Quadrilateral
rectangle

Example Meshing of a volume by an extrusive mesh generator defined by a


transformation of rotation type

The mesh is potentially anisotropic and the volume elements are prisms or
hexahedrons, depending on the mesh elements of the original face (triangles or
rectangles)

Application The mesh generator is particularly interesting when meshing thin regions (air
gaps, thin laminations, skin depth).
It reduces the mesh disturbance effect (noise) on results using the symmetries
of the device.
It has an economic effect by reducing the number of nodes necessary to
construct the mesh.

PAGE 228 USER GUIDE


Flux Mesh: principles

Restriction This mesh generator takes longer and is more difficult to implement than the
automatic mesh generator.

2D specificity Originally developed to mesh volumes, the extrusive mesh generator can also
be assigned to faces.
To obtain an extrusive mesh on faces, a prerequisite is that the face be
obtained by extrusion with an existing transformation (rectilinear extrusion by
translation, positive ratio affinity, or curvilinear extrusion by rotation)

Extrusive mesh of a
quarter circle. Extrusion
from the base line by a
rotation of 90°.

Example Let us consider device below which consists of eight volumes, meshed by
extrusion (extrusion by translation for the first four volumes and extrusion by
rotation for the other four volumes).
Two different extrusive meshes have
been carried out, one with a triangular
base, the other with a rectangular
base.
On these meshes, one can notice :
• the capacity to mesh while forming
a cycle.
• an extrusive mesh in rotation with
specific elements near the axis
(prisms, tetrahedrons, pyramids).
• the direction of extrusion of low
importance

USER GUIDE PAGE 229


Mesh: principles Flux

9.2.5. Mesh generator of the « No mesh » type

Definition The user can choose this mesh generator (absence of meshing), if they wish
not to mesh an internal zone in the geometry.
Example: simulate a conductor with constant value in an electrostatic field.

Example In the example below, a NO_MESH mesh generator type is allotted to face 5.

Use This mesh generator allows the user to reduce the number of nodes.

PAGE 230 USER GUIDE


Flux Mesh: principles

9.2.6. Fully automatic meshing or mixed meshing: comparison

Introduction Two mesh strategies are proposed:


• mesh the whole of the domain with one mesh generator: the automatic
mesh generator
• carry out a meshing by subdomains (mixed meshing), by using, for each
domain, the mesh generator that is the best adapted to the physical
phenomena to be modelled

This choice is made from case to case, and it depends on the constraints
connected to the modelled device.

Managing the The meshing operation must observe a certain number of constraints
constraints connected with the modeled device.

Constraint Description of the constraint Managed by


To respect the geometry of the device
Geometrical The software
(interfaces between different volumes)
To adapt the model to the physics of the
Physics The user
problem (thin air-gap, skin depth)

Automatic For an automatic mesh, the software completely ensures that the geometrical
mesh interfaces are respected.
To accomplish this, the algorithm of the automatic mesh generator inserts
additional nodes on the faces or inside the volumes, so as to respect the node
density information assigned to the points and lines.

Mixed mesh With a mixed mesh, the user has more options to adapt the mesh to the
physics of the problem.
On the other hand, they can face certain limitations of the software (in 3D) ;
the conformity of the meshing at the level of the geometric interfaces can
sometimes be difficult to carry out by the software.

Mixed mesh: When modeling electro technical devices, mesh the air and volumes with
examples of use complex topology with the automatic mesh generator, while the more
sensitive parts (magnetic circuit, air-gap, skin depth, etc.) are generally
meshed with the mapped or the extrusive mesh generator.
When modeling rotating machines, it is advisable to generate an identical
mesh on the faces (slots of machines, etc.), with the linked mesh generator.

Continued on next page

USER GUIDE PAGE 231


Mesh: principles Flux

Constraint of The mesh must conform, i.e. there must be a “continuity” or matching of
mesh elements on the interfaces between different domains.
conformity
If it is common to mix triangular and rectangular elements in 2D, mixing
hexahedral and tetrahedral elements in 3D can pose certain problems.
In 3D, the conformity with the interface between the meshed domains with
hexahedrons or prisms, and the meshed domains with tetrahedrons is ensured
by the automatic insertion of pyramid elements.
An example is represented in the figure below.

Example of An example of non-conformity on the interface between two domains is


non-conformity shown below. The first is meshed with hexaedrons and the second volume is
meshed with tetrahedrons.

Two triangular surface elements


consisting of faces with two
tetrahedral elements, correspond to a
rectangular surface element that is a
face of a hexahedron

This situation appears when a mapped meshed volume is in contact with a linked
meshed volume. The non conformity is forbidden in Flux

Continued on next page

PAGE 232 USER GUIDE


Flux Mesh: principles

Algorithm for To ensure conformity of the mesh, Flux uses an algorithm to repair non-
repairs of non- conformities between hexahedrons and tetrahedrons (or between rectangular
conformities faces, prism faces and tetrahedrons) by inserting pyramids.
In the presence of triangular and rectangular surface elements, Flux generates
pyramids, starting with two triangular elements.
Two cases may occur:
• The two tetrahedrons attached to the two triangular surface elements have
the same vertex node. In this case, the tetrahedrons can be connected to
create a pyramid.
• If the two tetrahedrons do not have the same vertex node, Flux will insert a
new node in an appropriate position.

Nouveau noeud

The insertion of pyramids is not always possible, and there are a certain
number of limitations to the algorithm when repairing non-conformities.

First limitation If the rectangular mesh is very distorted, the triangular elements belonging to
tetrahedrons may cut the rectangular elements. This case is illustrated in the
figure below.

In this case, Flux cannot


ensure the mesh
conformity.
This mesh will fail.

Continued on next page

USER GUIDE PAGE 233


Mesh: principles Flux

Second The second limitation is less clear. To ensure the conformity of the mesh by
limitation inserting pyramids, Flux adds a certain number of nodes. However, this
algorithm does not work properly in the presence of sharp angles. This
limitation is illustrated by the example below.
A simple device consisting of 3 hexahedral volumes is shown in the following
figure:
• two external volumes are meshed using the mapped mesh generator
• the inner volume is meshed using the automatic mesh generator

Take note that in practice the mesh


of this device is not possible.
The failure of the non-conformity
repairing algorithm is due to the
fact that the insertion of nodes to
construct pyramids is not possible
for this configuration.

Use By experience we realize that the pyramid generation algorithm is more


robust when the elements meshed with the automatic mesh generator are
bigger than the elements meshed mapped or extrusive mesh generator.

In some cases, the volume meshing based on the advancing front method can be a
solution in order to favor the creation of nodes and to permit the insertion of
pyramids, (see Algorithms of volume meshing).

PAGE 234 USER GUIDE


Flux Mesh: principles

9.3. Adjustments (mesh size)

Introduction The definition of the mesh elements shape is only one part of the necessary
information needed to generate the mesh. It is also necessary to determine the
mesh elements size, also called the weight of nodes. There is a weight
associated to each mesh node. This weight determines the distance between
two neighboring elements.
The object of this section is to provide to the user the tools for adjusting the
mesh size of the device.
The user will also find information on Aided mesh which permits
to use these tools in a global manner over the assembly of a project.
These various tools interact, and the user will also find certain priority rules
between the different adjustments in this section.

Contents This section contains the following topics:


• Adjustment: meshing by point discretization (on the points)
• Adjustment: meshing by linear discretization (on the lines)
• Adjustment: meshing by deflection (on the lines/ non flat faces)
• Adjustment: meshing by relaxation (on the geometric entities)
• Adjustment: meshing by shading (on the close faces in 3D)
• Aided mesh
• Combination of various adjustments

Reading advice The user wishing to obtain a satisfactory and time efficient automatic mesh
technique can consult part « 9.3.6 Aided mesh ».

USER GUIDE PAGE 235


Mesh: principles Flux

9.3.1. Adjustment: meshing by point discretization (on the points)

Introduction To adjust the mesh, the user can set the node density in the neighborhood of
the points.
Information related to the node density next to selected points is assigned to
the points; we use the phrase “mesh adjustment via the points” or
intermediate of mesh points.

Principle of The principle of “mesh adjustment via the points” is illustrated in the example
adjustment “via below.
the points”
1 mm 5 mm

• the user imposes a length of 1 mm on the left point and a length of 5 mm on


the right point
• the program subdivides the line according to this information: the first line
element in contact with the left point has a length of 1 mm and the first
line element in contact with the right point has a length of 5 mm. The
program arranges the nodes between the two points, following a
geometrical progression.

AIDED_MESHPO For each project, the software creates an « AIDED_MESHPOINT » instance


INT dedicated to Aided mesh.

PAGE 236 USER GUIDE


Flux Mesh: principles

9.3.2. Adjustment: meshing by linear discretization (on the lines)

Principle To adjust the mesh, the user can set the number and the distribution of the
nodes on the lines.
The information regarding the number and the distribution of the nodes on
the lines is carried by the lines, this is called meshing adjustment
« via the lines » or by means of linear discretizations.

Example The adjustment principle by linear discretization is illustrated in the example


below:
10 equally distributed

• the user imposes a number of elements and distribution on the line: 10 line
elements, equidistant nodes.
• the program divides the line according to this information.

Types of linear The different types of linear discretization are explained in the table below:
discretization

In a discretization of the … the user defines :


… type
arithmetic the number of elements on the line
absolute deflection the value of the deflection in meter
relative deflection the value of the relative deflection (0 < d < 1)
geometric with imposed the number of elements on the line and the
number of elements ratio of the progression
geometric with minimal the number of elements, the ratio of the
distance progression and the minimal distance to the
high density point
length of elements at the the length of elements at the two extremities
two extremities of the line
linked a transformation
weighted sum of line a discretization list with a multiplying
discretization coefficient for each of the discretizations

USER GUIDE PAGE 237


Mesh: principles Flux

9.3.3. Adjustment: meshing by deflection (on the lines/ non flat


faces)

Introduction Adjustment of the deflection permits cutting the meshing elements of the
curved objects in a project :
• cones, cylinders, distorted faces … (for the faces in 3D)
• arcs of circle, left lines (for the lines)

Principle The division is illustrated in the figure below. The arc of circle is cut into a
limit set by the user.

Definition For a line element, the criterion of deflection corresponds to the distance d
measured between the centre of the line element and its projection on to the
curved line.

Cutting by Schematically, on a curve line, for each linear element it should be checked
deflection that the deflection should be inferior to the maximal value of deflection
defined during the adjustment by the user. If this condition is not checked, our
arc is cut into two and so on, up to the attainment of the maximal deflection
distance.
d (1)

d d (2)

Continued on next page

PAGE 238 USER GUIDE


Flux Mesh: principles

Types of The meshing by deflection can be applied to lines and to faces. The value of
deflection the deflection can be relative or absolute. The different types of deflection in
function of their assignment are presented in the following table:

Element Type Value


Deflection on the faces relative 0<d<1
(including or not the infinite absolute Absolute dimension in meter
box) absolute Value defined by a relationship
between the max. dimension of
the project and the max.
dimension of the deflection
Linear discretization of the relative 0<d<1
deflection type absolute Absolute dimension in meter

Aided mesh For each project, the software creates an AIDED_MESHLINE instance (for the
deflection on non flat lines) and an AIDED MESHGENERATOR (for the
deflection on non flat faces in 3D) dedicated to the Aided mesh.

USER GUIDE PAGE 239


Mesh: principles Flux

9.3.4. Adjustment: meshing by relaxation (on the geometric entities)

Introduction Relaxation permits to smooth the mesh distribution on:


• lines
• faces
• volumes

Principle Relaxation permits to create the biggest possible good quality elements in
function of the size of the geometric entities (lines, faces or volumes).
The mesh will be dense for smaller size entities and more relaxed for bigger
size entities.

Repartition by To carry out the mesh relaxation, Flux modifies the weight of each
relaxation consecutive mesh node to progressively pass from a small element to a larger
one.
In the figure below, the weights on line (1) are smaller and influence the
weight on line (2).
The stronger the relaxation is, the faster the weights of line (2) will grow.

Operation On a first step, larger weights are attributed to each node of the mesh. A
relaxation algorithm facilitates the distribution of the node weights according
to the geometry configuration.
The smaller weights influence the bigger weights.
The stronger the relaxation is, the more important the difference is between
the biggest and the smallest weight . The mesh is then strongly relaxed in the
larger zones.

Aided mesh For each project, the software creates an AIDED_RELAXLINE instance (for the
relaxation on the lines), an AIDED RELAXFACE (for the relaxation on the
faces) and an AIDED RELAXVOLUME (for the relaxation on the volumes in 3D)
dedicated to the Aided mesh.

PAGE 240 USER GUIDE


Flux Mesh: principles

9.3.5. Adjustment: meshing by shading (on the close faces in 3D)

Introduction Shading improves the meshing of close faces.

Principle Shading permits the user to take into account the proximity between two
geometric objects to define the mesh.

Note on When two geometric objects (generally two non-adjoining volumes), are
shading close to one another, shading will influence the size of the nodes in function
at the proximity of the two entities.

Example In the example below, volumes (2) and (3) are very close to volume (1) but
they do not touch. The zones where the volumes are almost in contact will be
meshed in a denser manner.

Aided mesh For each 3D project, the software creates an AIDED_SHADOWFACE instance
dedicated to the Aided mesh.

USER GUIDE PAGE 241


Mesh: principles Flux

9.3.6. Aided mesh

Definition The Aided mesh means the use of the previously described adjusting tools, in a
global manner over the assembly of a project.
Indeed, the adjustment of the mesh size can be done :
• either locally :
adjustment information is created by the user and then allotted manually on
the geometric entities of the project (points, lines, faces,)
• or globally :
dynamic* adjustment information is created and automatically carried by the
assembly of the geometric entities of the project (points, lines, faces, …)
* dynamic means here that the information for adjustment is directly linked to the
dimensions of the entities on which they depend.

Description When the Aided mesh is activated, the software carries out the process
presented in the table below.

Stage Description
1 Control of points :
• allotting the entity AIDED_MESHPOINT at all the free points of
the project. By default this discretization is of the dynamic
type (a type specific to the Aided mesh).
2 Control of deflection on the curve lines and faces :
• allotting the entity AIDED_MESH GENERATOR
on all the free curve faces (3D)
• allotting the entity AIDED_MESHLINE
on all the free curve lines
3 Control of relaxation :
• allotting the entity AIDED_RELAXLINE
on all the free lines
• allotting the entity AIDED_RELAXFACE
on all the free lines
• allotting the entity AIDED_RELAXVOLUME
on all the free volumes (3D)
4 Control of shading on the volumes (3D) :
• allotting the entity AIDED_SHADOWFACE
on all the free faces (3D)

Global The Aided mesh must permit to rapidly obtain an automatic meshing of
adjustment satisfactory quality that respects the geometry of the device.
The various tools are « preadjusted » with by default values. After a first
meshing, the user can « play » with the various parameters up to the moment
they obtain the desired result.

Continued on next page

PAGE 242 USER GUIDE


Flux Mesh: principles

Use The Aided mesh is advised for meshing of all the projects in 2D.
It is particularly convenient :
• for the applications of electrostatic type (many distorted faces, and
proximity of elements having linear physical properties)
• for the mesh of a motor in 2D (one mesh element in the airgap with regular
elements, regular mesh for curves, …)

Limitations • The Aided mesh combines the various adjustment tools (deflection,
relaxation, shading) on the entities of the project. It is yet possible to have
an overmeshing in certain zones of the domain.
• The Aided mesh respects the constraints connected to the geometry of the
device without taking into consideration the physical properties of the
studied device. The user must control the constraints connected to the
physical aspect and adapt their adjustments to the studied physical
phenomena (thin air gap, thickness of skin, …)

Reading advice The meshing procedure with the Aided mesh is described to the user in
module 9.4.1 The mesh process (Aided mesh).

USER GUIDE PAGE 243


Mesh: principles Flux

9.3.7. Combination of various adjustments

Introduction The adjustment tools complete each other and interact. With a view to avoid
the conflicts between the various adjustments or to limit the meshing
overcharges, certain priority rules are established in the software.

Interaction The table below describes the order of the operations made by Flux during the
between meshing stages carried out by the user (mesh lines  mesh faces  mesh
adjustments volumes) :

Stage Description
1 Mesh lines :
1a The mesh points and mesh lines impose the density of the mesh on
the points and lines.
1b The line relaxations impose a relaxation of the meshing of the
lines. This relaxation is applied at the interior of the domain as far
as possible: If a line carries a discretization line or if it carries a
distribution of nodes that cannot leave space to a relaxation, then
there is no relaxation.
2 Mesh face :
2a The mesh generators impose the meshing on the faces.
2b The surface relaxation imposes a relaxation on the face meshing.
This relaxation is applied at the interior of the domain as far as
possible: if a face carries a mesh generator different from the
Automatic type mesh generator, then there is no relaxation.
2c Shadowing overmeshes the close faces if necessary.
Remark: the surface meshing can impact on the linear meshing.
3 Mesh volume :
3a The mesh generator imposes the meshing in the volumes.
3b The volume relaxations impose a relaxation of the meshing of
volumes. This relaxation is applied at the interior of the domain as
far as possible: if a volume carries an extruded meshing, then there
is no relaxation.

Continued on next page

PAGE 244 USER GUIDE


Flux Mesh: principles

Priorities of When mesh information is assigned to both lines and points, mesh lines have
lines over priority over mesh points.
points

Example
• Points P1, P2, P3 and P4: length of line P4
elements next to points: 2 mm
• Line Lz: geometric progression of the line
elements on the line:
Lz Ly P3
• minimum distance: 1 mm
• ratio : 1.5
• Result:
• on line Lx and Ly: division based on P1,
P1
P2 and P3 points information
• on line Lz: division base on the line
Lx
information
P2

Priority of local The adjustment instances created and assigned locally by the user have
adjustment priority over the instances controlled by the Aided mesh. The assistance does
over global not act on the instances assigned by the user, it acts only over
adjustment « free » entities.

USER GUIDE PAGE 245


Mesh: principles Flux

PAGE 246 USER GUIDE


Flux Mesh: principles

9.4. General steps of the mesh process

Introduction The mesh strategy is carried out in function of problem. This section proposes
two approaches to the meshing of a project.
The user who wishes a rapid meshing by taking into consideration of the
geometric constraints can consult the first section: § The meshing process
(Aided mesh).
The user who wishes to control and to personalize the meshing more by
means of different cutting and adjusting tools can consult the second section:
The process of meshing (advanced user).

Contents This section contains the following topics:


• The mesh process (Aided mesh)
• The mesh process (advanced user)

USER GUIDE PAGE 247


Mesh: principles Flux

9.4.1. The mesh process (Aided mesh)

Introduction The user can carry out a rapid and good quality meshing taking into account
the geometric constraints with the Aided mesh.

Aided mesh The Aided mesh permits the user to adjust the assembly of a project with the
taking into consideration of certain geometric constraints (lines, non flat
faces, narrow faces, or proximal, but not belonging to the same geometry) by
means of deflection, relaxation and shading tools (see also « 9.3.6 Aided
mesh »).
The table below illustrates possible mesh strategies the user may select to
mesh a project.

Stage Description
1 Mesh
 The result of meshing appears on screen
2 If the meshing is not satisfactory, edit the Aided mesh and modify
the values
3 Return to stage 1
4 • If the mesh is not satisfactory after several repetitions, add
information locally to the mesh by means of the adjustment tools
5 Mesh
6 If necessary, return to stage 4

PAGE 248 USER GUIDE


Flux Mesh: principles

9.4.2. The mesh process (advanced user)

Meshing The table below illustrates possible mesh strategies the user may select in
order to mesh a project using various tools (mesh generators and adjustments)
available in Flux.

Stage Description
1 Preliminary consideration: choose a mesh type
• automatic mesh (single mesh generator)
• mixed mesh (multiple mesh generators)
2 If mixed mesh
Then define different areas
• with the use of generic mesh generator
• or creation of user mesh generator
for different areas
3 Preadjustment of meshing
Reflection on the adjustment mode
• global with the Aided mesh (9.3.6 Aided mesh)
• and/or local (user adjustments)
4 Mesh construction (creation of line, surface, volume elements)
5 If necessary, readjustment of various adjustments and return to
stage 4
6 Choice of the type of elements: 1st order or 2nd order

Mesh strategy Phases 1 and 3 of the meshing process are consideration phases on the choice
(1 and 3) of mesh generators and the adjustment mode. For assistance making this
choice, see the sections on mesh generators (see 9.2.6 Fully automatic
meshing or mixed meshing: comparison) and the adjustment tools (see 9.3
Adjustments (mesh size).

Creation, mesh This stage concerns the possible creation of user mesh generators and
generator assignment of mesh generators to the different areas.
assignment (2)
In the case of mixed mesh, the user can:
• use the « generic mesh generators » :
automatic (with or without deflection control), adjusted or without
meshing
• or use his own mesh generators (linked or extrusion mesh generators)

Important:
In the geometry context, if the building options “with mesh” are activated during the
propagation and/or extrusion phases, linked and/or extrusive mesh generators are
automatically created.

Continued on next page

USER GUIDE PAGE 249


Mesh: principles Flux

Adjustment Mesh and mesh adjustment are two interdependent processes:


and mesh (3 • meshing (subdivision of lines, faces and volumes) is carried out by the
and 4) software
• the adjustment (Aided mesh and/or adjustments created by the user) is made
by the user
The complete process is represented in the diagram below.

Adjustment of
meshing

Meshing of lines

Meshing of faces

Meshing of volumes

The adjustment principles are described in the section "Adjustments (mesh


size).

Choice of the This last phase of mesh process is specific to volume mesh. For 2D mesh,
type of elements created are automatically 2nd order elements.
elements (6) In general, generating second order element is a better strategy, however it
could be useful, in certain configuration to solve a problem with first order
element (computation time, memory size problem,…).

Continued on next page

PAGE 250 USER GUIDE


Flux Mesh: principles

Mesh and The user generally proceeds with successive steps and it is possible to repeat
geometry several building geometry processes and several mesh construction processes.
Thereby going back and forth between geometry and mesh contexts (see
examples hereafter). For instance,
• When modeling a motor, the user can create the geometry of a slot, assign
mesh information, and propagate the slot with mesh information already
defined.
• The mesh of an air gap can be facilitated by adding points and lines that are
useless to the build regions.
This is illustrated in the figure below.

creation of three lines


line
instead one in order to
distrib
guide the meshing
of nodes

geometric
distribution
of nodes

Remark :in order not to be constrained to create supplementary points and lines, the
user can resort to Aided mesh (see 9.3.6 Aided mesh). Consideration of the
geometry will refine the mesh in the neighborhood of the rectangle, and the
relaxation will lighten up the mesh as one moves away from the rectangle.

USER GUIDE PAGE 251


Mesh: principles Flux

PAGE 252 USER GUIDE


Flux Mesh: principles

9.5. Automatic mesh parameters (options)

Introduction Various parameters for automatic mesh are used by Flux. The aim of this
section is to give the user the methods that can help them make choices as to
the modify the options of the automatic mesh generator.

The default options are adapted to most situations. The modification of these options
is considered an advanced user utilization of Flux.

Contents This section contains the following topics:


• Face mesh regularization
• Algorithms of volume meshing

USER GUIDE PAGE 253


Mesh: principles Flux

9.5.1. Face mesh regularization

Goal The mesh quality partly depends on regular repartitions of the mesh elements.
The bubble movement technique (bubble packing) permits the regularization
on face mesh with the automatic mesh generator.

Bubble packing With this method, the triangles or tetrahedrons tops are adjusted by certain
method charged particles, which are interacting by means of attractive and repulsive
forces. The balanced position of these particles forms an optimal mesh
configuration.

Process The mesh regularization process is described in the figures below.

Transformation of mesh
Initial mesh
into bubbles

Insertion of bubbles into


Movement of bubbles
spaces

Transformation of
Final mesh
bubbles into mesh

Continued on next page

PAGE 254 USER GUIDE


Flux Mesh: principles

Use The bubble packing method is applied only on faces meshed with an
automatic mesh generator in 2D and 3D.

Advantages / The bubble packing method applied to the face mesh (2D/3D) has the
disadvantages following advantages and disadvantages:
• advantages:
• automatic improvement of the mesh regularity on the faces
• shortcomings:
• more mesh
• longer meshing time

USER GUIDE PAGE 255


Mesh: principles Flux

9.5.2. Algorithms of volume meshing

Introduction Flux provides three generators for automatic meshing of volumes: the Delaunay
mesher, the Netgen mesher and the MeshGems mesher.
The three meshers are presented in the blocks below.

Delaunay The mesh generation by the Delaunay mesher is carried out in two phases, as
mesher: process presented in the table and figure below.

Stage Description
1 Generation of a boundary mesh
2 Insertion of internal nodes into border mesh elements

MeshGems MeshGems, by its module MG-Tetra it is a generator of tetrahedral mesh of


mesher: process volume from a mesh of surface triangular. It is marketed by Distene
http://www.distene.fr/

Comparison between Delaunay and MeshGems is presented in the table below.

Delaunay MeshGems
Characteristics • This mesher is the historical mesher • Respects the surface mesh (not node
of Flux insertion)
• Potentially it rebuild the surface • Robust mesher=> tested by other
mesh to construct a mesh of volume simulation tools
Advantages / • Relaxation may be important =>Less • Low relaxation => Increase the
disadvantages nodes and less mesh elements number of nodes and the number of
• More time to mesh the device mesh elements
• Difficulty with the extrusive mesh • Low time to mesh the device with
good quality of the mesh compared to
Delaunay
• Suitable for mixed mesh

* Reminder: In 3D, in case of a mixed meshing (mapped mesh /automatic mesh)


with the Delaunay mesher, certain nodes must be inserted on the faces during the
generation of the mesh front. This insertion is forbidden on the mapped faces,
which generates the failure of the Delaunay mesher. The Netgen mesher is better
suited to this problem.

Continued on next page

PAGE 256 USER GUIDE


Flux Mesh: principles

Netgen mesher: The mesh generation by the Netgen mesher is an iterative process that is carried
process out in several phases, as presented in the table and figure below.

Stage Description
1 Initialization of front on the domain boundary
2 The front becomes the border between the meshed region and the
non-meshed region
3 At each iteration:
• covering of the domain by the front (creation of one layer of
elements)
• actualization of the domain front
4 Stop the process when the domain is entirely meshed

Note: This mesher will not be available in future versions

Meshing Independent of the choice of mesher, Flux also provides an algorithm for the
optimization optimization of the automatic volume meshing.
The optimization enables the user to:
• improve the mesh quality
• reduce the number of elements

Optimization of The mesh optimization is an iterative process of partition and/or fusion of the
the mesh volume elements in function by certain predefined criteria. The overall goal is the
process improvement of mesh quality and the reduction of the number of elements.

The number of iterations influences. the quality of the result and the process time:
• Optimization of an average quality and rapid time: one iteration
• Optimization of a good quality and slow time: five iterations.
The default number of iterations is set to 3, a value permitting a good quality/time
ratio.

USER GUIDE PAGE 257


Mesh: principles Flux

9.5.3. Advice for specific mesh

Introduction To generate a « good » meshing, there are meshing tricks and rules that
facilitate the meshing of special geometries.

Contents This section contains the following topics:


• Help for meshing of the sliding surface

PAGE 258 USER GUIDE


Flux Mesh: principles

9.5.4. Help for meshing of the sliding surface

Introduction A coupled magneto-mechanical finite element model permits to study the


kinematics of mobile regions of the computation domain simultaneously
subjected to mechanical and magnetic forces.
For such models, where the mobile and fixed mechanical sets slide with
respect to one another, the meshing of the device must respect certain
constraints.

Dissociation Sliding is called the action of a mobile mechanical set, which is in a


surfaces translation or rotation motion with respect to the fixed one. The interface
between the two mobile and fixed mechanical sets is called sliding surface.

Mobile set Fixed set Mobile set

Fixed set
Sliding Sliding
surface surface

Non-conformity To permit sliding, the mechanical sets (mobile or fixed) are separated by
of meshing means of a « duplication» of the geometric and meshing entities.
Moreover, there is no remeshing of the fixed and mobile mechanical sets
from one position to another.
Consequently, when the part moves, the nodes of the meshing elements
located on one side and on the other side of the sliding surface are no longer
necessarily face to face. This is called non-conformity of the mesh. This is
illustrated in the figure below.

Example : non-conformity of meshing over the sliding surface for a rotation motion

Position 0°: The mesh nodes of the fixed Position 35°: The mesh nodes of the fixed
and moving mechanical sets are face to and moving mechanical sets are not face
face at the level of the sliding surface. to face at the level of the sliding surface.

In this situation, a non-conforming mesh is authorized at the level of the sliding


surface.

Continued on next page

USER GUIDE PAGE 259


Mesh: principles Flux

“Mesh The technique used in order to « connect the meshing » on one side and on
connection” the other of the sliding surface consists in an interpolation of the node values
technique of the face to face surface elements by a linear combination with a view to
ensure the continuity of the state variable.

Acceptable It is therefore important that the size of the surface elements that are face to
mesh face should be approximately the same, irrespective of the amplitude of the
displacement. This is illustrated in the figures below.

Example: sliding surface meshing for a rotation motion

Recommended
mesh

Non-
recommended
mesh(inhomogene
ous density of
nodes along the
two
circumferences)

PAGE 260 USER GUIDE


Flux Mesh: principles

9.5.5. Mesh of solid conductor with skin effect

Mesh of skin To obtain accurate results in skin effect problems (eddy currents, etc.), at
depth: rules to least two elements should be used on the skin depth.
follow
The state variable actually has an exponential variation on the skin depth, but
within an element, Flux 2D uses a parabolic approximation. Thus, the size of
elements should be small enough that the arc of parabola can be assimilated
to an exponential arc.

Computation of In magneto-harmonic problems with linear materials, the skin depth for eddy
skin depth: currents can be expressed as follows:
recall


f
where f is the frequency,  the resistivity and  the magnetic permeability.

Choosing the To mesh the skin depth, elements of rectangular or hexahedral type are
mesh generator recommended, that is:
• the mapped mesh generator (2D, 3D)
• an extruded mesh generator with a mapped base (3D)
The rest of the study domain is meshed using the automatic mesh generator.

2D Example A 2D example of mesh on the skin depth is shown in the figure below.

magnetic circuit
inductor

billet Mapped mesh


of skin depth {

 = skin depth

Continued on next page

USER GUIDE PAGE 261


Mesh: principles Flux

3D Example A 3D example of mesh on the skin depth is shown in the figure below.
The most critical volumes (the volumes corresponding to the skin depth of the
bar) are meshed using the extrusive mesh generator. The rest of the study
domain is meshed using the automatic mesh generator (inside the bar and the
surrounding air).

PAGE 262 USER GUIDE


Flux Geometry / mesh importation: principles

10. Geometry / mesh importation: principles

Introduction FLUX software has the ability to communicate with other software packages
and to carry out the transfer of data from CAD tools to the Finite Element
(FE) analysis tools.
This chapter presents the available choices for the different processes of
importation with Flux:
• import of geometry starting from geometric files
• import of geometry starting from mesh files
• import “Advanced Mode”
• in addition, the associated tools for simplification and repair of imported
data are described

Item of Note The import of a CAD geometry file into FLUX takes into account projects
(reminder) possessing complex geometries (e.g. presenting twisted surfaces). These
types of surfaces cannot be generated directly using the available tools in
FLUX.

Contents This chapter contains the following topics:


• REF Dataimportationoverview \h Geometry / mesh importation: overview
• REF GeometryimportationIGESSTEPDXFSTLFBDINTE \h Geometry
imports (standard formats)
• Import of geometry called « advanced mode »
• Mesh importation

USER GUIDE PAGE 263


Geometry / mesh importation: principles Flux

PAGE 264 USER GUIDE


Flux Geometry / mesh importation: principles

10.1. Geometry / mesh importation: overview

Introduction This section presents a general point of view concerning the authorized
formats for importation and the principle of conversion.

Contents This section contains the following topics:


• Types of imports
• Import formats

USER GUIDE PAGE 265


Geometry / mesh importation: principles Flux

10.1.1. Types of imports

Introduction Three different types of imports are possible with FLUX :


• import of geometry
• import of mesh
• import of geometry using “advanced mode”

Import of The import of geometry consists of importing geometric elements using


geometry entities compatible with the finite element environment of FLUX. The user is
required to check the imported geometry and correct any faults that may be
present.

Import of The import of geometry called «advanced mode » consists of importation of


geometry called geometric elements for entities compatible with the finite element
« advanced environment of FLUX. Using this model the user can choose the entities that
mode » he wishes to import, as well as having the option to automatically correct the
geometry.

Mesh Import Mesh import consists of importing the mesh which results in the creation of
geometry in the FLUX environment.

PAGE 266 USER GUIDE


Flux Geometry / mesh importation: principles

10.1.2. Import formats

Import formats The following table summarizes the different file formats accepted in Flux,
associated with the type of import.

Type of import Available File formats Extension Type of format


IGES (Initial Graphics *.IGES, *.IGS
Exchange Specification)
STEP (Standard for Exchange *.STEP, *.STP
geometry import of Product) standard
called « standard » DXF (Draw eXchange File) *.DXF
STL (STereo Lithography) *.STL

FBD (Flux 2D géométrie) *.FBD proprietary


NASTRAN neutral *.NAS, *.DAT
PATRAN neutral *.PAN, *.DAT
UNV (UNiVersel Ideas *.UNV
Master Serie)
mesh import MED (Model of data *.MED standard
exchange)
HyperMesh/SimLab/OptiStru *.BDF, *.BLK,
ct (Nastran format) *.BULK, *.DAT,
*.FEM, *.NAS,
*.NASTRAN
IGES (Initial Graphics *.IGES, *.IGS
Exchange Specification)
Standard
STEP (Standard for Exchange *.STEP, *.STP
of Product)
geometry import SAT *.SAT
called « advanced
CATIA V4 *.MODEL
mode »
CATIA V5 *.CATPRODUCT
proprietary
*.CATPART
INVENTOR *.IPT
PROE (Pro Engineer) *.ASM , *.PRT

Continued on next page

USER GUIDE PAGE 267


Geometry / mesh importation: principles Flux

Supported The following table summurize the versions supported by ACIS R22 version
versions (geometry kernel) for different import formats.

Type d’import Format de Fichier Versions supportées


IGES (Initial Graphics IGES versions up to 5.3
Exchange Specification)
STEP (Standard for Exchange STEP AP203, AP214 (geometry only
import de géométrie of Product)
dit « en mode SAT Up to ACIS R22
avancé »
CATIA V4 CATIA 4.1.9 to CATIA 4.2.4
CATIA V5 CATIA V5 R6 – R20
PROE (Pro Engineer) Pro/E 16 to Wildfire 5

Type of For importation Flux accepts only files in text format. The binary files are not
accepted file accepted.

Attention: It is not possible to import an assembly file consisting of several IGS files
(*_ASM.IGS).

Multiple Multiple importations are available. Flux is able to import the files with
importation different formats (DXF, STL, etc) in the same project.

PAGE 268 USER GUIDE


Flux Geometry / mesh importation: principles

10.2. Geometry imports (standard formats)

Introduction This section deals with the importation of geometry starting from geometry
files.
The import of a CAD geometry in an FE (finite elements) project is an
operation consisting of turning the data from the CAD type (in a specified
format) into data of the FE type.

Note: the import selection ,“advanced mode,” integrates a certain number of repairs
before the conversion of data (see § Import of geometry called « advanced
mode »

Formats
The following formats enable geometry import :

File format Extension Type of format


IGES (Initial Graphics *.IGES, *.IGS
Exchange Specification)
STEP (Standard for Exchange *.STEP, *.STP
of Product) standard
DXF (Draw eXchange File) *.DXF
ofSTL (STereo Lithography) *.STL

FBD (Flux 2D géométrie) *.FBD proprietary

Contents This section contains the following topics:


• Process of geometry importation
• Stage of conversion with options
• Stage of geometry checking: concept of geometric defect
• Stage of geometric defects correction / geometry simplification
• Geometry importation: strategies

USER GUIDE PAGE 269


Geometry / mesh importation: principles Flux

10.2.1. Process of geometry importation

Introduction The importation of geometry from a file is an operation that consists of


converting the geometry from the initial file (specific to the format) into Flux
entities (geometric entities of Point, Line, Face and Volume type).
The user then carries on the construction process with the available tools in
Flux.

Question It is important to note that in Flux, the user should build the geometry without
defects. A defect, in the Flux sense, is an error of the geometrical construction
of intersection of lines type, of superposition of points type, etc.
If there are geometric defects in the origin file (intersection of lines,
superimposed points, etc.), these can hinder and also block the process of
geometry building: impossibility of building faces and/or volumes.
So, after the geometry importation, it is necessary that complementary actions
should be taken in order to search (identify) and correct the geometric
defects.

Importation The process of importation is a process involving the three stages briefly
process describing in the table below and detailed in the following paragraphs.

Stage Description
1 Conversion with options
2 Geometry checking / search geometric defects
3 Correction of geometric defects
and/or
geometry simplification

PAGE 270 USER GUIDE


Flux Geometry / mesh importation: principles

10.2.2. Stage of conversion with options

Introduction The first stage of importation is the stage of conversion of the imported
geometry into the Flux format.

Operation The principle of operation of the importation is as follows: all the geometric
principle entities of the initial file (specific to the standard and proper formats) are
converted into the Flux format (geometric entities of type Point, Line, Face
and Volume...) in the final file.

Conversion of The entities of the initial file are read and converted into the Flux entities. The
entities summary table is presented below.

The file CAD entities


Convert into Flux entities …
format … contained…
points points defined by parameterized coordinates
lines lines of type:
• segment defined by extremity points
• arc defined by origin, intermediary and
extremity points
IGES /
STEP • curve (for the unspecified lines)
faces faces of type:
• automatically defined by plane, cylindrical
or conical surfaces
• uneven type, defined by any kind of
surfaces
POINT points defined by parameterized coordinates
LINE lines of segment type defined by extremity
points
POLYLINE N lines of segment type
DXF
ARC, lines of arc type defined by origin,
CIRCLE intermediary and extremity points
3DFACE faces of automatic type, with triangular shape,
defined by a plane surface
VERTEX points defined by parameterized coordinates
STL FACET faces of automatic type, with triangular shape,
defined by a plane surface

Continued on next page

USER GUIDE PAGE 271


Geometry / mesh importation: principles Flux

Conversion of
entities
(continued)

The file CAD entities


Convert into Flux entities …
format … contained…
points points defined by parameterized coordinates
lines lines of type
• segment defined by extremity points
• arc defined by origin, intermediary and
FBD extremity points
faces automatic faces
geometric geometric parameters
parameters
regions regions

Options for To perform the data conversion, different options are available to the user.
conversion
There are two types of options:
• general options, available for all formats
• choice of a coordinate system: locates the imported geometry in the Flux
project
• choice of the unit: chooses the units of the device dimensions
• choice of precision: defines the minimal distance that enables the
distinction of two points
• particular options, specific to the format
Only the general options are described in this section.

PAGE 272 USER GUIDE


Flux Geometry / mesh importation: principles

10.2.3. Stage of geometry checking: concept of geometric defect

Introduction The second stage is geometry checking. This stage is the stage of research
(identification) of the geometric defects; correction will be carried out in the
following stage (stage 3).
Before describing the modes of defects search, the different defect types are
described in the following blocks.

Geometric The geometric defects can hinder or block the geometry building process.
defects
The following can be therefore discerned:
• blocking defects (intersections and superimposed entities):
these defects must be identified and corrected before building the geometry
in Flux.
• non-blocking defects (very small lines and faces, wires not closed, …):
these defects do not impede the geometry building in Flux, but they can
influence, in a negative manner, the quality of the geometry building and/or
the meshing
The geometric defects are presented in the table below.

Defect Example (or type) Consequence


• intersection type:
• line-line
• line-face
• face-face*
building of the faces
• superposition type:
blocking and volumes
• confused points impossible
• superimposed lines
• entities of small dimensions:
• abnormal line
• abnormal face
• entities of small dimensions:
difficulties of
non- • abnormal line (user epsilon)
meshing
blocking • abnormal face (user epsilon)
• open wire missing face

*In the next figure, the faces building after the importation of
the geometry will generate the intersection of the faces. This
type of defect is not identified by Flux in the Geometric defect
P1
entity, but it is blocking for the further volumes building. The P2
connecting the points P1 and P2 by a new line before the faces
building enables to avoid the intersection of the faces.

Continued on next page

USER GUIDE PAGE 273


Geometry / mesh importation: principles Flux

Defects The research of the geometric defects can be carried out in two ways:
research modes • for the assembly of types of defects (described as global checking of the
geometry)
• by type of defect (described as research by type)

Research result Whatever the research mode, the result is the following:
• Flux creates a geometric entity of the Geometric defect type for each
defect found (this entity contains the information about the defect
localization: number of concerned points, lines or faces)
• Flux highlights this entity in a graphic window (specific display)

PAGE 274 USER GUIDE


Flux Geometry / mesh importation: principles

10.2.4. Stage of geometric defects correction / geometry simplification

Introduction The third stage is the stage of correction of geometric defects and/or
geometry simplification.

Correction The principle of correction proposed by Flux for the various types of
principle geometric defects is presented in the tables below.

Defect of the superposition Principle of correction


type
Confused points  Suppression of a point
Superimposed lines Cutting of the lines

Defect of the intersection type Principle of correction


Intersection of two lines Cutting of the lines

Intersection of a line and a face  Correction is to be made by the user

Defect type Principle of correction


Line abnormal Removal of the L2 line by
(value fixed by the user) fusion of the lines L1 and L2

Face shorter than ... Removal of the F1 face by


(value fixed by the user) confusion of the lines L1 and L2

Continued on next page

USER GUIDE PAGE 275


Geometry / mesh importation: principles Flux

Defect type Principle of correction


Closing of contour by
Open wire
 prolongation of the L1 line

Simplification The principle of simplification proposed by Flux consists to remove some


principle lines and points and thus “to reduce” the geometry. Simplification is expected
only for the lines of the segment type and arc of circle type.
The principle of simplification is presented in the table below.

Geometry type Principle of simplification


Removal of the lines L2 and L3 and
Segments located on the tangent suppression of the points P2 and P3
of the straight lines by fusion of the lines L1, L2 and L3

Arc of circle having the same Removal of the lines L2 and L3 and
curve angle suppression of the points P2 and P3
by fusion of the lines L1, L2 and L3

Continued on next page

PAGE 276 USER GUIDE


Flux Geometry / mesh importation: principles

Algorithms of To facilitate the process of correction, the algorithms of automatic correction /


automatic automatic simplification are proposed. They are presented in the table below.
correction /
automatic
simplification

The algorithm of … enables the correction …


of all blocking defects
automatic correction
(superimposed entities and intersections)
automatic simplification of all defects of type: abnormal lines

Note: These algorithms are planned especially for the 2D geometry, the result in 3D
is not guaranteed.

Manual To correct the other defects the user must carry out a manual correction with
correction the tools presented in the table below. The use of these various commands is
detailed in section “Correction of geometric defects” of chapter “Geometry /
mesh importation: software aspects”.

To correct the defect


the user should ...
type ...
Intersection of lines Cut line on a point
Superposition of lines Cut line on intersection
Abnormal line Decrease absolute precision by reducing
Abnormal face relative precision (relative epsilon)
Abnormal line
Fuse lines
(user epsilon)
Abnormal face
Confuse lines
(user epsilon)
Extend line to point
Open wire
Extend line to line

USER GUIDE PAGE 277


Geometry / mesh importation: principles Flux

10.2.5. Geometry importation: strategies

Introduction Although it is possible and necessary to correct the geometric defects after
importation, it is preferable to prepare the initial file so that the operations of
correction in Flux are minima.
The checking of the geometry and the correction of possible geometric
defects are essential.

Prepare the To prepare the initial file in general way:


initial file • define geometric elements in CAO software with respect to the
characteristics of the Flux geometry building module
• remove the intersections of lines, lines and faces, the superposition of faces,

The characteristics of geometry building module (description: the authorized
shapes of faces and volumes, prohibited intersections and superimposed
entities …) are given in chapter “Geometry: principles”.

Constraints of It is not possible to perform the following operations in an imported


Flux software geometry (containing lines of list edges type and faces of list facets type):
• modify the imported faces / lines
• propagate / extrude the imported faces / lines
• mesh the faces / volumes using mapped mesh generator

Capabilities of It is possible to perform the following operations in an imported geometry:


Flux software • build the faces / volumes
• mesh the faces / volumes using automatic mesh generator

PAGE 278 USER GUIDE


Flux Geometry / mesh importation: principles

10.3. Import of geometry called « advanced mode »

Introduction This section refers to the import of geometry starting from geometric files in
« advanced mode».
The import of CAD geometry into an FE (finite elements) project is an
operation which consists of the conversion of the CAD data (in a specified
format) into FE type data.
The advanced mode is a method that permits a CAD geometry transfer to the
FE software in a more efficient manner while integrating repairs before the
conversion of data. These repairs simplify the work of geometry
checking/correction.

Format The formats which permit the import of geometry are as follows:

File format Extension Type of


format
IGES (Initial Graphics *.IGES, *.IGS
Exchange Specification)
Standard
STEP (Standard for *.STEP, *.STP
Exchange of Product)
ACIS *.SAT
CATIA V4 *.MODEL
CATIA V5 *.CATPRODUCT
*.CATPART
INVENTOR *.IPT
PROE (Pro Engineer) *.ASM , *.PRT
proprietary
SOLIDWORKS *. SLDASM , *.SLDPART

NX (Siemens) *.X_T, *. XMT_TXT, *.X_B,


*.XMT_BIN

PARASOLID *.PRT

Interest The user can import a geometry in advanced import mode thereby eliminating
the need for the geometric correction phase to follow in FLUX.

Contents This section contains the following topics:


• About import « advanced mode »
• Import process

USER GUIDE PAGE 279


Geometry / mesh importation: principles Flux

10.3.1. About import « advanced mode »

Context In general, the CAD files used for the execution/ visualisation of a prototype
or device are not always adapted to finite element modelling. It is often
necessary « to facilitate» the transfer of data from the CAD format to the
finite elements analysis software format.
The advanced mode is an « optimised » mode, which, due to integrated
supplementary functions, facilitates the work of data transfer.

Problem The CAD file assemblies comprise geometries of independent parts


positioned to one another by means of positioning constraints. Problems may
arise at the moment of conversion to the FE model when these imported parts
are adjoined or overlapping, resulting in collisions, as represented in the
figure…

face/face
line/line
intersection
intersection

CAD FE
Model NOT SUITABLE
for FE computation

Solution To solve the problem of adjoining geometries (parts in contact, see figure), a
number of integrated repair tools are included in the import selection called
« advanced mode ». This consists of the appropriate construction of the
interfaces (minus the intersections), respective to the contact faces between
the parts. This must be designated before carrying out the proper operation of
conversion.

PAGE 280 USER GUIDE


Flux Geometry / mesh importation: principles

10.3.2. Import process

Import The import is carried out in two phases, as described in the table below and
process illustrated by the following figure.

Phase Description
1 Repair:
• Detection of parts in contact
• Construction of the contact faces
• Union of solids in contact
2 Conversion:
• Choice of elements of the CAD file to convert
• Conversion of elements:
CAD type geometry -> Geometry of Finite Elements type
3 Result: the results are displayed in an import report in the History
zone.

Conversion The CAD entities of the initial file are read and converted into FLUX entities
of the type:
• points defined by parametric coordinates
• lines of type :
• segment defined by extremity points
• arch defined by the origin, intermediate and extremity points
• curve (for any kind of lines)

• faces of the type :


• automatic defined by the plane, cylindrical or conical surfaces
• twisted faces, defined by any kind of surface

• volumes

USER GUIDE PAGE 281


Geometry / mesh importation: principles Flux

PAGE 282 USER GUIDE


Flux Geometry / mesh importation: principles

10.4. Mesh importation

Introduction This section refers to the import of a geometry and its mesh, from a mesh file.

Formats The following standards formats enable mesh importation.

File formats Extension Type of format


NASTRAN neutral *.NAS, *.DAT
PATRAN neutral *.PAN, *.DAT
UNV (UNiVersel Ideas *.UNV
Master Serie)
MED (Model of data *.MED standard
exchange)
HyperMesh/SimLab/OptiStru *.BDF, *.BLK,
ct (Nastran format) *.BULK, *.DAT,
*.FEM, *.NAS,
*.NASTRAN

Contents This section contains the following topics:


• REF Importationofmeshdataoverview \h Process of mesh importation
• Stage of conversion with options
• REF Simplificationstepconceptoffusion \h Stage of fusion
• REF Adjustmentstepconceptofpositioning \h Stage of positioning
• REF Meshimportationstrategies \h Mesh importation: strategies

USER GUIDE PAGE 283


Geometry / mesh importation: principles Flux

10.4.1. Process of mesh importation

Introduction
Mesh import enables the import of the geometry and mesh. The geometry
created is based on the imported mesh.
This approach enables the introduction in Flux projects of uneven surfaces in
the form of “cut surfaces”, but has the disadvantage of generating an
important number of geometric entities (volumes, faces, lines). As
consequence, the result of the mesh file conversion is not always compatible
with the requirements of Flux analysis (for example, the use of sliding
cylinder …).
At the moment of mesh importation (or right afterwards) additional
operations are necessary, in order to simplify and adjust the imported data.

Importation The mesh import process involves three stages, briefly described in the table
process below and detailed in the next paragraphs.

Stage Description
1 Conversion with options
2 Fusion of the multiples faces and lines coming from the mesh
importation (facets and edges)
3 Positioning of the faces on a reference plan / cylinder

PAGE 284 USER GUIDE


Flux Geometry / mesh importation: principles

10.4.2. Stage of conversion with options

Introduction The first stage is a stage of conversion of the mesh entities into geometric
entities.

Volume In Flux, a volume element of the vertex


element: mesh is characterized by vertexes,
reminder edges and facets, as shown in the side
next figure
edge

Principle of The principle of conversion shown in the scheme below is the following: all
operation the vertexes, edges and facets of volume elements of initial file are converted
into points, lines and faces in the final file.

Importation in Flux

1 square face meshed 6 faces, 12 lines, 7 points


with 6 elements
triangulaires
The group concept, regrouping volume elements having the same material in
the initial file, enables the creation of volumes in the Flux project.

Conversion of The entities of the initial file are read and converted into Flux entities, as
entities presented in the table below.

The file in
CAD entities contained
the format Converted into Flux entities …


nodes points defined by parameterized
coordinate position
nodes
NASTRAN line elements lines of edges list type
/ PATRAN line elements
/ UNV/
face elements faces of facets list type
MED
face elements
groups: volumes
component or material

Continued on next page

USER GUIDE PAGE 285


Geometry / mesh importation: principles Flux

Structure of In Flux, the geometric entities resulting from the mesh importation differ
data from “standard” geometric entities:
• the faces resulting from mesh importation are faces of facets list type
• the lines resulting from mesh importation are lines of edges list type

Option To perform the data conversion, different options are available to the user.
selections for
conversion These options are of two types:
• general options, available for all formats
• choice of a coordinate system: to place the imported geometry in the Flux
project
• choice of the unit: to choose the units of the device dimensions
• choice of precision: to define the minimal distance enabling to distinguish
two points
• particular options, specific to the format
Only the general options are described in this section.

PAGE 286 USER GUIDE


Flux Geometry / mesh importation: principles

10.4.3. Stage of fusion

Introduction Following the importation, the geometry of the imported device has multiple
lines and faces deriving from multiple facets and edges of the initial file.
The second stage is the stage of fusion (regrouping of the entities), which
enables the reduction of number of lines and faces, and facilitates their
handling, as well as the visualization of the device.

Fusion of faces: Although strongly advised, the fusion of faces / lines is optional. This
use operation becomes compulsory for the faces in the cases presented below.

If … The fusion …
kinematic coupling of dissociation faces (sliding cylinder, boundary of
mobile mechanical set and compressible
mechanical set)
symmetry and/or
of faces located on these planes
periodicity planes
… is compulsory

Concept of We call fusion of faces / lines the operation of regrouping faces/lines to


fusion form the main faces / lines of the device geometry.

Principle of The principle of fusion of faces is shown on the scheme below. During fusion
fusion of faces all faces belonging to the same surface are regrouped in one face.
and data
structure

The faces resulting from mesh importation are faces defined by a list of
facets.
• Before the fusion of faces:
every face (of facets list type) contains a single facet
• After the fusion of faces:
every face (of facets list type) contains many facets

Continued on next page

USER GUIDE PAGE 287


Geometry / mesh importation: principles Flux

Regrouping The surface of regrouping is defined by the user, using an angle named angle of
surface and fusion. All adjacent faces whose angle is less than the fusion angle are regrouped in
angle of fusion a single face (See figure of example below).

Example:
Three adjacent faces are
regrouped in a single face with
a fusion angle 

The regrouping surfaces can be of different shapes (plane, cylindrical, …) and


depend on the chosen value of fusion angle as follows:
• for an angle of small value (between 0 and 1°), the regrouping surface is a
planar surface
• for a larger angle, the regrouping surface can be of any shape

Precaution So that the simplified geometry approaches with more real geometry, it is
necessary to take some care as for the choices of an angle of fusion, the risk
being to gather faces, which should remain separate.
In general, it is advised to comply with the following rule:
• start with an angle that is inferior or equal to 1° - to identify the plane faces
• gradually increase the value of the angle - to identify the others faces

Attention The fusion process does not create even surfaces. The regrouping surface is
an uneven surface, (although this surface looks like an even one).

And for the The principle of lines fusion is the same with the one of faces fusion. It is
lines … illustrated in figure below.

Continued on next page

PAGE 288 USER GUIDE


Flux Geometry / mesh importation: principles

Rules of fusion Two faces (lines) can be regrouped if they belong to same volumes (faces).
The mesh importation of a quarter cylinder before and after the fusion of
faces and lines is shown in figure below.

Geometry created in Flux Geometry in Flux after


starting from an imported mesh fusion of faces and lines

USER GUIDE PAGE 289


Geometry / mesh importation: principles Flux

10.4.4. Stage of positioning

Introduction After importation of mesh and simplification of geometry, the quality of the
faces obtained starting from mesh data can be unsatisfactory for the Flux
further operations (see examples below). In this case, it is necessary to adjust
the geometry.
Examples:
• If we want to impose the condition of periodicity on two faces which
theoretically form an angle of 60°, but in reality the imported faces form an
angle of 59.9999°, it is necessary to adjust the geometry in such way that
the real angle between the two faces to be 60°.
• If we want to use the sliding cylinder entity and if the face corresponding to
the surface of dissociation not be really carried by a cylindrical surface, it
will then be necessary to adapt the consequently geometry.

Positioning of The positioning of the faces is optional but becomes compulsory for the faces
faces: use in the following cases:

If … the positioning …
kinematics coupling of dissociation faces (sliding cylinder, boundary of
mobile mechanical set and of compressible
mechanical set)
Symmetry and/or
of faces located on these planes
periodicity planes
… is compulsory

Concept of We call positioning of a face on a plan or on a cylinder the operation that


positioning consists in projecting the face on a reference plan or cylinder, defined by the
user.
The positioning is not intended to orient differently the plans with respect to
imported geometry, but to homogenize this geometry in order to ensure a
good Flux further operation.

Principle of The positioning of a face F on a surface S means the projection of points,


positioning nodes of F on S, the edges follow the movement. Thus, the use of positioning
of faces by their displacement with many degrees with respect to the initial
geometry can results in a geometry deformation.
Many successive displacements can emphasize the deformation of the
geometry even if we return to an arrangement conform to the imported
geometry.

PAGE 290 USER GUIDE


Flux Geometry / mesh importation: principles

10.4.5. Mesh importation: strategies

Strategies of Previous to mesh data importation is important to choose a strategy for the
mesh importation. It is possible:
importation • to import a complete geometry of the device, i.e. all its components, the
including box and the complete mesh of the study domain
• to import the geometry and the mesh of a only one component or of a part
of the device and to complete the description of geometry and mesh in Flux.
The further steps of the project depend on the chosen strategy.

Strategy 1 The first strategy consists in importing the whole study domain. The process
of importation can be presented as follows:
Stage Description
1 Preparation of initial file in the origin software:
• full description of the device geometry
• addition of an air region or of a box including the device
• meshing of study domain
2 Data importation into Flux by using the option:
• with mesh (mesh data importation)
3 Simplification of file:
• fusion of faces / lines
4 Direct passage to physics

Strategy 2 The second strategy consists in importing a specific meshed part of the
device. The process of importation can be presented as follows:
Stage Description
1 Preparation of initial file in the origin software CAD (ex. rotor):
• description of the geometry of the device part
• mesh of this part
2 Data importation into Flux by using the option
• without mesh
3 Simplification and adjustment of file:
• fusion of faces / lines
• positioning of faces
4 Building in Flux of the rest of the device geometry (ex. stator) :
• geometrical construction of other device parts
• construction of faces and volumes
• mesh of the whole computation domain
5 Direct passage to physics
Important: The device parts, added by Flux, do not have to touch the imported
geometry (imported parts).

Continued on next page

USER GUIDE PAGE 291


Geometry / mesh importation: principles Flux

Constraints of It is not possible to perform the following operations in an imported


Flux software geometry containing lines of list edges type and faces of list facets type:
• modify the imported faces / lines
• propagate/extrude the imported faces / lines
• modify the mesh of imported objects; the initial mesh is entirely preserved

Capabilities of It is possible to perform the following operations in an imported geometry:


Flux software • build the faces / volumes
• mesh the faces / volumes using automatic mesh generator

Preparation of During the preparation of the initial file:


initial file • you must verify if the mesh is non-conform (ex: the addition of two parts
separately meshed is forbidden)
• when the periodicity is present, you should perform an identical mesh on
the faces concerning the periodicity

Attention: A non-conform mesh in the initial file may generate intersections that
cannot be removed.

PAGE 292 USER GUIDE

You might also like