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

DEFINE_SOURCE to cells near wall

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 18, 2020, 08:37
Default DEFINE_SOURCE to cells near wall
  #1
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14
arunraj is on a distinguished road
Hello everyone, the below UDF works fine. However, the unit of mass flux is kg/m3s. However, the unit I have incorporate for mass flux is kg/s. May i know how to incorporate volume of the wall into the UDF to ensure proper unit. When I divide by C_VOLUME(c,t), my UDF is not working.

#include "udf.h"
int boundaryID1=78;
int boundaryID2=80;
int boundaryID3=82;
int boundaryID4=79;
int boundaryID5=81;
int boundaryID6=83;
int boundaryID7=76;
int boundaryID8=84;
int boundaryID9=86;
int boundaryID10=77;
int boundaryID11=85;
int boundaryID12=87;

DEFINE_INIT(initialize, d)
{
Thread *t;
cell_t c;
face_t f;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0) = 0;
}
end_c_loop(c,t)
}
}
DEFINE_SOURCE(mass_source,c,t,dS,eqn)
{
return C_UDMI(c,t,0);
}
DEFINE_ON_DEMAND(on_demand_calc)
{
face_t f;
cell_t c;
Domain *domain=Get_Domain(1);
Thread *t;
thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=0;
}
end_c_loop(c,t)
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID1)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID2)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=0.0;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID3)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=-4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID4)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID5)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=0.0;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID6)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=-4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID7)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID8)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=0.0;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID9)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=-4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID10)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=4.23729E-05;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID11)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=0.0;
}
end_f_loop(f,t)
}
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID12)
{
begin_f_loop(f,t)
{
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=-4.23729E-05;
}
end_f_loop(f,t)
}
}
}
arunraj is offline   Reply With Quote

 


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
SimpleFoam & Theater jipai OpenFOAM Running, Solving & CFD 3 June 18, 2019 10:11
Locating near wall cells for evaporation model mehrdad_kbg OpenFOAM Programming & Development 2 February 4, 2014 02:56
Radiation interface hinca CFX 15 January 26, 2014 17:11
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
[ICEM] Export ICEM mesh to Gambit / Fluent romekr ANSYS Meshing & Geometry 1 November 26, 2011 12:11


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