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

How to get the specific face by UDF?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2019, 22:55
Post How to get the specific face by UDF?
  #1
New Member
 
刘宵
Join Date: Aug 2019
Posts: 4
Rep Power: 7
Jonathon_L is on a distinguished road
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;
}
}
}
Jonathon_L is offline   Reply With Quote

Old   August 28, 2019, 01:30
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
in your code you've made loop over cells,
Code:
thread_loop_c(t,domain) 
{ 
begin_c_loop(c,t) 
{
but to use c0=F_C0(f,t); you need loop over faces
Code:
thread_loop_f(t,domain) 
{ 
begin_f_loop(f,t) 
{
best regards
AlexanderZ is offline   Reply With Quote

Old   August 28, 2019, 02:56
Default
  #3
New Member
 
刘宵
Join Date: Aug 2019
Posts: 4
Rep Power: 7
Jonathon_L is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
in your code you've made loop over cells,
Code:
thread_loop_c(t,domain) 
{ 
begin_c_loop(c,t) 
{
but to use c0=F_C0(f,t); you need loop over faces
Code:
thread_loop_f(t,domain) 
{ 
begin_f_loop(f,t) 
{
best regards

Thank you very much! I'll try.
Jonathon_L is offline   Reply With Quote

Reply

Tags
specific face, udf


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
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


All times are GMT -4. The time now is 15:59.