|
[Sponsors] |
September 8, 2016, 11:14 |
Solid State Diffusivity UDF
|
#1 |
Member
Join Date: Jun 2016
Posts: 31
Rep Power: 9 |
Hi,
I am new about udf. I am trying to write UDF which is related to thermal diffusivity. (Local Thermal Non-Equilibrium Model / Solid state energy equation) This is code. I try to define material panel and it did not run. I did not understand UDS's logic. My question are 1 - How can I define Ts (Solid State Temperature) 2 - What does if (i==TS) mean I would be glad if you help. # include "udf.h" # define zeta 0.38 # define TKS 16.591 DEFINE_DIFFUSIVITY (uds_diffusivity, cell, thread, i) { real source,Ts; if (i == TS)//if solid state temperature { /*source = (1-porosity)* (Thermal conductivity of solid)*/ source = ((1-zeta)*TKS); } else source = 0.0; return source; } |
|
September 8, 2016, 15:14 |
|
#2 |
Senior Member
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 13 |
You need to get the cell or face temperature into a variable.
like T=F_T() or C_T() (refer manual) then compare this with TS (solid state temp) which you have to define using #define. The code has some syntax and semantic errors. (TS not defined anywhere, i==TS doesn't make sense at all) Refer udf manual and look at the examples there. |
|
September 10, 2016, 10:41 |
|
#3 |
Member
Join Date: Jun 2016
Posts: 31
Rep Power: 9 |
This code run. But When I can define solid state temperature (#define Ts something). It did not run.
Do u know How can I define solid state temperature. #include "udf.h" #define TKS 10 #define SOLID_THERMAL_COND(Ts) 2 #define SOLID_DENSITY(Ts) 3 #define SOLID_CP(Ts) 2 enum { SOLID_TEMP }; DEFINE_DIFFUSIVITY( uds_diffusivity, cell, thread, i ) { real source; real Ts; if (i == SOLID_TEMP) { Ts = C_UDSI(cell, thread, SOLID_TEMP); source = (SOLID_THERMAL_COND(Ts) / (SOLID_DENSITY(Ts)*SOLID_CP(Ts))); } else source = 0.0; return source; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simulation of a single bubble with a VOF-method | Suzzn | CFX | 21 | January 29, 2018 00:58 |
Fluent Radiation/porous media | Schmitt pierre-Louis | FLUENT | 26 | September 1, 2016 10:29 |
UDF for solid volume of fraction | Capricorn | Fluent UDF and Scheme Programming | 0 | March 22, 2016 04:06 |
UDF diffusivity (strain rate)-UDS | Lilly | Fluent UDF and Scheme Programming | 0 | September 6, 2013 02:47 |
UDF Multicomponent Diffusivity with Knudsen term | Emmanuel Resch | FLUENT | 0 | August 8, 2008 21:01 |