CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF Pressure Inlet for standing wave (https://www.cfd-online.com/Forums/fluent-udf/152096-udf-pressure-inlet-standing-wave.html)

SDK125 April 23, 2015 14:13

UDF Pressure Inlet for standing wave
 
I am simulating the thermo acoustic effect using Fluent. The basic principle is that we are providing the pressure inlet. We have placed the porous media in between the two ends. The other end is closed (reflecting wall). Because of the porous media temp difference is generated across the porous media.
I have two options
1)Run the simulation for 30min total time. The standing wave will form after @ 30 min experimentally.
2) or we can directly provide the standing wave as pressure inlet.
What will be the UDF for the standing wave as inlet pressure?

mrwan September 18, 2017 14:13

Pulse wave
 
U CAN USE PULSE WAVE AS
#include "udf.h"
#define pi (22/7)
#define frq 235
DEFINE_PROFILE(PRES_AIR_INLET, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if (sin(2*pi*frq*t)>=0)
F_PROFILE(f, thread, position) = 100E+3*sin(2*pi*frq*t);
else
F_PROFILE(f, thread, position) =0;
}
end_f_loop(f, thread)
}
IT VERY EASY TO USE

ssj May 5, 2021 18:19

Hello
I am gonna simulate a thermoacoustic heat exchanger using fluent. The geometry accounts for a 3d shell and tube heat exchanger. The exhust gases of an engine function as hot fluid in conjunction with heating tubes containing standing/or traveling waves. As I am new at this field starting the process recently, could you please help me how to carry out the simulation.
Kind regards

AlexanderZ May 5, 2021 22:48

what are input data of your simulation and what are you going to get?

ssj June 20, 2021 13:59

velocity profile
 
Quote:

Originally Posted by mrwan (Post 664797)
U CAN USE PULSE WAVE AS
#include "udf.h"
#define pi (22/7)
#define frq 235
DEFINE_PROFILE(PRES_AIR_INLET, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if (sin(2*pi*frq*t)>=0)
F_PROFILE(f, thread, position) = 100E+3*sin(2*pi*frq*t);
else
F_PROFILE(f, thread, position) =0;
}
end_f_loop(f, thread)
}
IT VERY EASY TO USE

Dear Mrwan,
could we also use a velocity profile instead of the oscillatory pressure as an inlet boundary condition?
best

ssj June 20, 2021 14:12

1 Attachment(s)
Quote:

Originally Posted by AlexanderZ (Post 803226)
what are input data of your simulation and what are you going to get?

Dear AlexanderZ,
Thanks for your replay, I set mas flow inlet of my mixture as inlet B.C, needing a UDF file to be set as oscillatory pressure or velocity (skeptical which one must be used) inlet B>C at thermo-acoustic zones inside the heating tubes, as you can see in the figure attached. I am wondering if you worked on thermo-acoustic cfd simulation, it would be appreciated if you help me in this regard.
bestAttachment 85024

pakk June 20, 2021 14:16

Quote:

Originally Posted by ssj (Post 806482)
Dear Mrwan,
could we also use a velocity profile instead of the oscillatory pressure as an inlet boundary condition?
best

Yes, just write the equation you want in mathematical language. Put it here, I can help you to put it in program form.

By the way: this is wrong on multiple levels:
Code:

#define pi (22/7)
Never use this. In Fluent code, you can just use M_PI if you need pi.

ssj June 20, 2021 16:22

thanks for your reply dear,
I don't know which B.C type could help more to write UDF on? oscillatory velocity or pressure

pakk June 20, 2021 16:49

I can't answer the question about which BC you should be using, because I don't know the goal of your simulation.

mrwan June 20, 2021 17:11

Quote:

Originally Posted by ssj (Post 806482)
Dear Mrwan,
could we also use a velocity profile instead of the oscillatory pressure as an inlet boundary condition?
best

yes it is available

ssj July 17, 2021 15:20

error
 
Quote:

Originally Posted by pakk (Post 806486)
Yes, just write the equation you want in mathematical language. Put it here, I can help you to put it in program form.

By the way: this is wrong on multiple levels:
Code:

#define pi (22/7)
Never use this. In Fluent code, you can just use M_PI if you need pi.

Dear Pakk,
I faced this error while compiling the UDF:
The UDF library you are trying to load (C:\Users\SSJ\Desktop\TAHX_files\dp0\FFF\Fluent\li budf) is not compiled for 3d on the current platform (win64).
could u plz help me how to fix that?
regards

pakk July 18, 2021 02:42

This question is so common that I have put the answer in my signature a while ago. Please read what is directly below this.

ssj July 22, 2021 01:59

Dear Pakk
Thanks for your reply. U are very supportive man! Id like to ask u that coud u plz tell me should we define a conditional statement for wave B.C equation? I mean i am gonna use this UDF for a travelling wave boundary condition, so, is the equation of wave the same as u wrote in the UDF?
Kind regards

pakk July 22, 2021 04:26

I never wrote a UDF here. I don't know which BC you want to use. Tell me the BC (the equation, not just "for standing wave") and I can tell you how to implement that.

ssj July 30, 2021 09:02

Dear guys,
As i said before I am simulating a thermoacoustic travelling wave heat exchanger using fluent. I would like to know that is it necessary to enable the "acoustics mode" in Fluent in order to extract the thermoacoustic effect?
regrads


All times are GMT -4. The time now is 14:49.