Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f1adf22
Separate inductance analyzer and flux linkage analyzer
dmnewman3 Oct 18, 2023
64d2616
rename to proper convention
dmnewman3 Oct 19, 2023
0680cb9
Merge branch 'develop' into user/dmnewman3/restructure_inductance_ana…
dmnewman3 Mar 5, 2024
b9e3009
separate flux linkage and inductance analyzers
dmnewman3 Mar 5, 2024
075a619
fix grammar and spelling of .rst files
dmnewman3 Mar 6, 2024
d82acbc
fix links
dmnewman3 Mar 6, 2024
3e6b1db
restructure flux_linkage analyzer and documentation
dmnewman3 Mar 26, 2024
8ca3346
restructure inductance analyzer before debugging
dmnewman3 Mar 27, 2024
d0d39b3
fix array
dmnewman3 Mar 27, 2024
2e43979
Finalize documentation of inductance analyzer
dmnewman3 Apr 7, 2024
c507bbb
Merge branch 'develop' into user/dmnewman3/restructure_inductance_ana…
dmnewman3 Apr 7, 2024
c7c5bd1
update language of flux analyzer .rst file
dmnewman3 Apr 11, 2024
7c0e19a
remove references to a 3-phase machine
dmnewman3 May 3, 2024
6cf4d38
add code to specify geometry to avoid naming issues
dmnewman3 May 22, 2024
e25b6a0
update output print statement per Takahiro's feedback
dmnewman3 May 23, 2024
342969d
Fix Stator ID in imag_2d
noguchi-takahiro May 28, 2024
bb254eb
Uncomment codes to rename parts
noguchi-takahiro May 28, 2024
15665b9
make changes based on feedback:
dmnewman3 May 29, 2024
4498941
fix SynR and flux linkage analyzer for JMAG23
dmnewman3 May 30, 2024
7770101
Merge branch 'feature/fix_geometry_naming' into user/dmnewman3/restru…
dmnewman3 May 30, 2024
6c5bf1a
update .rst file documentation based on Eric's feedback - part 1
dmnewman3 May 30, 2024
032c68f
restructure analyzer files according to 5/31 feedback
dmnewman3 Jun 1, 2024
28063c3
update documentation according to 5/31 meeting
dmnewman3 Jun 1, 2024
953dd0b
update files according to 6/10 feedback from Eric for PR 343
dmnewman3 Jun 12, 2024
f9e4ef4
update analyzer to eliminate references to the csv file(s) in the ana…
dmnewman3 Jun 12, 2024
489c045
Make changes to the following for using parallel cases:
dmnewman3 Jun 13, 2024
f476022
Make changes on Eric's 6/17 feedback including:
dmnewman3 Jun 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,528 changes: 1,528 additions & 0 deletions docs/source/EM_analyzers/Images/a_b_c_inductances.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,434 changes: 1,434 additions & 0 deletions docs/source/EM_analyzers/Images/alpha_beta_inductances.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,452 changes: 1,452 additions & 0 deletions docs/source/EM_analyzers/Images/d_q_inductances.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions docs/source/EM_analyzers/flux_linkage_analyzer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
Flux Linkage Analyzer
########################################################################

This analyzer enables the flux linkage evaluation of a mutli-phase electric machine after running 2D FEA simulations using JMAG.

Model Background
****************

The flux linkage of a coil is defined as the amount of flux linking together for a multi-coil arrangment with electric current flowing
through them. The flux linkage of a coil within an electric machine comes from all coils present in the machine and has a profound
impact on the machine characteristics. Calculating coil flux linkages over time can lead to inductance calculations for an electric
machine, which are also important for characterizing that machine. The flux linkage is an important parameter for inductance calculations
as can be seen in the following equation:

.. math::

L = \lambda I \\

where :math:`\lambda` is the flux linkage, :math:`L` is the inductance, and :math:`I` is the coil current.

The code is structured such that the ``flux_linkage_analyzer`` contains the code for setting up and running the JMAG simulations based on
1) the machine inputs and conditions of the user and 2) the conditions required of the machine to be able to calculate the
necessary parameters. In the case of each machine, DC excitement of each phase coil occurs with all other coils open. This repeats for
each coil until all of the coils have been excited with DC current and all of the flux linkages have been captured.

This analyzer calculates the self and mutual flux linkages of each coil using JMAG's transient solver. It models an electric machine
under synchronous operation. The following information document will provide a description of the analyzer inputs and outputs.

Input from User
*********************************

Users are utilizing a single Problem class to interface with this analyzer. This class requires the user to provide an instance of the
JMAG FEA application being used, a the model of the current project which needs to be in a file that is already open, a dedicated filepath
for the results, the name of the phases, and the rated current of the machine. The specific requirements are summarized below:

.. csv-table:: `flux_linkage_analyzer Inputs`
:file: input_flux_linkage_analyzer.csv
:widths: 70, 70, 30
:header-rows: 1

With regards to the model properties, there are several aspects of the JMAG FEA model that must be specific such that this analyzer works
properly. Those properties are as follows

1. Must be transient model (can be 2D or 3D)
2. The model must be named "Machine_FluxLinkage_Project"
3. The study must be named "Machine_FluxLinkage_Study"
4. The motion condition must be specified and MUST be rotating 1 full mechanincal revolution
5. "FEM Coils" must be applied to the winding and linked to the circuit
6. The study properties must be fully defined, except for the csv output, which is defined by the analyzer
7. The circuit must appear similar to the following image, where the current sources are titled "cs_PhaseName"
8. Under case control, the "cs_PhaseName" amplitudes MUST be the first cases AND listed in order of excitation

.. figure:: ./Images/FluxLinkageExampleCircuit.png
:alt: Stator Diagram
:align: center
:width: 250

Example Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following example demonstrates how to initialize instances of ``Flux_Linkage_Problem`` and ``Flux_Linkage_Analyzer``. An instance of
JMAG FEA is used in this example and is stored in the ``fluxlinkage_inductance_eval`` folder of the ``mach_eval_examples`` in ``eMach``.
An example file containing the example code is also found in that folder. The following code runs the flux linkage analyzer using the
aforementioned example file:

.. code-block:: python

import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from time import time as clock_time

os.chdir(os.path.dirname(__file__))
sys.path.append("../../../")

from mach_eval.analyzers.electromagnetic.flux_linkage_analyzer import FluxLinkageJMAG_Problem, FluxLinkageJMAG_Analyzer

from mach_cad.tools import jmag as JMAG

filepath = "eMach_location/eMach/examples/mach_eval_examples/fluxlinkage_inductance_eval"
phasenames = ['U', 'V', 'W']
rated_current = 20

####################################################
# 01 Setting project name and output folder
####################################################

toolJmag = JMAG.JmagDesigner()
toolJmag.visible = True
toolJmag.open(filepath + "/Example_FluxLinkage_Machine.jproj")
toolJmag.save()

This example code does the following:
1. Initializes all of the required libraries and classes
2. Defines the necessary inputs of the ``problem`` and ``analyzer`` classes
3. Opens a fully-defined instance of JMAG
4. Defines the output file location based
5. Names project accordingly

Output to User
**********************************

The ``flux_linkage_analyzer`` returns a directory holding the results obtained from the transient analysis of the machine. The elements
of this dictionary and their descriptions are provided below:

.. csv-table:: `flux_linkage_analyzer Output`
:file: output_flux_linkage_analyzer.csv
:widths: 70, 70
:header-rows: 1

The following code should be used to run the example analysis:

.. code-block:: python

############################ Create Evaluator #####################
tic = clock_time()
flux_linkage_prob = FluxLinkageJMAG_Problem(toolJmag, phasenames, rated_current)
flux_linkage_analyzer = FluxLinkageJMAG_Analyzer()
flux_linkages, currents = flux_linkage_analyzer.analyze(flux_linkage_prob)
toc = clock_time()
print("Time spent on the flux linkage evaluation is %g min." % ((toc- tic)/60))

linkages = flux_linkages["linkages"]
phase_currents = currents
rotor_angle = flux_linkages["rotor_angle"][0]
name_of_phases = flux_linkages["name_of_phases"]

print("\n************************ FLUX LINKAGE RESULTS ************************")
print("Linkages = ", linkages)
print("phase_currents = ", phase_currents, " A")
print("rotor_angle = ", rotor_angle, " deg")
print("name_of_phases = ", name_of_phases)
print("*************************************************************************\n")

This example, contained in the aforementioned ``fluxlinkage_inductance_eval`` folder, should produce the following results:

.. csv-table:: `flux_linkage_analyzer Results`
:file: results_flux_linkage_analyzer.csv
:widths: 70, 70, 30
:header-rows: 1

One should expect the ``/run_data/`` working folder location to differ depending on where the workspace is. Within ``/run_data/`` there should be a
total of 4 csv files that contains the flux linkage calculations for a 3 phase machine, there should be 7 csv files for a 6 phase machine, etc. Each
csv files should contain a total number of columns that equals the phase count of the machine. All of the code shown exists in the
``fluxlinkage_inductance_evaluator.py`` file in the ``eMach/examples/mach_eval_examples/fluxlinkage_inductance_eval`` folder. This analyzer serves
as a first step in conjunction with the `Inductance Analyzer <https://emach.readthedocs.io/en/latest/EM_analyzers/inductance_analyzer.html>`_.
3 changes: 2 additions & 1 deletion docs/source/EM_analyzers/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ This section provides documentation for the electromagnetic analyzers supported
BSPM JMAG 2D FEA <bspm_jmag2d_analyzer>
Winding Factors <winding_factors>
SynR JMAG 2D FEA <SynR_jmag2d_analyzer>
Inductance/Saliency <inductance_analyzer>
Flux Linkage <flux_linkage_analyzer>
Inductance <inductance_analyzer>
Loading