CFD Online Logo CFD Online URL
Home > Forums > STAR-CCM+

User Function

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 7, 2011, 16:04
Default User Function
New Member
Join Date: Sep 2010
Posts: 6
Rep Power: 9
racerdude777 is on a distinguished road
I'm modeling a 3-D wing in a wind tunnel and am looking to oscillate the flow direction in a sinusoidal fashion. I am looking to use a simple user function to accomplish this but Star-CCM+ can't compile it. Can somebody take a look and shed some light on whats wrong with it? Thank you.

First Code:
($Time > 0) :
$$Velocity[0] = 24.218*COS*(0.2094395+0.174533*SIN*((0.2079*$Time) ));
$$Velocity[1] = 24.218*SIN*(0.2094395+0.174533*SIN*((0.2079*$Time) ));
$$Velocity[2] = 0;

Second Code:
($Time > 0)? [24.218*COS*(0.2094395+0.174533*SIN*((0.2079*$Time) )), 24.218*SIN*(0.2094395+0.174533*SIN*((0.2079*$Time) )), 0] : [0,0,0])

racerdude777 is offline   Reply With Quote

Old   April 7, 2011, 17:17
Senior Member
Join Date: Apr 2009
Posts: 129
Rep Power: 10
f-w is on a distinguished road

[($Time > 0) ? 24.218*cos(0.2094395+0.174533*sin(0.2079*$Time)) : 0, ($Time > 0) ? 24.218*sin(0.2094395+0.174533*sin(0.2079*$Time) ) : 0, 0]
f-w is offline   Reply With Quote

Old   April 14, 2011, 02:58
Senior Member
Join Date: Oct 2009
Location: Germany
Posts: 637
Rep Power: 15
abdul099 is on a distinguished road
$$Velocity[x] with x = 0,1,2 (from the first code) adresses the velocity field generated by the solver. You can not assign any values to one of the default field functions, so the statement "$$Velocity[0] = " can not work.
In general, your second code should work, but there are some * too much between the sin and cos functions and the following brackets. Even on your calculator, you don't type "sin * (5*PI)", you type sin(5*PI).

($Time > 0)? [24.218*COS(0.2094395+0.174533*SIN((0.2079*$Time) )), 24.218*SIN(0.2094395+0.174533*SIN((0.2079*$Time) )), 0] : [0,0,0])
abdul099 is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
Could you please help me liugx212 OpenFOAM Paraview & paraFoam 4 December 22, 2005 17:55
User Defined Function for convection coefficient ereiss FLUENT 1 July 8, 2004 16:10
User define flux function kethireddy FLUENT 0 July 5, 2004 04:53

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