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

Minor fix to mesh generator #430

Merged
merged 10 commits into from
Jun 4, 2024
Merged

Minor fix to mesh generator #430

merged 10 commits into from
Jun 4, 2024

Conversation

kanekosh
Copy link
Contributor

@kanekosh kanekosh commented Jun 3, 2024

Purpose

OAS mesh generator currently only accepts the chordwise discretization nx to be 2 or an odd number because of how it generates the cosine spacing in the chordwise direction. This PR fixes the mesh generator to make it work with even numbers for nx.

I also realized a weird behavior for rectangle wings: the default chordwise coordinate for [LE, TE] was [0, chord] when nx=2 and [-chord/2, chord/2] when nx >= 3. Now I fixed it, and the default coordinate is [0, chord] for any nx. I adjusted a few test cases accordingly because it affects CM computation.

Also made a minor edit to the GHA setting so that the "latest" build continues even if the "oldest" job fails, and vice versa.

Closes #378

Mesh examples

Screenshot 2024-06-03 at 12 06 58 PM Screenshot 2024-06-03 at 12 07 12 PM Screenshot 2024-06-03 at 12 45 52 PM

Expected time until merged

Week

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@kanekosh kanekosh changed the title Mesh gen Minor fix to mesh generator Jun 3, 2024
@kanekosh kanekosh marked this pull request as ready for review June 3, 2024 18:37
@kanekosh kanekosh requested a review from a team as a code owner June 3, 2024 18:37
@kanekosh kanekosh requested review from lamkina, bernardopacini and sabakhshi and removed request for bernardopacini June 3, 2024 18:37
@kanekosh
Copy link
Contributor Author

kanekosh commented Jun 3, 2024

Codecov is failing, but it's ready for review.

@eytanadler eytanadler requested review from eytanadler and removed request for lamkina June 4, 2024 15:24
Copy link
Collaborator

@eytanadler eytanadler left a comment

Choose a reason for hiding this comment

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

This makes the code both simpler and more general, very nice! (Nevermind about bumping the patch, I got it)

If you don't mind, I have a couple things to try with GHA to try to get codecov working that I'll add here. No guarantees that it'll work though.

openaerostruct/geometry/utils.py Outdated Show resolved Hide resolved
openaerostruct/geometry/utils.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.94%. Comparing base (d788e11) to head (29fe136).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
+ Coverage   93.92%   93.94%   +0.02%     
==========================================
  Files         104      104              
  Lines        6472     6461      -11     
==========================================
- Hits         6079     6070       -9     
+ Misses        393      391       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@sabakhshi sabakhshi left a comment

Choose a reason for hiding this comment

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

These changes make sense. The inconsistent chordwise positioning of the wing added extra complexity when doing stability analysis. These changes will break my 740 code as result but they are for the better.

@kanekosh
Copy link
Contributor Author

kanekosh commented Jun 4, 2024

@sabakhshi I'm planning on adding a stability-constrained example to the docs, so I'll document the origin of the chordwise coordinate at that time.

@eytanadler eytanadler self-requested a review June 4, 2024 18:50
@eytanadler eytanadler merged commit 0448bff into mdolab:main Jun 4, 2024
9 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.

Mesh num_x restriction
3 participants