CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   time dependent velocity input by user subroutine (http://www.cfd-online.com/Forums/cd-adapco/56390-time-dependent-velocity-input-user-subroutine.html)

shohel mahmud December 17, 2007 17:16

time dependent velocity input by user subroutine
 
Hi Everybody I am struggling with a simple transient model. I have a 2-D rectangular channel with one inlet, one outlet, and two walls. At the inlet, V and W velocity are zero. Only U velocity is time dependent. For example, U=U0*sin(2*pi*f*time) where, U0, f, and time are velocity amplitude, frequency, and time or iteration number. How can I set this boundary condition in starcd user subroutine? The existing subrutine only accept spatial variation not temporal.

any help will be greatly appreciated

shohel

university of waterloo

Pauli December 17, 2007 17:56

Re: time dependent velocity input by user subrouti
 
The user subroutine bcdefi.f supports time dependant velocity boundary conditions.

Another option is to use a table.


shohel mahmud December 17, 2007 20:56

Re: time dependent velocity input by user subrouti
 
Thanks Pauli I don't know how to implement time in the bcdefi.f suroutine. Specially, no idea about variable time or time step. Below I copied a portion of the bcdefi.f subroutine and show an example of time variation of U. lots of question mark, I don't know what to put to consider the time or time step or iteration. Do I need to "include" any new inc file or add new EQUIVALENCE. Your help will be greatly appreciated.

IF(IREG.EQ.2) THEN

TURINT=.FALSE.

U=2.3*sin(2*22/7*??????)

V=0.0

W=0.0

TE=0.0

ED=0.0

T=0

V22=0.0

F22=0.0

SCALAR(1)=0.0

DEN=0

ENDIF

RETURN

END C


James December 18, 2007 08:50

Re: time dependent velocity input by user subrouti
 
If you look in nom.inc the variable time should be available (it comes through a common block not the call list)

Pauli December 18, 2007 12:40

Re: time dependent velocity input by user subrouti
 
The bcdefi.f template should include the line:

INCLUDE 'usrdat.inc'

This gives you access to a parameter "TIME". So for your example:

U=2.3*sin(2*22/7*TIME)

When you tell Star to write the usubs, it should put usrdat.inc into the ufile subdirectory.

On my system I have to create the ufile subdirectory manually. Otherwise when I try to write the usubs, Star reports the directory doesn't exist.


All times are GMT -4. The time now is 10:17.