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

UDF - Write data into file at the end of every time-step

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2017, 10:45
Smile UDF - Write data into file at the end of every time-step
  #1
New Member
 
Join Date: Apr 2017
Posts: 7
Rep Power: 9
rookiecfd is on a distinguished road
Hello everyone,

I need to write a UDF to be executed with a transient simulation. I have specified the number of iterations to be carried out per time-step. I need to make a UDF that will write some data into a file at the end of each time-step. I don't want to see this at every iteration per time-step. Say, I specify 20 iterations per time-step. Then I want to have the data written at the end of 20th iteration or at the point where convergence is achieved for a time-step. Could someone tell me how can this be achieved? Thanks in advance!
rookiecfd is offline   Reply With Quote

Old   April 13, 2017, 11:28
Default
  #2
Boh
Member
 
Join Date: Sep 2016
Posts: 33
Rep Power: 10
Boh is on a distinguished road
The EXECUTE_AT_END macro is executed at the end of each time step of a transient model...so if you write into your file inside this macro it will contain only the values at the end of each time step.
Boh is offline   Reply With Quote

Old   April 13, 2017, 11:54
Default
  #3
New Member
 
Join Date: Apr 2017
Posts: 7
Rep Power: 9
rookiecfd is on a distinguished road
Quote:
Originally Posted by Boh View Post
The EXECUTE_AT_END macro is executed at the end of each time step of a transient model...so if you write into your file inside this macro it will contain only the values at the end of each time step.
Thank you Boh. Let me try that out.
rookiecfd is offline   Reply With Quote

Old   April 13, 2017, 15:14
Default
  #4
New Member
 
Join Date: Apr 2017
Posts: 7
Rep Power: 9
rookiecfd is on a distinguished road
Hi,

unfortunately, that did not work out. It is still printing values at every iteration per time-step. Could someone help me out on this?
rookiecfd is offline   Reply With Quote

Old   April 14, 2017, 04:53
Default
  #5
New Member
 
Maksim
Join Date: Jan 2016
Posts: 24
Rep Power: 10
qorka is on a distinguished road
Quote:
Originally Posted by rookiecfd View Post
Hi,

unfortunately, that did not work out. It is still printing values at every iteration per time-step. Could someone help me out on this?
If you solve in transient, EXECUTE_AT_END is called at the end of time step (it works good by me)
In static analys it is called at the end of iteration

Sent from my Lenovo K50-t5 using CFD Online Forum mobile app
qorka is offline   Reply With Quote

Old   April 14, 2017, 09:05
Default
  #6
New Member
 
Join Date: Apr 2017
Posts: 7
Rep Power: 9
rookiecfd is on a distinguished road
Hi Boh and qorka,

Thanks for the reply. So that means it has to do something with my code.
I wrote a UDF to calculate the point of slowest blending in a mixing tank based on mass fraction of species. I tried running it on a Linux system with one node (16 cores) but I did not make it compatible for parallel processing. Am getting weird results. Have to go back and check where I made the mistake.
rookiecfd is offline   Reply With Quote

Old   April 14, 2017, 21:13
Default
  #7
New Member
 
钱权
Join Date: Mar 2017
Posts: 5
Rep Power: 9
qianquan is on a distinguished road
let me try


Sent from my iPhone using CFD Online Forum mobile app
qianquan is offline   Reply With Quote

Old   April 17, 2017, 12:21
Default
  #8
New Member
 
Join Date: Apr 2017
Posts: 7
Rep Power: 9
rookiecfd is on a distinguished road
..........................................

Last edited by rookiecfd; May 3, 2017 at 15:55.
rookiecfd is offline   Reply With Quote

Reply

Tags
file writing, time-step, udf


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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
Simulation of a single bubble with a VOF-method Suzzn CFX 21 January 29, 2018 01:58
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56


All times are GMT -4. The time now is 15:07.