Register Blogs Members List Search Today's Posts Mark Forums Read

 August 28, 2014, 06:56 Adaptive time stepping #1 New Member   Thomas Green Join Date: Aug 2014 Posts: 7 Rep Power: 11 I post again here because maybe the discussion in which I posted was closed. Dear All, I have the same problem of DIVERGENCE DETECTED IN AMG SOLVER: y-momentum. I am simulating a constant flow profile but I would like to analyze it in transient mode. My mass flow inlet is of 0.000001 kg/s, I thought that using an adaptive time step that change from 0.001 for the first second to something bigger for the rest of the simulation (for instance 10 seconds) because the fluid flow will be developed. Solution Method (in order): PISO (Skewness Correction & Neighbor Correction = 1), Least Squares Cell Based, Second Order, Second Order Upwind, First Order Implicit. Run Calculation: Adaptive Time Stepping Method (deltat); Time Step Size (s)=0.001 (because I have to select the initial time step); Number of Time Step=1000, Max Iterations/Time Step=200. My code for the adaptive time stepping is: #include "udf.h" DEFINE_DELTAT(deltat,d){ real time_step; real tx=CURRENT_TIME; if ( tx<=1 ) { time_step=0.001; } else{ time_step=10; return time_step; } } I don`t get very well what is wrong in what I am doing, anybody has suggestions? Thank you so much. Thomas

 August 28, 2014, 08:52 #2 Senior Member   Join Date: Nov 2013 Posts: 1,965 Rep Power: 26 If your time is below 1 second, nothing is returned. Code: ```#include "udf.h" DEFINE_DELTAT(deltat,d){ real time_step; real tx=CURRENT_TIME; if ( tx<=1 ) { time_step=0.001; } else { time_step=10; } return time_step; }``` If you do this, the time_step will always be returned. (I don't know if this will solve your problem.)

 August 28, 2014, 10:18 #3 New Member   Thomas Green Join Date: Aug 2014 Posts: 7 Rep Power: 11 Thank you so much! It works perfectly