|
[Sponsors] |
Loop through timesteps in the command editor of CFD-Post and write evaluated function |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 5, 2014, 13:00 |
Loop through timesteps in the command editor of CFD-Post and write evaluated function
|
#1 |
New Member
Sagar
Join Date: Apr 2014
Posts: 10
Rep Power: 12 |
Hello!
I am trying evaluate the volume averaged water volume fraction for each timestep I have run. I have written these commands in the command editor of CFD-Post. #************************************************* ********************* ! open(OFH, " >> file.dat"); # writing to a file # for loop start ! for ($i=100; $i <= 28000; $i=$i+100) { COMMAND FILE: CFX Post Version = 14.5.7 END > load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\bcp4_3_v4_sr4_omg15-13-00$i.dat ! $vff= volumeAve(Water.Volume Fraction, "Plane 1"); ! printf (OFH "1.8f\n",$vff; !} ! close(OFH); #************************************************* ********* I get the error- ERROR CCL parser failed with message: Perl Syntax errors detected: syntax error at (eval 6235) line 11, at EOF Could somebody tell me whether I am on the right track with the code? If yes, then how can I correct it? Cheers. |
|
April 7, 2014, 07:29 |
|
#2 |
New Member
Sagar
Join Date: Apr 2014
Posts: 10
Rep Power: 12 |
I don't see the difference..
I have changed the code now. I get no errors, but nothing is written to file.txt, no matter what I do. Even the simplest of commands such as !open(FH, '<file.txt'); !printf (FH, "Hello"); !close(FH); does not print to file! Here is my new code- #************************************************* COMMAND FILE: CFX Post Version = 14.5.7 END ! my $file=file.txt; ! open(FH, '>$file'); # writing to a file !$start = 200; !$finish = 400; ! for ($i=$start; $i <= $finish; $i=$i+100) { !if($i<1000){ > load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\Data files\bcp4_3_v4_sr4_omg15-13-00$i.dat !} !elsif($i<10000){ > load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\Data files\bcp4_3_v4_sr4_omg15-13-0$i.dat !} !else{ > load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\Data files\bcp4_3_v4_sr4_omg15-13-$i.dat !} ! $vol_frac_fluid= areaAve("Water.Volume Fraction", "Plane 1"); !printf(FH "1.8f\n",$vol_frac_fluid); !} ! close(FH); #************************************************* ********* |
|
Tags |
cfd - post, command editor, loop, timesteps |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Helyx OS] Helyx-OS (GUI for SnappyHexMesh | elvis | OpenFOAM Community Contributions | 210 | January 30, 2017 19:57 |
Guide: Getting Started with the CFD Online Discussion Forums | pete | Site Help, Feedback & Discussions | 8 | July 29, 2016 06:00 |