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

UDF :: trying to use parcel->user

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2016, 13:09
Default UDF :: trying to use parcel->user
  #1
New Member
 
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 10
kabil is on a distinguished road
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 05:17.
kabil is offline   Reply With Quote

Old   August 22, 2016, 18:39
Default
  #2
New Member
 
SauravMitra's Avatar
 
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10
SauravMitra is on a distinguished road
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,
__________________
Saurav Mitra
Senior Research Engineer
CONVERGECFD
SauravMitra is offline   Reply With Quote

Old   September 2, 2016, 09:46
Default
  #3
New Member
 
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 10
kabil is on a distinguished road
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]"
kabil is offline   Reply With Quote

Old   September 4, 2016, 20:36
Default
  #4
New Member
 
SauravMitra's Avatar
 
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10
SauravMitra is on a distinguished road
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
__________________
Saurav Mitra
Senior Research Engineer
CONVERGECFD
SauravMitra is offline   Reply With Quote

Old   September 5, 2016, 11:08
Default
  #5
New Member
 
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 10
kabil is on a distinguished road
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.
kabil is offline   Reply With Quote

Old   September 6, 2016, 10:55
Default
  #6
New Member
 
SauravMitra's Avatar
 
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10
SauravMitra is on a distinguished road
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,
__________________
Saurav Mitra
Senior Research Engineer
CONVERGECFD
SauravMitra is offline   Reply With Quote

Reply

Tags
converge, udf


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
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
Parallelize UDF? Which kind of UDF? Lilly FLUENT 5 March 25, 2014 02:05
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 09:01
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 15:37.