CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

creating a field function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2009, 19:21
Default creating a field function
  #1
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
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


Thanks in advance.
Can

Last edited by can_yas; July 1, 2009 at 03:26.
can_yas is offline   Reply With Quote

Old   July 1, 2009, 05:37
Default
  #2
SKK
Member
 
Join Date: Mar 2009
Posts: 55
Rep Power: 17
SKK is on a distinguished road
(-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)

Last edited by SKK; July 1, 2009 at 06:58.
SKK is offline   Reply With Quote

Old   July 1, 2009, 06:59
Default
  #3
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
(-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
can_yas is offline   Reply With Quote

Old   July 1, 2009, 07:06
Default
  #4
SKK
Member
 
Join Date: Mar 2009
Posts: 55
Rep Power: 17
SKK is on a distinguished road
Quote:
Originally Posted by can_yas View Post
(-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.
SKK is offline   Reply With Quote

Old   July 1, 2009, 07:41
Default
  #5
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
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

Last edited by can_yas; July 1, 2009 at 09:03.
can_yas is offline   Reply With Quote

Old   July 1, 2009, 08:30
Default
  #6
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
Sure that he need to write the E8 as a pow?
Normally it works without this fine?!
Maddin is offline   Reply With Quote

Old   July 1, 2009, 08:53
Default
  #7
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
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
can_yas is offline   Reply With Quote

Old   July 1, 2009, 09:01
Default
  #8
SKK
Member
 
Join Date: Mar 2009
Posts: 55
Rep Power: 17
SKK is on a distinguished road
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.
SKK is offline   Reply With Quote

Old   July 1, 2009, 09:02
Default
  #9
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
Hmm is the function set a scalar?
Maddin is offline   Reply With Quote

Old   July 1, 2009, 09:18
Default
  #10
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
No, I have field function 'Type' Scalar. I am using version 4.2 of STAR CCM+. how did they coordinate system defined?
can_yas is offline   Reply With Quote

Old   July 1, 2009, 09:23
Default
  #11
SKK
Member
 
Join Date: Mar 2009
Posts: 55
Rep Power: 17
SKK is on a distinguished road
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]
SKK is offline   Reply With Quote

Old   July 1, 2009, 09:27
Default
  #12
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
4.2? You mean 4.02?
In the properties you have the function type.
Make a screenshot.
Maddin is offline   Reply With Quote

Old   July 1, 2009, 09:32
Default
  #13
SKK
Member
 
Join Date: Mar 2009
Posts: 55
Rep Power: 17
SKK is on a distinguished road
Quote:
Originally Posted by Maddin View Post
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...
SKK is offline   Reply With Quote

Old   July 1, 2009, 09:39
Default
  #14
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
Quote:
Originally Posted by SKK View Post
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
can_yas is offline   Reply With Quote

Old   July 1, 2009, 09:41
Default
  #15
New Member
 
Join Date: Jun 2009
Posts: 7
Rep Power: 16
can_yas is on a distinguished road
Quote:
Originally Posted by Maddin View Post
4.2? You mean 4.02?

course V4.02
can_yas is offline   Reply With Quote

Old   July 1, 2009, 10:11
Default
  #16
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
@SKK: Maybe you should make a benchmark for this extra pow function

A other way would be to use $Centroid_i (maybe a "cleaner" way).
Of cource you need the vector "style" for the velocity I make too much 2D
Maddin is offline   Reply With Quote

Old   November 26, 2020, 08:37
Default
  #17
New Member
 
jas
Join Date: Nov 2020
Posts: 11
Rep Power: 5
jzyk1212 is on a distinguished road
I want to do what OP did but with a parabolic velocity profile inlet. The eqaution would be
v(r) = Vm(1-(r^2/R^2)). What code would i have to implement.
thanks
jzyk1212 is offline   Reply With Quote

Old   November 26, 2020, 15:40
Default
  #18
cwl
Senior Member
 
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 435
Rep Power: 17
cwl is on a distinguished road
Quote:
Originally Posted by jzyk1212 View Post
I want to do what OP did but with a parabolic velocity profile inlet. The eqaution would be
v(r) = Vm(1-(r^2/R^2)). What code would i have to implement.
thanks
You would have to implement reading User Guide p. 465 - "Field Functions".
You are welcome.
cwl is offline   Reply With Quote

Old   November 27, 2020, 10:08
Default
  #19
New Member
 
Madrigal
Join Date: Oct 2020
Location: Germany
Posts: 19
Rep Power: 5
CFD2DXY is on a distinguished road
Quote:
Originally Posted by jzyk1212 View Post
I want to do what OP did but with a parabolic velocity profile inlet. The eqaution would be
v(r) = Vm(1-(r^2/R^2)). What code would i have to implement.
thanks
first you should to define your parameters as a fieldfunktion... right click on fieldfunktion.. choice scalar... than define your Vm as a Value.. for example 0.2.. your radius too... and I think r is our radialcoordinate right?

Use this:

${Vm} * (1-(pow(${RadialCoordinate},2)/pow(${Radius},2)))

CFD2DXY
CFD2DXY is offline   Reply With Quote

Old   November 27, 2020, 10:18
Default
  #20
New Member
 
jas
Join Date: Nov 2020
Posts: 11
Rep Power: 5
jzyk1212 is on a distinguished road
Quote:
Originally Posted by CFD2DXY View Post
first you should to define your parameters as a fieldfunktion... right click on fieldfunktion.. choice scalar... than define your Vm as a Value.. for example 0.2.. your radius too... and I think r is our radialcoordinate right?

Use this:

${Vm} * (1-(pow(${RadialCoordinate},2)/pow(${Radius},2)))

CFD2DXY
Thanks. I have values for Vm and radius but I am confused as what to put for the radial coordinate given as the model is a pipe.
jzyk1212 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 04:35.