CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Scheme file for sinusoidal channel flow (https://www.cfd-online.com/Forums/fluent/70432-scheme-file-sinusoidal-channel-flow.html)

elobb November 24, 2009 10:27

Scheme file for sinusoidal channel flow
 
I am trying to model flow through a channel, Womersley number one, with a sinusoidal pressure gradient. I saw elsewhere on this forum that using a udf with a scheme file to implement it at each timestep is the way forward, though I am having trouble programming the scheme file.

This is the udf and scheme file I started with..

udf...

#include "udf.h"

DEFINE_EXECUTE_AT_END(execute)
{
real pressure, t;
t=CURRENT_TIME;
pressure=sin(t);; /* The pressure gradient can be a function of time. */
RP_Set_Real("flag", pressure); /* This will store the pressure gradient value in a variable called flag*/
}

scheme file...

(rp-var-define 'flag 0 'real #f)
(define print
(lambda()
(define nu (rpgetvar 'flag))
(rpsetvar 'periodic/pressure-derivative nu)
)
)

Any help would be much appreciated

Regards


All times are GMT -4. The time now is 23:40.