Skip to content
Open
Show file tree
Hide file tree
Changes from 14 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
1,586 changes: 1,586 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.
176 changes: 176 additions & 0 deletions docs/source/EM_analyzers/flux_linkage_analyzer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
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
*********************************

This analyzer is used in the same way as the ``SynR_JMAG_2D_FEA_Analyzer``. The inputs and initialization are the exact same and are shown
in the tables below:

.. csv-table:: `MachineDesign Input`
:file: input_SynR_jmag2d_analyzer.csv
:widths: 70, 70
:header-rows: 1

.. csv-table:: `SynR_flux_linkage_analyzer Initialization`
:file: init_SynR_jmag2d_analyzer.csv
:widths: 70, 70
:header-rows: 1

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

Example code defining the flux linkage step is provided below. This code defines the analyzer problem class (input to the analyzer),
initializes the analyzer class with an explanation of the required configurations, and calls the post-analyzer class.

.. code-block:: python

import os
import copy

from mach_eval import AnalysisStep, ProblemDefinition
from mach_eval.analyzers.electromagnetic import flux_linkage_analyzer as flux_linkage
from mach_eval.analyzers.electromagnetic.flux_linkage_analyzer_config import Flux_Linkage_Config

############################ Define Flux Linkage Step ###########################
class SynR_EM_ProblemDefinition(ProblemDefinition):
"""Converts a State into a problem"""

def __init__(self):
pass

def get_problem(state):

problem = flux_linkage.Flux_Linkage_Problem(
state.design.machine, state.design.settings)
return problem

# initialize em analyzer class with FEA configuration
configuration = Flux_Linkage_Config(
no_of_rev = 1,
no_of_steps = 72,

mesh_size=3, # mm
mesh_size_rotor=1.5, # mm
airgap_mesh_radial_div=4,
airgap_mesh_circum_div=720,
mesh_air_region_scale=1.05,

only_table_results=False,
csv_results=("FEMCoilFlux"),
del_results_after_calc=False,
run_folder=os.path.dirname(__file__) + "/run_data/",
jmag_csv_folder=os.path.dirname(__file__) + "/run_data/jmag_csv/",

max_nonlinear_iterations=50,
multiple_cpus=True,
num_cpus=4,
jmag_scheduler=False,
jmag_visible=True,
non_zero_end_ring_res = False,
scale_axial_length = True,
time_step = 0.0001
)

class SynR_Flux_Linkage_PostAnalyzer:

def get_next_state(results, in_state):
state_out = copy.deepcopy(in_state)

state_out.conditions.path = results["csv_folder"]
state_out.conditions.study_name = results["study_name"]
state_out.conditions.I_hat = results["current_peak"]
state_out.conditions.rotor_angle = results["rotor_angle"]
state_out.conditions.name_of_phases = results["name_of_phases"]

print("\n************************ FLUX LINKAGE RESULTS ************************")
print("path = ", state_out.conditions.path)
print("study_name = ", state_out.conditions.study_name)
print("I_hat = ", state_out.conditions.I_hat, " A")
print("rotor_angle = ", state_out.conditions.rotor_angle, " deg")
print("name_of_phases = ", state_out.conditions.name_of_phases)
print("*************************************************************************\n")

return state_out

SynR_flux_linkage_analysis = flux_linkage.Flux_Linkage_Analyzer(configuration)

SynR_flux_linkage_step = AnalysisStep(SynR_EM_ProblemDefinition, SynR_flux_linkage_analysis, SynR_Flux_Linkage_PostAnalyzer)

It should be noted that this code should be contained as an analysis step in the main folder of the eMach repository. It must be contained
within the same folder as the code below in order for the code below to run.

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

The ``SynR_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:: `SynR_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

import os
import sys
from time import time as clock_time

os.chdir(os.path.dirname(__file__))

from mach_eval import (MachineEvaluator, MachineDesign)
from examples.mach_eval_examples.SynR_eval.SynR_flux_linkage_step import SynR_flux_linkage_step
from examples.mach_eval_examples.SynR_eval.example_SynR_machine import Example_SynR_Machine, Machine_Op_Pt

############################ Create Evaluator ########################
SynR_evaluator = MachineEvaluator(
[
SynR_flux_linkage_step
]
)

design_variant = MachineDesign(Example_SynR_Machine, Machine_Op_Pt)

results = SynR_evaluator.evaluate(design_variant)

All example SynR evaluation scripts, including the one used for this analyzer, can be found in ``eMach\examples\mach_eval_examples\SynR_eval``,
where the post-analyzer script uses FEA results and calculates machine performance metrics, including torque density, power density, efficiency,
and torque ripple. This analyzer can be run by simply running the ``SynR_evaluator`` file in the aforementioned folder using the ``flux_linkage_step``.

This example, contained in the aforementioned ``SynR_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 csv_folder location to differ depending on where the desired destination is. Within the ``resuls_folder`` there should be a
total of 6 csv files that contains the information requested in the ``_step`` file.
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