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

Error in udf-Excuted on demand -parallel mode

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2022, 01:06
Default Error in udf-Excuted on demand -parallel mode
  #1
New Member
 
masoud fard
Join Date: Jan 2022
Posts: 7
Rep Power: 4
fard734 is on a distinguished road
Dear freinds
The following UDF is just working in "SERIAL" processing option without problem, but in the "PARALLEL" mode, when the Excuted on deman is selected, this error appear"Node 999999: Process 12480: Received signal SIGSEGV. MPI Application rank 0 exited before MPI_Finalize() with status -1
The fl process could not be started. "

The udf is interpreted without any problem, but dosnt work in parallel mode. Please let me know your suggestions.

#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
Domain *d; /* declare domain pointer since it is not passed as an
argument to the DEFINE macro */

real R=8.314;
real D=26.1e-6;
float Y_W,X_W,Y_A; "mole fraction and mass fraction of vapor"
float T_cell, P_cell, P_sat,Powsat;
Thread *t;
cell_t c;
d = Get_Domain(2); /* Get the domain using ANSYS Fluent utility */

/* Loop over all cell threads in the domain */
thread_loop_c(t,d)
{


Y_W = C_YI(c,t,0);
Y_A = C_YI(c,t,1);
X_W = (Y_W*29)/((29*Y_W) + (18*Y_A));
T_cell = C_T(c,t); /*cell mixture temperature*/
P_cell = C_P(c,t);
Powsat=(8.07131-1730.63/(233.426+(T_cell-273.15)));
P_sat = pow(10,Powsat)*133.322;

/* Loop over all cells */
begin_c_loop(c,t)
{
C_UDSI(c,t,0) = C_VOF(c,t);
C_UDSI(c,t,1) = C_YI(c,t,0);

C_UDMI(c,t,1)=NV_MAG(C_UDSI_G(c,t,0));
C_UDMI(c,t,2)=NV_MAG(C_UDSI_G(c,t,1));
C_UDMI(c,t,4)= pow(C_VOLUME(c,t),0.66)*3;

if (C_UDMI(c,t,1)>40)
{
C_UDSI(c,t,1)=P_sat/ P_cell;

C_UDMI(c,t,2)=NV_MAG(C_UDSI_G(c,t,1));

C_UDMI(c,t,0)=D*P_cell/(R*T_cell)* C_UDMI(c,t,2)*C_UDMI(c,t,4);
C_UDMI(c,t,5)=D*P_cell/(R*T_cell)* C_UDMI(c,t,2);
}
else
{C_UDMI(c,t,0)=0;}
}
end_c_loop(c,t)




}
}

DEFINE_MASS_TRANSFER(mass_transfer1, c, t, from_phase_index, from_species_index, to_phase_index, to_species_index)
{


float m_lg, T_cell, P_cell, P_sat,Powsat;
float NV_VEC(G);
float X_W, Y_W, Y_A;
float cur_ts;
Thread *w_liq, *gas_mix, *w_gas;
face_t f;
Domain *mix_domain, *pdomain;
int i, pdomain_index;
float area[ND_ND], A, ad, theta, cotan, len;

/******** Define variables *********/
mix_domain = Get_Domain(1);
/* pdomain = DOMAIN_SUB_DOMAIN(mixture_domain,2); */ /* For gas domain */
pdomain_index = 0;
pdomain = DOMAIN_SUB_DOMAIN(mix_domain,pdomain_index);

w_liq = THREAD_SUB_THREAD(t, from_phase_index);
gas_mix = THREAD_SUB_THREAD(t, to_phase_index);
w_gas = THREAD_SUB_THREAD(t, to_species_index);

T_cell = C_T(c,t); /*cell mixture temperature*/
P_cell = C_P(c,t); /*cell mixture pressure*/
m_lg = ABS(C_UDMI(c,t,0));
C_UDMI(c,t,3)=m_lg;
return (m_lg); /* return value of mass transfer rate */
}

Last edited by fard734; February 22, 2022 at 03:34.
fard734 is offline   Reply With Quote

Old   February 22, 2022, 20:43
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
it should work in parallel either.

check again if you've allocated udmi and udsi memories in fluent GUI
you may try to compile udf instead of interpret it.
fard734 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
does Hyperthreading affect the application of UDF? SJSW Fluent UDF and Scheme Programming 11 October 10, 2018 22:28
Debug mode with UDF ?? Thierry FLUENT 1 October 9, 2018 21:57
Error code: 126 when loading parallel UDF Coop Fluent UDF and Scheme Programming 0 July 13, 2018 08:33
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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