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

Suitable timestep for DNS flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2020, 03:56
Default Suitable timestep for DNS flow
  #1
Member
 
Join Date: Feb 2019
Posts: 65
Rep Power: 7
cfdnewb123 is on a distinguished road
I am starting on turbulent flow and I am using a DNS code for low speed compressible air flow.
The code is discretization is based on central difference for its 1st order and 2nd order derivative. The code uses the temperature equation to determine the flow dynamic viscosity using Sutherland formula as well as the flow pressure using ideal gas law. The flow is also affected by gravitational along the z-direction. The code is initialized at a flow speed of 1 in each direction and at a starting temperature of 293K. Random noise are also given to speed and temperature to speed up turbulence.

However, after time of 10, the result produces velocity of the thousands which are not possible. I think that the code is still incomplete, in particular the timestep as the timestep is very big at dt=3.3333. May I know what is the suitable timestep for DNS flow? I try using CFL-based timestep but I need to set my CFL=0.001 for the resulting speed to be more reasonable, however this seems rather arbitrary plus, the timestep is very small. Also, the flow Re number is around 0.6.
cfdnewb123 is offline   Reply With Quote

Old   April 12, 2020, 04:54
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,776
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by cfdnewb123 View Post
I am starting on turbulent flow and I am using a DNS code for low speed compressible air flow.
The code is discretization is based on central difference for its 1st order and 2nd order derivative. The code uses the temperature equation to determine the flow dynamic viscosity using Sutherland formula as well as the flow pressure using ideal gas law. The flow is also affected by gravitational along the z-direction. The code is initialized at a flow speed of 1 in each direction and at a starting temperature of 293K. Random noise are also given to speed and temperature to speed up turbulence.

However, after time of 10, the result produces velocity of the thousands which are not possible. I think that the code is still incomplete, in particular the timestep as the timestep is very big at dt=3.3333. May I know what is the suitable timestep for DNS flow? I try using CFL-based timestep but I need to set my CFL=0.001 for the resulting speed to be more reasonable, however this seems rather arbitrary plus, the timestep is very small. Also, the flow Re number is around 0.6.



First of all, at Re=0.6 you cannot talk of real turbulence!
Then, the compressible low Mach flow are quite stiff and the CFL condition is dictated by the sound velocity
FMDenaro is offline   Reply With Quote

Old   April 13, 2020, 23:08
Default
  #3
Member
 
Join Date: Feb 2019
Posts: 65
Rep Power: 7
cfdnewb123 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
First of all, at Re=0.6 you cannot talk of real turbulence!
Then, the compressible low Mach flow are quite stiff and the CFL condition is dictated by the sound velocity
Thanks for the input. I try using CFL condition based on sound velocity, e.g. dtx=CFL*min([|dx/(u-a)|,|dx/(u)|,|dx/(u+a)|]) but I still get divergence in terms of velocity. The solver does not diverge when I remove the noise during initialization but when I add in noise (either for velocity or temperature or both), the solver velocity diverges. Is there any way I can do to prevent this velocity divergence?
cfdnewb123 is offline   Reply With Quote

Old   April 14, 2020, 02:50
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,776
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by cfdnewb123 View Post
Thanks for the input. I try using CFL condition based on sound velocity, e.g. dtx=CFL*min([|dx/(u-a)|,|dx/(u)|,|dx/(u+a)|]) but I still get divergence in terms of velocity. The solver does not diverge when I remove the noise during initialization but when I add in noise (either for velocity or temperature or both), the solver velocity diverges. Is there any way I can do to prevent this velocity divergence?
I cannot say without any detail of your method. The noise is divergence-free and a small perturbation?
However, what You are not understanding is that at Re=0.6 the flow is laminar, the numerical stability constraint is due to the diffusive terms.
FMDenaro is offline   Reply With Quote

Old   April 15, 2020, 22:31
Default
  #5
Member
 
Join Date: Feb 2019
Posts: 65
Rep Power: 7
cfdnewb123 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I cannot say without any detail of your method. The noise is divergence-free and a small perturbation?
However, what You are not understanding is that at Re=0.6 the flow is laminar, the numerical stability constraint is due to the diffusive terms.
Thanks so much for the response. I look through the code and realize that the viscosity for air used is on the order of 10 which thus, gives a low Reynolds number as well as cause huge velocity divergence. I have corrected it to the order of 10^-5 and the solver now has a high Reynolds number of approx. 49000. The solver is more stable but its velocity still increase unphysically when temperature and speed noise are introduced. Will the solver be stable if the cells are at the Kolmogorov length scale instead? Or should I introduce explicit filter since I am using coarser cells (~ Taylor microscale)?

The code I am testing out come from this source: http://cfd2012.com/matlab-dns-subsonic-code.html
cfdnewb123 is offline   Reply With Quote

Old   April 16, 2020, 02:50
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,776
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by cfdnewb123 View Post
Thanks so much for the response. I look through the code and realize that the viscosity for air used is on the order of 10 which thus, gives a low Reynolds number as well as cause huge velocity divergence. I have corrected it to the order of 10^-5 and the solver now has a high Reynolds number of approx. 49000. The solver is more stable but its velocity still increase unphysically when temperature and speed noise are introduced. Will the solver be stable if the cells are at the Kolmogorov length scale instead? Or should I introduce explicit filter since I am using coarser cells (~ Taylor microscale)?

The code I am testing out come from this source: http://cfd2012.com/matlab-dns-subsonic-code.html



There are a couple of possible problems:
1) the flow is at very low Mach number, a case that is stiff and hard to be simulated using a fully compressible formulation. More specific low-Mach or full incompressible formulations should be adopted.
2) the term "DNS" means not only the fact you are solving the NSE without any models for the turbulence but that means you resolve alla the characteristic scales of the turbulence until the range of dissipative scales. If you are using a grid resolving up to the Taylor microscale you are at the beginning of the dissipative range, that is almost a real DNS simulation. The code should produce a stable solution but you need to consider all the correct requirements for the numerical stability that depend on the discretization in the code.


Be aware that the numerical stability is something that does not depend on the initial condition, that is a superimposed perturbation should not affect the stability of the solution. Maybe something is worng when you add the perturbation.
FMDenaro is offline   Reply With Quote

Old   April 16, 2020, 06:02
Default
  #7
Member
 
Join Date: Feb 2019
Posts: 65
Rep Power: 7
cfdnewb123 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
There are a couple of possible problems:
1) the flow is at very low Mach number, a case that is stiff and hard to be simulated using a fully compressible formulation. More specific low-Mach or full incompressible formulations should be adopted.
2) the term "DNS" means not only the fact you are solving the NSE without any models for the turbulence but that means you resolve alla the characteristic scales of the turbulence until the range of dissipative scales. If you are using a grid resolving up to the Taylor microscale you are at the beginning of the dissipative range, that is almost a real DNS simulation. The code should produce a stable solution but you need to consider all the correct requirements for the numerical stability that depend on the discretization in the code.


Be aware that the numerical stability is something that does not depend on the initial condition, that is a superimposed perturbation should not affect the stability of the solution. Maybe something is worng when you add the perturbation.
Thanks so much for the answer. It may be a bad idea for me to start on a random code without any manual. However, I have experience with Riemann solver (using Euler equation) and it may be a better idea for me to start with my own code. May I ask for your recommendations on what are some good and comprehensible sources for me to introduce physical viscosity to Euler equation?

Last edited by cfdnewb123; April 16, 2020 at 08:29.
cfdnewb123 is offline   Reply With Quote

Old   April 16, 2020, 14:32
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,776
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by cfdnewb123 View Post
Thanks so much for the answer. It may be a bad idea for me to start on a random code without any manual. However, I have experience with Riemann solver (using Euler equation) and it may be a better idea for me to start with my own code. May I ask for your recommendations on what are some good and comprehensible sources for me to introduce physical viscosity to Euler equation?



What do you mean exactly? This topic is about the formulation for solving the Navier-Stokes equations and can be found in many of CFD textobooks.
FMDenaro 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
Is COMSOL Multi Physics is suitable to solve complex flow problem? steve lee COMSOL 8 January 5, 2023 02:31
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate MSchneid Fluent UDF and Scheme Programming 3 February 23, 2019 06:00
flow over a cylinder urgent! kevin FLUENT 8 August 11, 2015 13:00
Most suitable solution method for incompressible flow in porous media Tanjina FLUENT 0 January 30, 2014 11:19
Gate valve flow simulations... nikesh FloEFD, FloWorks & FloTHERM 5 January 28, 2014 01:31


All times are GMT -4. The time now is 19:24.