General

General

Scheme Function for Creating File Name Based on Flow Time

    • FAQFAQ
      Participant

      The scheme function provided below creates a file named ‘flow-time-xyz’. Here ‘xyz’ is the value of flow time. For example, if the flow time is 0.0037 seconds then the file name would be ‘flow-time-0.0037’. Current scheme only saves the value of flow time in the file ‘flow-time-xyz’ as an example but this can be changed as needed. ; This scheme function will create a file “flow-time-xyz” ; “xyz” is the current value of flow time in seconds ; Currently this function just appends the current flow time value in this file as an example ; It can be modified according to the use case ; To call this function write (fn1) in Solve-> Execute Commands panel ; We can change filename by changing the value of variable ‘name’. (define (fn1) ; Change file name as needed (define name “flow-time-“) (define fullname (string-append name (number->string (rpgetvar ‘flow-time)))) (append-file fullname ‘(lambda(port)(format port “~an” (rpgetvar ‘flow-time)))))