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

Dual Time Stepping

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By t.teschner

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 2, 2017, 11:05
Default Dual Time Stepping
  #1
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 204
Rep Power: 16
t.teschner is on a distinguished road
I have some issues implementing the dual time stepping procedure and was hoping some experienced eyes can help me out. Suppose I want to solve the advection equation using a dual time stepping procedure, then I have

\frac{\partial u}{\partial \tau}+\frac{\partial u}{\partial t}+a\frac{\partial u}{\partial x},

where \tau and t are the pseudo and real time, respectively. Using first order (for simplicity) for all the derivatives, I get

\frac{u_i^{n+1,m+1}-u_i^{n+1,m}}{\Delta \tau} + \frac{u_i^{n+1,m}-u_i^{n}}{\Delta t} + a\frac{u_i^n - u_{i-1}^n}{\Delta x} = 0.

I define the right-hand side (RHS) as

RHS=-\frac{u_i^{n+1,m}-u_i^{n}}{\Delta t} - a\frac{u_i^n - u_{i-1}^n}{\Delta x}

and then can rewrite the equation in explicit time integration form as

u_i^{n+1,m+1}=u_i^{n+1,m}+\Delta\tau RHS.

Once u_i^{n+1,m+1}-u_i^{n+1,m}<\epsilon, where \epsilon is some small (convergence number), the pseudo time derivative vanishes and i obtain the solution at the next time step. The pseudo code for my example follows below

Code:
t_r=0

while(t_r < t_{end})
   while(\epsilon<residual and iteration<iteration_{max})
   
      Do i=2 to n
         RHS=-\frac{u_i^{n+1,m}-u_i^{n}}{\Delta t} - a\frac{u_i^n - u_{i-1}^n}{\Delta x}
      End

      Do i=2 to n
         u_i^{n+1,m+1}=u_i^{n+1,m}+\Delta\tau RHS
      End

      calculate residual
      set iteration=iteration+1
      u^{n+1,m}=u^{n+1,m+1}

   End

   u^n=u^{n+1,m+1}
   t_r=t_r+\Delta t

End
As long as I have \Delta \tau=\Delta t the above code works fine, but as soon as I use different time steps, say 2\Delta \tau=\Delta t, then my solution is off (by a factor of 2, in terms of propagated distance). It is probably an easy fix, but at the moment I am not quite sure what I am doing wrong.

Last edited by t.teschner; August 3, 2017 at 14:13.
t.teschner is offline   Reply With Quote

 

Tags
dual time stepping


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
Elastic or Plastic Deformations in OpenFOAM NickolasPl OpenFOAM Pre-Processing 36 September 23, 2023 08:22
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 05:28
same geometry,structured and unstructured mesh,different behaviour. sharonyue OpenFOAM Running, Solving & CFD 13 January 2, 2013 22:40
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58


All times are GMT -4. The time now is 00:48.