|
[Sponsors] |
May 9, 2011, 11:15 |
second derivation
|
#1 |
Member
m.reza
Join Date: Apr 2011
Posts: 38
Rep Power: 15 |
Hi
How can I define second derivation of temperature and velocity in special direction in udf ??????????????????? |
|
May 10, 2011, 09:38 |
|
#2 |
Senior Member
|
Hi,
I guess a tip may work: (do that and inform me) 1)store first gradient of T in a UDS but do not solve a UDS equation.(use that just as a storing position) 2)use C_UDSI_G to compute gradient of gradient Regards, Amir |
|
May 10, 2011, 10:14 |
Second Deivation
|
#3 |
Member
m.reza
Join Date: Apr 2011
Posts: 38
Rep Power: 15 |
Hi Amir
I did that,but I have a error : Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () And it's my udf for changing the energy Eq. #include "udf.h" #include "mem.h" #define C_teta 0.3 #define P_t 0.85 DEFINE_SOURCE(source_ggdh , c, t, dS, eqn) { Domain *domain; real coord[ND_ND]; real source,y,T,nu_t,S11,S12,S22,A,B,C,D; real DUDX,DVDY,DVDX,DUDY,D2UDX2,D2UDXY,D2UDY2,D2VDY2,D2 VDYX,D2VDXY,D2VDX2,D2TDX2,D2TDXY,D2TDY2; C_CENTROID(coord,c, t); y = coord[1]; nu_t = C_MU_T(c,t)/C_R(c,t); T = C_K(c, t)/C_D(c, t); S11 = 0.5*(C_U_G(c,t)[0]+C_U_G(c,t)[0]); S12 = 0.5*(C_U_G(c,t)[1]+C_V_G(c,t)[0]); S22 = 0.5*(C_V_G(c,t)[1]+C_V_G(c,t)[1]); C_UDSI(c,t,0) = (C_U_G(c,t)[0]); C_UDSI(c,t,1) = (C_V_G(c,t)[1]); C_UDSI(c,t,2) = (C_U_G(c,t)[1]); C_UDSI(c,t,3) = (C_V_G(c,t)[0]); C_UDSI(c,t,4) = C_T_G(c,t)[0]; C_UDSI(c,t,5) = C_T_G(c,t)[1]; DUDX = (C_UDSI(c,t,0)); DVDY = (C_UDSI(c,t,1)); DUDY = (C_UDSI(c,t,2)); DVDX = (C_UDSI(c,t,3)); D2UDX2 =(C_UDSI_G(c,t,0)[0]); D2UDXY =(C_UDSI_G(c,t,0)[1]); D2UDY2 =(C_UDSI_G(c,t,2)[1]); D2VDY2 =(C_UDSI_G(c,t,1)[1]); D2VDYX =(C_UDSI_G(c,t,1)[0]); D2VDXY=D2VDYX; D2VDX2 =(C_UDSI_G(c,t,3)[0]); D2TDX2=(C_UDSI_G(c,t,4)[0]); D2TDXY=(C_UDSI_G(c,t,4)[1]); D2TDY2=(C_UDSI_G(c,t,5)[1]); A = T*((-2.*nu_t*D2UDX2)*C_UDSI(c,t,4)+(2.*C_K(c, t)/3.-2.*nu_t*S11)*D2TDX2+(-nu_t*(D2UDXY+D2VDX2))*C_UDSI(c,t,5)+(-2.*nu_t*S12)*D2TDXY); B = T*((-nu_t*(D2UDY2+D2VDXY)*C_UDSI(c,t,4))+(-2.*nu_t*S12)*D2TDXY+(-2.*nu_t*D2VDY2)*C_UDSI(c,t,5)+(2.*C_K(c, t)/3.-2.*nu_t*S22)*D2TDY2); C = nu_t*C_T_G(c,t)[0]/P_t; D = nu_t*C_T_G(c,t)[1]/P_t; source = C_teta*C_R(c,t)*C_CP(c,t)*(A+B-C-D); dS[eqn] = 0.0; return source; } but I don't know to do. Do you know where my error is? |
|
May 10, 2011, 11:56 |
|
#4 | |
Senior Member
|
Hi,
I compiled and had some iterations with that! note these comments: 1)activate energy and k-e model 2)you have to prevent the solver from freeing up memory by issuing the text command solve/set/expert and then answering yes to the question Keep temporary solver memory from being freed? 3)use this code: Quote:
|
||
May 11, 2011, 11:17 |
second derivation
|
#5 |
Member
m.reza
Join Date: Apr 2011
Posts: 38
Rep Power: 15 |
tnx Amir
I'm trying download C++ and Comile it. thanks for your help I'll inform you. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Derivation of k-e model from momentum equation | CFDtoy | Main CFD Forum | 5 | May 10, 2006 17:53 |
derivation enthalpy | Tomik | FLUENT | 2 | March 9, 2006 16:39 |
derivation of tsunami speed | novice | Main CFD Forum | 3 | February 24, 2005 09:43 |
Derivation d Roh / dt or dT/dt. | henry pastohr | FLUENT | 0 | May 17, 2000 04:44 |
Flux Splitting: Derivation | Abhijit Modak | Main CFD Forum | 5 | May 2, 2000 05:13 |