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

CylinderSector composite surface #2027

Merged
merged 25 commits into from
Apr 28, 2022

Conversation

yardasol
Copy link
Contributor

@yardasol yardasol commented Apr 7, 2022

This PR adds a new CompositeSurface class, CylinderSector, and associated unit tests. This PR also adds the CylinderSector class to the SphinxDocs

This PR also contains some pep8 fixes generated using autopep8

@yardasol yardasol marked this pull request as ready for review April 7, 2022 23:56
@yardasol
Copy link
Contributor Author

Bump since this has been sitting for a while @paulromano @pshriwise

@paulromano
Copy link
Contributor

@yardasol Apologies! I was on vacation last week and just now catching up. I'll try to take a look this week

Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another contribution @yardasol! A few simple comments and I think this is good to go. Sorry it took so long to get you a review on this!

Comment on lines 72 to 76
theta0 : float
Angular offset of the sector in degrees relative to the primary basis
axis (+y, +z, or +x).
theta : float
Angular width of the sector in degrees.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent confusion, I think we should have the user specify two angles theta1 and theta2 rather than an angle and an angular width.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having an offset and a width is a bit more robust of an approach than two explicit angles, but I agree that having two theta variables is confusing... maybe delta would be a good variable for the angular width?

I actually initially thought about using a two-angle approach like you suggested, but one of the issues I ran into was handling cases where the two angles are inverted, i.e. theta1 = 30 and theta2 = 40 would be a 10 degree sector, whereas theta1 = 40 and theta2 = 30, would be a 350 degree sector, but this isn't entirely clear from just reading off the values of theta1 and theta2. The offset and sector width formulation is clearer about this difference.

One snag I can see right now though is it's not entirely clear where on the sector the offset is measured to. In my head it's the clockwise-most edge of the sector but this isn't specified in the docstring.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way to get rid of any ambiguities with two angles is to require that theta2 > theta1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the variable names to be more specific. Instead of theta we have central_angle, and instead of theta0 we have ccw_offset. I've also changes the internal variables theta0 and theta1 to phi1 and phi2, respectively.

openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
tests/unit_tests/test_surface_composite.py Outdated Show resolved Hide resolved
tests/unit_tests/test_surface_composite.py Outdated Show resolved Hide resolved
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more minor things and then this should be good to go. Thanks @yardasol!

openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
openmc/model/surface_composite.py Outdated Show resolved Hide resolved
@paulromano paulromano merged commit 9395c65 into openmc-dev:develop Apr 28, 2022
@paulromano
Copy link
Contributor

Thanks for another contribution @yardasol!

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