CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   how to export every data w.r.t time to txt file (http://www.cfd-online.com/Forums/cfx/25213-how-export-every-data-w-r-t-time-txt-file.html)

jaho February 11, 2008 11:40

how to export every data w.r.t time to txt file
 
Hello. I would like to ask you a question regariding export method. Actually, I did transient simulation to see the temperature change w.r.t time at every node. I tried to find the way to export all data at every node to txt or xls file in cfx-post. If I use a chart, then I could just export only data as many as point's no. that I defined (not all points). Also, if I use the export (file -> export)in cfx-post , I am able to get the temperature values at every point but these temperatures are only the values at the last time step (not all time steps). Could you please let me know how to export every datum (temp.) for every point at all time steps (or each time step)? Thank you so much for your concern. Have a great day~!

CycLone February 11, 2008 13:32

Re: how to export every data w.r.t time to txt fil
 
Firstly, why? I ask because there may be a better way to do what you are ultimately trying to do.

You can write a macro to loop through all of the trn files and export the data at each timestep. Start by recording a small session where you load a trn file and export the results. You can then put a PERL loop around this and subsitute PERL variables for the timestep number.

Before you do this or ask more details on how (to which I'll refer you to past discussion on this forum, user documentation and tech tips on the ANSYS customer portal), please answer my first question.

-CycLone

jaho February 11, 2008 13:43

Re: how to export every data w.r.t time to txt fil
 
Dear CycLone,

Thank you for your kind answer. CycLone, actually I am a notice CFX user. Unfortunately, I don't know about macro and PERL variable... Also, I have to hurry up to solve this problem because of meeting with Prof... If you don't mind, could you please explain this in detain or take an simple exampe if possible? Thanks again. Have a good day, CycLone.

-Jaho

CycLone February 11, 2008 17:22

Re: how to export every data w.r.t time to txt fil
 
Answer the first question: Why do you need this data? What do you intend to do with it?

Jaho Seo February 11, 2008 17:36

Re: how to export every data w.r.t time to txt fil
 
Sorry about that. Let me explain about this. Let's say that the total simulation time is 50 sec. By the way, at the end of every 1 sec, I changed input conditions. Thus, what I need is not the final output at the end step time but the output at every second. So, each datum is important. These gathered all data points will be used for fiding optimum condition. If you need the explanation in detail, please let me know. Thank you, CycLone.

- Jaho

Rogerio Fernandes Brito February 11, 2008 20:22

Re: how to export every data w.r.t time to txt fil
 
How did you change, at the end of every 1 sec, your input conditions?

If you are using a few points, u can use "monitor points" on CFX-Pre. You must enter each point (x;y;z) for monitoring (checking) the temperatures!

Can you send me your .cfx file?

I use CFX-v5.6.


jaho February 11, 2008 21:59

Re: how to export every data w.r.t time to txt fil
 
Hi, you can create such data sets using cel interpolation... Thank you.


CycLone February 12, 2008 16:13

Re: how to export every data w.r.t time to txt fil
 
Hi Jaho,

It sound like you forgot to set the transient output up before the run. The results file only contains the solution at the last timestep. If you need intermediate results, you need to set up the transient output in the Output Control panel in CFX-Pre. There is way to recover this information after the fact.

If you are running version 11 and had payed attention to the warnings, you would have seen that this is missing. You might want to run through a transient tutorial before continuing, just in case there is more you are missing.

Sorry to be the bearer of bad news, but you'll have to run your analysis again.

-CycLone

Jaho Seo February 12, 2008 16:31

Re: how to export every data w.r.t time to txt fil
 
Hi, CycLone. Thank you for your kind answer. For my transient simulation, I set up the transient output in the output Control panel in CFX-Pre. So, I have 'trn' files as many as total step time number. In this case, how can I solve my problem? (The only solution is what you said already (i.e., macro))? Thank you again, CycLone.

CycLone February 12, 2008 18:01

Re: how to export every data w.r.t time to txt fil
 
So, back to my original question. What do you want to calculate from the transient results, i.e. what would you do with the text files you want to export?

Jaho Seo February 12, 2008 19:48

Re: how to export every data w.r.t time to txt fil
 
These gathered all data points will be used for designing obtimized neural network strucure of the system. Thank you...

CycLone February 13, 2008 10:39

Re: how to export every data w.r.t time to txt fil
 
So you're planning to train the neural network based on the results at each node? Interesting.


CycLone February 13, 2008 11:00

Re: how to export every data w.r.t time to txt fil
 
Here's a crude session that will do the trick. Copy and paste it into your command window in Post and substitute your starting and finishing iteration numbers as well as your desire filename. Leave the "$i" in the name, as I have done below; Post will substitute the current value of the PERL variable $i into the name when it writes the file. You should first do a manual export to select the variables you want.

!$start = 0;
!$finish = 100;

!for($i=$start,$i<=$finish,$i++) {
> load timestep=$i

EXPORT:
Export File = export_$i.csv
END
>export
!}

-CycLone

Jaho Seo February 13, 2008 20:32

Re: how to export every data w.r.t time to txt fil
 
Thank you so much for your kind answer, CycLone. Have a great day~!

hung February 17, 2010 01:14

CycLone,
can you check the code again?
because when I used that code to export the data
the ERROR
Overwrite not allowed: export_2.dat
how can i solve it?
thanks

Hung

Lance February 17, 2010 11:40

Just out of curiosity, have you read the error message?
" ERROR
Overwrite not allowed: export_2.dat"

You're not allowed to overwrite the file, so just simply manually delete the file and run the PERL script again? I am sure that will work.

hung February 17, 2010 21:23

Hi Lance
I tried many times but it doesn't work.
the error still appear.
Can you check it again.
thanks

Hung

hung February 17, 2010 21:27

For example i leave the state
!$start = 0;
!$finish = 33;
the error will be ExportExecutor::invoke - Overwrite not allowed: export_1.csv
when i chang the start to 1
the error will be export_2.csv
thanks

Hung

Carlitos February 18, 2010 07:22

I have the same problem as you, Hung. I've tried to delete the file in order to overcoming the overwrite but it doesn't work. Does anyone may help us?

Regards

Carlitos

hung February 19, 2010 21:08

Hi,
I tried to do the manual way first.
overwrite the file
and then tried with the code.
the error message did not appear, but the export is only for 1 step.
it doesnot work for the next step
can someone check and give me the right code.
thanks

Hung


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