CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Getting coordinates of the center of a boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2015, 07:44
Default Getting coordinates of the center of a boundary
  #1
Member
 
Join Date: Jul 2014
Location: Portugal
Posts: 36
Rep Power: 12
Rui_27 is on a distinguished road
Hello to all,

Anyone knows how to get the coordinates of the center of a boundary (namely, velocity-inlet type)?

I have a straight channel with pores on its bottom surface, from where liquid water emerges. I want to get the coordinates of the center of each pore to be used in my udf calculations.

Any ideias?

Thanks!

Rui
Rui_27 is offline   Reply With Quote

Old   February 6, 2015, 08:56
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Some scheme magic:
Code:
(display
 (map 
  (lambda (zone) 
   (format #f "~a: (~a,~a,~a)\n" zone 
    (pick-a-real
     (format #f "/report/surface-int/area-weighted-avg ~a () x-coordinate no" zone)
    )
    (pick-a-real
     (format #f "/report/surface-int/area-weighted-avg ~a () y-coordinate no" zone)
    )
    (pick-a-real
     (format #f "/report/surface-int/area-weighted-avg ~a () z-coordinate no" zone)
    )
   )
  )
  (filter
   (lambda (zn) (eq? (zone-type (get-zone zn)) 'velocity-inlet)) (inquire-zone-names)
  )
 )
)
Copy-paste this in the text-user-interface, and you will see a list appear.

Probably you want it in a udf, and not in scheme, but it was nice to get this working in scheme.
anan12345 likes this.
pakk is offline   Reply With Quote

Old   February 6, 2015, 09:40
Default
  #3
Member
 
Join Date: Jul 2014
Location: Portugal
Posts: 36
Rep Power: 12
Rui_27 is on a distinguished road
Hi pakk,

Thanks for your answer.

I did what you said, but nothing happening, and Fluent crashed.

Any suggestion for doing it in a udf?

Regards,
Rui
Rui_27 is offline   Reply With Quote

Old   February 6, 2015, 11:12
Default
  #4
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
You can look for the cell with the highest cell wall distance (C_WALL_DIST) or you can calculate the average x, y and z coordinate, it is not very complex to calculate it via UDF.
But unless your boundary has a simple geometry, it will not make much sense in any case.
upeksa is offline   Reply With Quote

Old   February 2, 2022, 09:04
Default
  #5
New Member
 
Join Date: Jun 2021
Posts: 13
Rep Power: 5
anan12345 is on a distinguished road
Quote:
Originally Posted by pakk View Post
Some scheme magic:
Code:
(display
 (map 
  (lambda (zone) 
   (format #f "~a: (~a,~a,~a)\n" zone 
    (pick-a-real
     (format #f "/report/surface-int/area-weighted-avg ~a () x-coordinate no" zone)
    )
    (pick-a-real
     (format #f "/report/surface-int/area-weighted-avg ~a () y-coordinate no" zone)
    )
    (pick-a-real
     (format #f "/report/surface-int/area-weighted-avg ~a () z-coordinate no" zone)
    )
   )
  )
  (filter
   (lambda (zn) (eq? (zone-type (get-zone zn)) 'velocity-inlet)) (inquire-zone-names)
  )
 )
)
Copy-paste this in the text-user-interface, and you will see a list appear.

Probably you want it in a udf, and not in scheme, but it was nice to get this working in scheme.
Thanks pakk, I've been searching for this for a couple of days now.
anan12345 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
inlet velocity boundary condition murali CFX 5 August 3, 2012 09:56
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
Solver error message!!! IoSa CFX 1 September 14, 2006 05:48
?? How to get cell center coordinates? erica FLUENT 0 May 11, 2005 23:02


All times are GMT -4. The time now is 20:29.