Please help me understand behaviour with 0m depth wall and periodic boundaries. #4055
Replies: 1 comment 2 replies
-
I'm surprised by this behavior, it seems wrong to me. If the bottom height is 0, then the whole column should be masked. Maybe there is some kind of round-off error, not sure, so that the free surface is not masked in the first place but is masked in the second case. It may help to check how high your "wall" needs to be. Is it identically 0 or machine eps less than 0? Does the wall height need to be machine eps greater than 0 for the free surface to be masked? Can you check what happens if you use a Bounded topology in x? Also, based on your description it sounds like you probably want to be using some kind of open boundary condition on the right side of the domain. Open boundary conditions are quite experimental right now, but you may be able to use @jagoosw's implementation on #3977 . Open boundary conditions can only be implemented with a Bounded topology (or put another way, Periodic topology requires Periodic boundary conditions, open boundary conditions cannot be used with a periodic topology). |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am modifying the internal tide example to attempt to make a 2d simulation of a harbour basin. I implemented a sponge layer that forces a sin function over a 1km region on the east (right hand boundary). With smoothed realistic bathymetry, the model was behaving very strangely, so I've stepped back to try to understand how bathymetry going to 0m at one edge affects the model (which currently has periodic conditions), and I'm noticing interesting behaviour that I'm not sure I understand.
Here is the code I'm running to simulate the sponge and a flat bottom:
This runs through and looks quite reasonable for a flat bottom. However, if I modify the function bottom(x) to be = -H + H*(x<1kilometer) I have noticed something interesting. When the factor is equal to H (the bathymetry goes to exactly 0m in the first kilometer) there seems to be "spillover", and you can see velocity moving over the wall. However, if you change the factor to be much larger than H (say 100 meters, causing the "wall" to be 30m high), there is essentially no movement in the entire domain. Is this a case of a raised free surface allowing water to "spill" over the wall when it's 0m?
Following this, how would one go about closing one end of the simulation to model a tidal flow in a basin? Should I set the x-boundaries to bounded and give a long tail to the right of the sponge to give room for the model to relax the velocities back down to zero?
The 0m tall wall case after 2 days (note that the free surface height is plotted and scaled by 10^4):
![Screenshot 2025-01-21 at 1 58 53 PM](https://private-user-images.githubusercontent.com/187400799/405335436-f6d6b78a-1387-425e-81e7-f1bb7a49ba5e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTE2ODMsIm5iZiI6MTczOTY5MTM4MywicGF0aCI6Ii8xODc0MDA3OTkvNDA1MzM1NDM2LWY2ZDZiNzhhLTEzODctNDI1ZS04MWU3LWYxYmI3YTQ5YmE1ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwNzM2MjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lZjYzNTJlYzM2NDJmY2VmYjdhYTYxM2Q0NTk3YzhiNGU5N2VjMDM4NDJjOWZiMTM1MzczYWY3YTIwYjM0Mjg0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.xZ4mCfoaXljO9DscqDdJ0mFKSc5NHt1JlhOoCVsL8Fg)
The 30m tall wall case after 2 days (note that the free surface height is plotted and scaled by 10^4):
![Screenshot 2025-01-21 at 1 59 24 PM](https://private-user-images.githubusercontent.com/187400799/405335596-35c147eb-eab8-4122-ba0e-c44a6008a001.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTE2ODMsIm5iZiI6MTczOTY5MTM4MywicGF0aCI6Ii8xODc0MDA3OTkvNDA1MzM1NTk2LTM1YzE0N2ViLWVhYjgtNDEyMi1iYTBlLWM0NGE2MDA4YTAwMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwNzM2MjNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05N2FkZGIwZmE4ZjZmMjg0ZmNiYmZhZTI1YjQ3YTlkMGE0M2Y2YmQ3YWZiZDE4YzM3ODExNzJkYmVlN2ZiZWJmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.GXlAApZxstf0CV81PkpJa9YNPThL2FTZnQSjAOlUYlE)
I can also share the actual basin bathymetry example if you think it'd help!
Cheers,
Erik
Beta Was this translation helpful? Give feedback.
All reactions