CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Time step UDF for help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2011, 21:41
Default Time step UDF for help
  #1
New Member
 
Join Date: Apr 2011
Posts: 9
Rep Power: 15
peaker007 is on a distinguished road
The CFD calculation is so time-consuming, so I want to define the timestep size by udf, and then expect that the calculation can be done automatically, i.e, after a certain steps, timestep size can be changed and go on calculating without taking care manually. I have used the following UDF, but when used it in practice, it does not work well. After calculate for 100 steps, the iteration will stop, then I have to restart the calculate, but it stopped after another 100 steps. Plese help me, thanks in advance.

DEFINE_DELTAT(my_timestep,d)
{
real time_step;
real flow_time = CURRENT_TIME;

if (flow_time < 0.005)
time_step = 0.00005; /*0.00005 100 steps */
else if(flow_time < 0.025)
time_step = 0.0001; /*0.0001 200 steps */
else if(flow_time<0.175)
time_step=0.0005; /*0.0005 300 steps */
else if(flow_time<1.175)
time_step=0.001; /*0.001 1000 steps */
else if(flow_time<5.675)
time_step=0.003; /*0.003 1500 steps */
else if(flow_time<10.675)
time_step=0.005; /*0.005 1000 steps */
else
time_step=0.01;
return time_step;
}
peaker007 is offline   Reply With Quote

Old   November 23, 2011, 04:15
Default
  #2
Member
 
laurentb's Avatar
 
Laurent B
Join Date: Jun 2009
Location: Lille, FRANCE
Posts: 70
Rep Power: 16
laurentb is on a distinguished road
What do you choose for the "Number of Time Steps" under "Run Calculation" ?
you must put a number higher than 4600 (total number of steps)
laurentb is offline   Reply With Quote

Old   November 23, 2011, 20:43
Default
  #3
New Member
 
Join Date: Apr 2011
Posts: 9
Rep Power: 15
peaker007 is on a distinguished road
Quote:
Originally Posted by laurentb View Post
What do you choose for the "Number of Time Steps" under "Run Calculation" ?
you must put a number higher than 4600 (total number of steps)
Thank youvery much. I think you are right and I have accept your suggestion. Wish to success.
peaker007 is offline   Reply With Quote

Reply

Tags
time step size


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
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36
Full pipe 3D using icoFoam cyberbrain OpenFOAM 4 March 16, 2011 09:20
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


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