|
[Sponsors] |
August 26, 2019, 22:55 |
How to get the specific face by UDF?
|
#1 |
New Member
刘宵
Join Date: Aug 2019
Posts: 4
Rep Power: 7 |
Hi all,
I am using UDF to simulate the erosion of fluid in the tube against the wall. I built a model with rectangular bulges on the wall and wanted to use UDF to make dynamic mesh reduction to simulate erosion. In my wear equation, the amount of erosion is related to the angle at which the fluid impacts the wall, so I need to get the angle between the wall and the direction of fluid velocity. I know that I can use F_C0(f,t) to select the cell that is in contact with the fluid domain, but how can I select the face in the cell that is in contact with the fluid? thread_loop_c(t,domain) { begin_c_loop(c,t) { c0=F_C0(f,t); c_face_loop(c0,t,n) { F_AREA(A,f,tf); velm=NV_MAG(vel); Am=NV_MAG(A); cos=NV_DOT(vel,A)/velm/Am; alpha=asin(cos)*180/3.1416; } } } |
|
August 28, 2019, 01:30 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
in your code you've made loop over cells,
Code:
thread_loop_c(t,domain) { begin_c_loop(c,t) { Code:
thread_loop_f(t,domain) { begin_f_loop(f,t) { |
|
August 28, 2019, 02:56 |
|
#3 |
New Member
刘宵
Join Date: Aug 2019
Posts: 4
Rep Power: 7 |
||
Tags |
specific face, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting the height of the stream in the free channel | kevinmccartin | CFX | 12 | October 13, 2022 22:43 |
how create a liquid film on specific face | fabio.villa | OpenFOAM Pre-Processing | 2 | May 28, 2015 11:43 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[Commercial meshers] Converting meshes that includes interfaces | ham | OpenFOAM Meshing & Mesh Conversion | 29 | January 8, 2007 09:58 |