|
[Sponsors] |
March 15, 2016, 04:16 |
udf for volume fraction and temperature
|
#1 |
New Member
YUPeng
Join Date: Mar 2016
Posts: 2
Rep Power: 0 |
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); } |
|
March 16, 2016, 16:21 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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...)?
|
|
March 16, 2016, 21:43 |
|
#3 |
New Member
YUPeng
Join Date: Mar 2016
Posts: 2
Rep Power: 0 |
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.
|
|
Tags |
udf c_vof |
|
|
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 |