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

How to edit a single phase UDF for a multiphase case?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2020, 05:02
Default How to edit a single phase UDF for a multiphase case?
  #1
New Member
 
Mat
Join Date: Jan 2017
Posts: 23
Rep Power: 9
mataus is on a distinguished road
In the first case (single phase case) liquid enters the tube and absorbs heat energy which is produced by the solid region. There is no phase change happening here. The following UDF is used to calculate the source term in single phase flow. The UDF works correctly.
#include "udf.h"
DEFINE_EXECUTE_AT_END(s_calculation)
{
Domain *d=Get_Domain(1);
int zone_id=6;
Thread *t = Lookup_Thread(d,zone_id);
cell_t c;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=C_T(c,t)*0.25;
}
end_c_loop(c,t)
}
}
DEFINE_SOURCE(energy, c, t, dS, eqn)
{
real x[ND_ND];
real source;
source =1680000*C_UDMI(c,t,0);
dS[eqn] = 0;
return source;
}
In second case, liquid enters the tube and undergoes phase change due heat addition. How to rewrite the above UDF for this multiphase case.

am getting some segmentation fault at the end of the first timestep when using the same UDF for multiphase flow.
I think i am unable to access the correct the solid zone.
Attached Images
File Type: jpg mp.JPG (16.9 KB, 9 views)
mataus is offline   Reply With Quote

Reply

Tags
energy source udf, multiphase flow


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
Viscous dissipation UDF for multiphase DDPM (Divergence problem) bhargavbharathan FLUENT 0 November 30, 2016 13:23
Viscous dissipation UDF for multiphase DDPM bhargavbharathan Fluent Multiphase 0 November 30, 2016 13:17
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
Two-phase/ Single phase mix flow Reza Main CFD Forum 1 August 6, 2003 07:36
compressible two phase flow in CFX4.4 youngan CFX 0 July 2, 2003 00:32


All times are GMT -4. The time now is 19:48.