|
[Sponsors] |
July 26, 2017, 23:52 |
Segmentation fault at the end of timestep
|
#1 |
New Member
Mat
Join Date: Jan 2017
Posts: 23
Rep Power: 9 |
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; } |
|
July 27, 2017, 10:51 |
|
#2 | |
New Member
Alexander
Join Date: Dec 2016
Posts: 24
Rep Power: 9 |
Quote:
|
||
|
|
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 |