|
[Sponsors] |
October 4, 2023, 23:22 |
Drag force for a specified zone
|
#1 |
New Member
anonymous
Join Date: Sep 2023
Posts: 2
Rep Power: 0 |
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; } |
|
October 5, 2023, 04:28 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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;
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
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 |