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

URGENT!!! F_UDSI at symmetry boundary

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2010, 15:41
Exclamation URGENT!!! F_UDSI at symmetry boundary
  #1
Member
 
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 47
Rep Power: 17
gemini is on a distinguished road
Hi,

In FLUENT udf manual following statement is given,

Quote:
Note that F_UDSI is available for wall and flow boundary faces, only. If a UDS attempts to access any other face zone, then an error will result.


Then, I tried to test this in a simple 3D uds diffusion problem where the domain has symmetry boundary condition. After convergence, I applied following function to printout the face values of uds at all boundaries:

Code:
face_t f;
Thread *tf;
thread_loop_f(tf, domain)/* loops over all face threads in a domain*/
  {
   begin_f_loop(f, tf)    /* loops over faces in a face thread  */
   {
     if (BOUNDARY_FACE_THREAD_P(tf)) 
       {
           Message("face id = %d, UDS0 value = %12.5e",f, F_UDSI(f, tf, 0));  
       }
   }                         
   end_f_loop(f, f_thread)
}
However, execution of this script resulted in an error. So, is there any way to prevent the use of F_UDSI at symmetry bc's? or How can I extract the type of bc of a particular boundary face?

thanks



[/COLOR]

Last edited by gemini; March 5, 2010 at 02:34.
gemini is offline   Reply With Quote

Old   March 8, 2010, 04:51
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by gemini View Post
Hi,

In FLUENT udf manual following statement is given,



Then, I tried to test this in a simple 3D uds diffusion problem where the domain has symmetry boundary condition. After convergence, I applied following function to printout the face values of uds at all boundaries:

Code:
face_t f;
Code:
Thread *tf;
thread_loop_f(tf, domain)/* loops over all face threads in a domain*/
 {
  begin_f_loop(f, tf)    /* loops over faces in a face thread  */
  {
    if (BOUNDARY_FACE_THREAD_P(tf)) 
      {
          Message("face id = %d, UDS0 value = %12.5e",f, F_UDSI(f, tf, 0));  
      }
  }                         
  end_f_loop(f, f_thread)
}
However, execution of this script resulted in an error. So, is there any way to prevent the use of F_UDSI at symmetry bc's? or How can I extract the type of bc of a particular boundary face?

thanks



[/COLOR]
It seems that there are no values stored on the non-wall boundary. This has been also an question confusing me. Maybe it's a bug of Fluent. If it is urgent for you , you can use the following better-than-nothing solution. It uses the neighbour cell's uds value , uds gradient, and distance vector to calculate the face value.


#include "udf.h"
DEFINE_ON_DEMAND(test)
{
face_t f;
cell_t c0;
Thread *tf,*t0;
Domain*domain=Get_Domain(1);
real NV_VEC(dist_vector);
real f_centoid[ND_ND],c_centroid[ND_ND];
real face_value,cell_value;
thread_loop_f(tf, domain)/* loops over all face threads in a domain*/
{
if (THREAD_F_AXIS==THREAD_TYPE(tf)) /* if the thread is an axis thread*/
{
begin_f_loop(f, tf) /* loops over faces in a face thread */
{
F_CENTROID(f_centoid,f,tf); //centroid of a face
c0=F_C0(f,tf);
t0=THREAD_T0(tf);
C_CENTROID(c_centroid,c0,t0); //centroid of the neighbour cell
NV_DD(dist_vector,=,f_centoid[0],f_centoid[1],0,-,c_centroid[0],c_centroid[1],0);
face_value=C_UDSI(c0,t0,0)+NV_DOT(C_UDSI_G(c0,t0,0 ),dist_vector);
cell_value=C_UDSI(c0,t0,0);
Message0("x coord.=%g,face value=%g,cell value=%g\n",f_centoid[0],face_value,cell_value);
}
end_f_loop(f, f_thread)
}

}
}
gearboy is offline   Reply With Quote

Old   March 10, 2010, 03:20
Default
  #3
Member
 
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 47
Rep Power: 17
gemini is on a distinguished road
Quote:
Originally Posted by gearboy View Post
It seems that there are no values stored on the non-wall boundary. This has been also an question confusing me. Maybe it's a bug of Fluent. If it is urgent for you , you can use the following better-than-nothing solution. It uses the neighbour cell's uds value , uds gradient, and distance vector to calculate the face value.


#include "udf.h"
DEFINE_ON_DEMAND(test)
{
face_t f;
cell_t c0;
Thread *tf,*t0;
Domain*domain=Get_Domain(1);
real NV_VEC(dist_vector);
real f_centoid[ND_ND],c_centroid[ND_ND];
real face_value,cell_value;
thread_loop_f(tf, domain)/* loops over all face threads in a domain*/
{
if (THREAD_F_AXIS==THREAD_TYPE(tf)) /* if the thread is an axis thread*/
{
begin_f_loop(f, tf) /* loops over faces in a face thread */
{
F_CENTROID(f_centoid,f,tf); //centroid of a face
c0=F_C0(f,tf);
t0=THREAD_T0(tf);
C_CENTROID(c_centroid,c0,t0); //centroid of the neighbour cell
NV_DD(dist_vector,=,f_centoid[0],f_centoid[1],0,-,c_centroid[0],c_centroid[1],0);
face_value=C_UDSI(c0,t0,0)+NV_DOT(C_UDSI_G(c0,t0,0 ),dist_vector);
cell_value=C_UDSI(c0,t0,0);
Message0("x coord.=%g,face value=%g,cell value=%g\n",f_centoid[0],face_value,cell_value);
}
end_f_loop(f, f_thread)
}

}
}
Hi,

Can your script be used for calculation of face value at the interior faces by just removing the following line?

if (THREAD_F_AXIS==THREAD_TYPE(tf)) /* if the thread is an axis thread*/

Also, THREAD_F_AXIS didn't worked for SYMMETRY bc's. Instead "THREAD_F_SYMMETRIC" works well...

Thanks.

Last edited by gemini; March 10, 2010 at 04:00.
gemini is offline   Reply With Quote

Old   March 10, 2010, 21:50
Default
  #4
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by gemini View Post
Hi,

Can your script be used for calculation of face value at the interior faces by just removing the following line?

if (THREAD_F_AXIS==THREAD_TYPE(tf)) /* if the thread is an axis thread*/

Also, THREAD_F_AXIS didn't worked for SYMMETRY bc's. Instead "THREAD_F_SYMMETRIC" works well...

Thanks.
The script can be used for interior faces if the F_T macro doesn't work. And I misunderstood the case as an axial symmetric one. Sorry.
gearboy is offline   Reply With Quote

Old   March 11, 2010, 01:23
Cool
  #5
Member
 
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 47
Rep Power: 17
gemini is on a distinguished road
Quote:
Originally Posted by gearboy View Post
The script can be used for interior faces if the F_T macro doesn't work. And I misunderstood the case as an axial symmetric one. Sorry.
Hi,

Your script was very useful, and as you said, it can be used for calculating face fluxes of UDS and then they can be used anywhere in your model.

thanks again.
gemini is offline   Reply With Quote

Reply


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
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 05:58
Symmetry and boundary conditions eric FLUENT 3 August 30, 2012 09:09
inlet velocity boundary condition murali CFX 5 August 3, 2012 08:56
Normal velocity at the symmetry boundary Seventy FLUENT 1 October 26, 2009 06:52
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


All times are GMT -4. The time now is 20:52.