Add solid fake for perpendicular flap tutorial#541
Add solid fake for perpendicular flap tutorial#541BenjaminRodenberg merged 8 commits intoprecice:developfrom
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. |
| # 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.
| # 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.
I added some comments that hopefully clarify the idea behind the formula
BenjaminRodenberg
left a comment
There was a problem hiding this comment.
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.