-
-
Notifications
You must be signed in to change notification settings - Fork 120
Add solid fake for perpendicular flap tutorial #541
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
Conversation
Is this ready for review? I will fix the markdownlint, it is failing also elsewhere. |
@NiklasVin please rebase/merge from develop, the markdownlint issue is now fixed. |
Yes, now this should be ready for review. |
@NiklasVin can you please enable edits by maintainers? It's a checkbox on the right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the case with fluid-openfoam
. Generally runs and VTK output looks good. Only a minor point is left + some readability comments.
# first, get displacement independent of x, only dependent on y and t | ||
# maximal displacement at flap tip should be 0.5 | ||
# initially, flap's displacement is 0 | ||
x_displ = np.minimum(((np.sin(3 * np.pi * t + np.arcsin(-0.95)) + 0.95) / 8) * y / flap_tip_y, 0.5 * y / flap_tip_y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# first, get displacement independent of x, only dependent on y and t | |
# maximal displacement at flap tip should be 0.5 | |
# initially, flap's displacement is 0 | |
x_displ = np.minimum(((np.sin(3 * np.pi * t + np.arcsin(-0.95)) + 0.95) / 8) * y / flap_tip_y, 0.5 * y / flap_tip_y) | |
# first, get displacement independent of x, only dependent on y and t | |
# initially, flap's displacement is 0 | |
max_x_displacement = 0.5 | |
x_displ = np.minimum(((np.sin(3 * np.pi * t + np.arcsin(-0.95)) + 0.95) / 8) * y / flap_tip_y, max_x_displacement * y / flap_tip_y) |
I would generally try to avoid raw numbers and rather use descriptive names. This often allows you to completely save some comments.
What does the 0.95
, the 3 * np.pi
and the /8
do? Generally, I think if the formula you are using here works we can keep it. But a brief comment about the general rationale behind the arcsin
and sin
would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments that hopefully clarify the idea behind the formula
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for the changes! Looks good now. Let's get this merged 🎉
I added a solid fake implemented in Python to the perpendicular flap tutorial, similar to the already existing fluid-fake.