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

The diameter of particle keep constant

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Shevin W.
  • 2 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2021, 09:28
Unhappy The diameter of particle keep constant
  #1
New Member
 
Join Date: Mar 2021
Posts: 8
Rep Power: 5
Shevin W. is on a distinguished road
Hi, everyone! I am writting a DPM UDF for making the variation of particle diameter governed by R-P equation. Marco DEFINE_DPM_LAW was used, and this marco is hooked in the custom law of Fluent. But the diameter keeps constant after injection. I checked the UDF, found the UDF is not called when the calculation is in progress. The UDF and the hook progress are listed below, but i cannot find where goes wrong.

This is my UDF:

#include "udf.h"
#include "dpm.h"

#define Pv 3540.0
#define RhoL 998.2

DEFINE_DPM_LAW(bubble_growth,p,ci)
{
real sign;
Thread *t = TP_CELL_THREAD(p);
cell_t c = TP_CELL(p);
real P = C_P(c,t);
real dR,D;

/* first, define sign value*/
if (P-Pv == 0.)
{ sign = 0.; }
else if (P-Pv > 0.)
{ sign = -1.; }
else if (P-Pv < 0.)
{ sign = 1.; }
else
{ Message("wrong!"); }

/* compute new particle diameter*/
dR = TP_DT(p)*sign*sqrt(2./3.*abs(P-Pv)/RhoL);
D = TP_DIAM(p) + 2.0*dR;
if (D < 1.0e-6)
{ TP_DIAM(p) = 1.0e-6; }
else
{ TP_DIAM(p) = D; }

}

This is the process of UDF hook:
Setup → Models → Discrete Phase → Injections → set → Custom Laws
→ First law
Wang Cong NEU likes this.
Shevin W. is offline   Reply With Quote

Old   May 24, 2021, 21:46
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
compile code, check syntax

try to change TP_* to P_* everywhere
Shevin W. and Wang Cong NEU like this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   May 24, 2021, 22:30
Default
  #3
New Member
 
Join Date: Mar 2021
Posts: 8
Rep Power: 5
Shevin W. is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
compile code, check syntax

try to change TP_* to P_* everywhere
Hollow, Alexander!
You are the first people helping me in CFD Online! Thank you very much! I have checked my UDF, and changed TP_* to P_* everywhere. The UDF is successfully complied in Fluent without any error. However, the particle diameter still keeps constant! I added a message into the law marco, and run the calculation. The message doesn't occur at the Fluent concole, indicating that the law marco isn't called when the calculation is on!

Are there something needed noted concering the progress of Law Marco hook? In my hook progress, the Law Marco is choosen in the injection-laws-custom-First law, and the switch Marco is choosen in the injection-laws-custom-Switching.

DEFINE_DPM_LAW(bubble_growth,p,ci)
{
cell_t cell;
Thread *cthread;

cell = P_CELL(p);
cthread = P_CELL_THREAD(p);

P_DIAM(p) = 6e-6;
P_RHO(p) = 1.0;

Message("program is under way!\n");
}

DEFINE_DPM_SWITCH(dpm_switch,p,ci)
{
P_CURRENT_LAW(p) = DPM_LAW_USER_1;
Message("law is switched!\n");

}
Shevin W. is offline   Reply With Quote

Old   May 25, 2021, 03:59
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
looks like you've applied correct way to hook udf
This is the process of UDF hook:
Setup → Models → Discrete Phase → Injections → set → Custom Laws → First law

not sure, what could be a problem
you may try to find more information in Ansys Fluent Customization manual
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   May 25, 2021, 04:06
Default
  #5
New Member
 
Join Date: Mar 2021
Posts: 8
Rep Power: 5
Shevin W. is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
looks like you've applied correct way to hook udf
This is the process of UDF hook:
Setup → Models → Discrete Phase → Injections → set → Custom Laws → First law

not sure, what could be a problem
you may try to find more information in Ansys Fluent Customization manual
Thank you, Alexander!

I just settled this problem after noting this sentence in Ansys Help: you can specify custom laws for mass, diameter, and temperature properties as the droplet or particle exchanges mass and energy with its surroundings.

Best regards!
Shevin
Shevin W. is offline   Reply With Quote

Old   May 5, 2022, 05:12
Default
  #6
New Member
 
Tongshan Chai
Join Date: Mar 2022
Posts: 1
Rep Power: 0
tongshan_chai is on a distinguished road
Quote:
Originally Posted by Shevin W. View Post
Thank you, Alexander!

I just settled this problem after noting this sentence in Ansys Help: you can specify custom laws for mass, diameter, and temperature properties as the droplet or particle exchanges mass and energy with its surroundings.

Best regards!
Shevin
Hello Shevin!
I also want to change the particles’ diameter based on R-P equation by DEFINE_DPM_LOW in UDF. But the diameter keeps constant after injection just like your problem. You mentioned that you have settled this problem after noting this sentence in Ansys Help: you can specify custom laws for mass, diameter, and temperature properties as the droplet or particle exchanges mass and energy with its surroundings. How did you solve this problem please? Is another UDF about energy exchange created? Looking forward to getting your help!
Best regards!
Tongshan Chai

Last edited by tongshan_chai; May 6, 2022 at 04:31.
tongshan_chai is offline   Reply With Quote

Reply

Tags
dpm fluent


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
Lagrangian multiphase - Parcel size is much smaller than particle diameter ard STAR-CCM+ 1 August 14, 2020 05:56
twoPhaseEulerFoam - particle diameter distribution Elm OpenFOAM Pre-Processing 2 December 4, 2018 04:23
Particle size and Mesh Size; Particle tracking; Suman Sapkota CFX 11 August 12, 2018 19:39
visualize the particle with various diameter using Paraview openfoammaofnepo OpenFOAM 3 June 25, 2018 17:18
Diameter of injected particle noa FLUENT 0 January 1, 2014 03:30


All times are GMT -4. The time now is 11:34.