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

Calculating UDS gradient containing flux term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 12, 2021, 09:05
Default Calculating UDS gradient containing flux term
  #1
New Member
 
Anas Nur Fauzan
Join Date: Oct 2019
Posts: 18
Rep Power: 6
luzikato is on a distinguished road
Hello,

I'm simulating a thermoelectric generator model. To represent every term I need to solve, I'm using UDS.

For example, I want to solve equation of electric field inside a control volume. The equation is shown below,


\nabla V = -\alpha \nabla T - \rho J


The \alpha is Temperature-dependent Seeback Coefficient Polynomial, T is temperature, \rho is Temperature-dependent Electrical Conductivity Polynomial, and J is current flux.

In order to solve this equation, I use UDS to represent each term at RHS. Each term represented by UDS1 and UDS0, respectively.


\nabla UDS0 = - \rho J

and,

-\nabla UDS1 = \alpha \nabla T

Those representation of RHS term are based from the reference journal I read. For UDS1, I think it's pretty straight forward, I think I can write the code like this inside a cell loop.

Code:
real alpha;
alpha = 8.439e-4 - 3.81e-6*C_T(c,t) + 6.736e-9*pow(C_T(c,t),-9) - 3.934e-12*pow(C_T(c,t),-12);

NV_VS(C_UDSI_G(c,t,1) ,=, C_T_G(c,t),*,alpha);
I'm having difficulties on implementing the UDS0 to codes. The \rho is also a polynomial. So, basically I can take temperature value of a cell like I did on alpha. But the J term is what am trying to figure how to write it in codes.

I mean to say that as we know J is a current flux which can be calculated from this equation below.

J = \frac {I} {A}

And the current within the cell can be calculated with the equation below.


I = \frac {\nabla UDS1} {R}

From what I understand, current usually calculated using area of surface flux. In this case, I want to calculate J for cell which contain multiple faces. Once, I figured that maybe in order to calculate J, I could just calculate every J value at each face on the cell then sum it all at the end.



But since I have to use UDS1 value to calculate this, I need to call the UDS1 value from the FACE. On that, I used F_UDSI macro. But in the Fluent Customization Guide stated,

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.
Based on that statements, I understand that I cannot take UDS1 face value within the interior. I have tried this and indeed it showed errors. Based on this experience, I know that summing up fluxes all over the cell faces are wrong method to calculate the J.

So, please. Does anyone have any suggestion on how to implement J term on my codes?

I have discussed with my professors and colleagues. But none of them familiar with UDF. So maybe someone here can offer their help. Thank you in advance.




Best regards,

Anas




luzikato 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
UDF for removing the density in the flux term of UDS Nadun19 Fluent UDF and Scheme Programming 3 February 13, 2019 05:38
UDS of concentration solved in multiphases system Tleja Fluent UDF and Scheme Programming 0 January 19, 2017 11:38
UDS gradient ?? akm Fluent UDF and Scheme Programming 0 April 23, 2012 14:49
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
pressure gradient term in low speed flow Atit Koonsrisuk Main CFD Forum 2 January 10, 2002 10:52


All times are GMT -4. The time now is 16:49.