|
[Sponsors] |
April 7, 2011, 17:04 |
User Function
|
#1 |
New Member
Ryan
Join Date: Sep 2010
Posts: 6
Rep Power: 15 |
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, 18:17 |
|
#2 |
Senior Member
Join Date: Apr 2009
Posts: 153
Rep Power: 16 |
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, 03:58 |
|
#3 |
Senior Member
Join Date: Oct 2009
Location: Germany
Posts: 636
Rep Power: 21 |
$$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 | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
[OpenFOAM] Could you please help me | liugx212 | ParaView | 4 | December 22, 2005 17:55 |
User Defined Function for convection coefficient | ereiss | FLUENT | 1 | July 8, 2004 17:10 |
User define flux function | kethireddy | FLUENT | 0 | July 5, 2004 05:53 |