|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14 ![]() |
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) } } } |
|
![]() |
![]() |
|
|
![]() |
||||
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 |