|
[Sponsors] |
August 21, 2016, 14:09 |
UDF :: trying to use parcel->user
|
#1 |
New Member
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 11 |
Hi all,
While writing a udf i found that there is a variable "user" used in user_post.c . Is it possible to be used in other udfs?? since it keeps giving me segmentation fault just by assigning a value to it like: "parcel->user[0] = 1;" even though i am writing in a loop that loops over parcels where other variables are present as "parcel->temp". Last edited by kabil; August 22, 2016 at 06:17. |
|
August 22, 2016, 19:39 |
|
#2 |
New Member
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10 |
Hi kabil,
Make sure you have all the header files and the user_dynamic_routines.c in the udf directory. The "user" variable in user_post.c is linked to only user defined parcel properties/entities. It will not work with any cell-related quantities. Keep in mind the array size of "user" needs to be specified via user_num_parcel variable in udf.in. So, if you want to use 2 elements of "user" as in user[0] and user[1], set user_num_parcel to 2. Also have them included in post.in. Above, should get help you to get past the hurdle. Keep us posted, if it doesnt. Best, |
|
September 2, 2016, 10:46 |
|
#3 |
New Member
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 11 |
Thanks Saurav for your response,
Now the udf is working fine for single parcel and i tested it with 1000 parcels and worked. The issue now is when testing it with spray A it crashes due to segmentation fault. I suspect parcel->user or my case setup,, so just to not waste time revisiting the code Is there any limitation on "parcel->user" size as i may use up to "parcel->user[800]" |
|
September 4, 2016, 21:36 |
|
#4 |
New Member
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10 |
Hi kabil,
As long as you set the dimensions of parcel-user[] consistent via user_num_parcelin udf.in, it should work out. If you can let us know, what are you trying to calculate via the UDF in Spray A simulations, that might help. Thanks |
|
September 5, 2016, 12:08 |
|
#5 |
New Member
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 11 |
I am just trying to make sure that the "user_spray_evap" udf ,implementing effective diffusivity and effective thermal conductivity, is working by comparing the jet penetration length.
Spray A case runs fine with original Converge code with no UDFs. Now the UDF is working fine without amr and embedding but once i turn them on the case crashes after a couple of cycles giving me this error: ncyc= 58, time= 3.393970393e-05, dt= 7.120605223e-07, time-step limit =dt_spray Something is wrong in function get_temp_from_table_massfrac: upper_energy_value must be greater than lower_energy_value! upper_energy_value is nan, and lower_energy_value is nan . ------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code.. Per user-direction, the job has been aborted. ------------------------------------------------------- -------------------------------------------------------------------------- mpirun detected that one or more processes exited with non-zero status, thus causing the job to be terminated. The first process to do so was: Process name: [[57443,1],2] Exit code: 1 -------------------------------------------------------------------------- Any suggestions would be of great help since i tried to refine the mesh but also crashed. |
|
September 6, 2016, 11:55 |
|
#6 |
New Member
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10 |
Hi kabil,
Check for the numerical bounds you are having for diffusivity and thermal conductivity separately. Are they reasonable in the given temperature range. You should be able to plot those values separately. Double-check them with the lookup table in liquid.dat. It looks like you are getting some unreasonable values which is violating energy conservation, leading to errors and crash. We are discussing this on a similar thread : http://www.cfd-online.com/Forums/con...lculation.html Best, |
|
Tags |
converge, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Parallelize UDF? Which kind of UDF? | Lilly | FLUENT | 5 | March 25, 2014 03:05 |
Help! Delete the UDM codes in the UDF | Messi | Fluent UDF and Scheme Programming | 2 | January 28, 2014 10:01 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |