Use TUI commands to Patch variables for FLUENT 6.1


Several CRs (1451, 2353, 5676, C8446) listed the interest of users in being able to use only TUI commands to Patch variables on a list of zones.
The need is for being able to run batch jobs controlled exclusively through text-comand based journal files.
A different Scheme function was provided in Solution 366 for Fluent 6.0.20 or earlier versions of Fluent 6 and 5.
This Solution applies for Fluent 6.1.18 or later.
The Scheme file (text-multi-patch-f61.scm) listed below provide the user with the possibility of Patching a variable
on cell zones and / or adaption registers given through their names.

PLEASE NOTE THAT THESE TWO SCHEME FUNCTIONS CAN BE USED ONLY WITH FLUENT
VERSION 6.1.18 OR LATER.

;;;;
;;;; This Scheme Tool allows Patching values for
;;;; various variables on list of zones and / or
;;;; adaption registers specified through their symbol-names
;;;; in a journal file / TUI usage only
;;;;
;;;; Use this Scheme function only for FLUENT 6.1.18 or later
;;;; For earlier versions, a different Scheme function is available
;;;;
;;;; Usage is described below
;;;;
;;;; 1) File>Read>Scheme .. this file (text-multi-patch-f61.scm)
;;;; or
;;;; (load "text-multi-patch-f61.scm")
;;;;
;;;; 2) Then, the patch tool can be accessed in a journal
;;;; or in another Scheme tool through the command:
;;;;
;;;; (patch (arg-patch-dom domain-name variable-name
;;;; desired-value list-of-zone-names list-of-register-names))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Examples of valid constructions for list-of-zone-names:
;;;;
;;;; (list 'fluid-1 'fluid-2 'solid-3)
;;;;
;;;; or
;;;;
;;;; '() if no fluid zones are used
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Examples of valid register name lists
;;;;
;;;; (list 'isovalue-r0 'gradient-r1)
;;;;
;;;; or
;;;;
;;;; '() if no registers are used
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; domain-name can be one of the following
;;;;
;;;; a) 'mixture
;;;;
;;;; which is
;;;;
;;;; the symbol for the default domain in a single phase problem
;;;; the symbol for the mixture domain in a multiphase problem
;;;;
;;;; b) the symbol name of one of the secondary phases in a multiphase
;;;; problem, for example
;;;; 'liquid
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Examples of using general patch tool:
;;;;
;;;; (patch (arg-patch-dom 'liquid 'mp 0.8 (list 'fluid-1)
;;;; (list 'isovalue-r0)))
;;;;
;;;; with this command, the user is patching a 0.8 value for
;;;; the volume fraction of the phase named "liquid" in the
;;;; adaption register named "isovalue-r0" and in the
;;;; cell zone named "fluid-1"
;;;;
;;;; or
;;;;
;;;; (patch (arg-patch-dom 'mixture 'xvelocity 5 (list 'fluid-1) '()))
;;;;
;;;; with this command, the user is patching a value of 5 m/s
;;;; for the x-velocity in the cell zone named "fluid-1" and
;;;; on no adaption register, in a single phase problem, or
;;;; in a multiphase problem for the mixture domain
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; For Species names with Species Transport Model, use
;;;; 'species-0, 'species-1, 'species-2, etc.
;;;; where the order is taken from the definition of the species mixture
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; For Volume Fraction with Multiphase Model, use
;;;; 'mp
;;;;
;;;; Do not change below this line without calling for support
;;=============================================================
(define thr-list
(lambda (name-list)
(if (pair? name-list)
(map thread-name->id name-list)
'())))
(define regi-list
(lambda (name-list)
(if (pair? name-list)
(map register-rbit (map get-register name-list))
'())))
(define cb-p
(lambda (varn did)
(let ((pa-var-list))
(set! pa-var-list (%inquire-patch-variable-names did))
(assq varn pa-var-list))))
(define n-index
(lambda (did varn index) (list-ref (cb-p varn did) index)))
(define arg-patch-dom
(lambda (dname varn xt t-name-list r-name-list)
(let ((did))
(set! did (domain-name->id dname))
(list (n-index did varn 2)
(n-index did varn 3) did
(thr-list t-name-list) (regi-list r-name-list) xt))))





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