CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

time step not being adjusted according to predefined max allowed Courant number

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Sebastiaan
  • 1 Post By Sebastiaan
  • 1 Post By Sebastiaan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2024, 06:53
Default time step not being adjusted according to predefined max allowed Courant number
  #1
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
Hello everyone,

this is a newbie's question, but I took the pitzDaily (LES/pisoFoam) example to try the adjustable time step, however it looks like it the time step is not being calculated to satisfy the maxCo I defined. I attached my controlDict here. I was going through the code and I saw that writeInterval can interfere with the code updating the time step, so I tried different values (1e3 to 1e-10) and nothing seems to change the results.

PS: everything else is from the pitzDaily case, I just changed the controlDict.
Attached Files
File Type: c controlDict.c (2.8 KB, 4 views)

Last edited by ncl94; June 12, 2024 at 10:56. Reason: grammar mistake
ncl94 is offline   Reply With Quote

Old   June 12, 2024, 07:11
Default
  #2
New Member
 
sebastiaan bors
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Sebastiaan is on a distinguished road
I don't see anything obviously wrong, could you perhaps provide a piece of your log file? Do you really want to write results with each 10^-10 seconds? And do you expect the required time step for co<1 to be lower than that?
ncl94 likes this.
Sebastiaan is offline   Reply With Quote

Old   June 12, 2024, 10:54
Default
  #3
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
Quote:
Originally Posted by Sebastiaan View Post
Do you really want to write results with each 10^-10 seconds?
Not really, that is just something I was trying to see the effects of writeInterval when having an adjustable time step

Quote:
Originally Posted by Sebastiaan View Post
And do you expect the required time step for co<1 to be lower than that?
Lower than the writeInterval? No.
Lower than the deltaT I specified in controlDict?Yes.






Sorry for not attaching the log file instead of just writing it here, but I am getting a weird message whenever I try to attach any kind of file. Anyway, there it is:


--------------------------------------------------------------------------------------------------------------------

Time = 2e-05

Courant Number mean: 0.000174979 max: 0.0631777
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 2.48998e-07, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 2.6611e-07, No Iterations 2
GAMG: Solving for p, Initial residual = 1, Final residual = 0.0982953, No Iterations 20
time step continuity errors : sum local = 3.44036e-05, global = -1.90151e-06, cumulative = -1.90151e-06
GAMG: Solving for p, Initial residual = 0.0123119, Final residual = 6.67732e-07, No Iterations 8
time step continuity errors : sum local = 2.62174e-08, global = -2.66804e-09, cumulative = -1.90418e-06
smoothSolver: Solving for k, Initial residual = 0.72442, Final residual = 1.51991e-07, No Iterations 3
bounding k, min: 0 max: 0.000841637 average: 1.64512e-07
ExecutionTime = 0.18 s ClockTime = 0 s

fieldAverage fieldAverage1:
Reading/initialising field UMean
Reading/initialising field pMean
Reading/initialising field UPrime2Mean
Reading/initialising field pPrime2Mean

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

scalarTransport execute: s
smoothSolver: Solving for s, Initial residual = 1, Final residual = 8.10247e-06, No Iterations 2

scalarTransport write: scalarTransport
s

Time = 4e-05

Courant Number mean: 0.0848829 max: 1.89314
smoothSolver: Solving for Ux, Initial residual = 0.858153, Final residual = 4.38444e-06, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 0.220983, Final residual = 8.45497e-06, No Iterations 4
GAMG: Solving for p, Initial residual = 0.0194081, Final residual = 0.00176716, No Iterations 19
time step continuity errors : sum local = 4.63307e-05, global = -3.7076e-06, cumulative = -5.61177e-06
GAMG: Solving for p, Initial residual = 0.0408878, Final residual = 5.63238e-07, No Iterations 12
time step continuity errors : sum local = 7.69652e-09, global = -1.03697e-09, cumulative = -5.61281e-06
smoothSolver: Solving for k, Initial residual = 0.239396, Final residual = 1.8275e-06, No Iterations 2
bounding k, min: -3.38517e-10 max: 0.00153181 average: 3.74304e-07
ExecutionTime = 0.24 s ClockTime = 0 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

scalarTransport execute: s
smoothSolver: Solving for s, Initial residual = 0.210501, Final residual = 3.31326e-06, No Iterations 2

scalarTransport write: scalarTransport
s

Time = 6e-05

Courant Number mean: 0.0848805 max: 1.84028
smoothSolver: Solving for Ux, Initial residual = 0.685705, Final residual = 3.32903e-06, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 0.0878103, Final residual = 4.38787e-06, No Iterations 4
GAMG: Solving for p, Initial residual = 0.017978, Final residual = 0.00174891, No Iterations 17
time step continuity errors : sum local = 2.27482e-05, global = 2.11883e-06, cumulative = -3.49398e-06
GAMG: Solving for p, Initial residual = 0.583057, Final residual = 5.26689e-07, No Iterations 16
time step continuity errors : sum local = 1.70612e-10, global = 2.06454e-11, cumulative = -3.49396e-06
smoothSolver: Solving for k, Initial residual = 0.146676, Final residual = 6.81688e-06, No Iterations 4
bounding k, min: -1.50636e-07 max: 0.00217707 average: 6.33037e-07
ExecutionTime = 0.3 s ClockTime = 0 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

scalarTransport execute: s
smoothSolver: Solving for s, Initial residual = 0.117555, Final residual = 3.4525e-06, No Iterations 2

scalarTransport write: scalarTransport
s

Time = 8e-05

Courant Number mean: 0.0847656 max: 1.76053
smoothSolver: Solving for Ux, Initial residual = 0.00879533, Final residual = 3.64488e-06, No Iterations 3
smoothSolver: Solving for Uy, Initial residual = 0.0023919, Final residual = 4.50489e-06, No Iterations 3
GAMG: Solving for p, Initial residual = 0.176207, Final residual = 0.0133852, No Iterations 2
time step continuity errors : sum local = 3.1426e-06, global = 7.29022e-08, cumulative = -3.42106e-06
GAMG: Solving for p, Initial residual = 0.0224733, Final residual = 3.64068e-07, No Iterations 11
time step continuity errors : sum local = 8.04213e-11, global = -1.0749e-11, cumulative = -3.42107e-06
smoothSolver: Solving for k, Initial residual = 0.105586, Final residual = 1.8306e-06, No Iterations 6
bounding k, min: -3.3322e-07 max: 0.0027276 average: 1.0776e-06
ExecutionTime = 0.35 s ClockTime = 0 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

scalarTransport execute: s
smoothSolver: Solving for s, Initial residual = 0.0814703, Final residual = 4.10346e-06, No Iterations 2

scalarTransport write: scalarTransport
s

Time = 0.0001

Courant Number mean: 0.0845884 max: 1.69682
smoothSolver: Solving for Ux, Initial residual = 0.00879353, Final residual = 2.88955e-06, No Iterations 3
smoothSolver: Solving for Uy, Initial residual = 0.00173623, Final residual = 3.72738e-06, No Iterations 3
GAMG: Solving for p, Initial residual = 0.109361, Final residual = 0.0054413, No Iterations 3
time step continuity errors : sum local = 1.09907e-06, global = -1.89206e-07, cumulative = -3.61027e-06
GAMG: Solving for p, Initial residual = 0.010983, Final residual = 6.11753e-07, No Iterations 11
time step continuity errors : sum local = 1.07575e-10, global = 7.201e-12, cumulative = -3.61027e-06
smoothSolver: Solving for k, Initial residual = 0.0849395, Final residual = 1.70522e-06, No Iterations 6
bounding k, min: -1.55854e-08 max: 0.00357542 average: 1.99527e-06
ExecutionTime = 0.4 s ClockTime = 0 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

scalarTransport execute: s
smoothSolver: Solving for s, Initial residual = 0.062312, Final residual = 5.05917e-06, No Iterations 2

scalarTransport write: scalarTransport
s

Time = 0.00012

Courant Number mean: 0.0844443 max: 1.64538
smoothSolver: Solving for Ux, Initial residual = 0.00625174, Final residual = 2.99884e-06, No Iterations 3
smoothSolver: Solving for Uy, Initial residual = 0.00145455, Final residual = 3.65718e-06, No Iterations 3
GAMG: Solving for p, Initial residual = 0.109404, Final residual = 0.00763556, No Iterations 8
time step continuity errors : sum local = 1.25652e-06, global = -1.08833e-07, cumulative = -3.7191e-06
GAMG: Solving for p, Initial residual = 0.0157532, Final residual = 4.27e-07, No Iterations 12
time step continuity errors : sum local = 8.47843e-11, global = -1.50146e-11, cumulative = -3.71911e-06
smoothSolver: Solving for k, Initial residual = 0.0603562, Final residual = 8.98367e-06, No Iterations 5
bounding k, min: -7.64728e-06 max: 0.00549997 average: 3.30318e-06
ExecutionTime = 0.46 s ClockTime = 0 s
ncl94 is offline   Reply With Quote

Old   June 13, 2024, 04:00
Default
  #4
New Member
 
sebastiaan bors
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Sebastiaan is on a distinguished road
My mistake, I forgot that pisoFoam does not support an adjustable time step. You could try pimpleFoam as an alternative. Or if you feel comfortable you could adapt and recompile pisoFoam (see Using adjustableTimeStep in pisoFoam), however I would suggest using pimpleFoam regardless if you intend to operate near the CFL~1 condition as you might need outer iterations for stability (depends highly on the application).
ncl94 likes this.
Sebastiaan is offline   Reply With Quote

Old   June 13, 2024, 04:07
Default
  #5
New Member
 
sebastiaan bors
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Sebastiaan is on a distinguished road
You migth be interested in this reply by Tobi on configuring pimpleFoam with respect to pisoFoam.
ncl94 likes this.
Sebastiaan is offline   Reply With Quote

Old   June 13, 2024, 06:10
Default
  #6
New Member
 
Join Date: Mar 2024
Posts: 10
Rep Power: 2
ncl94 is on a distinguished road
Thank you very much, Sebastiaan! I didn't know either that some solvers do not offer time step adjustment, I thought it was inherited by every solver.
ncl94 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 05:28
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 07:47


All times are GMT -4. The time now is 23:45.