|
[Sponsors] |
August 28, 2018, 09:01 |
Pressure UDF not working as intended
|
#1 |
New Member
Madrid
Join Date: Apr 2018
Posts: 15
Rep Power: 8 |
Hi, recently I used this UDF to set the pressure in a velocity inlet:
#include "udf.h" DEFINE_PROFILE(pressure_inlet, thread, position) { face_t f; real t = CURRENT_TIME; real v = 4; real t1 = 11000/v; real t2 = 20000/v; real t3 = 32000/v; begin_f_loop(f, thread) { if (t <= t1) { F_PROFILE(f, thread, position) = 101325.0*pow(((288.15-0.0065*v*t)/288.15),5.25577); } else if (t <= t2) { F_PROFILE(f, thread, position) = pow(22632,(-(v*t-1000)/6341.62)); } else if (t <= t3) { F_PROFILE(f, thread, position) = 5474.87*pow(((216.65+0.010*(v*t-20000))/216.65),-34.163); } else { // Capture t values outside the allowed range: // print a message to the console and stop. Message("%d: Error: t=%e not allowed.\n",myid,t); return; } end_f_loop(f,thread) } } However the values I'm getting when I solve it, are no where close to what they should. Here are some images(see attached). What could be the reason behind it? For refference the geometry is a cube with a sphere in it, both fluids. The velocity inlet is the top face and a pressure outlet is set in the bottom face. My intention is to set an uniforn flow with the pressure changing as the UDF is written. Thanks in advance! PS: I also have been wondering if it might have to something with either the operating conditions or the refference values. |
|
August 28, 2018, 09:35 |
|
#2 |
Senior Member
|
Did you set the initial/supersonic pressure or total pressure? It should be the latter. If the fluid is incompressible please set operating pressure to zero and modify your UDF accordingly, or you will be surprised.
|
|
August 28, 2018, 10:17 |
|
#3 |
New Member
Madrid
Join Date: Apr 2018
Posts: 15
Rep Power: 8 |
Hi, thanks for your answer. I was indeed setting my desired pressure as Initial/Supersonic so there's 100% a mistake.
However I don't seem to be able to set a Total Pressure for the veolvity inlet( attached photo). I'm trying to set up my inlet conditions giving both the velocity and the pressure, since both of them change during the flow time. Last edited by miguwhynot; August 28, 2018 at 11:32. |
|
August 28, 2018, 14:00 |
|
#4 |
New Member
Madrid
Join Date: Apr 2018
Posts: 15
Rep Power: 8 |
Here's more info:
Hi everyone, I'm currently doing a project whose main goal is to be able to study how film temperature changes during the ascension of a high altitude balloon. The geometry model is pretty simple, 2 volumes, onw for the balloon and the other one for the air that surrounds it. To make the simulation my idea is to make a transient FLUENT simulation, whose inlet conditions change with the following UDFs: -UDF 1 "Temperature" #include "udf.h" DEFINE_PROFILE(temperature_inlet, thread, position) { face_t f; real t = CURRENT_TIME; real v = 4; real t1 = 11000/v; real t2 = 20000/v; real t3 = 32000/v; begin_f_loop(f, thread) { if (t <= t1) { F_PROFILE(f, thread, position) = 288.15-0.0065*v*t; } else if (t <= t2) { F_PROFILE(f, thread, position) = 216.65; } else if (t <= t3) { F_PROFILE(f, thread, position) = 216.65+0.0010*(v*t-20000); } else { // Capture t values outside the allowed range: // print a message to the console and stop. Message("%d: Error: t=%e not allowed.\n",myid,t); return; } end_f_loop(f,thread) } } -UDF2 Pressure #include "udf.h" DEFINE_PROFILE(pressure_inlet, thread, position) { face_t f; real t = CURRENT_TIME; real v = 4; real t1 = 11000/v; real t2 = 20000/v; real t3 = 32000/v; begin_f_loop(f, thread) { if (t <= t1) { F_PROFILE(f, thread, position) = 101325.0*pow(((288.15-0.0065*v*t)/288.15),5.25577); } else if (t <= t2) { F_PROFILE(f, thread, position) = 22605*pow(2.718281828,(11000-v*t)/6340); } else if (t <= t3) { F_PROFILE(f, thread, position) = 2447*pow((141.89+0.003*v*t)/216.65,-11.388); } else { // Capture t values outside the allowed range: // print a message to the console and stop. Message("%d: Error: t=%e not allowed.\n",myid,t); return; } end_f_loop(f,thread) } } As you can see both of them try to simulate the atmospheric external conditions for a ballon that ascends with a velocity of 4 m/s. When I'm trying to implement the problem in FLUENT I'm finding troubles when trying to set both the velocity inlet to 4 m/s and the pressure as shown before. My general idea was to make a velocity-inlet whose velocity was 4 m/s and a pressure outlet with the pressure given by the UDF. However when I do both things I get "floating point", and if I only select (velocity or pressure) the other doesn´t match the case. How would suggest to fix this case? Thanks you in advance. |
|
August 28, 2018, 21:39 |
|
#5 |
Senior Member
|
I have no comment on the way of your modeling but have you considered that apply the pressure profile at the outlet rather then inlet? For a normal subsonic flow you will not be able to specify both pressure and velocity simultaneously at the inlet, which gives five independent constraints for four incoming waves (three vorticity wave plus one acoustic wave) and the problem turns to be over-determined. If you insist on doing this you could use
Code:
DEFINE_ADJUST |
|
August 29, 2018, 04:22 |
|
#6 |
New Member
Madrid
Join Date: Apr 2018
Posts: 15
Rep Power: 8 |
Thanks aain for your answer. Yes I have been testing other models and setting the pressure in the outlet seems to work just fine.
Thanks for your answer! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What is difference between static pressure and gauge pressure? | aja1345 | FLUENT | 1 | July 20, 2018 21:05 |
UDF issue when implementing a downstream resistance dependent outlet pressure | shiju7279 | Fluent UDF and Scheme Programming | 1 | October 26, 2017 22:11 |
UDF for pressure outlet (resistance) | Lilly | Fluent UDF and Scheme Programming | 0 | October 15, 2014 07:22 |
Does star cd takes reference pressure? | monica | Siemens | 1 | April 19, 2007 12:26 |
Fluent 5.2, UDF and Pressure BC's | Alfonso Ferrandez | FLUENT | 0 | May 4, 2000 08:02 |