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

Drag force for a specified zone

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2023, 23:22
Default Drag force for a specified zone
  #1
New Member
 
anonymous
Join Date: Sep 2023
Posts: 2
Rep Power: 0
Ariyan is on a distinguished road
Dear Friends

I have developed a simple Drag force model code. my computational domain includes 4 different zones. the drag formulation is the same for all zones, except the constants will change. To specify which formulation applies to each zone, I plan to utilize conditional statements with the "IF" condition based on the zone_ID. could you please advise on how and where I should consider "IF" statement?


#include "udf.h"

DEFINE_EXCHANGE_PROPERTY(DRAG,c,mix_thread,s_col,f _col)
{
Thread *gas, *liq;
real r_vel_g,z_vel_g,r_vel_l,z_vel_l,abs_u,slip_r,slip_ z,rho_g,void_g,mu_g,drag_f;

/* find the threads for the gas(primary) */
/* find the threads for the liquid(secondary) */
gas=THREAD_SUB_THREAD(mix_thread,s_col);
liq=THREAD_SUB_THREAD(mix_thread,f_col);

/* find phase velocity and properties */
r_vel_g=C_U(c,gas);
z_vel_g=C_V(c,gas);
r_vel_l=C_U(c,liq);
z_vel_l=C_V(c,liq);
slip_r=r_vel_g-r_vel_l;
slip_z=z_vel_g-z_vel_l;

/* absolute slip */
abs_u=sqrt(pow(slip_r,2)+pow(slip_z,2));

/* properties */
rho_g=C_R(c,gas);
mu_g=C_MU_L(c,gas);
void_g=C_VOF(c,gas);

/* drag calculation */

/* Zone_ID=1 */
drag_f=121564*mu_g/void_g+11*rho_g*abs_u;

/* Zone_ID=2 */
drag_f=141266*mu_g/void_g+21*rho_g*abs_u;

/* Zone_ID=3 */
drag_f=181786*mu_g/void_g+11*rho_g*abs_u;

/* Zone_ID=4 */
drag_f=201454*mu_g/void_g+51*rho_g*abs_u;

return drag_f;
}
Ariyan is offline   Reply With Quote

Old   October 5, 2023, 04:28
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
you may check in Fluent GUI ID of each zone
each ID will be mix_thread value
so if your zones have ID (1, 5, 10, 15)
if statement could look
Code:
/* Zone_ID=1 */
if (mix_thread == 1)
drag_f=121564*mu_g/void_g+11*rho_g*abs_u;
else if (mix_thread == 5)
/* Zone_ID=5 */
drag_f=141266*mu_g/void_g+21*rho_g*abs_u;
else if (mix_thread == 10)
/* Zone_ID=10 */
drag_f=181786*mu_g/void_g+11*rho_g*abs_u;
else if (mix_thread == 15)
/* Zone_ID=15 */
drag_f=201454*mu_g/void_g+51*rho_g*abs_u;
Ariyan likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
PEMFC tutorial case problem Suleyman41 FLUENT 2 July 15, 2023 12:16
Drag force and drag coefficient abose06 ANSYS 1 December 11, 2020 00:55
Finding Drag Force from Skin Friction Rob Wilk Main CFD Forum 0 May 8, 2020 07:04
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 23:07
Force vectors for drag during sweeping motion aamer FLUENT 0 April 18, 2011 09:17


All times are GMT -4. The time now is 14:54.