CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

Source term for Momentum giving segementation fault

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

LinkBack Thread Tools Display Modes
Old   June 27, 2017, 06:56
Unhappy Source term for Momentum giving segementation fault
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 2
Tushar_Telmasre is on a distinguished road
In my momentum equation owing to density difference i have to write a source term udf. the source term is,

source term= - ρl.(1+∝).u ⃗ .∂fl/∂t

where ∝ = the volume of fraction variable
fl = liquid fraction
ul = Velocity vector
ρl and ρs = liquid and solid density respectively

I did write a udf for it

-----for x-momentum----
#include "udf.h"
#define rho_l 1544.0
#define rho_s 1648.0

real source;
source = -(rho_l*(1+C_VOF(c,t))*C_U(c,t)*((C_LIQF(c,t)-C_LIQF_M1(c,t))/CURRENT_TIMESTEP));
dS[eqn] = 0;
return source;

----for y-momentum-----
#include "udf.h"
#define rho_l 1544.0
#define rho_s 1648.0

real source;
source = -(rho_l*(1+C_VOF(c,t))*C_V(c,t)*((C_LIQF(c,t)-C_LIQF_M1(c,t))/CURRENT_TIMESTEP));
dS[eqn] = 0;
return source;

i hooked it in the cell zone section. i was using the VOF module.
IT is giving me a segmentation fault.
I am not able to understand the mistake here. can anybody help?
Tushar_Telmasre is offline   Reply With Quote


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
Source Term due to evaporation in energy transport equation styleworker OpenFOAM Programming & Development 2 September 3, 2014 21:24
Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Installation 27 April 16, 2014 15:14
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59
Error bulding swak4Foam sfigato OpenFOAM Installation 18 August 22, 2013 12:41
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 03:43

All times are GMT -4. The time now is 13:15.