Skip to content

Added needed function - #51

Merged
sadda merged 14 commits into
mainfrom
pl_mg
Oct 12, 2026
Merged

sadda merged 14 commits into
mainfrom
pl_mg

Conversation

@poli-machines

Copy link
Copy Markdown
Collaborator

Functions for:

  • creating magnets
  • creating material for magnets
  • creating coordinate system for magnets
  • added calling in design.py

@poli-machines
poli-machines requested a review from sadda September 22, 2026 07:32
@sadda

sadda commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

@poli-machines Can you please explain what points does?

There are some hard-coded constants, such as fill_height, which should probably be in the method signature.

One of the methods adds materials. Can these physical parameters differ? If so, they should be in the parameterisation of the motor.

@sadda

sadda commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

@poli-machines I have added one more commit, check it please, it should simplify the code substantially.

@haitao-ZCU Polina claims that the tests are failing. Please talk to each other and investigate what happened. It does not seem that anything substantial was changed in this branch.

@sadda

sadda commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

@poli-machines

  • How does this relate to the earlier PR that moved the computation from Ansys to Python? This file still does it in Ansys. Why are set_oper_params, set_solution_expressions, set_output_vars, set_post_params and extract_results different from the parent? My guess is that this comes from copy-pasting the code instead of inheriting it.
  • Similarly, set_variables should set the currents as on main, which also means oper_params should use Id/Iq and set_initpos() instead of fixed Im/epsI/InitPos.
  • extract_results should use extract_expression (SI units) as on main.
  • Magnet material belongs in the anchor file, not in GeometryBase. Please move set_magnets() (NdFeB and its properties) into synrm_3f_36s_mag.py and leave the base with no magnet by default. Create the material once in the anchor's build_stator (already done via the override there), and have add_rotor_magnet only assign self.magnet instead of calling _create_material.
  • This will probably mean that synrm_3f_36s_mag.py will shrink to a few lines.

@poli-machines

Copy link
Copy Markdown
Collaborator Author

@sadda
I merged it yesterday, so I didn't copypaste. I didn't even touch this part of this code, my only work are magnets.

And question about mag_id.material_name = self.magnet Ansys does not see the material and writes AttributeError: 'Geometry' object has no attribute 'magnet' after I did the 4th point. How can I make self.magnet visible after creating? I putted def set_magnets(self): into synrm_3f_36s_mag.py and it was created in build_stator but still does not appear.

@sadda

sadda commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@poli-machines You created the file synrm_3f_36s_mag.py, where you copy-pasted. That is the source of the problems, which I partially fixed in my last commit and which I mentioned in my last comment.

About the AttributeError: please push your changes or write a better description of what is wrong so I can help.

@poli-machines

poli-machines commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

@sadda
This error appears when def add_rotor_magnet asking for mag_id.material_name = self.magnet.

@sadda

sadda commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

@poli-machines Please address first what I asked you to do two days ago (the five bullet points), then we will start working on why the tests fail.

@sadda
sadda merged commit fe979ba into main Oct 12, 2026
6 checks passed
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 this pull request may close these issues.

2 participants