CAPE Forum
Ansys => Fluent => Topic started by: skhashan on August 14, 2012, 08:24:10 PM
-
Hello all,
Does any one know how to attach a assign a particel with a distinctive property. The diameter, mass, density, temerature, etc. are assigned automatically to each particel type (example P_DIAM(p) for diameter). But, I am interested in assigning other destinctive properties like magnetic saturation and magnetic susceptibility. Appreciate any help
-
Use DEFINE_DPM_SCALAR_UPDATE macro to change the property of the particle.
See Fluent UDF manual for examples of DEFINE_DPM_SCALAR_UPDATE.
-
Thanks Wiiliam. But here I am talking about a property that is not a standard macro
-
Inside the DPM_SCALAR_UPDATE macro you can use user defined scalar to store the property of material at each time step. You can even plot the trajectory of that property in the particle tracks option.
You will need to enable user define scalar in fluent.
To add it in the UDF, just after the header line #include "udf.h", add the following:
#define P_magnetic_sat(p) P_USER_REAL((p),0)
for second user defined scalar, add
#define P_magnetic_sat1(p) P_USER_REAL((p),1)
and so on.
Then in the DPM_SCALAR_UPDATE macro add the equations that define P_magnetic_sat(p) and P_magnetic_sat1(p)
In this case you will need to enable 2 user defined scalars.
-
great william, you are making me closer to solve the problem
However, to make my problem more understandable i must say that these properties are supposed to be different for each injected particel size. I am injecting three different particle diameters, each particel size is supposed to have its own distinctive magnetic saturation and magnetic susceptibility. Appreciate your help
-
You can define that inside the equation using "if and else" statements, like,
if (P_DIAM(p)<=XX.X){
P_magnetic_sat(p)=XXXXXX;
}else if(P_DIAM(p)>=XX.x){
P_magnetic_sat(p)=XXXXX;
}
and so on..
-
William
I used three scalers. Compilation is sucsseful
I appreciate if yould check the way I am assigning the properties for three diameters (1e-6, 2.8e-6 and 4.5e-6 m)
Also, is there a better way to retrieve HMAG_p
Regards
DEFINE_DPM_SCALAR_UPDATE(magnetic_properties, cell, thread, initialize, p)
{
cphase_state_t *c=&(p->cphase);
float MSAT_Myone,MSAT_M270,MSAT_M450;
float FUNCH2, HMAG_p,CHI_p;
MSAT_Myone=4.965e4;
MSAT_M270=1.705e4;
MSAT_M450=3.1595e4;
HMAG_p=C_UDMI(P_CELL(p),P_CELL_THREAD(p),11);
if((P_DIAM(p)>=0.99e-6) && (P_DIAM(p)<=1.01e-6)){P_magnetic_sat(p)= MSAT_Myone,P_magnetic_chi(p)=1.4; }
if((P_DIAM(p)>2.79e-6) && (P_DIAM(p)<2.81e-6)){P_magnetic_sat(p)= MSAT_M270,P_magnetic_chi(p)=0.17; }
if((P_DIAM(p)>4.49e-6) && (P_DIAM(p)<4.51e-6)){P_magnetic_sat(p) = MSAT_M450,P_magnetic_chi(p)=0.25; }
if (HMAG_p < P_magnetic_sat(p)/P_magnetic_chi(p))
{
P_magnetic_fuch(p) =P_magnetic_chi(p);
}
else
{
P_magnetic_fuch(p)=P_magnetic_sat(p) / HMAG_p;
}
C_UDMI(P_CELL(p),P_CELL_THREAD(p),13)=P_magnetic_fuch(p);
}
-
This looks fine but you should use user defined scalar as defined above to store the particle property instead of using UDM, because UDM will store it in the cell not in the particle tracks.