CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Read txt file with udf (http://www.cfd-online.com/Forums/fluent-udf/116988-read-txt-file-udf.html)

rayolau April 30, 2013 04:25

Read txt file with udf
 
I need write a udf or open a file with velocity values... (like a the file created when I do Fille-->write-->profile) , asociated to boundary that I choose, and that these values will be the "conditions" in the boundary at the start of the each time step. Any idea?
Thanks in advance !


Laura

dahmen April 30, 2013 04:53

Hi Laura!
About writing an output UDF u have to use the function hook "execut-at-and" and in the body of ur UDF u would includ a file for postprossecing as 'txt ro dat' format, then u will a have a file contain a postprocessing of the parameters that u need at each time step.

DonQuijote April 30, 2013 05:52

Hi all!

I'm facing the same problem. I have a .txt file (with coordinates and variables (velocity) values) wich is changing every time step, so It's so frustrating to use GUI 'define profile' in each tstep.

I have thought of creating a UDF for that, but I have not found nor fluent manual either UDF manual how to do that... Do anyone know if it is really feasible??

Thank you in advance!!

rayolau April 30, 2013 07:36

Quote:

Originally Posted by dahmen (Post 424106)
Hi Laura!
About writing an output UDF u have to use the function hook "execut-at-and" and in the body of ur UDF u would includ a file for postprossecing as 'txt ro dat' format, then u will a have a file contain a postprocessing of the parameters that u need at each time step.

Hi dahmen! Thanks for your reply.
I use an UDF with "execut-at-end" for save data of a boundary that I choose. But I need "read" these saved data, in other boundary. I think that I may do with DEFINE_ADJUST, but I don't have more ideas...

This is the part to write data, I need do something like that to read data into other id boundary. :confused:

DEFINE_EXECUTE_AT_END(name)
{
Domain *domain;
domain = Get_Domain(1);
file = fopen("2D_IZQUIERDA.PROF", "w");
name_void(domain, 10);
fclose(file);
}


All times are GMT -4. The time now is 08:58.