CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Custom DPM laws using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2018, 08:11
Default Custom DPM laws using UDF
  #1
New Member
 
sowmi
Join Date: Mar 2017
Posts: 14
Rep Power: 9
Sowmi is on a distinguished road
Hi all
I am injecting particles in plasma spray jet and need to find the solid heating of the particle with respect to time.
The formula used is
When the particle is less than melting point then DTp= DT *(6*dh/(PI*dp^3*cpp*rhop)

I wrote this in custom DPM law using UDF given below.
Can anyone help me to correct this UDF. And am very new to fluent and UDF it would be a grateful anybody help me at the earliest... Already am running out of time.

#include "udf.h"
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "surf.h"
#include "random.h"
#include "prop.h"
#include <math.h>
#include "mem.h"
#include "metric.h"
#include "dpm.h"
#include "dpm_types.h"
#include "dpm_laws.h"

#define CVIS 0.0037866 /*viscosity at 1310K */
#define PI 3.14


DEFINE_DPM_LAW(user_law,p,ci)
{
Material*m = P_MATERIAL(p);
Thread*t0=P_CELL_THREAD(p);
cell_t c = P_CELL(p);

real Tg,thermcnd,Tp,mp,Dp,Ap,Pr,cpp,cpg,visg,Nu,h,times tep,dh,dT,Re,aux5,rel_vel,TM=1358.0;
float x=0,dx;

Tg = C_T(c,t0); /*gas temperature */
visg = C_MU_T(c,t0); /*turbulent viscosity of gas*/
thermcnd = C_K_L(c,t0); /*thermal conductivity of gas*/
cpg = C_CP(c,t0); /*specific heat of gas*/
Tp = P_T(p); /* particle temperature */
mp = P_MASS(p); /* particle mass */
Dp = DPM_DIAM_FROM_VOL(mp / P_RHO(p)); /* particle diameter */
Ap = DPM_AREA(Dp); /* particle surface */
Pr = (cpg * visg)/thermcnd; /* Prandtl number */


cpp = DPM_SPECIFIC_HEAT(p,P_T(p)); /* particle specific heat*/


rel_vel= sqrt(pow((P_VEL(p)[0]-C_U(c,t0)),2.0)+pow((P_VEL(p)[1]-C_V(c,t0)),2.0));
aux5=((rel_vel* Dp * P_RHO(p))/CVIS); /* reynolds number */

Nu = (2.0 + 0.66 * sqrt(aux5) * pow(Pr, 1.0/3.0))); /* Nusselt number */
h = (Nu * thermcnd) / Dp; /* Heat transfer coefficient*/
timestep = P_DT(p);

dh = h * (Tg - Tp) * Ap; /* heat source term*/


dT =timestep*(6*dh/(PI*pow(Dp,3.0)*cpp*P_RHO(p)));
P_T(p)= P_T(p)+dT;
}

Last edited by Sowmi; March 17, 2018 at 00:24. Reason: missing of content
Sowmi is offline   Reply With Quote

Old   March 7, 2018, 11:31
Default
  #2
New Member
 
sowmi
Join Date: Mar 2017
Posts: 14
Rep Power: 9
Sowmi is on a distinguished road
Kindly someone reply me....
Sowmi is offline   Reply With Quote

Old   March 19, 2019, 01:54
Default
  #3
New Member
 
Tousif
Join Date: Nov 2018
Posts: 2
Rep Power: 0
Tousif is on a distinguished road
What is the error you are getting? Can you explain?
Tousif is offline   Reply With Quote

Reply


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
Contours of custom surface rate (UDF and UDM) cpassa FLUENT 2 August 14, 2021 13:25
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
DPM with UDF - Step-by-Step Procedure???? Prashanth FLUENT 3 April 3, 2009 17:45
So many questions in DPM & UDF - Help! URGENT! Prashanth FLUENT 0 March 3, 2009 22:26
DPM - UDF for fluctuating bubble size Jaroslav Kotara FLUENT 1 April 19, 2006 09:02


All times are GMT -4. The time now is 22:58.