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

time steps count

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 4, 2013, 03:01
Default time steps count
  #1
Member
 
Grigor Nikolov
Join Date: Dec 2012
Posts: 36
Rep Power: 13
Grigor Nikolov is on a distinguished road
Send a message via Skype™ to Grigor Nikolov
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: 78
Blog Entries: 1
Rep Power: 18
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: 245
Rep Power: 16
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
Member
 
Grigor Nikolov
Join Date: Dec 2012
Posts: 36
Rep Power: 13
Grigor Nikolov is on a distinguished road
Send a message via Skype™ to Grigor Nikolov
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: 245
Rep Power: 16
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
Member
 
Grigor Nikolov
Join Date: Dec 2012
Posts: 36
Rep Power: 13
Grigor Nikolov is on a distinguished road
Send a message via Skype™ to Grigor Nikolov
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


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
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 09:08
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 22:40
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35


All times are GMT -4. The time now is 02:13.