|
[Sponsors] |
June 19, 2005, 00:30 |
Square Wave Profile
|
#1 |
Guest
Posts: n/a
|
Dear All,
How do I generate a square wave profile for a pressure inlet boundary condition? I tried FFT but there are some problems with this. I need this to be a discontinous flow, because my pressure needs to have a square profile from 0 psi to 180 psi. I do not know how to write this as a UDF code. Can someone please help me? Thanks. Manish |
|
June 20, 2005, 11:40 |
Re: Square Wave Profile
|
#2 |
Guest
Posts: n/a
|
Hi, I've incluced a modified version of a UDF I used to prescribe a time-dependent velocity at the inlet of a pipe. I've modified it quickly so check for errors.
To use this, either interpret or compile this UDF and go to define/boundary-conditions. Choose the face on which you want to use the pressure pulse and choose the UDF named "pressurepulse" in this case. If you need more details, let me know. Regards, David --------------------------------------------------- #include "udf.h" DEFINE_PROFILE(pressurepulse, thread, position) { real x[ND_ND]; float t, velocity,w,y,z; face_t f; t = RP_Get_Real("flow-time"); w=floor (t); z=t-w;/* z is ranging from 0 to 1 in this case but the time variable could be modified */ if (z<0.4) pressure = 0; else pressure =180; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = pressure; } end_f_loop(f, thread) } |
|
July 4, 2019, 21:02 |
Re: Square Wave Profile
|
#3 |
New Member
Islam Hassan
Join Date: Jul 2019
Posts: 5
Rep Power: 7 |
Thanks David,
I have question regarding your UDF, how can I change the requecy in your code like if I need to create square wave from 0 to 90 PSI, and 90 PSI from 0 to 0.5 sec and it is 0 from 0.5 to 1., asn so on. thanks in advance |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fully developed 3d velocity profile: Square inlet! | Taru | FLUENT | 6 | September 14, 2015 09:38 |
UDF for Square Wave | Emmanuel | FLUENT | 2 | March 13, 2010 09:36 |
Free surface water wave profile | John N. | FLUENT | 0 | February 2, 2009 17:17 |
UDF for square wave velocity profile..pls help | Frederik | FLUENT | 0 | May 8, 2006 07:48 |
udf_square wave profile | Ramin | FLUENT | 0 | March 8, 2006 10:38 |