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

I know WHERE but not WHY- segmentation fault in an interpreted UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 28, 2015, 21:53
Default I know WHERE but not WHY- segmentation fault in an interpreted UDF
  #1
New Member
 
Achint Sanghi
Join Date: Mar 2015
Posts: 3
Rep Power: 2
achint is on a distinguished road
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)
        }
      }
}
achint is offline   Reply With Quote

Reply

Tags
drying, segmentation fault, udf

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 15: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
Paraview - Segmentation fault grjmell OpenFOAM 1 March 23, 2011 17:41
KIVA and Segmentation Fault Felix Main CFD Forum 2 January 18, 2006 02:24


All times are GMT -4. The time now is 04:34.