|
[Sponsors] |
UDF for pressure outlet backflow total temperature |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 12 ![]() |
Hi all,
I am trying to solve a solidification and melting problem using Ansys Fluent 13. My problem is: I have a mass of PCM (Phase Change Material) which is warmed up by a flux of oil in a heat pipe. When melting occurs, I set the density of the PCM to reduce, so I need an outlet in the volume occupied by PCM to make mass flow out of domain. Obviously convective movements are important in my simulation, so I need to know if there is a way to set the backflow temperature equal to the temperature in the cell near the pressure outlet, maybe using a UDF. Can anyone help me? I hope I've been clear. Regards |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 13 ![]() |
Hi guy,
I think, it's possible. First, try to get the temperature in cells near the pressure outlet using a DEFINE_ADJUST general purpose macro. Then store it in a C_UDMI and recall it by a DEFINE_PROFILE macro for the face thread.
__________________
Regard yours |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 12 ![]() |
Thanks man! Unfortunately I'm not so good using that kind of macro... Can you tell me more about it? How would you write it?
|
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 16 ![]() |
I got exactly what you want, did that in the past
![]() Did you look on the udf forum? Code:
#include "udf.h" real T_mean; /* defined outside because will be used in multiple DEFINE macros */ DEFINE_ADJUST(adjust, domain, t) { real T_tot; real u; real counter = 0; face_t f; int ID = 20; /* outlet ID displayed in Fluent boundary conditions panel */ Thread *thread; thread = Lookup_Thread(domain, ID); begin_f_loop(f, thread) { u = F_U(f, thread); /* x velocity */ if (u >= 0) /* if fluid is going out... */ { T_tot += F_T(f, thread); counter = counter + 1; } } end_f_loop(f, thread) T_mean = T_tot/counter; /* arithmetic mean T of outflow */ } DEFINE_PROFILE(T_backflow, thread, position) { face_t f; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = T_mean; } end_f_loop(f, thread) } - If I remember well, I think you have to interprete the udf before each simulation to reset the variables - It does an arithmetic mean of the outgoing fluid temperature, not accurate if your mesh is not uniform at the outlet and temperature varies a lot - If I were you, I'd modify the code for an area-weighted average of T of the outgoing fluid at the boundary Last edited by macfly; January 29, 2014 at 12:50. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 12 ![]() |
Thank you soooo much!
![]() |
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
adnan
Join Date: Nov 2013
Location: Germany
Posts: 6
Rep Power: 11 ![]() |
Dear friends, I have question in fluent please.
I used ICEM for simulate heat transfer in kiln, then export to fluent, actually in this time i run my program without combustion. can get converge at residual e-2 but with not good report about mass net, as same time reasonable result. so take more for residual until e-4 , also get converge but not reasonable result and in this case report mass excepted? any suggest, thanks in advance adnan |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 16 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#8 | |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 12 ![]() |
Quote:
Did you have the pressure outlet on the right side of domain? I have it on the left, so maybe I should consider the velocity in the opposite direction... Am I right? ![]() |
||
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 16 ![]() |
yes that's it, plot the velocity you'll see what's negative or not
|
|
![]() |
![]() |
![]() |
![]() |
#10 | |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 12 ![]() |
Quote:
Man, I'm sorry but it doesn't seem to work ![]() |
||
![]() |
![]() |
![]() |
![]() |
#11 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 16 ![]() |
- I assume you interpreted the udf and set the backflow T at the outlet.
- But did you hook the DEFINE_ADJUST? (Define\User-Defined\Function Hooks...\edit Adjust and select 'adjust' The udf works in 2D or 3D. I don't think that the axial symmetry boundary affects the udf. Last edited by macfly; February 3, 2014 at 15:20. |
|
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 12 ![]() |
I didn't know how to use the "adjust", I'm sorry
![]() Anyway, does this UDF work in steady and transition conditions too? |
|
![]() |
![]() |
![]() |
![]() |
#13 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 16 ![]() |
hooking is like telling Fluent to use the udf it interpreted (or compiled), see the Ansys Fluent UDF Manual
yes it will work for steady or transient cases |
|
![]() |
![]() |
![]() |
![]() |
#14 |
New Member
Join Date: Aug 2016
Posts: 13
Rep Power: 8 ![]() |
Hello,
I'm trying with this UDF but it stops when reaching about the 30 iteration (Diverges), and I'm still not sure why, can some help me, what do I need to check for that to work well? I have to tell, this only happens when I use the Coupled Pseudotransient Method, the thing is, I do need to use this solution method. Hope you can help me. Regards. Last edited by jjfm20; July 1, 2017 at 01:41. |
|
![]() |
![]() |
![]() |
Tags |
backflow, convection, pressure outlet, total temperature, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 07:15 |
Increasing of total temperature | Roland R | CFX | 4 | March 29, 2018 03:08 |
Inlet won't apply UDF and has temperature at 0K! | tccruise | Fluent UDF and Scheme Programming | 2 | September 14, 2012 06:08 |
non constant outlet temperature | amir7 | FLUENT | 0 | April 9, 2012 20:12 |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 15:45 |