|
[Sponsors] |
Getting coordinates of the center of a boundary |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 6, 2015, 07:44 |
Getting coordinates of the center of a boundary
|
#1 |
Member
Join Date: Jul 2014
Location: Portugal
Posts: 36
Rep Power: 12 |
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 |
|
February 6, 2015, 08:56 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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) ) ) ) Probably you want it in a udf, and not in scheme, but it was nice to get this working in scheme. |
|
February 6, 2015, 09:40 |
|
#3 |
Member
Join Date: Jul 2014
Location: Portugal
Posts: 36
Rep Power: 12 |
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 |
|
February 6, 2015, 11:12 |
|
#4 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
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. |
|
February 2, 2022, 09:04 |
|
#5 | |
New Member
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
Quote:
|
||
|
|
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 |