# Steady time step

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 January 22, 2004, 13:18 Steady time step #1 Jim Guest   Posts: n/a Sponsored Links I am trying to compute the allowable time-step at each grid point in order to satisfy the CFL condition. The problem I am solving is steady and so I can use different time-steps at each point. I realise that I need to find the max. wavespeed at each point to determine the time-step. I am using MacCormack's method and the stencil for each grid point is three points (i-1, i, i+1), so I need to consider flow conditions at all three stencil points in order to compute the allowable time-step at each grid point. However, I can't seem to be able to code this correctly. I'm using Visual C++ and have so far written: for (i = 1; i <= no. grid points; i = i + 1) { wav = 0.0; lambda[1] = m_old[i]/ro_old[i] - sqrt(gam*p_old[i]/ro_old[i]); lambda[2] = m_old[i]/ro_old[i]; lambda[3] = m_old[i]/ro_old[i] + sqrt(gam*p_old[i]/ro_old[i]); for (j = 1; j <= 3; j = j + 1) { if (fabs(lambda[j]) > wav) { wav = fabs(lambda[j]); } } deltat[i] = cflno*dx/wav; } When I run my program I get a very unstable solution and I think it's due to this time-step calculation. Any help would be greatly appreciated. Thanks.
 Sponsored Links

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 05:13 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03 cyberbrain OpenFOAM 4 March 16, 2011 10:20 carsten OpenFOAM Bugs 11 September 12, 2008 11:16 Kushagra CFX 1 June 22, 2008 19:06

 Sponsored Links

All times are GMT -4. The time now is 09:27.

 Contact Us - CFD Online - Top