CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF segmentation violation error

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

LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2011, 03:48
Default UDF segmentation violation error
New Member
Enrico Bezzi
Join Date: Aug 2011
Posts: 9
Rep Power: 14
be89 is on a distinguished road
I wrote the following UDF to define the condensation in a multiphase model from moist air water vapor to liquid water:

#include "udf.h"
#include "mem.h"
#include "math.h"
#include "sg.h"
#include "prop.h" /* for function: Saturation_Pressure() (of water) */
real H2O_Saturation_Pressure(real T)
real ratio, aTmTp;
aTmTp = .01 * (T - 338.15);
ratio = (647.286/T - 1.) *
(-7.419242 + aTmTp*(.29721 +
aTmTp*(-.1155286 +
aTmTp*(8.685635e-3 +
aTmTp*(1.094098e-3 +
aTmTp*(-4.39993e-3 +
aTmTp*(2.520658e-3 -
return (22.089e6 * exp(MIN(ratio,35.)));

Domain *d;
DEFINE_MASS_TRANSFER(vap_condensation,c,t,from_pha se_index,from_species_index,to_phase_index,to_spec ies_index)
real m_lg;
int i;
Material *m=THREAD_MATERIAL(t), *sp;
real x_h2o, x_sat, w_sat; /* w=mv/ma; x=mv/(ma+mv) */
#define p 101325
if (0 == strcmp(MIXTURE_SPECIE_NAME(m,i),"h2o") || (0 == strcmp(MIXTURE_SPECIE_NAME(m,i),"H2O")))
x_h2o = C_YI(c,t,i);

m_lg = 0.;

if (x_h2o > x_sat)
return m_lg;


Then I compiled it in Fluent receiving no error, but I can't initialize the calculation because Fluent gives a "segmentation violation error" when trying to do it.
Can anyone help me, please?
be89 is offline   Reply With Quote

Old   December 21, 2012, 03:07
Join Date: Nov 2012
Posts: 33
Rep Power: 13
IndrajitW is on a distinguished road
Hi Enrico Bezzi,
I am facing the same problem for a different case.When I compile there isn't any error however when I try to initialise it gives me segmentation violation error.
Since it has been an year, did you solve the problem??? What was going wrong?
IndrajitW is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 11:39
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 17:43
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08

All times are GMT -4. The time now is 22:49.