Modifying sonicFoam to run with variable timestep - strange results
3 Attachment(s)
I have modified the sonicFoam solver (version 2.1.1) to run a variable timestep and with maximum Courant number. The reason I want to have a variable timestep sonicFoam solver is to perform a grid dependency study, and doing so with a static timestep was very frustrating.
The modified solver works for some grid resolutions and not for others. I don't know why. The test case, and some (incorrect) pressure plots are attached. At the start of the simulation I set MaxCo = 0.2 in my controlDict file, run own_sonicFoam, and everything appears to be proceeding okay. A typical output near the start of the simulation is: Code:
Courant Number mean: 0.0629867 max: 0.200099 Then at a certain point the timestep drops rapidly and there is a huge discrepancy between the Courant number mean and max: Code:
Courant Number mean: 8.67688e-05 max: 0.2 One of the more confusing things about this was that for one test case (refer blockMeshDict file) I found that an odd number of cells in the vertical direction caused problems, but an even number gave a good solution. The changes I made to the sonicFoam solver are: Code:
|
A semi-progress update. Increasing the Courant number from 0.2 to 0.5 solves this problem and gives me good results.
As far as I understand, the Courant number only affects the stability of the solver. So shouldn't a higher Courant number be more likely to cause problems? What have I done wrong here that a lower Courant number is doing this instead? |
All times are GMT -4. The time now is 12:05. |