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

segmentation fault

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By MayTheFlowBeWithYou
  • 1 Post By KaLium
  • 1 Post By MayTheFlowBeWithYou
  • 1 Post By MayTheFlowBeWithYou

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2017, 12:21
Exclamation segmentation fault
  #1
New Member
 
maryam
Join Date: Jul 2017
Posts: 10
Rep Power: 9
maryam74121 is on a distinguished road
hi everybody
im using udf in simulation and i wrote it from help examples bud when i want to initilize or calculate my projet i get this error
chip-exec: unsteady_velocity: wrong return type: float udf function expected
Error: received a fatal signal (Segmentation fault).

Error: received a fatal signal (Segmentation fault).
Error Object: #f
could you please help me?
this is my udf
#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if (t<10)
F_PROFILE(f, thread, position) = 50*t;
else
F_PROFILE(f, thread, position) = 500;
}
end_f_loop(f, thread)
}
maryam74121 is offline   Reply With Quote

Old   July 31, 2017, 10:53
Default
  #2
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9
MayTheFlowBeWithYou is on a distinguished road
#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if (t<10)
{
F_PROFILE(f, thread, position) = 50*t;
}
else
{
F_PROFILE(f, thread, position) = 500;
}
}
end_f_loop(f, thread)
}
maryam74121 likes this.
MayTheFlowBeWithYou is offline   Reply With Quote

Old   August 1, 2017, 01:11
Default
  #3
New Member
 
maryam
Join Date: Jul 2017
Posts: 10
Rep Power: 9
maryam74121 is on a distinguished road
Quote:
Originally Posted by MayTheFlowBeWithYou View Post
#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if (t<10)
{
F_PROFILE(f, thread, position) = 50*t;
}
else
{
F_PROFILE(f, thread, position) = 500;
}
}
end_f_loop(f, thread)
}
Thank you I've done this before unfortunately it doesn't work
maryam74121 is offline   Reply With Quote

Old   August 2, 2017, 05:01
Default
  #4
Senior Member
 
KaLium's Avatar
 
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9
KaLium is on a distinguished road
what happens if you use this?

Code:
 
{
F_PROFILE(f, thread, position) = 50.0*t;
}
else
{
F_PROFILE(f, thread, position) = 500.0;
}
maryam74121 likes this.
KaLium is offline   Reply With Quote

Old   August 2, 2017, 06:50
Default
  #5
New Member
 
maryam
Join Date: Jul 2017
Posts: 10
Rep Power: 9
maryam74121 is on a distinguished road
it still has this error kalium
Error: received a fatal signal (Segmentation fault).
Error Object: #f
maryam74121 is offline   Reply With Quote

Old   August 2, 2017, 07:52
Default
  #6
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9
MayTheFlowBeWithYou is on a distinguished road
but is the "chip-exec: unsteady_velocity: wrong return type: float udf function expected" part still there?
maryam74121 likes this.
MayTheFlowBeWithYou is offline   Reply With Quote

Old   August 3, 2017, 02:57
Default
  #7
New Member
 
maryam
Join Date: Jul 2017
Posts: 10
Rep Power: 9
maryam74121 is on a distinguished road
No it doesn't have that error thank you😊but
it still has this error
Error: received a fatal signal (Segmentation fault).
Error Object: #f
maryam74121 is offline   Reply With Quote

Old   August 3, 2017, 04:42
Default
  #8
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9
MayTheFlowBeWithYou is on a distinguished road
What if, instead of

real t = CURRENT_TIME;

you put

real t = 1;

Does that still give you still give you the errors?? Basically I can only recommend commenting parts of the code out until you find exactly which part causes the error. The "segmentation error" is a very ambiguous error unfortunately.
maryam74121 likes this.
MayTheFlowBeWithYou is offline   Reply With Quote

Old   August 3, 2017, 05:50
Default
  #9
New Member
 
maryam
Join Date: Jul 2017
Posts: 10
Rep Power: 9
maryam74121 is on a distinguished road
i changed it to real t =1 but still have segmentation fault
Updating solution at time level N...chip-exec: unsteady_velocity: wrong return type: float udf function expected
Error: received a fatal signal (Segmentation fault).
maryam74121 is offline   Reply With Quote

Old   August 3, 2017, 07:27
Default
  #10
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9
MayTheFlowBeWithYou is on a distinguished road
Oh sorry, I meant 1.0 to keep it as a float. But it probably wont matter that much. Maybe do something like:


#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real time;
begin_f_loop(f, thread)
{
time=1.0;
if (t<10.0)
{
F_PROFILE(f, thread, position) = 50.0*t;
}
else
{
F_PROFILE(f, thread, position) = 500.0;
}
}
end_f_loop(f, thread)
}

If this works, you could change:

time=1.0;

to

time=CURRENT_TIME;

Other than that I have ran out of ideas, I have used F_PROFILE many times and there is nothing wrong with the way you're using that.
MayTheFlowBeWithYou is offline   Reply With Quote

Old   August 5, 2017, 16:16
Default
  #11
New Member
 
maryam
Join Date: Jul 2017
Posts: 10
Rep Power: 9
maryam74121 is on a distinguished road
it doesnt work
thank you
best wishes
maryam74121 is offline   Reply With Quote

Old   July 13, 2018, 14:53
Default Segmentation error
  #12
New Member
 
sadik
Join Date: Feb 2018
Posts: 7
Rep Power: 8
sumagaji is on a distinguished road
Hello every one,
I am Ansys Fluent to simulate heat flux on the cylindrical pipe and I use the following codes but after a successful interpretation I calculate but have this error.
chip-exec: heat flux wrong return type: void udf function expected
error: received a fatal (segmentation fault).
error object: # f
anticipate your kind help.
The codes are:
#include "udf.h"
#include "sg.h"
DEFINE_ON_DEMAND(copy_uds_to_udm)
{
Domain*d=Get_Domain(1);
Thread*t;
cell_t c;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=C_UDSI(c,t,0);
}
end_c_loop(c,t)
}
return;
}
DEFINE_SOURCE(heat_flux, c, t, dS, eqn)

{

real source;

dS[eqn] = 0.0;

source = C_UDMI(c,t,0);

return source;

}

please can someone help me
sumagaji is offline   Reply With Quote

Old   July 16, 2018, 21:37
Default
  #13
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
what a re you trying to do?
what do these lines mean?
Code:
C_UDMI(c,t,0)=C_UDSI(c,t,0);
source=C_UDMI(c,t,0);
Here source is not defined in UDF (may be you use patch tool.... may be,but), because UDMI_0 is not defined yet.
If source is not define, than the scalar is not define - > UDSI_0 is not defined.
So you got segmentation error, which means some variable is not defined.

best regards
AlexanderZ is offline   Reply With Quote

Old   July 18, 2018, 00:29
Default Segmentation error
  #14
New Member
 
sadik
Join Date: Feb 2018
Posts: 7
Rep Power: 8
sumagaji is on a distinguished road
Thank you AlexanderZ for the response
Quote:
Originally Posted by AlexanderZ View Post
what a re you trying to do?
I have multiple nonuniform data points in XYZ and want to hook the data on surfaces body.

Quote:
what do these lines mean?
Code:
C_UDMI(c,t,0)=C_UDSI(c,t,0);
source=C_UDMI(c,t,0);
I already interpolated the nonuniform data to UDS_0 after enabling it before interpolate. The first line is to store the data to UDM_0 from UDS_0. what i found that the data will not be stored to UDM_0 after interpret UDF unless i execute the UDF.
As for the second line is to hook the stored values from Memory to solid cell zone.

Quote:
Here source is not defined in UDF (may be you use patch tool.... may be,but), because UDMI_0 is not defined yet.
If source is not define, than the scalar is not define - > UDSI_0 is not defined.
How should i define the source, UDMI_0 and UDSI_0 ?
sumagaji is offline   Reply With Quote

Reply

Tags
ansys, error, fluent, segmentaion fault, udf


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
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 21:59
Segmentation fault in SU2 V5.0 ygd SU2 2 March 1, 2017 04:38
Segmentation fault when running in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 8, 2015 08:12
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example sudo OpenFOAM Running, Solving & CFD 3 April 2, 2013 17:27
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 15:06


All times are GMT -4. The time now is 22:05.