CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Can I define grids motion as a time functions (https://www.cfd-online.com/Forums/cfx/18487-can-i-define-grids-motion-time-functions.html)

Darcy March 28, 2001 06:22

Can I define grids motion as a time functions
 
Dear all

The complete title is 'Can I define grids motion as a time functions in a command file?'

In CFX-4, I think it not a easy job to use USRGRD for the definition of grids motion. I saw the desk calculator mode in command file today.I wondered if it can help me define grids motion to be a time function immediately in command file. To give my comcept, I give the commmand file codes below:

>>GRID MOTION PARAMETERS

#CALC

ALPHA = OMEGAT ** 2.0 / (4.0 * 3.41592);

OMEGA = ALPHA * TIME;

#ENDCALC

/* THE VARIABLE 'TIME' IS TIME VALUE OF TRANSIENT FLOW FIELD */

BLOCK NAMES 'BLOCK-NUMBER-1','BLOCK-NUMBER-2'

POSITION OF MATION AXIS 3 * 0.0

DIRCETION VECTOR OF MOTION AXIS -1.0 0.0 0.0

ROTATION SPEED #OMEGA

>>END

I make grids 'BLOCK-NUMBER-1' and 'BLOCK-NUMBER-2' rotate about the axis defined by (0,0,0) and (-1,0,0). The rotation speed is a linear time function. The rotation speed is 0 at t = 0 and OMEGAT when t = T. What's more the rotation acceleration is constant.

Is it all right? If it's not, pls. tell me what is not correct. Thx.

P.s. Is there someone tell me how to use CALL DEF('.spch.') and CALL DEF('.indc.')

gjvdg March 28, 2001 16:01

Re: Can I define grids motion as a time functions
 
Darcy,

- My calculator says pi is equal to 3.141592654 and not 3.41592.

I used the following code for rotation of block1 and 2 with

- 3 Hz;

- 360 degrees in 56 steps

- total number of steps is Nstep = 672

- This makes 672/56=12 rotations

- 12 rotations at 3 Hz is 4 seconds in the real world.

#CALC

PI = 4.0*ATAN(1.0);

DEGREE = PI/180.0;

FREQ = 3.0;

OMEGA = 2.0 * PI * FREQ; /* rad/s */

ANGLE = 360/56;

RSTEP = ANGLE * DEGREE;

DT = RSTEP /((2.0*PI) * FREQ);

NSTAP = 672;

#ENDCALC

. . .

>>GRID MOTION PARAMETERS

MOTION AROUND X AXIS

ROTATION SPEED #OMEGA

BLOCK NAMES 'BLOCK1' 'BLOCK2'

>>TRANSIENT PARAMETERS
:>FIXED TIME STEPPING

TIME STEPS #NSTAP * #DT

Hope this helps, Gert-Jan

Darcy March 29, 2001 01:47

Re: Can I define grids motion as a time functions
 
Thank you, Gert-Jan

I forgot use atan() to determine pi and typed it by hands in command file.

Additionally I gave a wrong title. This time I give a new title as 'Can I define the speed of grid motion as a time function in command file'

I tried yesterday and failed to archive my goal. I hope somebody can tell me if it is possible.

Darcy

Gert-Jan van der Gulik March 29, 2001 08:34

Re: Can I define grids motion as a time functions
 
Darcy,

I think it is not possible to vary the speed in the command file. You have to do this in USRGRD which is not too difficult, depending on your geometry, but you have to invest some time in it.

Gert-Jan

Darcy March 29, 2001 21:14

Re: Can I define grids motion as a time functions
 
Yes, I think so.

Thank u.

Darcy


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