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

calculating the face gradient of a UDS in fluent

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pifou74

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2012, 18:40
Default calculating the face gradient of a UDS in fluent
  #1
New Member
 
Join Date: Dec 2011
Posts: 2
Rep Power: 0
mean5990 is on a distinguished road
Hi every one,
I am trying to solve water transport equation in a fuel cell using ANSYS Fluent.
I need to define a flux for the equation that I am gonna solve. The problem is that I cannot calculate face gradients in my code. I used F_UDSI_G(c,t,0) macro for this purpose but I recieved this error:
"
..\..\src\sources2.c(348) : error C2109: subscript requires array or pointer type
..\..\src\sources2.c(348) : error C2109: subscript requires array or pointer type
..\..\src\sources2.c(348) : error C2109: subscript requires array or pointer type
"
Does anybody know how to calculate face gradients of a UDS in fluent?
mean5990 is offline   Reply With Quote

Old   September 29, 2012, 11:24
Default
  #2
New Member
 
Peter
Join Date: Mar 2009
Posts: 15
Rep Power: 17
pifou74 is on a distinguished road
I think that gradient data are not stored for the faces excepted boundary faces. You can only calculate the gradient by estimating a mean of the adjacent cells to the face....

Good luck
hzsme likes this.
pifou74 is offline   Reply With Quote

Old   September 20, 2015, 13:59
Default
  #3
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 11
Maryam-A is on a distinguished road
Hi every body

I wanted to return derivative of UDS as wall boundary value, but I faced with "fatal signal" while initializing (both Hybrid and standard) that I found this because of boundary condition UDS.
this is part of my udf for B.C of UDS( volume fraction of nanoparticle in my case)

DEFINE_PROFILE(alpha_bc1,thread,position)
{
Thread *t;
cell_t c;
.
.
.

begin_f_loop(f,thread)
{

C_UDSI_G(c,t,0)[0]=-(D_T/D_B)*C_T_G(c,t)[0];
F_PROFILE(f,thread,position)=C_UDSI_G(c,t,0)[0];
}
end_f_loop(f,t)
}

I would appreciate if anyone can help me about my mistakes.
Maryam-A is offline   Reply With Quote

Old   September 20, 2015, 14:00
Default
  #4
Member
 
Join Date: Nov 2014
Posts: 42
Rep Power: 11
Maryam-A is on a distinguished road
Furthermore, I used Define_Adjust to calculate laplacian, maybe this is my fault?
can I use UDS as scalar variable and then I used it in source function?
I will turn off all Uds except one that I wanted to solve. is it true?

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDSI(c,t,1)=D_T*C_T_G(c,t)[0];
C_UDSI(c,t,2)=D_T*C_T_G(c,t)[1];
C_UDSI(c,t,3)=D_T*C_T_G(c,t)[2];
Laplacian=Laplacian+C_UDSI_G(c,t,1)[0]+C_UDSI_G(c,t,2)[1]+C_UDSI_G(c,t,3)[2];

C_UDSI(c,t,5)=dD_T*C_T_G(c,t)[0];
C_UDSI(c,t,6)=dD_T*C_T_G(c,t)[1];
C_UDSI(c,t,7)=dD_T*C_T_G(c,t)[2];
d_Laplacian=d_Laplacian+C_UDSI_G(c,t,4)[0]+C_UDSI_G(c,t,5)[1]+C_UDSI_G(c,t,6)[2];

C_UDSI(c,t,9)=D_D*C_T_G(c,t)[0];
C_UDSI(c,t,10)=D_D*C_T_G(c,t)[1];
C_UDSI(c,t,11)=D_D*C_T_G(c,t)[2];
LL=LL+C_UDSI_G(c,t,9)[0]+C_UDSI_G(c,t,10)[1]+C_UDSI_G(c,t,11)[2];

C_UDSI(c,t,13)=dD_D*C_T_G(c,t)[0];
C_UDSI(c,t,14)=dD_D*C_T_G(c,t)[1];
C_UDSI(c,t,15)=dD_D*C_T_G(c,t)[2];
dLL=dLL+C_UDSI_G(c,t,13)[0]+C_UDSI_G(c,t,14)[1]+C_UDSI_G(c,t,15)[2];

}
end_c_loop(c,t)
}
C_UDSI(c,t,4)=Laplacian;
C_UDSI(c,t,8)=d_Laplacian;
C_UDSI(c,t,12)=LL;
C_UDSI(c,t,16)=dLL;
}
Maryam-A 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
Calculating the Wall Shear Stress Gradient over surface 123catty456 Main CFD Forum 1 October 1, 2012 22:27
HELP! grid check failed in parallel fluent restart FLUENT 0 March 5, 2011 09:55
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
Face based gradient calculation Bernhard Kubicek Main CFD Forum 1 February 12, 2008 16:34
[Commercial meshers] Converting meshes that includes interfaces ham OpenFOAM Meshing & Mesh Conversion 29 January 8, 2007 08:58


All times are GMT -4. The time now is 15:58.