User Control Fields Extraction Format

The user.ctl file is created by the user control program. Depending on the solver the following field types are available during export:

Field 2D 3D 3D A-Phi
B – Magnetic Flux Density X X X
H – Magnetic Field Strength X X X
J – Current Density X X X
A – Magnetic Vector Potential X   X
Phi - Electric Scalar Potential     X

To extract fields from Maxwell, the control program must create a user.ctl file with one of the two following syntax strings:

Note: You can combine field export keywords with other keywords.

Extract fields on all objects

user.ctl

begin_data
exportFieldAtMeshNodeOnAllObjects

end_data

 

Extract fields by object ID

user.ctl

begin_data
exportFieldAtMeshNodeOnObject <objectID>

exportFieldAtMeshNodeOnObject <objectID>

end_data

You can get the desired object IDs as follows:

  1. Select Tools > Open Command Window.

  2. In the following example code snippet, replace "Stator" in the object_name with the name of the desired object.

    object_name = "Stator"

    oProject = oDesktop.GetActiveProject()

    oDesign = oProject.GetActiveDesign()

    oEditor = oDesign.SetActiveEditor("3D Modeler")

    object_id = oEditor.GetObjectIDByName(object_name)

    print(object_id)

    AddInfoMessage(str(object_id))

  3. Copy and paste the code snippet into the Command Window and execute.

  4. Repeat as needed for additional objects.

 

Data Structure and Nodes Order for 2D Fields Extraction

Node order in Maxwell 2D element

The Maxwell 2D solver writes the data and updates field files (afield.ctl, bfield.ctl, hfield.ctl, jfield.ctl) at each time step with the following structure:

where:

Note: For vector potential, the afield.ctl file has one component of the field, which is Az.
Note: Coordinates of the element are given for the vertices (1, 4, 6) only. Middle points (2, 3, 5) can be calculated from the other given coordinates since they are located in the middle as shown above, for example: x2= (x1+x4)/2.

The following is an example for bfield.ctl data extracted in an object with ID 761 that consists of 2 elements at t = 0.04 sec.

Data Structure and Nodes Order for 3D Fields Extraction

Node order in Maxwell 3D element

The Maxwell 3D solver writes the data and updates field files (bfield.ctl, hfield.ctl, jfield.ctl) at each time step with the following structure:

where:

Note: The coordinates of the 3D element are given for the vertices (1, 5, 8, 10) only. Middle points (2, 3, 4, 6, 7, 9) can be calculated from the other given coordinates since they are located in the middle as shown above, for example: x2= (x1+x5)/2

Related Topics 

User-Control File Format

Using a Control Program in Maxwell 2D and 3D Transient Solutions

Activating a Control Program in Transient Solutions