|
[Sponsors] |
May 24, 2021, 10:28 |
The diameter of particle keep constant
|
#1 |
New Member
Join Date: Mar 2021
Posts: 8
Rep Power: 5 |
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 |
|
May 24, 2021, 22:46 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
compile code, check syntax
try to change TP_* to P_* everywhere
__________________
best regards ****************************** press LIKE if this message was helpful |
|
May 24, 2021, 23:30 |
|
#3 | |
New Member
Join Date: Mar 2021
Posts: 8
Rep Power: 5 |
Quote:
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"); } |
||
May 25, 2021, 04:59 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
May 25, 2021, 05:06 |
|
#5 | |
New Member
Join Date: Mar 2021
Posts: 8
Rep Power: 5 |
Quote:
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 |
||
May 5, 2022, 06:12 |
|
#6 | |
New Member
Tongshan Chai
Join Date: Mar 2022
Posts: 1
Rep Power: 0 |
Quote:
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 05:31. |
||
November 26, 2024, 17:20 |
|
#7 |
New Member
Alejandro
Join Date: Jun 2024
Posts: 5
Rep Power: 2 |
Hi, i have the solution, for DPM law is necesary to actívate energy equation... That's all..
|
|
Tags |
dpm fluent |
|
|
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 06:56 |
twoPhaseEulerFoam - particle diameter distribution | Elm | OpenFOAM Pre-Processing | 2 | December 4, 2018 05:23 |
Particle size and Mesh Size; Particle tracking; | Suman Sapkota | CFX | 11 | August 12, 2018 20:39 |
visualize the particle with various diameter using Paraview | openfoammaofnepo | OpenFOAM | 3 | June 25, 2018 18:18 |
Diameter of injected particle | noa | FLUENT | 0 | January 1, 2014 04:30 |