|
[Sponsors] |
[solidification/melting] udf to init Temperature |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 28, 2012, 02:53 |
[solidification/melting] udf to init Temperature
|
#1 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
Hi,
I'm trying to solve a solidification-melting problem and I have to initialize temperature, function of x coordinate: I used the following udf, which compiles/interprets fine: Code:
#include "udf.h" DEFINE_INIT(my_init_func,d) { cell_t c; Thread *t; real xc[ND_ND]; /* loop over all cell threads in the domain */ thread_loop_c(t,d) { /* loop over all cells */ begin_c_loop_all(c,t) { C_CENTROID(xc,c,t); if (xc[0] <= 0.015) C_T(c,t) = 346.15; else if (xc[0] <= 0.01575 && xc[0] > 0.015) C_T(c,t) = -2208.*xc[0]+351.171; else if (xc[0] <= 0.01625 && xc[0] > 0.01575) C_T(c,t) = -414.*xc[0]+322.9155; else if (xc[0] <= 0.01675 && xc[0] > 0.01625) C_T(c,t) = -66.*xc[0]+317.2605; else if (xc[0] <= 0.01725 && xc[0] > 0.01675) C_T(c,t) = -8.*xc[0]+316.289; else if (xc[0] <= 0.01775 && xc[0] > 0.01725) C_T(c,t) = -2.*xc[0]+316.1855; else C_T(c,t) = 316.15; } end_c_loop_all(c,t) } } However, after initializing, temperature contour plot looks fine, but when I plot liquid fraction my domain is 100% liquid.... Do I have to patch also the liquid fraction in my udf?If yes, how? Daniele |
|
November 28, 2012, 04:15 |
|
#2 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
I initialized also the liquid fraction thanks to C_LIQF(c,t) to 0; my problem was that I initialized all my domain, whch is composed by solid and fluid, but, as the fluent guide says, C_LIQF(c,t) is available only for fluid zones, so I received an access violation..now all is ok (I think).
..but I didn't know that I had to initialize also the liquid fraction, I thought that fluent would compute it automatically. Daniele |
|
June 19, 2013, 03:31 |
|
#3 |
Member
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13 |
Hi,
I am also working on the same problem. Were you able to solve this problem? I know it's late, you should also update enthalpy right to get the updated liquid fraction? Did you use the inbuilt solidification module? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF slip and temperature jump from IFRT | abir | Fluent UDF and Scheme Programming | 1 | July 30, 2012 06:44 |
UDF temperature profile | NeoGamaes | Fluent UDF and Scheme Programming | 5 | January 16, 2012 04:10 |
Parallel INIT UDF trouble | mil3st3g | Fluent UDF and Scheme Programming | 2 | January 6, 2011 15:07 |
UDF of linear distribution of temperature in a 2D tank | arailos | Fluent UDF and Scheme Programming | 1 | August 19, 2010 15:14 |
UDF or any approach for Bulk Temperature calculation | vemps | FLUENT | 0 | May 1, 2009 02:09 |