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

Segmentation Error during solution initialization using F_FLUX(f,t) Command

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2017, 00:52
Default Segmentation Error during solution initialization using F_FLUX(f,t) Command
  #1
New Member
 
Navier Stoke
Join Date: Aug 2017
Location: USA
Posts: 2
Rep Power: 0
Navier Stoke is on a distinguished road
Hi, I am trying to write UDF regarding diameter distribution of secondary phase in multiphase Simulation. I have two phases in my case. Primary phase is gas and secondary phase is liquid. The relation used needs mass flow rate of both liquid and gas phase to calculate the diameter of liquid droplet in each cell. Fluent successfully compiles the UDF. Also, UDF successfully hooks to the secondary phase diameter. But it gives following error whenever I initialized solution.
"received a fatal signal (Segmentation fault).Error Object: #f"
I have checked each line of code by commenting others. The problem I found is with C_FLUX(f,t).

Below is the code for refrence:

Code:
#include "udf.h"
#include "math.h"

#define SIGMA 0.07286             /*surface tension coefficient */


DEFINE_PROPERTY(liq_dia,cell,liq)
{
Thread *mix, *gas;
mix = THREAD_SUPER_THREAD(liq);  /*getting mixture thread*/
gas = THREAD_SUB_THREAD(mix,0); /*primary(gas) thread using mixture thread*/

/*----------------------------------------------------------------------------------------------------*/

double dia=0,v_fg=0,v_f=0,v_g=0,mass_gas=0,mass_liq=0;
double NV_VEC(v);                 /*A vector*/
double ro_f=C_R(cell,liq);        /*Density of liquid phase in the cell*/
double mu_f=C_MU_EFF(cell,liq);   /*Effective viscosity of liquid in a cell*/ /*C_MU_L(cell,liq) */
double ro_g=C_R(cell,gas);        /*Density of gas phase in the cell*/

/*----------------------------------------------------------------------------------------------------*/

NV_DD(v,=,C_U(cell,gas),C_V(cell,gas),C_W(cell,gas),-,C_U(cell,liq),C_V(cell,liq),C_W(cell,liq));	/*relative velocity vector*/
v_fg = NV_MAG(v);				/*relative velocity magnitude*/

v_f=sqrt(C_U(cell,liq)*C_U(cell,liq)+C_V(cell,liq)*C_V(cell,liq)+C_W(cell,liq)*C_W(cell,liq));	/*liquid velocity magnitude*/
v_g=sqrt(C_U(cell,gas)*C_U(cell,gas)+C_V(cell,gas)*C_V(cell,gas)+C_W(cell,gas)*C_W(cell,gas));	/*Gas velocity magnitude*/

/*----------------------------------------------------------------------------------------------------*/

int ng,nl;
face_t fg;
face_t fl;
Thread *tg;
Thread *tl;

c_face_loop(cell,gas,ng)
{
fg=C_FACE(cell,gas,ng);
tg=C_FACE_THREAD(cell,gas,ng);
mass_gas +=F_FLUX(fg,tg);        /*Gas flow rate calculation loop over all the faces*/        
}

c_face_loop(cell,liq,nl)
{
fl=C_FACE(cell,liq,nl);                 
tl=C_FACE_THREAD(cell,liq,nl);				 
mass_liq +=F_FLUX(fl,tl);           /*Liquid flow rate calculation loop over all the faces*/			 			        				 
}

dia;        /*Here comes the relation for droplet diameter calculation*/

return(dia);
}

Last edited by Navier Stoke; August 8, 2017 at 00:09.
Navier Stoke is offline   Reply With Quote

Old   September 17, 2019, 15:23
Default
  #2
New Member
 
zhou
Join Date: Feb 2012
Posts: 1
Rep Power: 0
benjamin710 is on a distinguished road
I have the same problem, it doesnot work
benjamin710 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
initialization using command line rohit CFX 2 October 16, 2008 11:02
Problem of compilation OF 14Allwmake command not found erik_d OpenFOAM Bugs 13 September 13, 2008 21:45
error during solution initialization Muhammad Usman Qureshi FLUENT 7 March 31, 2008 07:26
Conduct initialization with a old mesh solution Jianfeng Zou FLUENT 1 September 12, 2007 06:06


All times are GMT -4. The time now is 20:18.