CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   creating a field function (https://www.cfd-online.com/Forums/star-ccm/65922-creating-field-function.html)

 can_yas June 30, 2009 19:21

creating a field function

Hello,

I am working on a project where I have to simulate the flow of air through a pipeline.

I want to create the velocity inlet profile on star ccm+.

How do I implement this function into the program.

funktion :
-2E-08z^4 + 2E-05z^3 - 0,007z^2 + 1,03z- 4,578

Can

 SKK July 1, 2009 05:37

(-2*pow(10,8)*(pow(\$\$Centroid[2],4))) + (2*pow(10,5)*(pow(\$\$Centroid[2],3))) - (0.007*(pow(\$\$Centroid[2],2))) + (1.03*(\$\$Centroid[2])) - 4.578

In the above formulation you can also use \$\$Position[2] instead of \$\$Centroid[2] is thats what you need.

To implement the field function on the boundary
Region > Boundaries> Physics Values > Velocity Magnitude (Method > field function)

 can_yas July 1, 2009 06:59

(-2 * Pow (10.8) * (pow (\$ \$ Centroid [2], 4))) + (2 * pow (10.5) * (pow (\$ \$ Centroid [2], 3))) - (0.007 * (pow (\$ \$ Centroid [2], 2))) + (1.03 * (pow (\$ \$ Centroid [2], 1))) - 4.578

I have the equation changed(red color), ist dies correct?
and if I have this equation enter into the program, I get error message "Compiled field function type is not vector "

Can

 SKK July 1, 2009 07:06

Quote:
 Originally Posted by can_yas (Post 221058) (-2 * Pow (10.8) * (pow (\$ \$ Centroid [2], 4))) + (2 * pow (10.5) * (pow (\$ \$ Centroid [2], 3))) - (0.007 * (pow (\$ \$ Centroid [2], 2))) + (1.03 * (pow (\$ \$ Centroid [2], 1))) - 4.578 I have the equation changed(red color), ist dies correct? and if I have this equation enter into the program, I get error message "Compiled field function type is not vector " Thanks in advance. Can
Try this, just copy and paste...

(-2 * pow (10,8) * (pow (\$\$ Centroid [2], 4))) + (2 * pow (10,5) * (pow (\$\$ Centroid [2], 3))) - (0.007 * (pow (\$\$ Centroid [2], 2))) + (1.03 * (\$\$ Centroid [2])) - 4.578

In the pow command variables are separated with commas. Also, no space between the two \$\$ signs.

 can_yas July 1, 2009 07:41

Thank you for your effort, unfortunately, does not again.diese equation is a velocity distribution in a Pipe.
I have descriped cylindrical coordinatesystem in the Inlet .it must be the Origin in the middle? Part(Pipe) has a symmetry Plane :)

Sure that he need to write the E8 as a pow?
Normally it works without this fine?!

 can_yas July 1, 2009 08:53

Hi,

I have changed the equation again.

-0.00000002 * (pow (\$\$ Centroid [2], 4)) + 0.00002 * (pow (\$\$ Centroid [2], 3)) -
0.007 *(pow(\$\$ Centroid [2], 2)) + 1.03 * (\$\$ Centroid [2]) - 4.578

Unfortunately, I get the same error message again,"Compiled field function type is not vector "

Thanks

 SKK July 1, 2009 09:01

Have you changed the field function 'Type' to vector?

I don't get this error message. I am using an older version of STAR CCM+. I will check it with the new version later and let you know.

Hmm is the function set a scalar?

 can_yas July 1, 2009 09:18

No, I have field function 'Type' Scalar. I am using version 4.2 of STAR CCM+. how did they coordinate system defined?

 SKK July 1, 2009 09:23

for vector definition, the three velocity components are described [x,y,z]. I guess in your case it would be

[0,0,-0.00000002 * (pow (\$\$ Centroid [2], 4)) + 0.00002 * (pow (\$\$ Centroid [2], 3)) -
0.007 *(pow(\$\$ Centroid [2], 2)) + 1.03 * (\$\$ Centroid [2]) - 4.578]

4.2? You mean 4.02? ;)
In the properties you have the function type.
Make a screenshot.

 SKK July 1, 2009 09:32

Quote:
 Originally Posted by Maddin (Post 221067) Sure that he need to write the E8 as a pow? Normally it works without this fine?!
You're right, it works fine. I like to use pow so that I dont miss a zero...

 can_yas July 1, 2009 09:39

Quote:
 Originally Posted by SKK (Post 221078) for vector definition, the three velocity components are described [x,y,z]. I guess in your case it would be [0,0,-0.00000002 * (pow (\$\$ Centroid [2], 4)) + 0.00002 * (pow (\$\$ Centroid [2], 3)) - 0.007 *(pow(\$\$ Centroid [2], 2)) + 1.03 * (\$\$ Centroid [2]) - 4.578]

That is really unbelievable. This works. I am very grateful for their help:D

 can_yas July 1, 2009 09:41

Quote:
 Originally Posted by Maddin (Post 221079) 4.2? You mean 4.02? ;)

course V4.02:(