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

udf for volume fraction and temperature

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 15, 2016, 04:16
Smile udf for volume fraction and temperature
  #1
New Member
 
YUPeng
Join Date: Mar 2016
Posts: 2
Rep Power: 0
YUPeng is on a distinguished road
Hello
I want an UDF that computes volume fraction and temperature of one phase(the primary phase or the second phase) in two phase flow at each cell as fluid flows in order to calculate a coefficient to adjust the calculation at the end of iteration.Part of the code is shown as follows.It compiles well,but when I exectue it for the calculation,the error(received a fatal signal(Segmentation fault)) occours.

I would be appreciated if you could help me on this

Thankyou very much

Part of the code is shown as follows:

DEFINE_EXECUTE_AT_END(d_sum)
{
real d;
real d_sum=0;

cell_t cell;
Thread **pt;
Thread *cell_threads;
Domain *mixture_domain;
mixture_domain=Get_Domain(1);

mp_thread_loop_c(cell_threads,mixture_domain,pt)
{
begin_c_loop(cell,pt[0])
{
d=C_VOF(cell,pt[0])*C_R(cell,pt[0]);
d_sum+=d;
C_UDMI(cell,pt[0],0)=d_sum;
}
end_c_loop(cell,pt[0])
}
printf("sum:%g\n",d_sum);
}
YUPeng is offline   Reply With Quote

Old   March 16, 2016, 16:21
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You're using user-defined memory (with C_UDMI to store 'd_sum'), have you allocated memory by enabling at least one memory locations (Define > User-Defined > Memory...)?
`e` is offline   Reply With Quote

Old   March 16, 2016, 21:43
Smile
  #3
New Member
 
YUPeng
Join Date: Mar 2016
Posts: 2
Rep Power: 0
YUPeng is on a distinguished road
Thank you for your reply,the user-defined memory has been allocated,but once I used C_VOF() in DEFINE_EXECUTE_AT_END(d_sum) to computes volume fraction, the error(received a fatal signal(Segmentation fault)) occoured.So I calculate it in the Source term, and the code runs well. I have read the POST(http://www.cfd-online.com/Forums/flu...-fraction.html), the code which is similar to mine can run well.Now Iwant to know what went wrong,please give me some advice.
YUPeng is offline   Reply With Quote

Reply

Tags
udf c_vof


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
Error message: Insufficient Catalogue Size Paresh Jain CFX 33 August 16, 2024 06:09
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 10:21
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
UDF for mass fraction (spilled organic liquid) Klemens Schatka FLUENT 4 July 28, 2009 02:27


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