|
[Sponsors] |
June 5, 2014, 10:14 |
Field Function Question
|
#1 |
New Member
Jishen Zhang
Join Date: Jun 2014
Location: Vigo, Spain
Posts: 12
Rep Power: 11 |
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 |
|
June 6, 2014, 06:45 |
|
#2 |
Member
allan thomson
Join Date: Mar 2009
Location: scotland
Posts: 45
Rep Power: 17 |
Try using $$Position[1] or $$Centroid[1]
$ refers to a scalar, $$ for a vector Position refers to geometry and centroid to the mesh azt |
|
June 7, 2014, 02:10 |
|
#3 |
Senior Member
Ping
Join Date: Mar 2009
Posts: 556
Rep Power: 20 |
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 |
|
June 7, 2014, 03:25 |
|
#4 |
Senior Member
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 498
Rep Power: 20 |
$$Position[1] gives the y-Value. You have to use $$Position[0] instead.
|
|
June 8, 2014, 16:18 |
|
#5 |
New Member
Jishen Zhang
Join Date: Jun 2014
Location: Vigo, Spain
Posts: 12
Rep Power: 11 |
It works, thank all of you!
=) |
|
|
|
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 |