CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to identify a problem in CFL condition.

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By sbaffini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2016, 00:45
Default How to identify a problem in CFL condition.
  #1
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
This is about explicit, 3D, compressible NS solver. Consider two cases:
1) Code diverges after n time steps with step size dt. When I reduce the time step to 0.1*dt, the code diverges after 10*n time steps. i.e. code blows at the same actual time.
2) Code diverges after n time steps with step size dt. When I reduce the time step to 0.1*dt, the code still diverges after n time steps.

Which of the cases indicate a problem in CFL condition/numerical instability? What does the other case indicate? Or is it that either of the cases don't indicate anything specific, and there can be multiple possibilities where the problem is?

Thanks
pawank is offline   Reply With Quote

Old   October 5, 2016, 03:30
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,855
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I think that before to talk of a numerical instability you have to check that exists a certain smaller dt for which your computation is stable. Conversely, I would always check for some bug in the code.
FMDenaro is offline   Reply With Quote

Old   October 5, 2016, 12:37
Default
  #3
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
The code works when Mach no of the flow is 2. When I increase it to 4, it diverges. I decreased dt several times but it diverges at the same nth time step.
pawank is offline   Reply With Quote

Old   October 5, 2016, 12:45
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,855
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Are you solving Euler equations? Do you consider in the CFL condition the sound velocity? no dt values drive to a stable solution at M=4?
FMDenaro is offline   Reply With Quote

Old   October 5, 2016, 12:54
Default
  #5
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
I'm solving compressible navier stokes.
Actually the code is not mine and the person who wrote the code has not included any CFL condition. He used a dt which worked for him for Mach no 2. I have to run it for Mach no 4. I just wanted to test it out quickly so when it diverged, I reduced dt, but does not work.
And no dt works. Reduced it to at least 0.0001*dt just to see if it works, but it doesn't.
pawank is offline   Reply With Quote

Old   October 5, 2016, 13:03
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,855
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by pawank View Post
I'm solving compressible navier stokes.
Actually the code is not mine and the person who wrote the code has not included any CFL condition. He used a dt which worked for him for Mach no 2. I have to run it for Mach no 4. I just wanted to test it out quickly so when it diverged, I reduced dt, but does not work.
And no dt works. Reduced it to at least 0.0001*dt just to see if it works, but it doesn't.

these details are not sufficient to understand the problem.... what are you simulating? Increasing the Mach number you increase the velocity and the Reynolds number. Have you checked the fields before the code diverges?
FMDenaro is offline   Reply With Quote

Old   October 5, 2016, 13:08
Default
  #7
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
these details are not sufficient to understand the problem.... what are you simulating? Increasing the Mach number you increase the velocity and the Reynolds number. Have you checked the fields before the code diverges?
I am simulating a laminar boundary layer. The code diverges in very few iteration and hence there is not much seen in the flow field. It is as good as initial conditions.
The conditions are standard atm. And with the present conditions, Reynolds no is around 1000

And thanks for the help
pawank is offline   Reply With Quote

Old   October 5, 2016, 13:15
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,855
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Usually, numerical instability does not appear in few steps... I would check for a bug in the code ...I suggest to run the code for a single dt and check all the variables.
FMDenaro is offline   Reply With Quote

Old   October 5, 2016, 14:06
Default
  #9
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Usually, numerical instability does not appear in few steps... I would check for a bug in the code ...I suggest to run the code for a single dt and check all the variables.
Thanks for the suggestion
pawank is offline   Reply With Quote

Old   October 6, 2016, 13:14
Default
  #10
New Member
 
Join Date: Aug 2014
Location: Lexington
Posts: 11
Rep Power: 12
ashi.ismd is on a distinguished road
I use Cradle CFD for my simulations and I do a lot of transients. You may want to refine the mesh close to the boundaries especially. Secondly, run the simulations with a fixed time step instead of CFL and monitor the CFL number as the simulation progresses. Go back and use a Courant number that is lower than that.
ashi.ismd is offline   Reply With Quote

Old   October 7, 2016, 00:09
Default
  #11
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
Thanks ashi.ismd
pawank is offline   Reply With Quote

Old   October 7, 2016, 05:27
Default
  #12
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Generally speaking, if the simulation blows up at a given physical time, then it is a matter of physics or how you represented it in your code.

In this sense, a CFL instability is physics, because your scheme amplifies perturbations at a given rate. But you might have, as well, also introduced additional
"unwanted" physics by some coding mistake.

In contrast, when the simulation blows after a fixed number of steps, no matter how small they are, it is much more likely that something is wrong from the programming point of view (allocations, etc.).
FMDenaro and pawank like this.
sbaffini is offline   Reply With Quote

Old   October 7, 2016, 21:22
Default
  #13
New Member
 
Pawan Kerkar
Join Date: Sep 2016
Posts: 29
Rep Power: 10
pawank is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
Generally speaking, if the simulation blows up at a given physical time, then it is a matter of physics or how you represented it in your code.

In this sense, a CFL instability is physics, because your scheme amplifies perturbations at a given rate. But you might have, as well, also introduced additional
"unwanted" physics by some coding mistake.

In contrast, when the simulation blows after a fixed number of steps, no matter how small they are, it is much more likely that something is wrong from the programming point of view (allocations, etc.).
Thanks...What i was looking for...
pawank 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
problem of implementing a new solver with a special boundary condition huyidao OpenFOAM Programming & Development 0 April 27, 2015 09:24
an error problem for a change of boundary condition tsi07 FLUENT 7 May 15, 2012 08:56
Problem with "symmetryPlanne" boundary condition fcuevas OpenFOAM Running, Solving & CFD 1 March 14, 2012 06:07
problem with boundary condition??? smn CFX 5 November 24, 2009 07:37
CFL condition Sergei Main CFD Forum 2 October 13, 2004 16:38


All times are GMT -4. The time now is 02:46.