|
[Sponsors] |
May 26, 2015, 05:40 |
UDMs at some FACE THREAD are not available?
|
#1 |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
Hello, everyone, a problem now confused me.
i defined some F_UDMI in my udf, and a INITIAL MACRO was used: Code:
DEFINE_INIT(my_init_func,d) { cell_t c; Thread *t; face_t f; int i; /* loop over all cell threads in the domain */ thread_loop_c(t,d) { /* loop over all cells */ begin_c_loop_all(c,t) { for(i=0; i<sg_udm; i++) C_UDMI(c,t,i) = 0.0; } end_c_loop_all(c,t) } thread_loop_f(t,d) { if((THREAD_STORAGE(t,SV_UDM_I))!=NULL) { begin_f_loop(f,t) { for(i=0;i<sg_udm;i++) F_UDMI(f,t,i)=0; } end_f_loop(f,t) } else { Message("Skipping FACE thread no. %d..\n", THREAD_ID(t)); } } } "Skipping FACE thread no. 3.. Skipping FACE thread no. 8.." My model is a simple 2d Axisymmetric model: QQ??20150526164225.jpg i do not understand why UDMs at these two FACE THREAD are not available, i have to use UDM to define uds_flux later. Could someone explain these to me? |
|
May 29, 2015, 07:42 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
How many times does this message occur on your screen? Perhaps these threads are not featured on all parallel nodes. Do you experience the same problem while running in serial model? Similarly, are the UDM values as you expect when you check them after initialising? Note: UDM are initialised with zero when created and therefore you should choose a nonzero number for this verification task.
|
|
May 29, 2015, 12:02 |
|
#3 | |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
Thanks for your reply.
It occurred everytime i initialize...i don't understand why these face threads cannot be available. For now, i used an if-else sentence:if the face value are not available, then i will get Code:
c1 = F_C1(f,t); t1 = F_C1_THREAD(f,t); And i donot know whether this is accurate enough. For now, i am working on the convergence of the solution... Quote:
|
||
May 29, 2015, 20:46 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What faces have the IDs 3 and 8? If they correspond to the faces with periodic boundary conditions, perhaps it's nonphysical to allocate two UDM values at the same location.
|
|
May 30, 2015, 00:53 |
|
#5 |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
I do not know how to find where faces have the IDs 3 and 8 are..
i used "message "sentence to pring out the coordinate of each point, but they are to many... |
|
May 30, 2015, 07:36 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
||
May 30, 2015, 07:59 |
|
#7 |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
||
June 1, 2015, 09:44 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Fluent is a finite volume package. So volumes (2D volumes in your case) are important, and that is the basic "calculation unit".
Only at the boundaries, Fluent has to do something to get fluxes, so that is why F_UDMI can store values at boundary faces. (1D faces in your case). Storing UDMI's on internal faces is a waste of space, because normally you don't need them. Temperature and velocities are also not calculated on internal faces. So for that reason it makes sense to me that F_UDMI's are not defined on internal cell zones. At the axisymmetric axis, the flux of anything is zero. So there is no need to store flux variables, and Fluent apparently chose to also not store F_UDMI values there. |
|
June 4, 2015, 11:51 |
|
#9 | |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
I am so sorry for not replying you in time because of the network.
Your explaination sounds reasonable to me, thank you~ Based on this reason, if i want to use F_UDMI to define UDS_FLUX, for example, my opinion is: 1. at the boundaries, use if((THREAD_STORAGE(t,SV_UDM_I))!=NULL) to check if F_UDMI is available at the boundry, if not (just like at the axisymmetric axis), i should use the C_UDMI value of the adjacent cells C0 instead 2. at the internal cell zones, use average C_UDMI values of adjacent cells C0 and C1 with respect to the face instead. Am i right? Quote:
|
||
June 4, 2015, 11:54 |
|
#10 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
|
||
June 4, 2015, 11:57 |
|
#11 |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
||
June 4, 2015, 12:04 |
|
#12 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The help for DEFINE_UDS_FLUX says how to deal with interior faces:
"Additionally, since most quantities in ANSYS Fluent are not allocated in memory for interior faces, only for boundary faces (for example, wall zones), your UDF will also need to calculate interior face values from the cell values of adjacent cells. This is most easily done using the arithmetic mean method. Vector arithmetic can be coded in C using the NV_ and ND_ macros (see Additional Macros for Writing UDFs)." So yes, that is basically your point 2. And for your point 1: I think that should work. It might not be needed, because if Fluent is smart it should never ask for the UDS flux at the rotation axis boundary, but better be safe. |
|
June 4, 2015, 12:08 |
|
#13 | |
Member
Peter Aestas
Join Date: Dec 2013
Posts: 64
Rep Power: 13 |
Thank you so much! It's a fruitful conversation! Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent UDF for Micro Flow Face Slip Velocity | daniel_george_carter | Fluent UDF and Scheme Programming | 0 | May 12, 2013 06:39 |
Please check out my parallelized udf code | aleisia | Fluent UDF and Scheme Programming | 0 | June 10, 2011 17:16 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
Face loop in a face thread | Dario | FLUENT | 2 | March 13, 2007 06:14 |
material name of emissivity for a face thread | Nici | FLUENT | 6 | September 3, 2003 13:21 |