Yuanyuan Xiao
Ansys Employee

方法1

Journal文件命令如下:

/file/read-case cyl10.cas.gz

/solve/initialize/hyb-initialization

/file/start-transcript resi-demo

/solve/iterate 1000

/file/stop-transcript resi-demo

/file/write-data cyl-10.dat.gz

/exit

这样,计算时在工作路径下就会出现resi-demo的文件,该文件记录了残差,并实时更新。

方法2

采用如下命令:

    /file/read-case cyl10.cas.gz

/file/read-macros scmdemo.scm

/solve/initialize/hyb-initialization

/solve/set/time-step 0.1

/solve/execute-commands add-edit command-1 1 iteration  "/file/read-journal joudemo.jou"

/solve/execute-commands enable command-1

/solve/dual-time-iterate 100 30

/file/write-data cyl10.dat.gz

/exit

1joudemo.jou文件的内容如下:

(do

 

((i 0 (+ i 1)))

 

((= i (length (solver-residuals))))

 

(format port "~a ~2t" (cdr (list-ref (solver-residuals) i)))

 

)

 

(newline port)

 

 

 

2scmdemo.scm文件的内容如下

 

(define port)

 

(set! port (open-output-file "output.dat"))

 

 

 

(do

 

((i 0 (+ i 1)))

 

((= i (length (solver-residuals))))

 

(format port "~a ~2t" (car (list-ref (solver-residuals) i)))

 

)

 

(newline port)