如何实现自动export每个timestep的结果( ANSYS CFD-POST, pulsatile flow)
2018-03-16 02:47阅读:
用CFX做出求解文件后,有时得出的.trn文件名是不连续的,还有一种情况是连续但没有逻辑。
例如设定了300 time steps,
为3个周期,后处理时只需要最后一个周期的results.
1)第一种情况是得到了320.trn
到478.trn,中间不连续(自己的case,不赘述)
2)第二种情况是得到了244.trn到
342.trn,共99个文件,最后一个343.trn没有单独的trn文件,但在CFD-POST界面里会出现。虽然这种情况是连续的,但是其实的244.trn按照timestep的规律应该是201.trn.
所以,这就为自动输出每一个timestep的结果带来了困难,因为不能保证每次求解完初始timestep生成trn文件的名称。
# Load a transient file and read the time step list
> load filename=myFile.res
!$timestepList = getValue('DATA READER', 'Timestep List');
!@timesteps = split(/, /, $timestepList );
! foreach $ts ( @timesteps ) {
> load timestep=$ts
…operations you want
!}
在使用session功能生成.cse
file之后,可以将以上代码整合进去,实现每一个timestep结果文件的自动输出。Hope
it helps.
My case example:
# Session file started: 2018/03/15 16:49:59
# CFX-15.0.7 build 2014.04.26-07.00-131803
# 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 = 15.0
END
DATA READER:
Clear All Objects = false
Append Results = false
Edit Case Names = false
Open to Compare = false
Multi Configuration File Load Option = Last
Case
Open in New View = true
Keep Camera Position = true
Load Particle Tracks = true
Files to Compare =
END
DATA READER:
Domains to Load=
END
> load
filename=C:\myresearch\A_Useful_data_base\fluid\pulsatile2\\
pulsatile_001.res, force_reload=true
!$timestepList = getValue('DATA READER', 'Timestep
List');
!@timesteps = split(/, /, $timestepList );
!foreach $ts (@timesteps){
> load timestep=$ts
EXPORT:
ANSYS Export Data = Element Heat Flux
ANSYS File Format = ANSYS
ANSYS Reference Temperature = 0.0 [K]
ANSYS Specify Reference Temperature = Off
ANSYS Supplemental HTC = 0.0 [W m^-2 K^-1]
Additional Variable List =
BC Profile Type = Inlet Velocity
Export Connectivity = Off
Export Coord Frame = Global
Export File =
C:\myresearch\A_Useful_data_base\fluid\pulsatile2\step$ts.csv
Export Geometry = On
Export Location Aliases =
Export Node Numbers = Off
Export Null Data = On
Export Type = Generic
Export Units System = Current
Export Variable Type = Current
External Export Data = None
Include File Information = Off
Include Header = On
Location = INLET1
Location List = WALL_VESSEL
Null Token = null
Overwrite = On
Precision = 8
Separator = ' '
Spatial Variables = X,Y,Z
Variable List = Wall Shear, Wall Shear X, Wall Shear Y,
Wall Shear Z
Vector Brackets = ()
Vector Display = Scalar
END
>export
!}
# Session file stopped: 2018/03/15 16:51:04