CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF - Write data into file at the end of every time-step (https://www.cfd-online.com/Forums/fluent-udf/186228-udf-write-data-into-file-end-every-time-step.html)

rookiecfd April 13, 2017 09:45

UDF - Write data into file at the end of every time-step
 
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!

Boh April 13, 2017 10:28

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.

rookiecfd April 13, 2017 10:54

Quote:

Originally Posted by Boh (Post 644821)
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 April 13, 2017 14:14

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?

qorka April 14, 2017 03:53

Quote:

Originally Posted by rookiecfd (Post 644843)
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

rookiecfd April 14, 2017 08:05

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.

qianquan April 14, 2017 20:13

let me try


Sent from my iPhone using CFD Online Forum mobile app

rookiecfd April 17, 2017 11:21

..........................................


All times are GMT -4. The time now is 00:06.