|
[Sponsors] |
UDF for pressure outlet backflow total temperature |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 27, 2014, 04:47 |
UDF for pressure outlet backflow total temperature
|
#1 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 14 |
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 |
|
January 27, 2014, 14:48 |
|
#2 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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 |
|
January 28, 2014, 03:28 |
Thanks
|
#3 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 14 |
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?
|
|
January 29, 2014, 09:42 |
|
#4 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
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 13:50. |
|
January 29, 2014, 10:05 |
|
#5 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 14 |
Thank you soooo much!
|
|
January 29, 2014, 12:05 |
ANSYS Fluent
|
#6 |
New Member
adnan
Join Date: Nov 2013
Location: Germany
Posts: 6
Rep Power: 13 |
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 |
|
January 29, 2014, 12:13 |
|
#7 | |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
Quote:
|
||
January 29, 2014, 14:27 |
|
#8 | |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 14 |
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? |
||
January 29, 2014, 14:29 |
|
#9 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
yes that's it, plot the velocity you'll see what's negative or not
|
|
February 3, 2014, 09:16 |
|
#10 | |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 14 |
Quote:
Man, I'm sorry but it doesn't seem to work I used the ID of my outlet, change the velocity direction but it doesn't work... It sets the backflow total temperature to 0, even if I initialize my case with 423.15 K (which is my initial condition). My geometry is planar (2D), not solid, but I am using an assialsimmetry condition... does it affect the UDF? Was your UDF written for a 3D geometry? |
||
February 3, 2014, 13:16 |
|
#11 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
- 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 16:20. |
|
February 4, 2014, 03:10 |
|
#12 |
New Member
Gilberto Santo
Join Date: Apr 2012
Location: Gent (Belgium)
Posts: 18
Rep Power: 14 |
I didn't know how to use the "adjust", I'm sorry I never used this kind of UDF before, so thank you so much! I'm now tryin to do what you told me.
Anyway, does this UDF work in steady and transition conditions too? |
|
February 4, 2014, 11:11 |
|
#13 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
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 |
|
June 23, 2017, 01:45 |
|
#14 |
New Member
Join Date: Aug 2016
Posts: 14
Rep Power: 10 |
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 02:41. |
|
Tags |
backflow, convection, pressure outlet, total temperature, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
Increasing of total temperature | Roland R | CFX | 4 | March 29, 2018 04:08 |
Inlet won't apply UDF and has temperature at 0K! | tccruise | Fluent UDF and Scheme Programming | 2 | September 14, 2012 07:08 |
non constant outlet temperature | amir7 | FLUENT | 0 | April 9, 2012 21:12 |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 16:45 |