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

Lid-driven cavity verification experiment #572

Merged
merged 31 commits into from
Sep 20, 2020
Merged

Conversation

ali-ramadhan
Copy link
Member

This PR aims to add the lid-driven cavity as a verification experiment (first) and as a simple example (second) that is very well-known in the CFD world.

It's set up as a 2D problem in the yz plane. It also tests that horizontal/channel boundary conditions work.

The verification experiment aims to reproduce the results detailed by Ghia, Ghia, & Shin (1982).

Unfortunately right now it seems to blow up no matter what I do. Once the top plate is set in motion a vorticity anomaly makes its way along the top plate then down to the bottom plate at which point blow up seems to occur no matter the time step or Reynolds number.

A Physics StackExchange post suggested that quiescent initial conditions should be fine "although if the wall Mach number is large, the sudden impulse could be numerically destabilizing" which would only make sense for compressible models. I tried with vortical initial conditions too but no luck.

@ali-ramadhan ali-ramadhan added science 🌊 Sometimes addictive, sometimes allergenic numerics 🧮 So things don't blow up and boil the lobsters alive testing 🧪 Tests get priority in case of emergency evacuation labels Dec 14, 2019
@ali-ramadhan ali-ramadhan added this to the v1.0 milestone Dec 14, 2019
@codecov
Copy link

codecov bot commented Mar 9, 2020

Codecov Report

Merging #572 into master will decrease coverage by 2.75%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #572      +/-   ##
==========================================
- Coverage   72.61%   69.85%   -2.76%     
==========================================
  Files         199      144      -55     
  Lines        5806     3281    -2525     
==========================================
- Hits         4216     2292    -1924     
+ Misses       1590      989     -601     
Impacted Files Coverage Δ
src/Utils/versioninfo.jl 37.50% <0.00%> (-31.25%) ⬇️
src/Coriolis/f_plane.jl 57.14% <0.00%> (-22.86%) ⬇️
src/OutputWriters/OutputWriters.jl 60.00% <0.00%> (-6.67%) ⬇️
src/Buoyancy/Buoyancy.jl 59.37% <0.00%> (-3.79%) ⬇️
src/Buoyancy/nonlinear_equation_of_state.jl 72.00% <0.00%> (-3.00%) ⬇️
src/Models/incompressible_model.jl 87.50% <0.00%> (-1.39%) ⬇️
src/Utils/with_tracers.jl 100.00% <0.00%> (ø)
src/AbstractOperations/averages_of_operations.jl 66.66% <0.00%> (ø)
...ence_tests/ConvergenceTests/ForcedFlowFixedSlip.jl
test/test_averaged_field.jl
... and 75 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b45ce5...08d5cb5. Read the comment docs.

@ali-ramadhan
Copy link
Member Author

Thanks @glwagner for fixing pressure boundary conditions in #677!

Lid-driven cavity is looking pretty good now!

lid_driven_cavity_velocity_Re100_01000

lid_driven_cavity_vorticity_Re100_01000

@glwagner
Copy link
Member

glwagner commented Mar 11, 2020

Well, I'm happy that its working far better than before --- though the pressure solver is still incorrect! What is the Reynolds number (Re) for this problem? In this problem, the pressure solver errors are probably inversely proportional to Re. Could be nice to have a low Re reference so we can measure the changes that occur when we fix the pressure solver.

EDIT: the pressure solver is, in fact, correct, as proven by the forced flow fixed slip test in #767.

@ali-ramadhan
Copy link
Member Author

ali-ramadhan commented Mar 11, 2020

What is the Reynolds number (Re) for this problem? In this problem, the pressure solver errors are probably inversely proportional to Re. Could be nice to have a low Re reference so we can measure the changes that occur when we fix the pressure solver.

It's Re = 100 from the plots, which is the lowest Ghia et al. (1982) go. Could still be relatively high Re as far as pressure solver errors go...

The "forced flow" test in #573 is better in this regard as it runs at Re = 1.

@glwagner
Copy link
Member

The above comment was incorrect. I've struck it through.

The forced flow convergence tests in #767 run at Re = 1.

@ali-ramadhan ali-ramadhan removed this from the v1.0 milestone Sep 11, 2020
@ali-ramadhan ali-ramadhan changed the title [WIP] Lid-driven cavity verification experiment Lid-driven cavity verification experiment Sep 12, 2020
@ali-ramadhan
Copy link
Member Author

ali-ramadhan commented Sep 12, 2020

Alright after PR #910 I think we're good to go with this verification (we needed to compute vorticity at the top wall).

I produced movies for each Re (100, 400, 1000, 3200, 5000, 7500, 10000) that I'm going to upload to YouTube and embed into the docs.

I'm attaching the last frame from each movie here showing the agreement. Vorticity seems to agree very well. Velocities at higher Re don't agree exactly but I think it's close enough for this kind of verification (maybe more simulation time is needed to reach equilibrium, but there may be several other factors).


lid_driven_cavity_Re100_00150

lid_driven_cavity_Re400_00200
^ Note that one of the w data points is off. This is due to a probable typo in table 2 of Ghia et al. (1983).

lid_driven_cavity_Re1000_00250

lid_driven_cavity_Re3200_00500

lid_driven_cavity_Re5000_00500

lid_driven_cavity_Re7500_00750

lid_driven_cavity_Re10000_01000

Copy link
Member

@glwagner glwagner left a comment

Choose a reason for hiding this comment

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

I think the plotting script should be julia (because it easily can be and I think using fewer programming languages is better, especially if we recommend users to look to validation scripts for inspiration). But this is an important experiment so I'm approving; we can translate the plotting script later.

grid = RegularCartesianGrid(topology=topology, size=(1, N, N); domain...)

v_bcs = VVelocityBoundaryConditions(grid,
top = ValueBoundaryCondition(1.0),
Copy link
Member

Choose a reason for hiding this comment

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

Trivial side note: I think it's perfectly fine to use 1 instead of 1.0 and I do not think there is any effect on performance (since type promotion is cheap --- correct me if I'm wrong!)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good point, the type promotion only happens once.

@glwagner
Copy link
Member

@ali-ramadhan should we merge? We might want to redo this experiment with new time-stepper and advection schemes, at which point we can rewrite the plotting script if we desire.

@ali-ramadhan
Copy link
Member Author

I was going to update the documentation to include a page on this verification test/experiment and try to embed some YouTube videos, but yeah might be a good chance to translate the script and try RK3 + WENO if data needs to be generated again.

@ali-ramadhan ali-ramadhan merged commit 4de2c5c into master Sep 20, 2020
@ali-ramadhan ali-ramadhan deleted the ar/lid-driven-cavity-v2 branch September 20, 2020 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
numerics 🧮 So things don't blow up and boil the lobsters alive science 🌊 Sometimes addictive, sometimes allergenic testing 🧪 Tests get priority in case of emergency evacuation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants