CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Export data of expression from a point every time steps in .txt or .csv (https://www.cfd-online.com/Forums/cfx/235278-export-data-expression-point-every-time-steps-txt-csv.html)

Amir_line April 8, 2021 10:29

Export data of expression from a point every time steps in .txt or .csv
 
Hello,

I need to export data of mass flow (calculated by an expression) from a point or surface every time steps in format .csv or .txt. Can anyone help me, please?

I find this code but it does not work for me.
!$outfile = "tmp.txt";
!open(OUT, ">$outfile");
!$nodes = count("Default Domain");
!print OUT $nodes;
!close(OUT);

Thanks in advance,

Amir

Gert-Jan April 8, 2021 11:48

Mass flow from a point does not make sense in my opinion.
Through a boundary (inlet or outlet) or interface, I would create a plot as function of time in the solver manager and export this as csv file.
This data is available by default, even after the calculation has finished. CFX has saved these data for you in the results file .
Just open the calculation as finished run, create a new plot in the manager, and plot the data that you need.

AtoHM April 9, 2021 01:38

Or, if you don't want to rerun, you can record a session in CFD-Post, export the value for one step, stop the recording, take the recorded file, put a loop around it to go through time steps.
If you are going to make multiple runs anyway, go for Gert-Jan's suggestion. It will also give you a way better output as you can export it all into one file.


All times are GMT -4. The time now is 23:10.