How to create isosurfaces that are a series of conical sections?
Sometimes it is helpful to create a series of circular isosurfaces 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 isosurfaces 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 Conehalf angle STEPS to follow: 1) Save attached scheme file as a text file with name: conecustomfieldfunction.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>Isosurface>Quadric create a series of spheres with the origin at the desired origin and with different radii 5) We will now use the customfieldfunction entitled "cone" to isoclip these spherical surfaces and to obtain the series of conical sections From Surface>Isoclip select one shperical surface, Use the customfield function "cone" for clipping. Keep minimum value of the function = cosine of the desired cone halfangle 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 customfieldfunction ;;; 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 customfieldfunction can ;;; be used to create either a conical isosurface or to identify ;;; a conical region ;;; ;;; To create a conical surface simply create an isosurface of ;;; this customfieldfunction with value = cosine of the desired ;;; conehalfangle ;;; ;;; To use this function to identify a region inside the cone, ;;; use the range of values: ;;; from the cosine of the desired conehalfangle to 1 ;;; ;;; USAGE: ;;; 1) modify this file by entering desired coneaxisorigin ;;; 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 originx) (display "0") (syntaxtree 0) (code 0)) ;;; E.g. if the desired x coordinate is 12.33 change this ;;; line in the code below to: ;;; ((name originx) (display "12.33") (syntaxtree 12.33) (code 12.33)) ;;; ;;; Repeat the same procedure for 5 more lines in the code ;;; below, to specify originy, originz, axisx, axisy, axisz ;;; 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 ;;; originx ;;; originy ;;; originz ;;; axisx ;;; axisy ;;; axisz ;;; cone ;;; 3) Use the customfieldfunction entitled "cone" ;;; for post processing (customfieldfunction/define '(((name originx) (display "0") (syntaxtree 0) (code 0)) ((name originy) (display "0") (syntaxtree 0) (code 0)) ((name originz) (display "0") (syntaxtree 0) (code 0)) ((name axisx) (display "1") (syntaxtree 1) (code 1)) ((name axisy) (display "0") (syntaxtree 0) (code 0)) ((name axisz) (display "0") (syntaxtree 0) (code 0)) ((name cone) (display "((x  originx) * (axisx  originx) + (y  originy) * (axisy  originy) + (z  originz) * (axisz  originz)) / (sqrt ((x  originx) ^ 2 + (y  originy) ^ 2 + (z  originz) ^ 2) * sqrt ((axisx  originx) ^ 2 + (axisy  originy) ^ 2 + (axisz  originz) ^ 2))") (syntaxtree ("/" ("+" ("+" ("*" ("" "xcoordinate" "originx") ("" "axisx" "originx")) ("*" ("" "ycoordinate" "originy") ("" "axisy" "originy"))) ("*" ("" "zcoordinate" "originz") ("" "axisz" "originz"))) ("*" ("sqrt" ("+" ("+" ("**" ("" "xcoordinate" "originx") 2) ("**" ("" "ycoordinate" "originy") 2)) ("**" ("" "zcoordinate" "originz") 2))) ("sqrt" ("+" ("+" ("**" ("" "axisx" "originx") 2) ("**" ("" "axisy" "originy") 2)) ("**" ("" "axisz" "originz") 2)))))) (code (field/ (field+ (field+ (field* (field (fieldload "xcoordinate") (cxfieldeval "originx")) (field (cxfieldeval "axisx") (cxfieldeval "originx"))) (field* (field (fieldload "ycoordinate") (cxfieldeval "originy")) (field (cxfieldeval "axisy") (cxfieldeval "originy")))) (field* (field (fieldload "zcoordinate") (cxfieldeval "originz")) (field (cxfieldeval "axisz") (cxfieldeval "originz")))) (field* (fieldsqrt (field+ (field+ (field** (field (fieldload "xcoordinate") (cxfieldeval "originx")) 2) (field** (field (fieldload "ycoordinate") (cxfieldeval "originy")) 2)) (field** (field (fieldload "zcoordinate") (cxfieldeval "originz")) 2))) (fieldsqrt (field+ (field+ (field** (field (cxfieldeval "axisx") (cxfieldeval "originx")) 2) (field** (field (cxfieldeval "axisy") (cxfieldeval "originy")) 2)) (field** (field (cxfieldeval "axisz") (cxfieldeval "originz")) 2))))))) )) 

