CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   time dependent velocity input by user subroutine (https://www.cfd-online.com/Forums/siemens/56390-time-dependent-velocity-input-user-subroutine.html)

shohel mahmud December 17, 2007 16: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 16: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 19: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 07: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 11: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 19:03.