|
[Sponsors] |
April 25, 2012, 02:56 |
|
#21 |
New Member
|
FORTRAN code UDF for FLUENT, I am 99% sure it is not possible. You will have to recode it in c/C++. Besides, If you are writing a UDF for FLUENT, usually you do not code every thing from continuity all the way to the slightest details in combustion. Use the FLUENT UDF manual. It really will guide you well.
As for openfoam, I dont have much experience. I have only tried a very small and simple pipe flow model at home. No where enough experience to provide help or advice.
__________________
Adi. |
|
April 25, 2012, 03:01 |
|
#22 |
Member
Join Date: Apr 2012
Location: Mainz, Germany
Posts: 60
Rep Power: 14 |
Ok.
Yes I have started reading the UDF manual. Thanks for your advice. |
|
April 25, 2012, 06:42 |
|
#23 |
Member
Join Date: Apr 2012
Location: Mainz, Germany
Posts: 60
Rep Power: 14 |
@ADI : one more thing. It is possible to generate a virtual grid in C language and run the UFD code developed on that grid and to simultaneously run the FLUENT code (Continuity, mom, energy eqs) on the grid developed in GAMBIT/FLUENT?
|
|
July 13, 2012, 18:23 |
|
#24 |
Member
Shawn Fotovati
Join Date: Jul 2009
Location: Dallas, TX
Posts: 42
Rep Power: 17 |
High everybody,
I would like to loop over all particles and find their intraction with each other. However, this has to be done inside a UDF for DPM (e.g. Defiend_DPM_SCALAR_UPDATE). The compiler will go wrong as soon as I have one of the macros related for looping over the particles (e.g. begin_particle_cell_loop!). Does anyone have any idea to resolve this situation? Thank you. Sean |
|
April 11, 2015, 01:47 |
|
#25 | |
Senior Member
B_Kia
Join Date: May 2014
Location: Ir
Posts: 123
Rep Power: 12 |
Quote:
have you found any solution for that ? i stuck at this problem either, i am using Fluent v15.0, in v6.3.26 it works correctly, but in v15.0 no, thank you |
||
August 27, 2017, 20:34 |
nanoparticle measurement by CFD
|
#26 |
New Member
HASAN
Join Date: Oct 2016
Location: canada
Posts: 9
Rep Power: 10 |
Hello, dear
Is there any way to count the Particles on Boundries over the time ? how can I do it in the fluent? pls tell me the steps for it, and pls how can I know How many particles pass the Inlet in those ten seconds of Simulation in the fluent? 1000000000 thanks |
|
August 14, 2018, 13:25 |
Solution: looping over all particles, calculating melt fraction
|
#27 |
New Member
Patrick
Join Date: Jul 2018
Posts: 4
Rep Power: 8 |
Hi All,
Thank you for all your posts! I haven't read all the posts, so I'm not sure if a solution has been found. If not, here's some code I've written to count all of the particles and calculate the melt fraction. Note that I only have one injection so I didn't have to loop through them, as we done in the previous posts with Ilist. DEFINE_ON_DEMAND(melt_percent_calc) { Injection *I; Particle *p; real particle_count = 0; real melt_count = 0; real melt_percent = 0; I = Get_dpm_injections(); loop(p, I->p) { particle_count++; if (TP_T(p) > Tmelt){ melt_count++; } if (TP_TIME(p) > time){ time = TP_TIME(p); } } melt_percent = (melt_count/particle_count)*100; Message("\n"); Message("Particle count: %g\n", particle_count); Message("Melt count: %g\n", melt_count); Message("Melt percent: %g\n", melt_percent); } |
|
June 17, 2020, 02:21 |
|
#28 |
Member
vav noon
Join Date: May 2020
Posts: 49
Rep Power: 6 |
Hello everybody,
I want to inject several particles using read a file in the DPM setting and finally get their positions. I used the following UDF for writing the positions. #include "udf.h" #include "dpm.h" DEFINE_ON_DEMAND(particles_position) { Domain *d; Thread *t; cell_t c; d = Get_Domain(1); Injection *I; Particle *p; I = Get_dpm_injections(); FILE *fp; loop(p, I->p) { fp = fopen ("E:/aafinal/path/position.txt","a"); fprintf(fp, "%d %d %d \n", P_POS(p)[0], P_POS(p)[1], P_POS(p)[2]); fclose(fp); } } Despite the declaration variable I, I faced the error: I: undeclared variable. Could anyone please guide me? Thank you for your time and concern! |
|
June 17, 2020, 03:11 |
|
#29 |
Member
vav noon
Join Date: May 2020
Posts: 49
Rep Power: 6 |
I also have another question. Should I use if-loop if I want to get positions in several specified times? Do you have any suggestions?
Thanks |
|
June 17, 2020, 04:45 |
Compilation
|
#30 |
Senior Member
|
Are you compiling it or interpreting it? Interpreter will not work for this scenario. As a compiled version, it would work fine. You don't need the following lines
#include "dpm.h" Domain *d; Thread *t; cell_t c; d = Get_Domain(1); And open and close the file outside the loop, otherwise I/O will slow down the process significantly.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 17, 2020, 06:38 |
|
#31 |
Member
vav noon
Join Date: May 2020
Posts: 49
Rep Power: 6 |
Many thanks for the reply.
I interpreted it. Yes, you're right. There is no need to write the lines. #include "udf.h" DEFINE_ON_DEMAND(particles_position) { Injection *I; Particle *p; I = Get_dpm_injections(); FILE *fp; fp = fopen ("E:/aafinal/path/position.txt","a"); loop(p, I->p) { fprintf(fp, "%d %d %d \n", P_POS(p)[0], P_POS(p)[1], P_POS(p)[2]); } fclose(fp); } |
|
June 17, 2020, 06:52 |
Compiler
|
#32 |
Senior Member
|
You need to compile it. Interpreter won't work.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DPM UDF Injection leads to 2 different particles | sega | Fluent UDF and Scheme Programming | 4 | December 28, 2017 23:57 |
DPM - do the particles affect the liquid? | Nikhil Dani | FLUENT | 0 | January 1, 2009 12:58 |
NACA0012 geometry/design software needed | Franny | Main CFD Forum | 13 | July 7, 2007 16:57 |
DPM: using UDF for creating and deleting Particles | Markus Alzon | FLUENT | 0 | July 4, 2007 02:18 |
DPM; particle seeded / deleted by UDF | Laika | FLUENT | 6 | January 23, 2006 00:40 |