Problem with UDF

  • 153 Views
  • Last Post 03 December 2018
sairaja posted this 29 November 2018

I am using RPI model to simulate flow boiling, for nucleation site density Lemmert chawla model can be used in Fluent,
The formulation goes as follows:
N=(C (T_w -T_sat)) ^1.805, I wrote the same in an UDF, it did not give me the same results, I am not sure whether I was not able to call the wall temperature or any other issue, I defined UDF using DEFINE_BOILING_PROPERTY. To get the wall temperature i used F_T(f,t), not sure whether I used a wrong calling function for temperature. 

Order By: Standard | Newest | Votes
abenhadj posted this 29 November 2018

Can you tell me the motivation at first behind 're implementing the correlation

Best regards, Amine

sairaja posted this 30 November 2018

I would like to change the constants 'C' and 'p', by 'p' i mean 1.805. So, I am first tried to reimplement the correlation with default values to check my UDF. Please let me know if it is right to call wall temperature by F_T(f,t).

abenhadj posted this 30 November 2018

Yes it is right.

Best regards, Amine

sairaja posted this 30 November 2018

I used the following UDF, but I did not get the same result as the default model, not sure whether I am wrong or it has been implemented in Fluent in wrong way, Please let me know.

DEFINE_BOILING_PROPERTY(site_density,f,t,c0,t0,from_index,from_species_index,to_index,to_species_index)

 {

   real wallsubcool,pro_con,site_density_1;

   real T_SAT = C_STORAGE_R(c0,t0,SV_SAT_TEMPERATURE);

   real T_W = F_T(f, t);

   if (T_W < T_SAT)

   {

   site_density_1 = 0;

   }

 

   else

   {

   wallsubcool = (T_W - T_SAT);

   pro_con = wallsubcool * 210;

   site_density_1 = pow(pro_con, 1.805);

   }

   return site_density_1;

 }

 

abenhadj posted this 30 November 2018

Setting site density to zero is not enough. Whenever the superheat is negative the partioning is not used as there is no boiling.

Best regards, Amine

sairaja posted this 30 November 2018

I even tried giving just the default values without if condition (just C 210 and p =1.805), it didn't work. What could be the issue?

Thanks, Sai

abenhadj posted this 30 November 2018

Please test on  simple axisymmetric case and share a plot a long a heated wall for both cases.

Best regards, Amine

sairaja posted this 01 December 2018

I ran a simple axisymmetric case. The temperatures are not properly resolved. A clear difference can be seen in the above figure. (red indicates the default case and black indicates udf case)

Regards,

Sai

 

sairaja posted this 01 December 2018

In the following graph, the red line indicates the wall temperature with UDF (where I didn't use zero, just correlation). However, when I used the UDF (which contains if condition) and C value 1210, I got the result close to the default Lemmert Chawla model (green curve--default, black curve --udf that contains if condition+C=1210). I am sure fine tuning C value will get me closer to default, but does that indicate the C value used in fluent is not 210?

 

 

Regards,

Sai

abenhadj posted this 01 December 2018

Are all plots done with node values on? 

Best regards, Amine

sairaja posted this 01 December 2018

yes

abenhadj posted this 03 December 2018

I cannot reproduce on a case I created where I compare the default. Here I am calculating the site density whenever the wall super heat is larger then a certain small value. I am sure that there is a limiter but I would rather recommend focusing on the implementation of some other correlation rather then trying to reproduce the model in Fluent.

 

 

Best regards, Amine

Close