;; (C)  2023 
;;  Stefan Pirker
;;  Particulate Flow Modelling
;;  Johannes Kepler University, Linz, Austria
;;  www.particulate-flow.at 


(define rCFD_src_dir  "../../src")

(define rCFD_user_src_dir  "./user_src")

(define rCFD_data_scratch_dir  "/scratch/k3b02/k3b1570/rCFD_data/tutorials/fluidized_bed_segregation")

(define rCFD_data_case_dir "I110_114")

(define rCFD_data_case "BD")

(define rCFD_ref_case "BD")

(define rCFD_post_case "BD_NewCode")

(define post_on 1)
 
(define ANSYS_Fluent_case_dir "./ansys_fluent")

(define ANSYS_Fluent_case_file  "quad_80k")

(define number_of_rCFD_episodes 496)    ;; 496, i.e. number of frames for replay case

(define i_run 0)

(define img-1 "vof_3x_") 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R1)       ;; load source files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (ti-menu-load-string (format  #f "!cp ~a/~a.cas.h5 ." ANSYS_Fluent_case_dir ANSYS_Fluent_case_file))    
    (ti-menu-load-string (format  #f "!cp ~a/~a.dat.h5 ." ANSYS_Fluent_case_dir ANSYS_Fluent_case_file))

    (ti-menu-load-string (format  #f "!cp ~a/*.c ." rCFD_src_dir))
    (ti-menu-load-string (format  #f "!cp ~a/*.h ." rCFD_src_dir))
    
    (ti-menu-load-string (format  #f "!cp ~a/*.h ." rCFD_user_src_dir))
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R2)       ;; load data from scratch
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    ;; ref data
    (ti-menu-load-string "!rm ./data/ip/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/ip/ref* ./data/ip" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_ref_case))  
)

;; fluent_has_compiled lets the compile-scheme know if any udf has already been compiled
;; to enable recompilation
(if (not (symbol-bound? 'fluent_has_compiled (the-environment)))
    (begin
        (define fluent_has_compiled #f)
        (define fluent_has_compiled_headers #f)
    )
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_r3)       ;; compile everything into libudf_rcfd_prep
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (ti-menu-load-string "!rm -r libudf_rcfd_run")

    ;; load compile scheme
    (load (format  #f "~a/rCFD_C2C_run_compile.scm" rCFD_src_dir) )

    (ti-menu-load-string "!rm  ./*.c")
    (ti-menu-load-string "!rm  ./*.h")
)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R4)       ;; load start file, allocate UDMI's and init rCFD
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (ti-menu-load-string (format #f "/file/read-case-data ./~a.cas.h5 OK" ANSYS_Fluent_case_file))
    
    (ti-menu-load-string "/define/user-defined/user-defined-memory 30 q" )
	
	(ti-menu-load-string "/define/user-defined/user-defined-node-memory 2 q" )
    
    (ti-menu-load-string "/define/user-defined/compiled-functions load \"libudf_rcfd_run\"")

    (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_init_all::libudf_rcfd_run\"")
)   

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R5)       ;; read rCFD database
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_read_DB::libudf_rcfd_run\"")
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R6)       ;; run simulation w/o post-processing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        ;; load ref. data
        (ti-menu-load-string (format #f "!cp ./data/ip/ref_~04d.ip ./data.ip" (* i_run 2)))
        (ti-menu-load-string "/file/interpolate/read-data yes data.ip")
        
        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R6_post)  ;; run simulation with post-processing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;; graphics setting
    (ti-menu-load-string "/display/open-window 1")
    (ti-menu-load-string "/display/set-window 1")

    (ti-menu-load-string "/display/set/picture/driver tiff")
    (ti-menu-load-string "/display/set/picture/color-mode color")
    (ti-menu-load-string "/display/set/picture/invert-background? no")
    (ti-menu-load-string "/display/set/picture/invert-background? no")
    (ti-menu-load-string "/display/set/picture/use-window-resolution? no")
    (ti-menu-load-string "/display/set/picture/x-resolution 1200")
    (ti-menu-load-string "/display/set/picture/y-resolution 640")

    ;; generate contour plots for vof
    (ti-menu-load-string "/display/objects/create
        contour
        vof
        field mixture
            udm-3
        color-map
            visible no
            log-scale? no
            q
        boundary-values? no
        node-values? no
        range-option
            auto-range-off
            minimum 0.0
            maximum 0.67
            clip-to-range? no
            q
        surfaces-list
            9 ()
        q "
    )
    ;; generate contour plots for vof_small
    (ti-menu-load-string "/display/objects/create
        contour
        vof_small
        field mixture
            udm-0
        color-map
            visible yes
            q
        boundary-values? no
        node-values? yes
        range-option
            auto-range-off
            minimum 0.15
            maximum 0.35
            clip-to-range? no
            q
        surfaces-list
            9 ()
        q "
    )
    ;; generate contour plots for vof_large
    (ti-menu-load-string "/display/objects/create
        contour
        vof_large
        field mixture
            udm-1
        color-map
            visible no
            q
        boundary-values? no
        node-values? yes
        range-option
            auto-range-off
            minimum 0.15
            maximum 0.35
            clip-to-range? no
            q
        surfaces-list
            9 ()
        q "
    )	

    (do  ((i  0 (+ i  1)))
        ((= i  number_of_rCFD_episodes))

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")


        ;; contour vof
        (ti-menu-load-string "/display/set/overlays no")
		(ti-menu-load-string "/display/objects/display vof")
        (ti-menu-load-string "/display/views/restore-view view_3x")
        (ti-menu-load-string "/display/set/lights/lights-on no")
        (ti-menu-load-string "/display/update-scene/select-geometry yes vof-9 no no")
        (ti-menu-load-string "/display/update-scene/display yes no yes yes no no no no no 0 0 0 0")
        (ti-menu-load-string "/display/update-scene/transform no yes 0 0 0 yes 0 0 0 0 0 0 no")
        (ti-menu-load-string "/display/update-scene/select-geometry no yes vof-9")
		
        ;; contour vof_small
        (ti-menu-load-string "/display/set/overlays yes")
		(ti-menu-load-string "/display/objects/display vof_small")
        (ti-menu-load-string "/display/views/restore-view view_3x")
        (ti-menu-load-string "/display/set/overlays yes")
        (ti-menu-load-string "/display/set/lights/lights-on no")
        (ti-menu-load-string "/display/update-scene/select-geometry yes vof_small-9 no no")
        (ti-menu-load-string "/display/update-scene/display yes no yes yes no no no no no 0 0 0 0")
        (ti-menu-load-string "/display/update-scene/transform no yes 0.25 0 0 yes 0 0 0 0 0 0 no")
        (ti-menu-load-string "/display/update-scene/select-geometry no yes vof_small-9")
		
        ;; contour vof_small
        (ti-menu-load-string "/display/set/overlays yes")
		(ti-menu-load-string "/display/objects/display vof_large")
        (ti-menu-load-string "/display/views/restore-view view_3x")
        (ti-menu-load-string "/display/set/overlays yes")
        (ti-menu-load-string "/display/set/lights/lights-on no")
        (ti-menu-load-string "/display/update-scene/select-geometry yes vof_large-9 no no")
        (ti-menu-load-string "/display/update-scene/display yes no yes yes no no no no no 0 0 0 0")
        (ti-menu-load-string "/display/update-scene/transform no yes 0.475 0 0 yes 0 0 0 0 0 0 no")
        (ti-menu-load-string "/display/update-scene/select-geometry no yes vof_large-9")
		
        (ti-menu-load-string "!rm temp1.tif")
        (ti-menu-load-string "display/hardcopy temp1.tif")
        (ti-menu-load-string (format #f "! convert temp1.tif ~a~04d.jpg &" img-1 i))
    )

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R7)       ;; write fluent file
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (ti-menu-load-string (format #f "/file/write-case-data ./~a_After_Run.cas.h5 OK" ANSYS_Fluent_case_file))   
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R8)       ;; free all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_free_all::libudf_rcfd_run\"")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_R9)       ;; clean-up folder
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;; data case post
    (ti-menu-load-string (format  #f "!mkdir ./post/~a~a" rCFD_data_case_dir rCFD_post_case))
    
    (ti-menu-load-string (format  #f "!mv ./rCFD_run.trn ./post/~a~a" rCFD_data_case_dir rCFD_post_case))

    (ti-menu-load-string (format  #f "!mv ./~a_After_Run* ./post/~a~a" ANSYS_Fluent_case_file rCFD_data_case_dir rCFD_post_case))
    
    (ti-menu-load-string (format  #f "!mv ./*.out ./post/~a~a" rCFD_data_case_dir rCFD_post_case))
    
    (ti-menu-load-string (format  #f "!mv ./*.jpg ./post/~a~a" rCFD_data_case_dir rCFD_post_case))
    
    (ti-menu-load-string (format  #f "!mv ./post/balance_monitor.out ./post/~a~a" rCFD_data_case_dir rCFD_post_case))
    
    (ti-menu-load-string "!rm  ./*.c")
    (ti-menu-load-string "!rm  ./*.h")
    (ti-menu-load-string "!rm  ./fluent*")
    (ti-menu-load-string "!rm  ./*.log")
    (ti-menu-load-string "!rm  ./*.h5")
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_replay_all_with_ref)       ;; run single replay case
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; runs four cases with ref. data

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I110 PD2

	
	
	(set! rCFD_data_case_dir "I110_114")
	
    (set! rCFD_data_case "PD2_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD")
    
    (rCFD_R1)
    (rCFD_R2)

    (ti-menu-load-string "!mv rCFD_user_replay_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7) 
    (rCFD_R8)
    (rCFD_R9)   

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I110 PD4

	(set! rCFD_data_case_dir "I110_114")
	
    (set! rCFD_data_case "PD4_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD4_asBD")

    (set! rCFD_post_case "CAL_PD4_asBD")
    
    (rCFD_R1)
    (rCFD_R2)

    (ti-menu-load-string "!mv rCFD_user_replay_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I120 PD2
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD2_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD")
    
    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_replay_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I120 PD4
	
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD4_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD4_asBD")

    (set! rCFD_post_case "CAL_PD4_asBD")
    
    (rCFD_R1)
    (rCFD_R2)

    (ti-menu-load-string "!mv rCFD_user_replay_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_replay_all)       ;; run single replay case
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; runs four cases w/o ref. data

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I110 PD2

	(set! rCFD_data_case_dir "I110_114")
	
    (set! rCFD_data_case "PD2_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_replay_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I110 PD4

	(set! rCFD_data_case_dir "I110_114")
	
    (set! rCFD_data_case "PD4_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD4_asBD")

    (set! rCFD_post_case "CAL_PD4_asBD")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_replay_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I120 PD2
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD2_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    ;;(set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_replay_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I120 PD4
	
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD4_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD4_asBD")

    (set! rCFD_post_case "CAL_PD4_asBD")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_replay_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   
	

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_all)       ;; run single replay case
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; runs four cases w/o ref. data

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I110 PD2

	(set! rCFD_data_case_dir "I110_114")
	
    (set! rCFD_data_case "PD2_asBD_J")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD_J")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I110 PD4

	(set! rCFD_data_case_dir "I110_114")
	
    (set! rCFD_data_case "PD4_asBD_J")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD4_asBD")

    (set! rCFD_post_case "CAL_PD4_asBD_J")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I120 PD2
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD2_asBD_J")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD_J")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I120 PD4
	
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD4_asBD_J")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD4_asBD")

    (set! rCFD_post_case "CAL_PD4_asBD_J")
    
    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_replay)       ;; run single replay case
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! ANSYS_Fluent_case_file  "quad_80k")
	
	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "PD2_asBD")  ;; take data from bi-disperse simulation (full dataset, 496 frames)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "CAL_PD2_asBD")

    (set! post_on 1)
    
    (rCFD_R1)
	
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_replay_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
	
    (if (= post_on 1) (rCFD_R6_post) (rCFD_R6))
	
    ;;(rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump)         ;; run single jump case
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD_J")      ;; take data from bi-disperse simulation (cropped dataset, 150 frames, MS or BD_J)

    (set! rCFD_ref_case "PD2_asBD")

    (set! rCFD_post_case "PD2_asBD_J_Test4Asif")      ;; MS or BD_J

    (rCFD_R1)
    ;;(rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_replay_psd_all)    ;; run single jump case for poly-disperse (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD")

    (set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "PD2")
	
	(define number_of_rCFD_episodes 496)    ;; 496, i.e. number of frames for replay case

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)

	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly.out rCFD_monitor_poly_ref.out")
	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly_d32.out rCFD_monitor_poly_d32_ref.out")
	
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD2_asBD")

    (set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "PD2")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   

	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly.out rCFD_monitor_poly_ref.out")
	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly_d32.out rCFD_monitor_poly_d32_ref.out")
	
    (rCFD_R9)

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD4_asBD")

    (set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "PD4")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   

	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly.out rCFD_monitor_poly_ref.out")
	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly_d32.out rCFD_monitor_poly_d32_ref.out")
	
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD4_asBD")

    (set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "PD4")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   

	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly.out rCFD_monitor_poly_ref.out")
	(ti-menu-load-string "!cp rCFD_monitor_sqr_poly_d32.out rCFD_monitor_poly_d32_ref.out")
	
    (rCFD_R9)
	

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd_all)    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD_J")

    (set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2_J")
	
	(define number_of_rCFD_episodes 496)

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD2_asBD_J")

    (set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2_J")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD4_asBD_J")

    (set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4_J")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD4_asBD_J")

    (set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4_J")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
	
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd_all_wo_ref)    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD_J")

    ;;(set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2_J")
	
	(define number_of_rCFD_episodes 496)

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD2_asBD_J")

    ;;(set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2_J")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD4_asBD_J")

    ;;(set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4_J")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD4_asBD_J")

    ;;(set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4_J")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
  ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )

    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
	

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd_all_long)    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD_J")

    ;;(set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2_J_L")
	
	(define number_of_rCFD_episodes 6000)

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD2_asBD_J")

    ;;(set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2_J_L")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD4_asBD_J")

    ;;(set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4_J_L")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD4_asBD_J")

    ;;(set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4_J_L")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
  ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )

    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
	

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_all_long)    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD_J")

    ;;(set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2asBD_J_L")
	
	(define number_of_rCFD_episodes 6000)

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD2_asBD_J")

    ;;(set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "CAL_PD2asBD_J_L")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD2_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD4_asBD_J")

    ;;(set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4asBD_J_L")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
	
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "PD4_asBD_J")

    ;;(set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "CAL_PD4asBD_J_L")

    (rCFD_R1)
    ;;(rCFD_R2)

    ;; rCFD database
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    (ti-menu-load-string "!mv rCFD_user_jump_run_PD4_asBD.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
  ;;(rCFD_R6)
	
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )

    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
	

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd2)    ;; run single jump case for poly-disperse (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I120_114")

    (set! rCFD_data_case "BD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_ref_case "PD2")

    (set! rCFD_post_case "tmp")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd4)    ;; run single jump case for poly-disperse (wide part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "BD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_ref_case "PD4")

    (set! rCFD_post_case "tmp")

    (rCFD_R1)
    (rCFD_R2)
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    (rCFD_R6)
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)   

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd2_long)    ;; run single jump case for poly-disperse (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "BD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_post_case "PD2_L_NewCode")

    (set! number_of_rCFD_episodes 6000)
    
    (rCFD_R1)
    ;;(rCFD_R2) rCFD database (no ref data)
    
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta2_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
    
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        ;; no ref. data
         
        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
    
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd4_long)    ;; run single jump case for poly-disperse (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	(set! rCFD_data_case_dir "I120_114")
	
    (set! rCFD_data_case "BD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_post_case "PD4_L_NewCode")

    (set! number_of_rCFD_episodes 6000)  ;; 6000
    
    (rCFD_R1)
    ;; (rCFD_R2)
    
    ;; rCFD database (no ref data)
    
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    
    (ti-menu-load-string "!mv rCFD_user_jump_penta4_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
    
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        ;; no ref. data
         
        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
    
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd2_no_growth)    ;; run single jump case for no growth (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (set! rCFD_data_case_dir "I120_114")
    
    (set! rCFD_data_case "BD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_post_case "PD2_NO_GROWTH")

    (set! number_of_rCFD_episodes 2000)
    
    (rCFD_R1)
    ;;(rCFD_R2)
    
    ;; rCFD database (no ref data)
    
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    
    (ti-menu-load-string "!mv rCFD_user_jump_no_growth_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
    
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        ;; no ref. data
         
        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
    
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd2_growth)    ;; run single jump case for agglomeration (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (set! rCFD_data_case_dir "I120_114")
    
    (set! rCFD_data_case "BD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_post_case "PD2_GROWTH")

    (set! number_of_rCFD_episodes 2000)
    
    (rCFD_R1)
    ;;(rCFD_R2)
    
    ;; rCFD database (no ref data)
    
    (ti-menu-load-string "!rm ./data/c2c/*")

    (ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    (ti-menu-load-string "!rm ./data/vof/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!rm ./data/rec/*")
    
    (ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))
    
    
    (ti-menu-load-string "!mv rCFD_user_jump_growth_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
    
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        ;; no ref. data
         
        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
    
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_jump_psd2_growth_cont)    ;; run single jump case for agglomeration (narrow part.-size-distr.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (set! rCFD_data_case_dir "I110_114")

    (set! rCFD_data_case "PD2_asBD_J")    ;; take data from bi-disperse simulation (cropped dataset, 150 frames)

    (set! rCFD_post_case "PD2_GROWTH_CONT_Test4Asif")

    (set! number_of_rCFD_episodes 2000)

    (rCFD_R1)
    ;;(rCFD_R2)
    
    ;; rCFD database (no ref data)
    
    ;;(ti-menu-load-string "!rm ./data/c2c/*")

    ;;(ti-menu-load-string (format  #f "!cp ~a/~a~a/c2c/* ./data/c2c" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case)) 

    ;;(ti-menu-load-string "!rm ./data/vof/*")
    
    ;;(ti-menu-load-string (format  #f "!cp ~a/~a~a/vof/* ./data/vof" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    ;;(ti-menu-load-string "!rm ./data/rec/*")

    ;;(ti-menu-load-string (format  #f "!cp ~a/~a~a/rec/* ./data/rec" rCFD_data_scratch_dir rCFD_data_case_dir rCFD_data_case))

    (ti-menu-load-string "!mv rCFD_user_jump_growth_cont_run.h rCFD_user.h")
    
    (rCFD_R3)
    (rCFD_R4)
    (rCFD_R5)
    ;;(rCFD_R6)
    
    (do  ((i_run  0 (+ i_run  1)))
        ((= i_run  number_of_rCFD_episodes))              

        ;; no ref. data
         
        (ti-menu-load-string "/define/user-defined/execute-on-demand \"rCFD_run::libudf_rcfd_run\"")    
    )
    
    (rCFD_R7)   
    (rCFD_R8)   
    (rCFD_R9)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (rCFD_run_all)          ;; run single case (bi-disp. replay, bi-disp. jump, psd2 jump, psd4 jump)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (set! rCFD_data_case_dir "I110_114")
    
    (rCFD_run_replay)
    
    (rCFD_run_jump)
    
    (rCFD_run_jump_psd2)
    
    (rCFD_run_jump_psd4) 
    
    (rCFD_run_jump_psd2_long)
    
    (rCFD_run_jump_psd4_long)
)

