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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 26, 2017, 15:38
Unhappy Segmentation fault
  #1
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
I wrote this simple UDF for defining separate solid and liquid properties.
#include "udf.h"

DEFINE_PROPERTY(mass_wtd_k,c,t)
{
real sum = 0; int i;

real solid;
real liquid;

solid = 59;
liquid = 32;
sum = C_LIQF(c,t)*liquid+(1-C_LIQF(c,t))*solid;

return sum;
}

#include "udf.h"

DEFINE_PROPERTY(mass_wtd_cp,c,t)
{
real cp = 0; int i;

real solid;
real liquid;

solid = 200;
liquid = 231;
cp = C_LIQF(c,t)*liquid+(1-C_LIQF(c,t))*solid;

return cp;
}


It is getting interpreted. I hooked it to Conductivity and Specific heat. It is getting hooked also. But i am getting a segmentation fault while initialization.

What could be the reason.

Segmentation faults arise when solver tries to access an undefined memory location. but I cant decode which undefined location i am trying while initialization.

Please help.
Tushar_Telmasre is offline   Reply With Quote

Old   May 29, 2017, 16:22
Default
  #2
New Member
 
Denir Paganini Nascimento
Join Date: Dec 2016
Posts: 4
Rep Power: 10
dpnascimento is on a distinguished road
Are you using interpreted or compiled UDF´s?
dpnascimento is offline   Reply With Quote

Old   June 1, 2017, 10:46
Default
  #3
Senior Member
 
KaLium's Avatar
 
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9
KaLium is on a distinguished road
#include "udf.h" is mentioned twice. Could that cause some problems?

You can also remove "int i"
KaLium is offline   Reply With Quote

Old   June 1, 2017, 17:13
Default
  #4
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
i am using interpreted udf.
Tushar_Telmasre is offline   Reply With Quote

Old   June 1, 2017, 17:19
Default
  #5
New Member
 
Denir Paganini Nascimento
Join Date: Dec 2016
Posts: 4
Rep Power: 10
dpnascimento is on a distinguished road
I believe that the problem is that UDF´s for Cp can only be compiled. As far as for FLUENT 13.0
Check the manual:

Important:
If you would like to use a UDF to define specific heat properties, you must use the DEFINE_SPECIFIC_HEAT, as described in DEFINE_SPECIFIC_HEAT.

2.3.25.1.*Description
The DEFINE_SPECIFIC_HEAT macro can be used to define temperature dependent functions for specific heat and sensible enthalpy for fluid, solid and mixture materials (this does not include DPM particles). These functions must be defined in a consistent manner, that is, the enthalpy function should be the temperature integral of the specific heat function.

Important:
This option is not available with the premixed, non-premixed and partially premixed models, and should be used as a compiled UDF only.
dpnascimento 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
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 22:59
Segmentation fault in SU2 V5.0 ygd SU2 2 March 1, 2017 05:38
Segmentation fault when running in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 8, 2015 09:12
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example sudo OpenFOAM Running, Solving & CFD 3 April 2, 2013 18:27
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 16:06


All times are GMT -4. The time now is 17:57.