Post processing VOF cases with more than two phases

In VOF problems with more than 2 phases, there is no direct variable to visualize all the three phases simultaneously. The custom field function below would help in visualizing all three phases at the same time in a three phase problem.

Function = phase-1 + 2*phase-2 + 3*phase-3

where phase-* is the volume fraction of each phase.

When the function is displayed, all the three phases would be shown in different colors with lowest in the color scale being phase-1 and highest being phase-2.

The procedure can be extended to more than 3 phases too.

The following scheme can be used to create iso-surfaces in x y or z directions for visualizing the contours.

;; scheme to make isosurfaces at constant x y and z directions
;; n number of surfaces
(define nx 5)
(define ny 5)
(define nz 5)
(set! nx (read-integer "Number of surfaces in x direction " 5 ))
(set! ny (read-integer "Number of surfaces in y direction " 5 ))
(set! nz (read-integer "Number of surfaces in z direction " 5 ))
(define minx (list-ref (domain-extents) 0))
(define maxx (list-ref (domain-extents) 1))
(define miny (list-ref (domain-extents) 2))
(define maxy (list-ref (domain-extents) 3))
(define minz (list-ref (domain-extents) 4))
(define maxz (list-ref (domain-extents) 5))

(do ((i 1 (+ i 1))) ((> i nx))
(ti-menu-load-string (format #f "surf iso-surf mix x-coord bx-~02d , , ~d ," i (+ minx (* i (/ (- maxx minx) nx))))))

(do ((i 1 (+ i 1))) ((> i ny))
(ti-menu-load-string (format #f "surf iso-surf mix y-coord by-~02d , , ~d ," i (+ miny (* i (/ (- maxy miny) ny))))))

(do ((i 1 (+ i 1))) ((> i nz))
(ti-menu-load-string (format #f "surf iso-surf mix z-coord bz-~02d , , ~d ," i (+ minz (* i (/ (- maxz minz) nz))))))

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