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

Field Function Question

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2014, 10:14
Default Field Function Question
  #1
New Member
 
Jishen Zhang
Join Date: Jun 2014
Location: Vigo, Spain
Posts: 12
Rep Power: 11
Romarius is on a distinguished road
Hey guys,

I'm starting a project on a pipe gas flow between two tanks with different pressures. To set the initial condition on pressure, I had to create a field function which defined the pressure amplitude in function of x axis position.

So here's the problem:

P = 1000 Pa, 0<x<1 m
P = 200 Pa, 1<x<2 m

To make that, I was choosing a scalar field function and as definition I wrote:

($Position[1] < 1) ? 1000, 200

But that doesn't work

Does anybody have an idea whats wrong with my function?

Thanks,
Jishen
Romarius is offline   Reply With Quote

Old   June 6, 2014, 06:45
Default
  #2
azt
Member
 
allan thomson
Join Date: Mar 2009
Location: scotland
Posts: 45
Rep Power: 17
azt is on a distinguished road
Try using $$Position[1] or $$Centroid[1]

$ refers to a scalar, $$ for a vector

Position refers to geometry and centroid to the mesh

azt
azt is offline   Reply With Quote

Old   June 7, 2014, 02:10
Default
  #3
Senior Member
 
Ping
Join Date: Mar 2009
Posts: 556
Rep Power: 20
ping is on a distinguished road
there is another mistake in your equation since the command should be a colan

and a slight correction to what the location fields refer to

$$Position gives vertex location and for a cell is the average of the positions of the vertices of the cell
$$Centroid gives the cell or face centroid location
ping is offline   Reply With Quote

Old   June 7, 2014, 03:25
Default
  #4
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 498
Rep Power: 20
JBeilke is on a distinguished road
$$Position[1] gives the y-Value. You have to use $$Position[0] instead.
JBeilke is offline   Reply With Quote

Old   June 8, 2014, 16:18
Default
  #5
New Member
 
Jishen Zhang
Join Date: Jun 2014
Location: Vigo, Spain
Posts: 12
Rep Power: 11
Romarius is on a distinguished road
It works, thank all of you!

=)
Romarius 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
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 08:53
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 01:00.