CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Solid State Diffusivity UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2016, 11:14
Default Solid State Diffusivity UDF
  #1
Member
 
Join Date: Jun 2016
Posts: 31
Rep Power: 9
typhoon1010 is on a distinguished road
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;
}
typhoon1010 is offline   Reply With Quote

Old   September 8, 2016, 15:14
Default
  #2
Senior Member
 
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 13
nvarma is on a distinguished road
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.
nvarma is offline   Reply With Quote

Old   September 10, 2016, 10:41
Default
  #3
Member
 
Join Date: Jun 2016
Posts: 31
Rep Power: 9
typhoon1010 is on a distinguished road
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;
}
typhoon1010 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 03:41.