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 at the end of timestep

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2017, 23:52
Default Segmentation fault at the end of timestep
  #1
New Member
 
Mat
Join Date: Jan 2017
Posts: 23
Rep Power: 9
mataus is on a distinguished road
Hai..
I am trying to add an energy source term to a fluid flow problem.I wrote a UDF and interpret.
But I am getting a segmentation fault at the end of the first-time step.
I allocated 3 memory locations.
I believe the error occurs because of the error in executing at the end macro region.

Please help me


DEFINE_ON_DEMAND(solid)
{
Domain *d=Get_Domain(1);
int zone_id=11;
Thread *t = Lookup_Thread(d,zone_id);
cell_t c;
begin_c_loop(c,t)
{
C_UDMI(c,t,0) = 0.1;
}
end_c_loop(c,t)
}

DEFINE_EXECUTE_AT_END(source_calculation)
{

Domain *d;
Thread *t;
cell_t c;
real dt=CURRENT_TIMESTEP;
int zone_id=11;


thread_loop_c(t,d)
{
begin_c_loop(c,t)

{

C_UDMI(c,t,1)=C_T(c,t)/some constant;

C_UDMI(c,t,2)=0.01;

C_UDMI(c,t,0)=C_UDMI(c,t,0)+(C_UDMI(c,t,2)*dt);
}
end_c_loop(c,t)
}
}

DEFINE_SOURCE(energy, c, t, dS, eqn)
{
real x[ND_ND];
real source;
source = some constant* C_UDMI(c,t,2);

dS[eqn] = 0;
return source;
}
mataus is offline   Reply With Quote

Old   July 27, 2017, 10:51
Default
  #2
sfn
New Member
 
Alexander
Join Date: Dec 2016
Posts: 24
Rep Power: 9
sfn is on a distinguished road
Quote:
some constant
are you sure about that? non declared variable with a space
sfn 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
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
Simulation of a single bubble with a VOF-method Suzzn CFX 21 January 29, 2018 01:58
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00


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