|
[Sponsors] |
Using a C_UDMI defined in one UDF in another UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 30, 2018, 19:23 |
Using a C_UDMI defined in one UDF in another UDF
|
#1 |
New Member
Matt
Join Date: Mar 2018
Posts: 11
Rep Power: 8 |
I use a C_UDMI to calculate the number of particles that deposit on a wall as:
DEFINE_DPM_BC(Deposition,p,t,f,f_normal,dim) { #if !RP_HOST Thread *tcell=P_CELL_THREAD(p); cell_t c=P_CELL(p); Domain *d; d=Get_Domain(1); C_UDMI(c,tcell,0) += 1.; return PATH_ABORT; #endif } Then, I want to use this C_UDMI in another UDF to move the mesh where particles are deposited: DEFINE_GRID_MOTION(beam,domain,dt,time,dtime) { Thread *tf; face_t f; int n; Node *v; /* get the thread pointer for which this motion is defined */ tf=DT_THREAD(dt); begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); ...... ......C_UDMI....... ...... } } end_f_loop(f,tf); } Is this possible? Can anyone help how to do this? Thanks, Last edited by sthinmind; March 31, 2018 at 13:10. |
|
March 31, 2018, 03:18 |
|
#2 |
New Member
Doruk Yelkenci
Join Date: Apr 2017
Posts: 20
Rep Power: 9 |
real G;
G=C_UDMI(c,t,0); will allow you to use it on another define macro but above you are trying to use cell data in face node loop. You cant transfer data like that |
|
March 31, 2018, 11:36 |
|
#3 |
New Member
Matt
Join Date: Mar 2018
Posts: 11
Rep Power: 8 |
Thanks for your response. So does G have all information that C_UDMI has?(cell information and stored values)
Do I need to define G in the second UDF as well? Something like: DEFINE_GRID_MOTION(beam,domain,dt,time,dtime) { Thread *tf; face_t f; int n; Real G .... |
|
March 31, 2018, 12:45 |
|
#4 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
In your UDF "OSU_Deposition_Model_R1", you now store face data in a C_UDMI, by first finding the associated cell. You can skip that step, and directly store it in F_UDMI(f,t). Code:
DEFINE_DPM_BC(OSU_Deposition_Model_R1,p,t,f,f_normal,dim) { #if !RP_HOST F_UDMI(f,t,0) += 1.; return PATH_ABORT; #endif } |
||
April 1, 2018, 21:20 |
|
#5 |
New Member
Matt
Join Date: Mar 2018
Posts: 11
Rep Power: 8 |
Thanks for your response.
I guess I need the nodal values in DEFINE_GRID_MOTION to move the mesh? How do I store the same value (F_UDMI) in the neighboring nodes? How do I find the nodes around a the face f? (In 2D there are two nodes at two sides of the face) |
|
Tags |
dpm fluent, dynamic meshing, user defined memory |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Not able to use Interpreted in User Defined Function (UDF) | Touré | FLUENT | 0 | March 8, 2017 20:15 |
UDF error:strcpy has already been defined in the curren | alinik | FLUENT | 0 | November 2, 2016 21:17 |
Velocity inlet user defined function UDF in fluent | Ammofreak | Fluent UDF and Scheme Programming | 0 | January 14, 2014 05:59 |
Fluent User defined Scalars and UDF | Anirudh_Deodhar | Fluent UDF and Scheme Programming | 0 | February 16, 2011 21:16 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |