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

Source term for Momentum giving segementation fault

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tushar_Telmasre

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2017, 06:56
Unhappy Source term for Momentum giving segementation fault
  #1
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
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

DEFINE_SOURCE(x_momentum_source,c,t,dS,eqn)
{
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

DEFINE_SOURCE(y_momentum_source,c,t,dS,eqn)
{
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?
hooman.esl likes this.
Tushar_Telmasre is offline   Reply With Quote

Old   October 20, 2017, 08:37
Default
  #2
New Member
 
Hooman
Join Date: Jan 2016
Posts: 19
Rep Power: 10
hooman.esl is on a distinguished road
Did you solve your problem?
I have the same error. if it has solved please tell me.
thanks
hooman.esl 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
Source Term due to evaporation in energy transport equation styleworker OpenFOAM Programming & Development 3 September 7, 2022 03:09
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Community Contributions 27 April 16, 2014 15:14
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 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 06:05.