How to use CA for IC auto save


Currently, Fluent autosave will append time step. For IC simulation, it would be nice to have CA appended instead of time step.
A scheme file is created to help with that. Explanation on how to use it is on top of the scheme file.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; set_CA.scm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Scheme file for use with Fluent6.1
;;
;; Developed By:
;; Xiao Hu
;; Technical Support Engineer
;; Fluent Inc, 220 E Huron St, Ann Arbor MI 48197
;; xh@fluent.com
;;
;; February 24th, 2003
;;
;; If there are any questions about the use of this scheme
;; file please contact your support engineer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; BASIC NOTES:
;;; The purpose of this scheme file is to append the
;;; Crank Angle (CA) to the case/data file. When autosave data is
;;; is turned on and the datafile name is specified as
;;; filename-%t.dat Fluent will append the timestep number to
;;; the data filename. This scheme will instead append the
;;; actual CA to the filename.

;;; USAGE:
;;; 1) Open case file
;;; 2) File->ReadScheme set_CA.scm
;;; 3) File->Write->Autosave
;;; Enter the root name of the data file here.
;;; E.g. if you want the data file names to be
;;; filename-0.001.dat, filename-0.002.dat then enter
;;; filename in the autosave panel
;;; 4) Make sure that the autosave frequency is set to 0
;;; 5) Solve->ExecuteCommands
;;; Select one command. Enter the number of timesteps
;;; after which you want the data files to be saved
;;; under "frequency" and select TimeStep under "every"
;;; Type the following in the command field including parantheses:
;;; (set_CA_as_filename)
;;; 6) By default, the saved datafile will not be compressed.
;;; If you would like the saved datafile to be compressed,
;;; modify this schemefile as per the comments about 20
;;; lines below here

;;; Datafile name saved will have the following format
;;; filename_CA_CAangle.dat or
;;; filename_CA_CAangle.dat.gz


(define rootname "initial")
(set! rootname (rpgetvar 'autosave/filename))

(define (set_CA_as_filename)
(define tim 0)
(set! tim (rpgetvar 'flow-time))

(define ca)
(set! ca (* 6 (rpgetvar 'dynamesh/in-cyn/crank-rpm)))
(set! ca (* ca (rpgetvar 'flow-time)))
(set! ca (+ ca (rpgetvar 'dynamesh/in-cyn/crank-start-angle)))

(define castring (number->string ca))

(define string2 "_CA_")
(define string3 ".gz")

(define datafilename "temporary")

;; If you want the data file to be compressed, comment out the following line
;; and uncomment the line after that, and vice versa
;; (set! datafilename (string-append rootname string2 castring))
(set! datafilename (string-append rootname string2 castring string3))

(define TextCommand (string-append "/file/write-case-data " datafilename ))
(ti-menu-load-string TextCommand)
)





Show Form
No comments yet. Be the first to add a comment!