|
[Sponsors] |
Why are the derivatives of a UDS strange at boundaries? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Hugo
Join Date: Feb 2016
Posts: 3
Rep Power: 10 ![]() |
Hi,
When I calculate the derivatives of a UDS, the result is very strange at boundaries. I used C_UDSI_G. The values are correct inside the domain though. I have tested this with a very simple case. If I set the value of UDS as a constant, the derivative should be zero but at boundary it has some values. Even though they are very small values, they can affect other calculations when they become denominator. Why does this happen? Is there any solution for this? |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
J. David
Join Date: May 2013
Posts: 10
Rep Power: 13 ![]() |
I have found the similar problem too. Maybe you can calculate the gradient by your code
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 ![]() |
This is a bug of Fluent. I contacted their support and it was reported to the programmers team. What you can do to decrease the effect of it is to set that if the cell is in the boundary, the gradient is equal to 0.
The following code is the one I used in my problem to set it as 0, might help you guys. Code:
DEFINE_EXECUTE_AT_END(gradient_zero_boundary) { Domain *d; face_t f; cell_t c, c0, c1; Thread *t, *t0, *ct, *t1; d = Get_Domain(1); anode_diffusion_shadow_id = RP_Get_Integer("fuel-cell/anode-diffusion-shadow-id"); cathode_diffusion_shadow_id = RP_Get_Integer("fuel-cell/cathode-diffusion-shadow-id"); /* Initialise Cells */ thread_loop_c(ct, d) { begin_c_loop(c,ct) { C_UDMI(c,ct,elec_x) = C_UDSI_G(c,ct,ELEC_POT)[0]; C_UDMI(c,ct,elec_y) = C_UDSI_G(c,ct,ELEC_POT)[1]; C_UDMI(c,ct,elec_z) = C_UDSI_G(c,ct,ELEC_POT)[2]; } end_c_loop(c,ct) } /* Loop over all faces on wall */ t = Lookup_Thread(d,anode_diffusion_shadow_id); begin_f_loop(f,t) { c0 = F_C0(f, t); t0 = THREAD_T0(t); C_UDMI(c0,t0,elec_x) = 0.0; C_UDMI(c0,t0,elec_y) = 0.0; C_UDMI(c0,t0,elec_z) = 0.0; } end_f_loop(f,t) t = Lookup_Thread(d,cathode_diffusion_shadow_id); begin_f_loop(f,t) { c1 = F_C1(f,t); t1 = THREAD_T1(t); C_UDMI(c1,t1,elec_x) = 0.0; C_UDMI(c1,t1,elec_y) = 0.0; C_UDMI(c1,t1,elec_z) = 0.0; } end_f_loop(f,t) } |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
Hugo
Join Date: Feb 2016
Posts: 3
Rep Power: 10 ![]() |
Thanks, David.
I would like to do it but I am not so good at programming. Could you let me know it if you don't mind? Also Thanks for your code, Machado. But I have to use the gradient on boundaries and I can't set it as 0. Thanks anyway. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
J. David
Join Date: May 2013
Posts: 10
Rep Power: 13 ![]() |
Hi Machado
I think, maybe one can calculate the gradient of UDS by the information of the two adjacent cell on boundary. I find that you are modeling fuel cell, and I am doing the similar work too. Hope we can have more communication in the future |
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
J. David
Join Date: May 2013
Posts: 10
Rep Power: 13 ![]() |
Hi Hugo
In my case, the gradient of UDS is directly calculated by (C_UDSI(c0,t0,i)-C_UDSI(c1,t1,i))/(X(1)-X(0))(take x-direction for example). |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Hugo
Join Date: Feb 2016
Posts: 3
Rep Power: 10 ![]() |
Hi David.
I will apply it though I am a little worried about how I can modify it on the boundary. Thanks again. |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange temperature changes around boundaries | zhouyulun | FLUENT | 0 | June 30, 2014 08:18 |
Strange boundaries for k and epsilon | henning | OpenFOAM Running, Solving & CFD | 4 | January 7, 2009 03:54 |
Strange boundaries for k and epsilon | henning | OpenFOAM Running, Solving & CFD | 0 | December 16, 2008 09:42 |
UDS flux and boundaries | Kasper Skriver | FLUENT | 0 | April 18, 2006 09:36 |
UDS transport: strange results | Ale | FLUENT | 1 | November 6, 2003 07:28 |