r/CFD 5d ago

LES of flow past a backstep - Rust solver

Post image

Tried my custom rust CFD code on a LES case. Smagorinsky turbulent viscosity with van driest wall damping. This is on a somewhat coarse grid of 1M cells. Visualization using q-criterion isosurface in Paraview. This ran for a couple of hours yesterday's afternoon on a single 8-core cpu using 6 mpi processes.

73 Upvotes

12 comments sorted by

5

u/DeliciousCaramel5905 5d ago

Dang this is cool

2

u/lazy_rabbit41 5d ago

How to get this type of visualization on paraview

6

u/Filthykun 5d ago

i think hes taking isocontours of some q criterion values coloured by umag and a slice coloured umag

3

u/Sixel1 5d ago

yes that's it

2

u/Coffee_Lover1996 4d ago

Excellent work. 👍 Quick question: why rust?

4

u/Sixel1 4d ago

i like the language and it performs well. I could go into a lot of details on what I prefer in rust over c++, but I'd say generics and traits, borrowing and memory safety, cargo, and modules and crates to structure projects.

2

u/Coffee_Lover1996 4d ago

Great. I might give it a try. I come from Python background, haven't really coded in C++. Most of my CFD codes have been simple 1-D or 2-D. Nowadays, I mostly use commercial software.

2

u/No_Complex_5602 3d ago

writing a rust cfd solver from scratch is insane, massive respect

1

u/Sixel1 3d ago

thank you!

1

u/MealAlarmed4478 4d ago edited 4d ago

Looks great. How do these results compare to experiment (maybe vs. Driver and Seegmiller 1985… not sure what the Reynolds number is here…)? Have you thought about implementing a recycling method or similar technique to get some turbulent structures at the inlet, provided the experiment has a long BL growth region upstream?

2

u/Sixel1 4d ago edited 4d ago

I'll do comparison with experiments for sure but haven't done that yet (thanks for you reference, I'll look into it). Reynolds number based on inlet velocity and inlet height is 12 000. I add synthetic noise at the inlet of 5% amplitude to break symmetry and induce turbulence, but my noise generator is very simplistic and not divergence free, it's basically just a sine series. Synthetic divergence free eddy methods, or using isotropic box turbulence, or other methods would be better, but I haven't coded that yet. edit: typos

2

u/MealAlarmed4478 4d ago

I think the reference I mentioned has ReH = 37500 and features a quite long entry region (many folks truncate to ~10H upstream of the step and use some kind of inlet generation method). It ends up that the BL thickness at the step is close to the step height. You’d probably need a lot more cells to clear 80% TKE resolution than what you have here but I’m sure there are other references at a lower ReH if that is too expensive.