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

Problem of C_VOF_G in source term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2016, 09:11
Default Problem of C_VOF_G in source term
  #1
New Member
 
Howard Lu
Join Date: Mar 2016
Posts: 3
Rep Power: 10
Howard818 is on a distinguished road
Hi Friends,

I want to use volume fraction gradient in define_source. but I get an error "Error: received a fatal signal (Segmentation fault)".

Could anyone help me resolve this problem?

Thank you.




////////////////////////////////////////////////////////////////
#include "udf.h"


DEFINE_EXECUTE_AT_END(calculate_value)

{ Thread *t;
Thread **pt;
cell_t c;
Domain *domain = Get_Domain(1);
real n1, n2, n3, n4;

mp_thread_loop_c (t,domain,pt)

{

begin_c_loop(c, t)

{

n1 = C_VOF_G (c, pt[0])[0];

n2 = C_VOF_G (c, pt[0])[1];

n3 = C_VOF_G (c, pt[1])[0];

n4 = C_VOF_G (c, pt[1])[1];

C_UDMI(c, t, 0) = n1;

C_UDMI(c, t, 1) = n2;

C_UDMI(c, t, 2) = n3;

C_UDMI(c, t, 3) = n4;

}end_c_loop(c, t)

} }


DEFINE_SOURCE(source_wx, cell, thread_l, dS, eqn)
{

real U_Dx_L, U_Dx_G;
real aa, bb, source;
Thread *mix_thread, *thread_g;

mix_thread=THREAD_SUPER_THREAD(thread_l);
thread_g=THREAD_SUB_THREAD(mix_thread, 0);

aa=C_UDMI(cell, thread_l, 1);

bb=C_UDMI(cell, thread_l, 0);


U_Dx_L=C_U(cell,thread_l)*aa/C_VOF(cell, thread_l);

U_Dx_G=C_U(cell,thread_g)*bb/C_VOF(cell,thread_g);

source=U_Dx_L+U_Dx_G;

dS[eqn]=0.0;
return source;
}
Howard818 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
Problem of SOURCE term gradient in UDS wind Fluent UDF and Scheme Programming 6 December 1, 2022 14:21
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
Mass source term definition in UDF for an axisymmetric problem adnanakhtar Fluent UDF and Scheme Programming 0 February 19, 2015 18:18
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
[swak4Foam] problem on installing swak4Foam navid2 OpenFOAM Community Contributions 2 May 30, 2012 04:32


All times are GMT -4. The time now is 08:52.