|
[Sponsors] |
Gradient 0 at the interface of two fluid zones |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 23, 2016, 07:52 |
Gradient 0 at the interface of two fluid zones
|
#1 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Hello guys,
I will explain my problem first and subsequently ask you a question. I have 2 fluid zones, called zone 1 and 2. At the zone 1, I am solving the UDS-0. Nevertheless, this UDS-0 is not solved at the zone 2. The problem I face is that the one of my energy source terms (ohmic heating) considers the gradient of UDS-0 in its calculation. So at the interface, Fluent picks the value of UDS-0 at the cell in zone 1 and solves the gradient to the cell in zone 2 (which is 0 since this UDS is not solved there). Thus, it ends up giving me a value that has no physical meaning, leading to extremely high temperatures. I wrote this piece of code to define the gradient at the interface as 0 and solve it everywhere else as it should be. 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); /* Initialise Cells */ thread_loop_c(ct, d) { begin_c_loop(c,ct) { C_UDMI(c,ct,SOLID_PHASE_CURRENT_DENSITY_X) = C_UDSI_G(c,ct,ELEC_POT)[0]; C_UDMI(c,ct,SOLID_PHASE_CURRENT_DENSITY_Y) = C_UDSI_G(c,ct,ELEC_POT)[1]; C_UDMI(c,ct,SOLID_PHASE_CURRENT_DENSITY_Z) = C_UDSI_G(c,ct,ELEC_POT)[2]; } end_c_loop(c,ct) } /* Loop over all faces on wall */ t = Lookup_Thread(d,33); begin_f_loop(f,t) { c0 = F_C0(f, t); t0 = THREAD_T0(t); C_UDMI(c0,t0,SOLID_PHASE_CURRENT_DENSITY_X) = 0.0; C_UDMI(c0,t0,SOLID_PHASE_CURRENT_DENSITY_Y) = 0.0; C_UDMI(c0,t0,SOLID_PHASE_CURRENT_DENSITY_Z) = 0.0; } end_f_loop(f,t) t = Lookup_Thread(d,34); begin_f_loop(f,t) { c1 = F_C1(f,t); t1 = THREAD_T1(t); C_UDMI(c1,t1,SOLID_PHASE_CURRENT_DENSITY_X) = 0.0; C_UDMI(c1,t1,SOLID_PHASE_CURRENT_DENSITY_Y) = 0.0; C_UDMI(c1,t1,SOLID_PHASE_CURRENT_DENSITY_Z) = 0.0; } end_f_loop(f,t) } Thank you in advance for any helpful comment. |
|
September 23, 2016, 08:35 |
|
#2 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Well, I found one way of doing it. The code works fine. Just had to name the interface I wanted to define the variable as 0 and input its ID in the code before provided.
I contacted Ansys in the past and they said this is a bug and they would correct it for the new versions. not sure they did it on 16/17 versions. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
Coupled interface in between solid and fluid zones | oozcan | FLUENT | 0 | August 2, 2016 07:12 |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 15:32 |
Grid interface between zones of different size | agustinvo | FLUENT | 2 | July 24, 2013 10:21 |
how to use fluid fluid interface | Beno | CFX | 0 | July 13, 2005 15:08 |