How to create iso-surfaces that are a series of conical sections?
Sometimes it is helpful to create a series of circular iso-surfaces that are sections of a cone, to represent the development of the flow field along one direction. If you want to create a series of iso-surfaces that are a series of sections of a right circular cone you will need to know the following: Coordinates of the origin of the cone Coordinates of another point on the axis of the cone Cone-half angle STEPS to follow: 1) Save attached scheme file as a text file with name: cone-custom-field-function.scm 2) Read instructions at the top of the scheme file and make modifications to the file accordingly 3) Read it into your fluent session 4) From Surface->Iso-surface->Quadric create a series of spheres with the origin at the desired origin and with different radii 5) We will now use the custom-field-function entitled "cone" to iso-clip these spherical surfaces and to obtain the series of conical sections From Surface->Iso-clip select one shperical surface, Use the customfield function "cone" for clipping. Keep minimum value of the function = cosine of the desired cone half-angle Keep maximum value = 1 6) Repeat step 5 for all other spherical surfaces 7) Instead of a series of shperical surfaces, this procedure can also be used with a series of planar surfaces to get a series of planar conical sections =========Beginning of scheme function=====cut below here============ ;;; Scheme function created by Sandeep Sovani, June17th 2004, sds@fluent.com ;;; ;;; This scheme function is used to create a custom-field-function ;;; for the equation of a right circular cone ;;; ;;; The axis of the cone is defined by providing coordinates of ;;; the point that represents the origin of the axis and coordinates ;;; of another point on the axis. ;;; ;;; Once this axis is defined, this custom-field-function can ;;; be used to create either a conical iso-surface or to identify ;;; a conical region ;;; ;;; To create a conical surface simply create an iso-surface of ;;; this custom-field-function with value = cosine of the desired ;;; cone-half-angle ;;; ;;; To use this function to identify a region inside the cone, ;;; use the range of values: ;;; from the cosine of the desired cone-half-angle to 1 ;;; ;;; USAGE: ;;; 1) modify this file by entering desired cone-axis-origin ;;; coordinates, and coordinates of another point on the ;;; axis of the cone ;;; Change the number 0 at three places in the following ;;; line to the desired value of x coordinate for the ;;; origin ;;; ((name origin-x) (display "0") (syntax-tree 0) (code 0)) ;;; E.g. if the desired x coordinate is 12.33 change this ;;; line in the code below to: ;;; ((name origin-x) (display "12.33") (syntax-tree 12.33) (code 12.33)) ;;; ;;; Repeat the same procedure for 5 more lines in the code ;;; below, to specify origin-y, origin-z, axis-x, axis-y, axis-z ;;; 2) Save this schemefile and read it into Fluent via ;;; File->Read->Scheme ;;; Six new custom field functions will appear under ;;; Define->Custom_Field_Functions->Manage ;;; origin-x ;;; origin-y ;;; origin-z ;;; axis-x ;;; axis-y ;;; axis-z ;;; cone ;;; 3) Use the custom-field-function entitled "cone" ;;; for post processing (custom-field-function/define '(((name origin-x) (display "0") (syntax-tree 0) (code 0)) ((name origin-y) (display "0") (syntax-tree 0) (code 0)) ((name origin-z) (display "0") (syntax-tree 0) (code 0)) ((name axis-x) (display "1") (syntax-tree 1) (code 1)) ((name axis-y) (display "0") (syntax-tree 0) (code 0)) ((name axis-z) (display "0") (syntax-tree 0) (code 0)) ((name cone) (display "((x - origin-x) * (axis-x - origin-x) + (y - origin-y) * (axis-y - origin-y) + (z - origin-z) * (axis-z - origin-z)) / (sqrt ((x - origin-x) ^ 2 + (y - origin-y) ^ 2 + (z - origin-z) ^ 2) * sqrt ((axis-x - origin-x) ^ 2 + (axis-y - origin-y) ^ 2 + (axis-z - origin-z) ^ 2))") (syntax-tree ("/" ("+" ("+" ("*" ("-" "x-coordinate" "origin-x") ("-" "axis-x" "origin-x")) ("*" ("-" "y-coordinate" "origin-y") ("-" "axis-y" "origin-y"))) ("*" ("-" "z-coordinate" "origin-z") ("-" "axis-z" "origin-z"))) ("*" ("sqrt" ("+" ("+" ("**" ("-" "x-coordinate" "origin-x") 2) ("**" ("-" "y-coordinate" "origin-y") 2)) ("**" ("-" "z-coordinate" "origin-z") 2))) ("sqrt" ("+" ("+" ("**" ("-" "axis-x" "origin-x") 2) ("**" ("-" "axis-y" "origin-y") 2)) ("**" ("-" "axis-z" "origin-z") 2)))))) (code (field-/ (field-+ (field-+ (field-* (field-- (field-load "x-coordinate") (cx-field-eval "origin-x")) (field-- (cx-field-eval "axis-x") (cx-field-eval "origin-x"))) (field-* (field-- (field-load "y-coordinate") (cx-field-eval "origin-y")) (field-- (cx-field-eval "axis-y") (cx-field-eval "origin-y")))) (field-* (field-- (field-load "z-coordinate") (cx-field-eval "origin-z")) (field-- (cx-field-eval "axis-z") (cx-field-eval "origin-z")))) (field-* (field-sqrt (field-+ (field-+ (field-** (field-- (field-load "x-coordinate") (cx-field-eval "origin-x")) 2) (field-** (field-- (field-load "y-coordinate") (cx-field-eval "origin-y")) 2)) (field-** (field-- (field-load "z-coordinate") (cx-field-eval "origin-z")) 2))) (field-sqrt (field-+ (field-+ (field-** (field-- (cx-field-eval "axis-x") (cx-field-eval "origin-x")) 2) (field-** (field-- (cx-field-eval "axis-y") (cx-field-eval "origin-y")) 2)) (field-** (field-- (cx-field-eval "axis-z") (cx-field-eval "origin-z")) 2))))))) )) |
||
![]()
|