CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   write/read function (http://www.cfd-online.com/Forums/fluent/40644-write-read-function.html)

Paul April 19, 2006 10:06

write/read function
 
I am currently trying to create a UDF using windows operating sytem. The code I have creeated thus far is below. The idea is that in order to find out k the total system change in pressure is needed. Since I know the inlet pressure I turn the function on at the end of the chambre so that k can be calculated P1-P2 /1.004e6 . Then the value is written and then read into another equation during the next iteration.

It is not interpreted properly. Is there anyone who can offer some advice.

if (x[2]>=8.89)

k = (2.56e5-(C_P(cell,thread))/(1.004e6));

k++; printf("k=%d\n",k);

DEFINE_RW_FILE(writer,fp);

printf;

fprintf(fp"%d",k);

else k =

DEFINE_RW_FILE(reader,fp);

printf;

fscanf(fp,"%d",&k);

}



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