|
[Sponsors] |
February 13, 2013, 07:00 |
temperature jump code
|
#1 |
New Member
rehan
Join Date: Feb 2013
Posts: 1
Rep Power: 0 |
I encountered the following error "temperatuejump.c: line 66: coord_coeff: undeclared variable" while solving the problem using the code mention below
/* ================================================== ====== Temperature change at wall boundaries ================================================== ==== */ #include "udf.h" /* must be at the beginning of every UDF */ #include "sg.h" /*must be at the beginning of this UDF */ #include "math.h" /* must be at the beginning of this UDF */ # ifndef SCHEMESIGMASQUARE # define sigma_square 1.35305239e-19 # endif # ifndef SCHEMEAMPRESS # 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.02 # endif # define Boltzmann 1.3806505e-23 # define PI 3.14159265358979323846 # define SQRT_2 1.41421356237309504880 DEFINE_PROFILE(temperature_jump,f_thread,index) { real MeanFreePath; #ifdef SCHEMEMFP MeanFreePath=RP_Get_Real("meanfreepath"); #endif #ifdef SCHEMEThAC real ThAC= 1; ThAC=RP_Get_Real("thac"); #endif #ifdef SCHEMEUDRLXCOEFF real UDRLXCOEFF=O.2; UDRLXCOEFF=RP_Get_Real("udrlxcoeff"); #endif #ifdef SCHEMESpHR real SpHR; SpHR=RP_Get_Real("sphr"); #endif face_t face; cell_t cell; Thread*c_thread; real Coeff2[ND_ND]; real Prandtl,gamma,temp,normal; /* call the routine that computes the transformation coefficients, once per iteration should be enough*/ coord_coeff(f_thread); /* loops over all faces in the thread passed into the DEFINE macro argument */ 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*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)); /* evaluate the dT/dn (normal to surface) term in the local coord. system */ normal=NV_DOT(Coeff2,C_T_G(cell,c_thread)); gamma=(2*SpHR)/(SpHR+1); temp=((2-ThAC)/ThAC)*gamma* MeanFreePath/Prandtl*normal; /* in order to set wall temperature a user definedd scalar variahle F_UDSI( ....,0) has to be created (its transport is not important and won't effect ths result)*/ #ifdef UNDERRLX F_PROFILE(face,f_thread,index)= F_T(face,f_thread)*(l-UDRLXCOEFF)+ (F_UDSI(face,f_thread,0)+temp); #else F_PROFILE(face,f_thread,index)=(F_UDSI(face,f_thre ad,0)+temp); #endif } end_f_loop(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(face,f_thread), C_V(face,f_thread), C_W(face,f_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) } I will be grateful if someone can help in solving the issue |
|
February 14, 2013, 08:07 |
|
#2 |
Senior Member
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15 |
send this function (void coord_coeff) to top of (DEFINE_PROFILE) function.
I have modeled microchannel flow before |
|
May 18, 2013, 06:54 |
|
#3 |
New Member
Soner Isik
Join Date: May 2013
Location: Bursa-Turkey
Posts: 1
Rep Power: 0 |
Hi Guys
I am trying to use UDF given above for simulating temperature jump in a micro channel. as I understood, 1 user defined scalar and 6 user defined memory units should be allocated before assigning UDF to wall temp. but when I try to use it as thermal BC, fluent gives me Fatal Signal received access violation.what should I do? please help me Regards Soner |
|
May 28, 2016, 07:02 |
|
#4 | |
New Member
Pengwei Chen
Join Date: May 2016
Posts: 8
Rep Power: 10 |
Quote:
Could you help me? Thx in advance |
||
January 17, 2021, 00:03 |
|
#5 |
New Member
zhangdongjie
Join Date: Jan 2021
Posts: 22
Rep Power: 5 |
Hello, I'm studying wall slip and temperature jump. Would you please send me a UDF? Thank you very much. In addition, where is the temperature jump UDF loaded? Is it on the wall temperature?thanks。
|
|
January 17, 2021, 02:50 |
|
#6 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
2. You don't need this UDF (anymore), just use pressure based over and use low - pressure - boundary - slip. It has temperature jump, read the manual. |
||
January 17, 2021, 03:08 |
|
#7 | |
New Member
zhangdongjie
Join Date: Jan 2021
Posts: 22
Rep Power: 5 |
Quote:
Thank you very much for your reply. Low - pressure - Boundary - slip is only applicable to "pressure based", but I am based on "density based". When I choose "density based" instead of "pressure based". "Low pressure boundary slip" is not available. That's why I choose to use UDF, but I don't know where to load UDF with temperature jump? |
||
January 17, 2021, 05:24 |
|
#8 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
|
||
January 17, 2021, 05:46 |
|
#9 |
New Member
zhangdongjie
Join Date: Jan 2021
Posts: 22
Rep Power: 5 |
||
January 17, 2021, 08:28 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Modern pressure-based methods such as implemented in Fluent can do reasonably well with high Mach numbers, there is some benchmarking study in the manual.
|
|
Tags |
microchannels, temperature jump |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
Too low temperature at combustor outlet | romekr | FLUENT | 2 | February 6, 2012 11:02 |
difference of temperature | HKH | FLUENT | 0 | January 28, 2010 03:45 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |
What is the Better Way to Do CFD? | John C. Chien | Main CFD Forum | 54 | April 23, 2001 09:10 |