%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
%%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a
把上述字符加到批处理前面,再加一个清屏命令就行了
@cls
@echo off
@hm.exe thermal.hm > nul
REM @关闭命令回显
REM > nul 关闭程序执行输出
taskkill /f /im Ansys.exe
rm -f *.lock
3.1. Starting an ANSYS Session from the Command
Level
To start an interactive ANSYS session in graphics mode on UNIX
systems, type the following command at the prompt:
ansys100 -g
To start ANSYS from the MS-DOS command prompt on a Windows
system, type the following command:
ansys100
Always use the ANSYS-supplied scripts (ansys100 and
launcher100) for running ANSYS. User-written scripts for
running ANSYS products are not supported.
You can specify any of the following options for the ANSYS
execution command:
| -ansexe |
In the ANSYS Workbench environment, activates a custom ANSYS
executable. |
| -b list or nolist |
Acti |
/nolist在batch模式下不输出命令回显
/golist恢复在batch模式下输出命令回显
在iSight中集成CFX分三步:pre solve post,具体代码示例如下:
(1) Pre(下列代码作适当修改,保存为*.bat,在iSight中调用即可,2-Solver、3-Post亦同):
if exist *.def del *.def
if exist *.res del *.res
if exist *.out del *.out
if exist *.lock del *.lock
'D:\Ansys Inc\CFX\CFX-10.0\bin\cfx5pre.exe' -batch
missile.pre
'D:\Ansys Inc\CFX\CFX-10.0\bin\cfx5pre.exe' -cfx missile.cfx -gtm
missile.gtm
(2) Solver:
'D:\Ansys Inc\CFX\CFX-10.0\bin\cfx5solve.exe' -definition
missile.def
(3) Post:
'D:\Ansys Inc\CFX\CFX-10.0\bin\cfx5export.exe' -ansysfsi -name
missile_ansysfsi -eltype 154 -regions 'Domain 1 Default'
Missile_001.res
'D:\Ansys Inc\CFX\CFX-10.0\bin\cfx5post.exe' -session
missile.cse
参考:http://forum.simwe.com/viewthread.php?tid=865583
感谢 jacicka1984
!start_line=插入开始位置
!end_line=插入结束位置
!Filename1='文本名'
*dim,Astr3,String,
*dim,Astr4,String,
*Sread,Astr3,'%Filename1%',inp,,128,0,start_line-1
*Sread,Astr4,'%Filename1%',inp,,128,end_line,
*CFOPEN,'%Filename1%',inp,,
*VWRITE,AStr3(1,1)
%C
*vwrite,zr_out(1,1),zr_out(1,2)
!插入内容
(3x,f11.8,4x,f11.8)
*VWRITE,AStr4(1,1)
%C
*cfclos
! This code just for study, It doesn't work without
certain input files.
finish
/clear,nostart
/INPUT,'Analysis','inp','','',0
!----------------normalized curve
start--------------------------------
fix_p2z=1 ! 1: fix p2z=p3z, 0: free
p2z
f_line=end_line-start_line+1
*dim,tbzr,table,f_line,1
*dim,zrt,array,f_line,3
*tread,tbzr(1,0),'%Filename1%',inp,,start_line-1
*voper,zrt(1,1),1,mult,tbzr(1,0)
*voper,zrt(1,2),1,mult,tbzr(1,1)
cpts=4
*dim,cpzr,array,cpts,2
!calculate the sum distance
dist=0
*do,i,1,f_line
j=i+1
dist_z=zrt(j,1)-zrt(i,1)
dist_r=zrt(j,2)-zrt(i,2)
dist=SQRT(dist_z**2+dist_r**2)
sum=sum+dist
*if,j,eq,f_line,exit
*enddo
!calculate the normalized distance ratio
dist=0
ANSYS中小数点位数的确定
在ANSYS 中关于小数点位数的命令有几个,常用的两个:/GFORMAT, Ftype, NWIDTH,
DSIGNF和/FORMAT, NDIGIT, Ftype, NWIDTH, DSIGNF, LINE, CHAR命令。
/GFORMAT, Ftype, NWIDTH, DSIGNF这个命令是相对图形上的小数点而言;
而在POST1中的这些 PRNSOL, PRESOL, PRETAB, PRRSOL, and PRPATH
命令中的有效数字,在GUI上没有直接路径,可以用/FORMAT, NDIGIT, Ftype, NWIDTH, DSIGNF,
LINE, CHAR命令完成自己想要的位数。
如:
/format,,f,18,1则表示选F格式下宽度为18的有效位数,小数点后保留1位
/format,,f,18,3则表示选F格式下宽度为18的有效位数,小数点后保留3位
/format,,g,18,10则表示选G格式下宽度为18的有效位数,共为10位数(包括整数及小数部分)
该命令只对POST1中的这些 PRNSOL, PRESOL, PRETAB, PRRSOL, and PRPATH
列表数据有效。
注意一下:
当/format,,f,18,1中要求保留的位数不大于整数位时,保留1个有效数字,换为其他位时是一样的;而当/format,,f,18,10中的10的位数远大于整数时,表示整个数(包括小数点前面的整数部分及小数部分)之和为10位,其他同理。
@date /T|find '2012'
@IF %ERRORLEVEL% == 0 echo '条件符合!执行任务'