Category Archives: scripts

Python Scripts

Fluent in batch mode os.system(r'”C:\Program Files\ANSYS Inc\v195\fluent\ntbin\win64/fluent.exe” 2d -g -t2 -i case4.jou’ ) In these examples, fluent is the command you type to execute ANSYS FLUENT interactively. -g indicates that the program is to be run minimized in the taskbar. -i journal reads the specified journal file. -wait is the command you type in a…

Read More

Ansys-Fluent Solutions

Exporting Particle History /file/export/p-h-d/cfdpost testingP (left-nostril-10mic) particle-diameter particle-velocity-mag () 5 When restarting a transient simulation, the error “Update_Time_Level: invalid data” occurs. Solution: In the journal file use: /solve/iterate 1 /solve/dual-time-iterate 100 20 They say this is some kind of strange error that comes when you use it in command line mode (with -g option) Change…

Read More

Convert a single cine file to sequentially numbered tiffs

Convert a single cine file to sequentially numbered tiffs ================================================================ credit: “https://wiki.brown.edu/confluence/display/ctx/Convert+a+single+cine+file+to+sequentially+numbered+tiffs” ================================================================ In Phantom cine viewer open the cine file, for example “Kia_cam1_run33.cine” Click on “Convert” button, in the lower right hand of the screen. Choose the type of tiff: 8 or 12 or 16 bit tiff (the second number after the comma is…

Read More

Using a batch file to automatically compress files of the same type or folders using 7-zip

Compressing files of the same type =============================== @echo off cd /d %~dp0 rem 7z.exe path set sevenzip= if “%sevenzip%”==”” if exist “%ProgramFiles(x86)%\7-zip\7z.exe” set sevenzip=%ProgramFiles(x86)%\7-zip\7z.exe if “%sevenzip%”==”” if exist “%ProgramFiles%\7-zip\7z.exe” set sevenzip=%ProgramFiles%\7-zip\7z.exe if “%sevenzip%”==”” echo 7-zip not found&pause&exit set extension=.xls for %%a in (*%extension%) do “%sevenzip%” a -mx “%%~na.7z” “%%a” pause Change the extension for the…

Read More

Ansys-Fluent-CFD-Post-Scripts

How-to-remove-partition-line-in-figures Pre-setup commands for saving images How to compile FLUENT 64-bit UDFs using Visual Studio Express 2010 and the 7.1 SDK Extracting data from Fluent Extract numerical values from Fluent xy-plot files using Matlab Looping through cfx .trn files and exporting figures and data Looping through cfx .trn files and exporting figures and data Script…

Read More

Tecplot Tips

Extract Images =========================== import os os.chdir(r’F:\images\planes-bend’) import glob flist=glob.glob(‘*planes.plt’) #flist = flist[0:5] # just for testing on 5 files and not all of them! import tecplot as tp from tecplot.exception import * from tecplot.constant import * # Uncomment the following line to connect to a running instance of Tecplot 360: tp.session.connect() #fname = ‘p0.01_b0.02_planes.plt’ #…

Read More