As part of my process of learn
As part of my process of learning how to use OpenFOAM, I decided to try implementing a steady-flow solver with laminar flow and no turbulence. That is, essentially simpleFoam solver, but with the viscosity model and related bits from the icoFoam solver.
As a test case for the solver, I'm using the cavity problem from the first tutorial in the handbook, with the timestep variables adapted for a steady-state problem. Everything seems to be working, up until the point where I start looking at the results. I've got a nasty odd-even (checkerboard) instability going on.
Now, I know that theoretically this sort of thing happens because a central-differenced velocity discretization is decoupled from the pressure value in the center of the cell, and that this is generally best solved by providing some form of upwind biasing. However, this problem arises in my steady-state calculation, but it doesn't arise in the time-based calculations of the example....
Thus, my question: What's present in the icoFoam calculation that takes care of this that I may be missing? What is the best way to take care of the problem in my steady-state calculation? (Or perhaps: Is this something that ought not be happening in the first place, and I'd be better off looking for a bug?)
What's present in the icoFoam
If you want to make a steady-state version of icoFoam, all you need to do is to get rid of the time derivative in the momentum equation and add implicit under-relaxation. Additionaly, you want SIMPLE instead of PISO (solve the pressure only once and under-relax it explicitly) and you're done.
Thanks for the advice! That s
Thanks for the advice! That sounded like almost exactly what I'd done, so I went through and compared each line of my case to the icoFoam code, and made sure things matched up properly.
I'm embarassed to say what the problem was: I'd made a sign error on the viscosity term!
|All times are GMT -4. The time now is 07:40.|