Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify whether eddy currents are enabled in the BSPM analyzer #346

Open
elsevers opened this issue Dec 20, 2024 · 0 comments · May be fixed by #347
Open

Add ability to specify whether eddy currents are enabled in the BSPM analyzer #346

elsevers opened this issue Dec 20, 2024 · 0 comments · May be fixed by #347
Assignees

Comments

@elsevers
Copy link
Contributor

Abstract

Add ability to specify whether eddy currents are enabled in the BSPM analyzer

Context

Currently, the BSPM analyzer has eddy currents enabled in the shaft and permanent magnets. We would like to allow the user to disable this.

Approach

Let's add a configuration setting that allows us to disable calculating eddy currents everywhere in a manner that does not break the functionality of this analyzer for existing users.

Suggested approach:

In jmag_2d_config.py

Within other settings, add a field self.enable_eddy_current_calcs to take a value of either false or true. Set it up for a default value of true (as this is what is the existing behavior)

# other settings
# set maximum iteration number of nonlinear calculation required until solution converges
self.max_nonlinear_iterations = kwargs["max_nonlinear_iterations"]
self.multiple_cpus = kwargs["multiple_cpus"] # True if multiple cores are required
self.num_cpus = kwargs["num_cpus"] # number of cpus or cores used. Only value if multiple_cpus = True
self.jmag_scheduler = kwargs["jmag_scheduler"] # True if it is desired to schedule jobs instead of solving immediately
self.jmag_visible = kwargs["jmag_visible"] # JMAG application visible if true
self.jmag_version = kwargs["jmag_version"] # JMAG application version

In jmag_2d.py

Within the initializer

add a check to see if the self.config.enable_eddy_current_calcs field exists. If it does not exist, create it and set it to true

def __init__(self, configuration):
self.config = configuration

Within add_material()

Only set EddyCurrentCalculation to 1 if self.config.enable_eddy_current_calcs == true

study.GetMaterial("Shaft").SetValue("EddyCurrentCalculation", 1)

study.GetMaterial("Magnet").SetValue("EddyCurrentCalculation", 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants