Animation of steady state particle tracks (scheme-routine)


Here is a feature to create hardcopies of steady state particle tracks with increasing the path length (maximum number of steps) step by step. The result is a series of images which show a similar 'growth' of particle tracks as is seen when particle tracks are displayed through the GUI or like pathline animations.

The tracking is not time accurate (like pathline animations), but can enhance the visibility of 3-dimensional flow features.

Feel free to give this code to customers.

Feedback will be welcome: cxb@fluent.de
Christian Budde

;;; (c) Fluent Deutschland GmbH
;;; Author: Christian Budde, cxb@fluent.de
;;;
;;; Create hardcopies of animated particle tracks
;;; in stationary particle tracking
;;;
;;;
;;; Useage: (p-anim MAXIMUM_STEPS)
;;; This will create several images with increasing path length
;;;
;;; Five variables control the behaviour:

; This is the TUI command to change the maximum number of steps.
; The '~a' will be replaced by variable 'schritt' (see below).
(define p-anim/step-str "/def/mod/dpm/num/tp ~a ,,")

; This is the TUI command to create the plot. The example uses a
; macro, which only pushes the 'Display' button in the particle tracks
; window. Change this according to your needs.
(define p-anim/display-str "push-pt-display-button")

(cx-macro-define
'((push-pt-display-button
. "(cx-gui-do cx-activate-item "Particle Tracks*PanelButtons*PushButton1(OK)")n")))

; This is the TUI command to create a hardcopy.
; The '~a' will be replaced by variable 'schritt' (see below).
; The example presumes that the hardcopy format has been set to 'tif' already.
; Change this according to your needs.
(define p-anim/hc-str "/dis/hc "p-anim-~a.tif"")

; This is a switch to turn hardcopies on or off
(define p-anim/hc? #f)

; This is the increment of the number of steps (at which display is
; updated or hardcopies are written). In Fluent6.2 it could be useful
; to disable accuracy control for a smooth growth of path length
(define p-anim/step-incr 10)

;;; instead of '(set! VARIABLE VALUE)', you can use following aliases
;;; for interactive (TUI-like) modification of variables.
;;; Type the alias _without_ parentheses:
;;; 'ALIAS VALUE' sets the variable
;;; 'ALIAS' prints the current value and prompts for a new one
(alias 'p-anim-set-display-str
(lambda ()
(set!
p-anim/display-str
(read-string
"p-anim/display-str"
p-anim/display-str))))

(alias 'p-anim-set-step-str
(lambda ()
(set!
p-anim/step-str
(read-string
"p-anim/step-str"
p-anim/step-str))))

(alias 'p-anim-set-hc-str
(lambda ()
(set!
p-anim/hc-str
(read-string
"p-anim/hc-str"
p-anim/hc-str))))

(alias 'p-anim-set-step-incr
(lambda ()
(set!
p-anim/step-incr
(read-integer
"p-anim/step-incr"
p-anim/step-incr))))

(alias 'p-anim-set-hc
(lambda ()
(set!
p-anim/hc?
(yes-or-no?
"p-anim/hc?"
p-anim/hc?))))



(define p-anim
(lambda (schritte)
(letrec
((schritt 1)
(p-anim-int
(lambda (schritt)
(cond
((> schritt schritte) #t)
(else
(ti-menu-load-string (format #f p-anim/step-str schritt))
(ti-menu-load-string p-anim/display-str)
(if
p-anim/hc?
(ti-menu-load-string (format #f p-anim/hc-str schritt))
)
(p-anim-int (+ schritt p-anim/step-incr)))))))
(p-anim-int schritt))))





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