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

Rotate rectangular shape and tank #305

Closed

Conversation

LasNikas
Copy link
Collaborator

@LasNikas LasNikas commented Dec 1, 2023

The problem is that I can't rotate the acceleration since we have this barrier

        throw(ArgumentError("hydrostatic pressure calculation is not supported with " *
                            "diagonal acceleration"))

therefor the IC looks like this:
image

@efaulhaber what do you think? is it easy to implement a support also for diagonal acceleration? Then I only have to add this line:

acceleration = rot_matrix(rot_angle, Val(NDIMS)) * acceleration

@LasNikas LasNikas requested a review from efaulhaber December 1, 2023 15:02
src/util.jl Outdated Show resolved Hide resolved
@efaulhaber
Copy link
Member

Why did you implement this into the rectangular shape and tank? Can we make it a general function rotate(::InitialCondition)?

@efaulhaber what do you think? is it easy to implement a support also for diagonal acceleration?

No, it's not easy. If there is no air inside the tank, or only the corner on top of the rotated tank is cut off, then yes.

But I'd say that when we want to run something with a rotated tank, we will usually have a flat fluid surface and not a corner. Maybe by cutting off the corner with setdiff. Then, the pressure has to be calculated from the flat surface and not from the corner.

My previous idea how to do that would be to pass the index or position of a particle at the surface, so that we can do the Euler integration from there. But I just had another idea. We could pass a height indicating how far the corner of the fluid reaches over the surface. Then we can just put this offset into the Euler integration to get pressure zero at the surface when the corner is cut off.

But all of these make the API more complicated. Do we actually need this feature?

@LasNikas
Copy link
Collaborator Author

LasNikas commented Dec 5, 2023

Why did you implement this into the rectangular shape and tank? Can we make it a general function rotate(::InitialCondition)?

The problem are the min_coordinates which are not optional in RectangularShape. When the shape is shifted in a direction, the shifting is also rotated.

I can make the min_coordinates also optional for the RectangularShape and implement the rotate function. What do you think?

But all of these make the API more complicated. Do we actually need this feature?

Not yet. But the rotating of the RectangularShape could be useful to setup angled pipes and rotating RectangularTank is interesting for sloshing or so...

Also, for arbitrary shapes (when using a filling algorithm) it might be useful to have a generic function to apply hydrostatic pressure.

@svchb svchb added the enhancement New feature or request label Dec 13, 2023
@svchb svchb added this to the 0.2 milestone Dec 13, 2023
@sloede sloede closed this Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants