|
[Sponsors] | |||||
I know WHERE but not WHY- segmentation fault in an interpreted UDF |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Achint Sanghi
Join Date: Mar 2015
Posts: 3
Rep Power: 12 ![]() |
I am interpreting an ADJUST macro as well as two Source macros. I have identified that I get segmentation errors while using C_UDMI and C_UDSI (though they are both already defined in the case using GUI). For example, in lines 17 and 18 of the below code. Can someone ID the problem?
Code:
DEFINE_ADJUST (moisture_update, d)
{
real n_ts, m, time, dmdt, Tabs, RH, mr, t_hour, Psat, time_step, k, n, power, a, b, EMC, Mnew, w, Pvs, E_evp;
Thread *t;
cell_t c;
n_ts = RP_Get_Integer ("time-step");
time_step=RP_Get_Real("physical-time-step");
time=RP_Get_Real("flow-time");
t_hour=time/3600;
if(last_timestep !=n_ts)
{
last_timestep=n_ts;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
m=C_UDMI(c,t,0);
w=C_UDSI(c,t,0);
Tabs=C_T(c,t);
Pvs=0.1 * exp(27.014-(6887/Tabs)-(5.31*log(Tabs/273.16)));
RH=(101.3 * w)/(Pvs*(0.62189 + w));
if(RH>0.99)
{RH=0.99;}
C_UDMI(c,t,1)=RH;
dmdt=100.0;
Mnew=(time_step*dmdt)+m;
C_UDMI(c,t,0)=Mnew;
C_UDMI(c,t,2)=dmdt;
}
end_c_loop(c,t)
}
}
}
|
|
|
|
|
|
![]() |
| Tags |
| drying, segmentation fault, udf |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [OpenFOAM] Paraview - Segmentation fault | grjmell | ParaView | 5 | January 9, 2024 14:14 |
| segmentation fault when installing OF-2.1.1 on a cluster | Rebecca513 | OpenFOAM Installation | 9 | July 31, 2012 16:06 |
| gmshToFoam teminates on Segmentation fault | XXLRay | OpenFOAM | 9 | December 7, 2011 03:10 |
| Segmentation Fault | Shawn_A | OpenFOAM Running, Solving & CFD | 6 | October 31, 2011 15:38 |
| KIVA and Segmentation Fault | Felix | Main CFD Forum | 2 | January 18, 2006 02:24 |