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

999999: mpt_accept: error: accept failed

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2020, 03:49
Default 999999: mpt_accept: error: accept failed
  #1
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 164
Rep Power: 10
arunraj is on a distinguished road
Hello everyone,

I am receiving the following error when I press the initialize button. I have UDM in my code. I have allocated 3 User defined memory locations and 0 User defined node memory locations.

999999: mpt_accept: error: accept failed: No such file or directory
================================================== ============================

999999: mpt_accept: error: accept failed
: No such file or directory
Node 3: Process 21136: Received signal SIGSEGV.
999999: mpt_accept: error: accept failed

: ================================================== ============================
No such file or directory

999999: mpt_accept: error: accept failed: No such file or directory



999999: mpt_accept: error: accept failed: No error
Node 4: Process 26964: Received signal SIGSEGV.


999999: mpt_accept: error: accept failed============================================ ==================================: No error


999999: mpt_accept: error: accept failed: No error



#include "udf.h"
#include "math.h"
#include "sg_udms.h"
#include "sg.h"
#include "stdio.h"
#include "mem.h"
#include "dpm.h"
#include "surf.h"

Domain *d;
Thread *t;
Thread *tve;
Thread *tle;
Thread *t0;
Thread *t0_s;
face_t fve;
face_t fle;
cell_t c;
cell_t c0;
cell_t c0_s;
real temp_cell_ve, press_cell_ve, rho_cell_ve;
real rho_cell_le;
real hfg = 2360000.0;
real R = 8314.0;
real M = 18.015;
real RR;
real s = 0.03;
real po = 101325.0;
real to = 373.0;
real p_op = 13450.0;
real a1, a2, a3;
real mdot;
real pi;
real rho_cell_le;
real rho_cell_ve;
real vel_ve, vel_le;

DEFINE_INIT(my_init_udf,d)
{
#if !RP_HOST
{
begin_c_loop(c0,t0)
{
C_UDMI(c0,t0,0) = 0.0;
C_UDMI(c0,t0,1) = 0.0;
C_UDMI(c0,t0,2) = 0.0;
}
end_c_loop(c0, t0);
}
# endif
}


DEFINE_ADJUST(interfacesimple, domain)
{
#if !RP_HOST
tve=Lookup_Thread(Get_Domain(1),76); /*velocity inlet ID*/
begin_f_loop(fve, tve)
{
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
temp_cell_ve = C_T(c0,t0);
press_cell_ve = C_P(c0,t0);
rho_cell_ve = C_R(c0,t0);
rho_cell_le = C_R(c0_s,t0_s);
RR = R/M;
pi = po*exp((hfg/RR)*((1/to)-(1/324.7278)));
a1 = (2.0*s)/(2.0-s);
a2 = 1/sqrt(2*M_PI*RR);
a3 = ((p_op+press_cell_ve)/sqrt(temp_cell_ve))-(pi/sqrt(324.7278));
mdot = a1*a2*a3;
C_UDMI(c0,t0,0)=mdot;
C_UDMI(c0,t0,1)=rho_cell_ve;
C_UDMI(c0,t0,2)=rho_cell_le;
vel_ve=C_UDMI(c0,t0,0)/C_UDMI(c0,t0,1);
vel_le=C_UDMI(c0,t0,0)/C_UDMI(c0,t0,2);
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(vaporside_velocity, tve, i)
{
#if !RP_HOST
begin_f_loop(fve, tve)
{
F_PROFILE(fve, tve, i) = -vel_ve;
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(liquidside_velocity, tle, i)
{
#if !RP_HOST
begin_f_loop(fle, tle)
{
F_PROFILE(fle, tle, i) = vel_le;
}
end_f_loop(fle, tle)
#endif
}
arunraj is offline   Reply With Quote

Old   June 27, 2020, 08:27
Default Error in UDF
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,948
Blog Entries: 1
Rep Power: 31
vinerm will become famous soon enough
Remove all the include files, except udf.h. Those are not required for your UDF.

The problem most likely is because you have declared Domain *d. This is in conflict. Remove this.

Declare all variables within their respective DEFINE_ functions, until you need global ones.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 28, 2020, 04:30
Default
  #3
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 164
Rep Power: 10
arunraj is on a distinguished road
Hi vinerm,

Thank you so much for your suggestion.

I have tried as per your instruction but still I am still getting the same error

I followed the following procedure
step1: setup the case
step2: allocate 4 memory locations
step3: initialization.
step4:compile and load UDF.
step5: Function hook ---> Initialization and adjust ---> load
step6: Hook define_profile in velocity and liquid side of the velocity inlet.

I am receiving the error segmentation fault when i press compute.

I tried several other versions too. However, I am receiving the same error

I am not even receiving the message in DEFINE_INIT and DEFINE_ADJUST which I have. Please suggestion modifications in UDF id needed.

#include "udf.h"

Thread *t0;
Thread *tve;
Thread *tle;
cell_t c0;
face_t fve;
face_t fle;
real vel_ve, vel_le;

DEFINE_INIT(my_init_udf,d)
{
#if !RP_HOST
{
begin_c_loop(c0,t0)
{
C_UDMI(c0,t0,0) = 0.0;
C_UDMI(c0,t0,1) = 0.0;
C_UDMI(c0,t0,2) = 0.0;
Message("first udmi is %g\n", C_UDMI(c0,t0,0));
Message("secod udmi is %g\n", C_UDMI(c0,t0,1));
Message("thirs udmi is %g\n", C_UDMI(c0,t0,2));
}
end_c_loop(c0, t0);
}
# endif
}

DEFINE_ADJUST(hp, domain)
{
#if !RP_HOST
Thread *t0_s;
cell_t c0_s;
real temp_cell_ve, press_cell_ve, rho_cell_ve;
real rho_cell_le;
real hfg = 2360000.0;
real R = 8314.0;
real M = 18.015;
real RR;
real s = 0.03;
real po = 101325.0;
real to = 373.0;
real p_op = 13450.0;
real a1, a2, a3;
real mdot;
real pi;

tve=Lookup_Thread(Get_Domain(1),20); /*velocity inlet ID*/
begin_f_loop(fve, tve)
{
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
temp_cell_ve = C_T(c0,t0);
press_cell_ve = C_P(c0,t0);
rho_cell_ve = C_R(c0,t0);
rho_cell_le = C_R(c0_s,t0_s);
RR = R/M;
pi = po*exp((hfg/RR)*((1/to)-(1/324.7278)));
a1 = (2.0*s)/(2.0-s);
a2 = 1/sqrt(2*M_PI*RR);
a3 = ((p_op+press_cell_ve)/sqrt(temp_cell_ve))-(pi/sqrt(324.7278));
mdot = a1*a2*a3;
C_UDMI(c0,t0,0)=mdot;
C_UDMI(c0,t0,1)=rho_cell_ve;
C_UDMI(c0,t0,2)=rho_cell_le;
vel_ve=C_UDMI(c0,t0,0)/C_UDMI(c0,t0,1);
vel_le=C_UDMI(c0,t0,0)/C_UDMI(c0,t0,2);
Message("vapor vel is %g\n", vel_ve);
Message("liquid vel is %g\n", vel_le);
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(vaporside_velocity, tve, i)
{
#if !RP_HOST
tve=Lookup_Thread(Get_Domain(1),20); /*velocity inlet ID*/
begin_f_loop(fve, tve)
{
F_PROFILE(fve, tve, i) = -vel_ve;
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(liquidside_velocity, tle, i)
{
#if !RP_HOST
begin_f_loop(fle, tle)
tle=Lookup_Thread(Get_Domain(1),21);
{
F_PROFILE(fle, tle, i) = vel_le;
}
end_f_loop(fle, tle)
#endif
}
arunraj is offline   Reply With Quote

Old   June 28, 2020, 05:03
Default
  #4
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 164
Rep Power: 10
arunraj is on a distinguished road
Following your previous answer on the below post. I used the below UDF, I am receving the message for vel_ve. However, the problem is in the calculation of vel_le. Could you please suggest some modifications?

Calculating flow variables only once in begin_f_loop()


#include "udf.h"

Thread *tve;
Thread *tle;
Thread *t0;
Thread *t0_s;
cell_t c0;
cell_t c0_s;
face_t fve;
face_t fle;
real vel_ve, vel_le;


DEFINE_INIT(my_init_udf,d)
{
#if !RP_HOST
{
begin_c_loop(c0,t0)
{
C_UDMI(c0,t0,0) = 0.0;
Message("first udmi is %g\n", C_UDMI(c0,t0,0));
}
end_c_loop(c0, t0);
}

{
begin_c_loop(c0_s,t0_s)
{
C_UDMI(c0_s,t0_s,1) = 0.0;
Message("first udmi is %g\n", C_UDMI(c0_s,t0_s,1));
}
end_c_loop(c0_s, t0_s);
}
# endif
}

DEFINE_ADJUST(heatpipe, domain)
{
#if !RP_HOST
tve=Lookup_Thread(Get_Domain(1),20);
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
real temp_cell_ve, press_cell_ve, rho_cell_ve;
real rho_cell_le;
real hfg = 2360000.0;
real R = 8314.0;
real M = 18.015;
real RR;
real s = 0.03;
real po = 101325.0;
real to = 373.0;
real p_op = 13450.0;
real a1, a2, a3;
real mdot;
real pi;

begin_f_loop(fve, tve)
{
temp_cell_ve = C_T(c0,t0);
press_cell_ve = C_P(c0,t0);
rho_cell_ve = C_R(c0,t0);
rho_cell_le = C_R(c0_s,t0_s);
RR = R/M;
pi = po*exp((hfg/RR)*((1/to)-(1/324.7278)));
a1 = (2.0*s)/(2.0-s);
a2 = 1/sqrt(2*M_PI*RR);
a3 = ((p_op+press_cell_ve)/sqrt(temp_cell_ve))-(pi/sqrt(324.7278));
mdot = a1*a2*a3;
vel_ve=mdot/rho_cell_ve;
vel_le=mdot/rho_cell_le;
C_UDMI(c0,t0,0)=vel_ve;
C_UDMI(c0_s,t0_s,1)=-vel_le;
Message("vel_ve is %g\n", C_UDMI(c0,t0,0));
Message("vel_le is %g\n", C_UDMI(c0_s,t0_s,0));
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(vaporside_velocity, tve, i)
{
#if !RP_HOST
begin_f_loop(fve, tve)
{
tve=Lookup_Thread(Get_Domain(1),20);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
F_PROFILE(fve, tve, i) = C_UDMI(c0,t0,0);
Message("vel_ve profile is %g\n", C_UDMI(c0,t0,0));
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(liquidside_velocity, tle, i)
{
#if !RP_HOST
begin_f_loop(fle, tle)
{
tve=Lookup_Thread(Get_Domain(1),20);
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
F_PROFILE(fle, tle, i) = C_UDMI(c0_s,t0_s,1);
Message("vel_le profile is %g\n", C_UDMI(c0_s,t0_s,1));
}
end_f_loop(fle, tle)
#endif
}
arunraj is offline   Reply With Quote

Old   June 29, 2020, 04:42
Default Corrections to the UDF
  #5
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,948
Blog Entries: 1
Rep Power: 31
vinerm will become famous soon enough
You still have variables outside DEFINE_ functions.

The problem is because fve and fle are not available outside f_loop. So, you need to declare those outside f_loop but use only inside the loop, i.e., any command that use either fve or fle as an argument, must be used inside f_loop.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 29, 2020, 09:00
Default UDF uninitialized local variable
  #6
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 164
Rep Power: 10
arunraj is on a distinguished road
Dear vinerm,

Thank you for making me understand. I am receiving fresh error. I forgot to mention one thing. le- liquid evaporator and ve - vapor evaporator are not walls. They are velocity inlet. So I believe these commands do not work tle=THREAD_SHADOW(tve); fle=F_SHADOW(fve,tve);

Is there a way to call face and thread of one velocity inlet inside another ? They are shadow velocity inlets not wall. Previously, I remember you saying, it can not be done. I have seen people using something like this ff_shadow=ff_Vapour_liquid [iii];

D:\leonard validation\libudfaabvvvbcccddaa\src\pipe.c(19) : warning C4700: uninitialized local variable 'fve' used
D:\leonard validation\libudfaabvvvbcccddaa\src\pipe.c(125) : warning C4700: uninitialized local variable 'fve' used

#include "udf.h"

Thread *tve;
Thread *tle;
Thread *t0;
Thread *t0_s;

DEFINE_INIT(my_init_udf,d)
{
#if !RP_HOST
face_t fve;
face_t fle;
cell_t c0;
cell_t c0_s;
{
begin_c_loop(c0,t0)
{
tve=Lookup_Thread(Get_Domain(1),20);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
C_UDMI(c0,t0,0) = 0.0;
Message("first udmi is %g\n", C_UDMI(c0,t0,0));
}
end_c_loop(c0, t0);
}

{

begin_c_loop(c0_s,t0_s)
{
tve=Lookup_Thread(Get_Domain(1),20);
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
C_UDMI(c0_s,t0_s,1) = 0.0;
Message("first udmi is %g\n", C_UDMI(c0_s,t0_s,1));
}
end_c_loop(c0_s, t0_s);
}
# endif
}

DEFINE_ADJUST(pipe, domain)
{
#if !RP_HOST
face_t fve;
face_t fle;
cell_t c0;
cell_t c0_s;
real temp_cell_ve, press_cell_ve, rho_cell_ve;
real rho_cell_le;
real hfg = 2360000.0;
real R = 8314.0;
real M = 18.015;
real RR;
real s = 0.03;
real po = 101325.0;
real to = 373.0;
real ti = 324.7278;
real p_op = 13450.0;
real a1, a2, a3;
real mdot;
real pi;
real vel_ve, vel_le;

begin_f_loop(fve, tve)
{
tve=Lookup_Thread(Get_Domain(1),20);
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
temp_cell_ve = C_T(c0,t0);
press_cell_ve = C_P(c0,t0);
rho_cell_ve = C_R(c0,t0);
rho_cell_le = C_R(c0_s,t0_s);
RR = R/M;
pi = po*exp((hfg/RR)*((1/to)-(1/ti)));
a1 = (2.0*s)/(2.0-s);
a2 = 1/sqrt(2*M_PI*RR);
a3 = ((p_op+press_cell_ve)/sqrt(temp_cell_ve))-(pi/sqrt(ti));
mdot = a1*a2*a3;
vel_ve=mdot/rho_cell_ve;
vel_le=mdot/rho_cell_le;
C_UDMI(c0,t0,0)=vel_ve;
C_UDMI(c0_s,t0_s,1)=-vel_le;
Message("vel_ve is %g\n", C_UDMI(c0,t0,0));
Message("vel_le is %g\n", C_UDMI(c0_s,t0_s,0));
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(vaporside_velocity, t, i)
{
#if !RP_HOST
face_t fve;
face_t fle;
cell_t c0;
begin_f_loop(fve, tve)
{
tve=Lookup_Thread(Get_Domain(1),20);
c0 = F_C0(fve,tve);
t0 = F_C0_THREAD(fve,tve);
F_PROFILE(fve, tve, i) = C_UDMI(c0,t0,0);
Message("vel_ve profile is %g\n", C_UDMI(c0,t0,0));
}
end_f_loop(fve, tve)
#endif
}

DEFINE_PROFILE(liquidside_velocity, t, i)
{
#if !RP_HOST
face_t fve;
face_t fle;
cell_t c0_s;
begin_f_loop(fle, tle)
{
tve=Lookup_Thread(Get_Domain(1),20);
tle=THREAD_SHADOW(tve);
fle=F_SHADOW(fve,tve);
c0_s = F_C0(fle,tle);
t0_s = F_C0_THREAD(fle,tle);
F_PROFILE(fle, tle, i) = C_UDMI(c0_s,t0_s,1);
Message("vel_le profile is %g\n", C_UDMI(c0_s,t0_s,1));
}
end_f_loop(fle, tle)
#endif
}
arunraj 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
Foam::error::printStack(Foam::Ostream&) with simpleFoam -parallel U.Golling OpenFOAM Running, Solving & CFD 42 May 22, 2020 12:20
Initial conditions for uniform flow andreas OpenFOAM 5 November 16, 2012 15:00
[OpenFOAM] ParaView/Parafoam error when making animation Disco_Caine ParaView 6 September 28, 2010 09:54
user subroutine error CFDUSER CFX 2 December 9, 2006 06:31
user defined function cfduser CFX 0 April 29, 2006 10:58


All times are GMT -4. The time now is 01:23.