Author Topic: DPM: How to attach deistinctive property for a particle  (Read 2113 times)

Offline skhashan

  • Newbie
  • *
  • Posts: 7
  • Reputation: +0/-0
  • Searching for solution
    • View Profile
DPM: How to attach deistinctive property for a particle
« on: August 14, 2012, 08:24:10 PM »
Advertisement
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

Offline william

  • Full Member
  • ***
  • Posts: 151
  • Reputation: +14/-0
  • Know it, share it.
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #1 on: August 16, 2012, 11:29:20 AM »
Use DEFINE_DPM_SCALAR_UPDATE macro to change the property of the particle.
See Fluent UDF manual for examples of DEFINE_DPM_SCALAR_UPDATE.

Offline skhashan

  • Newbie
  • *
  • Posts: 7
  • Reputation: +0/-0
  • Searching for solution
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #2 on: August 16, 2012, 05:54:37 PM »
Thanks Wiiliam. But here I am talking about a property that is not a standard macro

Offline william

  • Full Member
  • ***
  • Posts: 151
  • Reputation: +14/-0
  • Know it, share it.
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #3 on: August 17, 2012, 09:52:46 AM »
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.

Offline skhashan

  • Newbie
  • *
  • Posts: 7
  • Reputation: +0/-0
  • Searching for solution
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #4 on: August 17, 2012, 05:53:02 PM »
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

Offline william

  • Full Member
  • ***
  • Posts: 151
  • Reputation: +14/-0
  • Know it, share it.
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #5 on: August 18, 2012, 01:36:35 PM »
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..

Offline skhashan

  • Newbie
  • *
  • Posts: 7
  • Reputation: +0/-0
  • Searching for solution
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #6 on: August 18, 2012, 11:23:31 PM »
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);
}

Offline william

  • Full Member
  • ***
  • Posts: 151
  • Reputation: +14/-0
  • Know it, share it.
    • View Profile
Re: DPM: How to attach deistinctive property for a particle
« Reply #7 on: August 19, 2012, 08:25:23 AM »
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.