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

Multiphase UDF problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2018, 18:01
Default Multiphase UDF problem
  #1
New Member
 
Lukas
Join Date: Mar 2018
Posts: 6
Rep Power: 8
Sijnhaven is on a distinguished road
Hello,

I am simulating liquid-gas muliphase flow.

I need a UDF to define the bubble diameter for the gas phase.

I can interpret the UDF, but after initialization I get this error message:
"Node X: Process 11780: Received signal SIGSEGV"

Something is going wrong in the part of the code that is calling the properties of the primary and secondary phases.

Thank you for responding.

UDF:


#include "udf.h"


DEFINE_PROPERTY(BubbleDiameter, c, mixture_thread)
{
real BD; /* Bubble diameter */

int SurfaceTension;

int PhaseOneIndex = 0;
int PhaseTwoIndex = 1;

real DensS; /* S = primary (liquid) phase */
real DensG; /* G = secondary (gas) phase */
real XVelS;
real XVelG;
real YVelS;
real YVelG;
real ZVelS;
real ZVelG;
real EffViscG;

Thread *p1 = THREAD_SUB_THREAD(mixture_thread,PhaseOneIndex);
Thread *p2 = THREAD_SUB_THREAD(mixture_thread,PhaseTwoIndex);

DensS = C_R(c,p1); /* density liquid */
DensG = C_R(c,p2); /* density gas */
XVelS = C_U(c,p1); /* x velocity liquid */
XVelG = C_U(c,p2); /* x velocity gas */
YVelS = C_V(c,p1); /* y velocity liquid */
YVelG = C_V(c,p2); /* y velocity gas */
ZVelS = C_W(c,p1); /* z velocity liquid */
ZVelG = C_W(c,p2); /* z velocity gas */
EffViscG = C_MU_EFF(c,p1); /* effective viscosity of the gas phase */
SurfaceTension = 1.76;

BD = XXX ; /* HERE WILL BE MY FORMULA */

return BD;

}
Sijnhaven is offline   Reply With Quote

Old   May 2, 2018, 12:27
Default
  #2
New Member
 
Star
Join Date: Apr 2018
Posts: 3
Rep Power: 7
sikandar is on a distinguished road
Quote:
Originally Posted by Sijnhaven View Post
Hello,

I am simulating liquid-gas muliphase flow.

I need a UDF to define the bubble diameter for the gas phase.

I can interpret the UDF, but after initialization I get this error message:
"Node X: Process 11780: Received signal SIGSEGV"

Something is going wrong in the part of the code that is calling the properties of the primary and secondary phases.

Thank you for responding.

UDF:


#include "udf.h"


DEFINE_PROPERTY(BubbleDiameter, c, mixture_thread)
{
real BD; /* Bubble diameter */

int SurfaceTension;

int PhaseOneIndex = 0;
int PhaseTwoIndex = 1;

real DensS; /* S = primary (liquid) phase */
real DensG; /* G = secondary (gas) phase */
real XVelS;
real XVelG;
real YVelS;
real YVelG;
real ZVelS;
real ZVelG;
real EffViscG;

Thread *p1 = THREAD_SUB_THREAD(mixture_thread,PhaseOneIndex);
Thread *p2 = THREAD_SUB_THREAD(mixture_thread,PhaseTwoIndex);

DensS = C_R(c,p1); /* density liquid */
DensG = C_R(c,p2); /* density gas */
XVelS = C_U(c,p1); /* x velocity liquid */
XVelG = C_U(c,p2); /* x velocity gas */
YVelS = C_V(c,p1); /* y velocity liquid */
YVelG = C_V(c,p2); /* y velocity gas */
ZVelS = C_W(c,p1); /* z velocity liquid */
ZVelG = C_W(c,p2); /* z velocity gas */
EffViscG = C_MU_EFF(c,p1); /* effective viscosity of the gas phase */
SurfaceTension = 1.76;

BD = XXX ; /* HERE WILL BE MY FORMULA */

return BD;

}
did you found the solution of this matter? Do you have UDF for terminal Velocity of bubble i need help
sikandar is offline   Reply With Quote

Old   May 2, 2018, 19:51
Default
  #3
New Member
 
Lukas
Join Date: Mar 2018
Posts: 6
Rep Power: 8
Sijnhaven is on a distinguished road
Quote:
Originally Posted by sikandar View Post
did you found the solution of this matter? Do you have UDF for terminal Velocity of bubble i need help
Yes, I believe the DEFINE_PROPERTY macro does not pass the mixture_thread, because it is coupled to the bubble diameter, which is a secondary (gas) phase property. So in this case, the DEFINE_PROPERTY macro passes the thread of the secondary phase.

The solution that I found was to first look up the mixture_thread with THREAD_SUPER_THREAD(p2), in which p2 is the thread of the secondary phase, that was passed by the solver through the DEFINE_PROPERTY macro.

Then, in a next step, I define the thread of the primary phase by using the macro THREAD_SUB_THREAD(mixture_thread,0). Of course, it is not needed to explicitly lookup the thread of the secondary phase with THREAD_SUB_THREAD(mixture_thread,1), because it was already passed to the UDF by the solver.

Unfortunately, I do not have a UDF for terminal velocity. I never used this.

Regards

Last edited by Sijnhaven; May 8, 2018 at 11:08.
Sijnhaven is offline   Reply With Quote

Old   May 8, 2018, 10:59
Default
  #4
Member
 
tahir
Join Date: May 2010
Posts: 35
Rep Power: 15
ENGRTAHIR is on a distinguished road
Quote:
Originally Posted by sikandar View Post
did you found the solution of this matter? Do you have UDF for terminal Velocity of bubble i need help
Hi i also need help for bubble diameter. I am doing two phase simulation in fluent with combustion
ENGRTAHIR 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
Problem accessing material properties in UDF for Multiphase Multispecies pmtgt Fluent Multiphase 3 January 17, 2021 07:11
Mesh UDF problem kornetka Fluent UDF and Scheme Programming 4 July 25, 2013 06:54
Help! Compiled UDF problem 4 Wave tank tutorial Shane FLUENT 1 September 3, 2010 02:32
UDF using problem, error happens-heip!! Michael FLUENT 1 December 9, 2008 07:51
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 10:22


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