CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Need help please: Threads and domain multiphase looping (https://www.cfd-online.com/Forums/fluent-udf/97711-need-help-please-threads-domain-multiphase-looping.html)

CFD-student February 23, 2012 03:57

Need help please: Threads and domain multiphase looping
 
Hi!
I am trying to calculate a given function for every face at a given boundary and then store it in the user defined memory. I have a eulerian-eulerian simulation with water and sand. The sand phase is the one which I want to extract variables from such as granular temperature and the calculate a function on a boundary.

The phase ID for the sand phase is 3 and the boundary of intrest has ID 13. Here is a simplified code of what I want to achieve with the exception that I here only try to assign 1 to each boundary face. However this code doesnt work and returns the ACCESS_VIOLATION error message when I try to run it.

Here is the code I have written. Could anyone help me out on this?

#include "udf.h"
#include "mem.h"
#include "surf.h"
#include "metric.h"
DEFINE_ON_DEMAND(erosionrate)
{
int zone_ID=13;
Thread *sandthreadweld;
Domain *sanddomain;
face_t faceidentifier;
sanddomain=Get_Domain(3);
sandthreadweld=Lookup_Thread(sanddomain,zone_ID);
begin_f_loop(faceidentifier,sandthreadweld)
{
F_UDMI(faceidentifier,sandthreadweld,0)=1;
}
end_f_loop(faceidentifier,sandthreadweld)
}

Best regards
CFD-student

CFD-student February 23, 2012 07:00

I dont completely understand the reason for this fix but by using the user defined scalar capability instead i can utilize the code above. When using the user defined memory as above when trying to plot the contour i only get the option of plotting for "mixture-phase" in the contour plot window, dont know the reason for this might have something to do with the problem for F_UDMI(f,t)


All times are GMT -4. The time now is 09:53.