CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > CFX

Modifying CFD-Post macro to output a time-varying expression at every timestep

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 28, 2015, 16:19
Lightbulb Modifying CFD-Post macro to output a time-varying expression at every timestep
  #1
New Member
 
Join Date: Dec 2015
Posts: 1
Rep Power: 0
lynnathere is on a distinguished road
I am running a TBR case whose solution file contains multiple timesteps, similar to a conventional true transient simulation.

I want to output an expression that varies with time at every timestep. What I've attempted so far:
1) record a session where I load timestep=0, create a table ("Table 1"), in field A1 enter the current time ("Time"), in B1 enter the time-varying expression ("modalF" in the following text), save the table to a .csv file;
2) stop recording and modify the .cse file into a macro and impose a for loop on the timestep;
3) load the macro (pasted in the end of the thread).

This doesn't really work. The .csv file I got after running the macro has only one row with "Time" and "modalF" at the timstep=1 recorded at the first and second column.

I'm guessing my syntax on the table fields ("A$i" and "B$i") might be wrong, but I don't know what the correct syntax is or how to fix it.

Can somebody more experienced in CFD-Post macros please help? Thank you!!

-----------------------------------
# Session file started: 2015/12/28 14:23:18
# CFX-17.0 build 2015.09.01-23.36-134860

# To avoid unnecessary file pre-processing and modifications, include
# COMMAND FILE at the top of your session file.
# If it is not included, the file is assumed to be older and will be
# modified for backward compatibility.
COMMAND FILE:
CFX Post Version = 17.0
END

DATA READER:
CASE: Case trnExactTT_s1r2_02_timestep60_noHarFor_005
Current Timestep = 0
TBR OPTIONS:
Timestep Sampling = Uniform
Number of Timesteps = 240
END
END
END

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

TABLE:Table 1
TABLE CELLS:
A$i = "=Time", False, False, False, Left, True, 0, Font Name, 1|1, %13.7e,\
True, ffffff, 000000, True
END
END

TABLE:Table 1
TABLE CELLS:
B$i = "=modalF", False, False, False, Left, True, 0, Font Name, 1|1, \
%13.7e, True, ffffff, 000000, True
END
END

TABLE:Table 1
Export Table Only = True
Table Export HTML Title =
Table Export HTML Caption Position = Bottom
Table Export HTML Caption =
Table Export HTML Border Width = 1
Table Export HTML Cell Padding = 5
Table Export HTML Cell Spacing = 1
Table Export Lines = All
Table Export Trailing Separators = True
Table Export Separator = Tab
END

>table save=N:/tmp_cfx_projects/test.csv, \
name=Table 1

!}

# Session file stopped: 2015/12/28 14:24:10
lynnathere is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
outputTime in Swak function immortality OpenFOAM Post-Processing 16 February 14, 2016 17:02
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07
Where do we go from here? CFD in 2001 John C. Chien Main CFD Forum 36 January 24, 2001 22:10


All times are GMT -4. The time now is 13:25.