# User Function

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

 April 7, 2011, 16:04 User Function #1 New Member   Ryan Join Date: Sep 2010 Posts: 6 Rep Power: 8 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

 April 7, 2011, 17:17 #2 Senior Member   Join Date: Apr 2009 Posts: 129 Rep Power: 9 Try: [(\$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]

 April 14, 2011, 02:58 #3 Senior Member   Join Date: Oct 2009 Location: Germany Posts: 637 Rep Power: 13 \$\$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). Try (\$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])

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06 ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50 liugx212 OpenFOAM Paraview & paraFoam 4 December 22, 2005 17:55 ereiss FLUENT 1 July 8, 2004 16:10 kethireddy FLUENT 0 July 5, 2004 04:53

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