CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Field function in StarCCM (https://www.cfd-online.com/Forums/star-ccm/242238-field-function-starccm.html)

hamed1983 April 11, 2022 20:57

Field function in StarCCM
 
Hi all,

I am a newbie in StarCCM, and I am simulating a model in a virtual wind tunnel. I wanted to apply a specific velocity profile in the inlet using the field function but I have come across a problem. First, the equation of the wind profile is pretty simple in Matlab and it is U=@(x) 45*((z/0.0222).^0.11); while z is the position in z-direction ranging z=(1:100)/1000. Now I want to write a field function that can be input into the inlet but the star ccm keeps showing syntax error:
here is my code in starccm: (45*(pow($$Position[2]/0.0222,0.11 )))

Also, I don't know why the field function does not pop up in physic value-velocity!

So any help would be so welcome and highly appreciated.
regards,
Hamed

LuckyTran April 11, 2022 21:55

You have three closing parentheses ))) and only two opening ones ((

Your field function will result in a scalar field and not a vector field so of course it won't show up. Vectors have i,j,k components.

Note that a velocity profile can be specified using a vector field function or you can specify the x,y,z components using scalar functions. The vector route you need to fix your field function into an actual vector. The component route you need to click a few buttons and then you can use your field function. Go to Physics Values and in Methods choose composite. But make sure you create a new scalar field function with this definition and not a vector field function.

hamed1983 April 11, 2022 22:09

Dear Tran,

Thanks for your prompt reply. Well, these are three parentheses if you check again, even though the code itself is correct, right? and I was wondering if it can be the right approach for the given case explained in the previous question (profile of velocity inlet in a wind tunnel)?

Thanks a billion!

hamed1983 April 11, 2022 22:15

1 Attachment(s)
Dear Tran,

As you can see in the attached, why the wind velocity does not show the logarithmic profile. I know something is wrong but don't know what? I would be grateful if you give me a hand in this issue since I have nobody around to ask.

Kind regards

hamed1983 April 11, 2022 22:20

Dear Tran,

I don't know why the output shows zero!

Regards,

LuckyTran April 11, 2022 22:52

Dear 1983 read my post again

Btw if you're going to use a cracked windows, at least learn to turn off the activator.

You need to put in the range for V[2] not V[0]. Your field function isn't defined over the range of Position[0]


Also there's examples in the help file

hamed1983 April 11, 2022 23:21

Dear Tran

:D ooh how could u spot that!:) Thanks alot btw. That means a lot to me🙋

Regards


All times are GMT -4. The time now is 15:54.