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

time steps count

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 4, 2013, 03:01
Default time steps count
  #1
New Member
 
Grigor Nikolov
Join Date: Dec 2012
Posts: 26
Rep Power: 5
Grigor Nikolov is on a distinguished road
Hi everybody
im writing UDF using DEFINE_CG_MOTION
I have to make at the end of calculation low pass filter of the results and i want to include the filter in the aforementioned UDF. In these case i need to know when is the end of calculation.
So the question is is there possibility to get time step count to include it in UDF
Grigor Nikolov is offline   Reply With Quote

Old   September 4, 2013, 05:22
Talking
  #2
Member
 
Centurion2011's Avatar
 
Join Date: Jul 2011
Posts: 73
Blog Entries: 1
Rep Power: 11
Centurion2011 will become famous soon enough
check this link
__________________
I'M NOT A GYNECOLOGIST BUT I'LL TAKE A LOOK.
Centurion2011 is offline   Reply With Quote

Old   September 4, 2013, 07:27
Default
  #3
Senior Member
 
duri
Join Date: May 2010
Posts: 136
Rep Power: 8
duri is on a distinguished road
Quote:
Originally Posted by Grigor Nikolov View Post
Hi everybody
im writing UDF using DEFINE_CG_MOTION
I have to make at the end of calculation low pass filter of the results and i want to include the filter in the aforementioned UDF. In these case i need to know when is the end of calculation.
So the question is is there possibility to get time step count to include it in UDF
Easiest way is to use a static variable that counts number of times DEFINE_CG_MOTION is called. This works because DEFINE_CG_MOTION is called once for each time step. I would better use execute_at_end or execute_on_demand for doing this kind of operation.
duri is offline   Reply With Quote

Old   September 4, 2013, 07:43
Default
  #4
New Member
 
Grigor Nikolov
Join Date: Dec 2012
Posts: 26
Rep Power: 5
Grigor Nikolov is on a distinguished road
Tnx for answer but i need the final count of time steps to include it in UDF

like IF count = ..... then do the low pass filter
so i need to know the number of final count to use it in UDF
Grigor Nikolov is offline   Reply With Quote

Old   September 4, 2013, 08:00
Default
  #5
Senior Member
 
duri
Join Date: May 2010
Posts: 136
Rep Power: 8
duri is on a distinguished road
Quote:
Originally Posted by Grigor Nikolov View Post
Tnx for answer but i need the final count of time steps to include it in UDF

like IF count = ..... then do the low pass filter
so i need to know the number of final count to use it in UDF
follow this sample code,


DEFINE_CG_MOTION(....)
{
static int time_counter=0;
time_counter++;

if(time_counter > required_timestep)
{
.....
}

}
duri is offline   Reply With Quote

Old   September 4, 2013, 08:12
Default
  #6
New Member
 
Grigor Nikolov
Join Date: Dec 2012
Posts: 26
Rep Power: 5
Grigor Nikolov is on a distinguished road
When i start my calculation i insert "Number of Time Steps" in Fluent.
In my case 300000.
So i need after time step 300 000 to start filter or If count=300000 do....
But this is private case and i want to make UDF for any case
when i dont know "Number of Time Steps" is there a way to obtain this number from Fluent
Grigor Nikolov is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 12 March 21, 2016 14:05
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 02:34
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
same geometry,structured and unstructured mesh,different behaviour. sharonyue OpenFOAM Running, Solving & CFD 13 January 2, 2013 23:40
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35


All times are GMT -4. The time now is 16:26.