|
[Sponsors] |
How to setup the wall boundary condition of maxwell_slip_velocity_x_full UDF? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 15, 2015, 10:16 |
How to setup the wall boundary condition of maxwell_slip_velocity_x_full UDF?
|
#1 |
New Member
Xing Baoyu
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
I have compiled the maxwell_slip_velocity_x_full and temperature_jump UDF from IFTR_Reports provided by Steffen Jebauer. But in the Fluent GUI, where to load the UDF, wall motion and specify shear are not right for it. And in thermal label, I cannot find how to load temperature_jump.
So,are there some models to be setup in order to use this UDF? Best regards. |
|
January 15, 2015, 10:21 |
|
#2 |
New Member
Xing Baoyu
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
the UDF is below.
/************************************************** ************************************* Slip_Thermal_BC.c UDF for slip velocity(Maxwell)+temperature jump ************************************************** ***************************************/ #include "udf.h" #include "sg.h" #include <math.h> #define notSCHEMEMFP /**/ #define SCHEMETMAC /*TMAC..*/ #define SCHEMEUDRLXCOEFF /*under-relaxation coefficient*/ #define notSCHEMEThAC #define notSCHEMESpHR #define SCHEMESIGMASQUARE #define SCHEMEAMBPRESS #define UNDERRLX #define WALLMOTION #define Boltzmann 1.3806505e-23 #define PI 3.14159265 #define SQRT_2 1.414213562 #ifndef SCHEMESIGMASQUARE #define sigma_square 1.35305239e-19 /**/ #endif #ifndef SCHEMEAMBPRESS #define ambpress 101325 /**/ #endif #ifndef SCHEMETMAC #define TMAC 1.0 /**/ #endif #ifndef SCHEMEThAC #define ThAC 1.0 /*热调节系数*/ #endif #ifndef SCHEMESpHR #define SpHR 1.4 /*比热比*/ #endif #ifndef SCHEMEUDRLXCOEFF #define UDRLXCOEFF 0.2 /**/ #endif DEFINE_PROFILE(temperature_jump,f_thread,index) { face_t face; cell_t cell; Thread *c_thread; real Coeff2[ND_ND]; real Prandtl, gamma, temp, normal; real MeanFreePath=6.8e-8; #ifdef SCHEMEMFP MeanFreePath=RP_Get_Real("meanfreepath"); #endif #ifdef SCHEMEThAC real ThAC; ThAC=RP_Get_Real("thac"); #endif #ifdef SCHEMEUDRLXCOEFF real UDRLXCOEFF=0.2; UDRLXCOEFF=RP_Get_Real("udrlxcoeff"); #endif #ifdef SCHEMESpHR real SpHR; SpHR=RP_Get_Real("sphr"); #endif coord_coeff(f_thread); begin_f_loop(face,f_thread) { cell=F_C0(face,f_thread); c_thread=THREAD_T0(f_thread); #ifdef SCHEMEMFP MeanFreePath = Boltzmann * F_T(face,f_thread)/(sigma_square * (F_P(face,f_thread)+ambpress) * PI * SQRT_2); #endif Prandtl=(C_MU_L(cell,c_thread)*C_CP(cell,c_thread) )/C_K_L(cell,c_thread); ND_SET(Coeff2[0],Coeff2[1],Coeff2[2], F_UDMI(face,f_thread,3), F_UDMI(face,f_thread,4), F_UDMI(face,f_thread,5)); normal=NV_DOT(Coeff2,C_T_G(cell,c_thread)); gamma=(2*SpHR)/(SpHR+1); temp=((2-ThAC)/ThAC) * gamma * MeanFreePath / Prandtl * normal; #ifdef UNDERRLX F_PROFILE(face,f_thread,index)=F_T(face,f_thread)* (1-UDRLXCOEFF)+(F_UDSI(face,f_thread,0)+temp)*UDRLXCO EFF; #else F_PROFILE(face,f_thread,index)=(F_UDSI(face,f_thre ad,0)+temp); #endif } end_f_loop(f,thread) } DEFINE_PROFILE(maxwell_slip_velocity_x_full,f_thre ad,index) { face_t face; cell_t cell; Thread *c_thread; real slip, thcreep, dveloc; real normal_slip, tangential_slip, tangential_thcreep; real Coeff1[ND_ND], Coeff2[ND_ND]; real u[ND_ND]; real TMAC=1; real MeanFreePath=6.8e-8; real UDRLXCOEFF=0.2; real sigma_square=1.0e-19; real ambpress; #ifdef SCHEMETMAC TMAC=RP_Get_Real("tmac"); #endif #ifdef SCHEMEMFP MeanFreePath=RP_Get_Real("meanfreepath"); #endif #ifdef SCHEMEUDRLXCOEFF UDRLXCOEFF=RP_Get_Real("udrlxcoeff"); #endif #ifdef SCHEMESIGMASQUARE sigma_square=RP_Get_Real("sigmasquare"); #endif #ifdef SCHEMEAMBPRESS ambpress=RP_Get_Real("ambpress"); #endif if (RP_Get_Integer("coordeval")==1) coord_coeff(f_thread); if ((RP_Get_Integer("tempgradeval")>1)&&(Data_Valid_P ())) { begin_f_loop(face,f_thread) { cell=F_C0(face,f_thread); c_thread=THREAD_T0(f_thread); #ifndef SCHEMEMFP MeanFreePath = Boltzmann * F_T(face,f_thread) / (sigma_square*(F_P(face,f_thread)+ambpress)*PI*SQR T_2); #endif ND_SET(u[0],u[1],u[2], F_U(face,f_thread), F_V(face,f_thread), F_W(face,f_thread)); ND_SET(Coeff1[0],Coeff1[1],Coeff1[2], F_UDMI(face,f_thread,0), F_UDMI(face,f_thread,1), F_UDMI(face,f_thread,2)); ND_SET(Coeff2[0],Coeff2[1],Coeff2[2], F_UDMI(face,f_thread,3), F_UDMI(face,f_thread,4), F_UDMI(face,f_thread,5)); tangential_slip=NVD_DOT(Coeff1, NV_DOT(Coeff1,C_U_G(cell,c_thread)), NV_DOT(Coeff1,C_V_G(cell,c_thread)), NV_DOT(Coeff1,C_W_G(cell,c_thread))); normal_slip=-1 * NVD_DOT(Coeff1, NV_DOT(Coeff2,C_U_G(cell,c_thread)), NV_DOT(Coeff2,C_V_G(cell,c_thread)), NV_DOT(Coeff2,C_W_G(cell,c_thread))); slip = ((2-TMAC)/TMAC) * MeanFreePath * (tangential_slip+normal_slip); tangential_thcreep=NV_DOT(Coeff1,C_T_G(cell,c_thre ad)) ; thcreep = 0.75 * C_MU_L(cell,c_thread)/(C_R(cell,c_thread) * C_T(cell,c_thread)) * tangential_thcreep ; #ifdef WALLMOTION dveloc = Coeff1[0]* (F_UDSI(face,f_thread,1) + (slip + thcreep)) ; #else dveloc = Coeff1[0]* (slip + thcreep) ; #endif #ifdef UNDERRLX dveloc = (1-UDRLXCOEFF) *u[0] + UDRLXCOEFF * dveloc; #endif F_PROFILE(face,f_thread,index) = dveloc; } end_f_loop(face,f_thread) } else { begin_f_loop(face,f_thread) { ND_SET(u[0],u[1],u[2], F_U(face,f_thread), F_V(face,f_thread), F_W(face,f_thread)) ; ND_SET(Coeff1[0],Coeff1[1],Coeff1[2], F_UDMI(face,f_thread,0), F_UDMI(face,f_thread,1), F_UDMI(face,f_thread,2)) ; #ifdef WALLMOTION F_PROFILE(face,f_thread,index) = Coeff1[0] * F_UDSI(face,f_thread,1); #else F_PROFILE(face,f_thread,index) = Coeff1[0] * NV_DOT(u,Coeff1); #endif } end_f_loop(face,f_thread) } } void coord_coeff(Thread *f_thread) { face_t face; cell_t cell; Thread *c_thread; real y[ND_ND]; real u[ND_ND], a; real A[ND_ND]; real dr0[ND_ND], es[ND_ND], ds, A_by_es; begin_f_loop(face,f_thread) { F_CENTROID(y,face,f_thread); cell=F_C0(face,f_thread); c_thread=THREAD_T0(f_thread); BOUNDARY_FACE_GEOMETRY(face,f_thread,A,ds,es,A_by_ es,dr0); ND_SET(u[0],u[1],u[2], C_U(cell,c_thread), C_V(cell,c_thread), C_W(cell,c_thread)); a=NV_MAG(u); ND_SET(F_UDMI(face,f_thread,0), F_UDMI(face,f_thread,1), F_UDMI(face,f_thread,2), NVD_DOT(u,1,0,0)/a, NVD_DOT(u,0,1,0)/a, NVD_DOT(u,0,0,1)/a); ND_SET(F_UDMI(face,f_thread,3), F_UDMI(face,f_thread,4), F_UDMI(face,f_thread,5), NVD_DOT(A,1,0,0)/A_by_es, NVD_DOT(A,0,1,0)/A_by_es, NVD_DOT(A,0,0,1)/A_by_es); } end_f_loop(face,f_thread) } Last edited by ailee0303; January 23, 2015 at 05:24. |
|
February 3, 2015, 07:31 |
|
#3 |
New Member
Xing Baoyu
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
Nobody used the UDF before?
I really need all your help. |
|
May 26, 2016, 04:33 |
|
#4 |
New Member
Pengwei Chen
Join Date: May 2016
Posts: 8
Rep Power: 10 |
||
January 13, 2021, 09:14 |
|
#5 |
New Member
zhangdongjie
Join Date: Jan 2021
Posts: 22
Rep Power: 5 |
||
November 12, 2024, 22:37 |
|
#6 |
New Member
请选择…
Join Date: Mar 2022
Posts: 2
Rep Power: 0 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting rotating frame of referece. | RPFigueiredo | CFX | 3 | October 28, 2014 05:59 |
Internal wall boundary condition | ivan-s | COMSOL | 0 | October 8, 2014 17:09 |
Low Mixing time Problem | Mavier | CFX | 5 | April 29, 2013 01:00 |
Dirichlet boundary condition for additional variable on the wall | ftab | CFX | 13 | January 27, 2013 13:24 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |