CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Reference pressure

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By aloeven

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2010, 05:24
Default Reference pressure
  #1
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 17
OFU is on a distinguished road
Hello,

for my computations I need to set a reference pressure in one cell of the outer wall (named oustide) of my geometry. But how can I find out which cells are part of the outer wall und how they are numbered, so that I can choose one from these cells? I had a look in the five files boundary, faces, neighbour, owner, points, but that didn't help me.
And how can I set the reference value in one cell? By using pRefCell and pRefValue?

Would be nice, if anyone could help me.

Thanks,
Jennifer
OFU is offline   Reply With Quote

Old   August 19, 2010, 08:10
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
You can foamToVTK -time 0, then in paraview select the cell you want to set the pressure on, open the selection inspector, make the cell label visible and select cellID (not "Cell ID"). Then use pRefCell and pRefValue to set the reference.
akidess is offline   Reply With Quote

Old   August 30, 2010, 17:06
Default
  #3
Member
 
Alex
Join Date: Apr 2010
Posts: 32
Rep Power: 16
aloeven is on a distinguished road
I had the same problem when I was using different meshes for the same geometry. The cell with label 0 was on the farfield boundary on one mesh and on a wall in another mesh.

Now I use pRefPoint instead of pRefCell. Then the reference pressure is defined in the point you want, just give the x, y, and z coordinates:

pRefPoint (x y z);

instead of

pRefCell 0;
Mueye and libindaniel2000 like this.
aloeven is offline   Reply With Quote

Old   August 31, 2010, 05:01
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Alex, does this also work for decomposed meshes?
akidess is offline   Reply With Quote

Old   August 31, 2010, 06:34
Default
  #5
Member
 
Alex
Join Date: Apr 2010
Posts: 32
Rep Power: 16
aloeven is on a distinguished road
I didn't think of that. But I performed parallel computations and observed no problems.
aloeven is offline   Reply With Quote

Old   August 31, 2010, 10:37
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Ok, good to know!
akidess is offline   Reply With Quote

Old   September 15, 2010, 06:19
Default
  #7
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 17
OFU is on a distinguished road
I used Paraview to find the right cell and now it works with pRefCell and pRefValue. Thanks for your answer, Anton.
But then I tried to use pRefPoint, because I think it's the easier way to set the reference pressure at a special point. So I replaced pRefCell with pRefPoint, but it didn't work. Alex, can you explain me in detail how to use it? What must be written in which file? I want to use it with the solver rhoPisoFoam...

It would be nice, if you can help me.
OFU is offline   Reply With Quote

Old   September 15, 2010, 06:35
Default
  #8
Member
 
Alex
Join Date: Apr 2010
Posts: 32
Rep Power: 16
aloeven is on a distinguished road
In your system/fvSolution file there is something like:

SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}


Change this to the following if you want to specify 0 pressure at point (1,0,0.5):

SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefPoint (1 0 0.5);
pRefValue 0;
}
aloeven is offline   Reply With Quote

Old   September 15, 2010, 10:13
Default
  #9
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 17
OFU is on a distinguished road
I changed pRefCell to pRefPoint in system/fvSolution, but it doesn't work. in the createFields.H file of rhoPisoFoam I added

scalar pRefValue = 0.0
label pRefCell = 0
setRefCell (p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue)

to use pRefCell and pRefValue and I think this causes ther error. I tried to use something like

point pRefPoint = (0 0 0)
label pRefCell = 0
setRefCell (p, mesh.solutionDict().subDict("SIMPLE"), pRefpoint, pRefValue)

but this also doesn't work. So what do I have to write in createFields.H that I can use pRefPoint? Do I have to integrate a special header-file or have I just to leave it out?
OFU is offline   Reply With Quote

Old   September 15, 2010, 10:24
Default
  #10
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Quote:
Originally Posted by OFU View Post
I changed pRefCell to pRefPoint in system/fvSolution, but it doesn't work. in the createFields.H file of rhoPisoFoam I added

[...]
to use pRefCell and pRefValue and I think this causes ther error. I tried to use something like

[...]
but this also doesn't work. So what do I have to write in createFields.H that I can use pRefPoint? Do I have to integrate a special header-file or have I just to leave it out?
You mention an error three times, yet don't tell us even once what error it is you are having. Makes it hard to guess a solution.
akidess is offline   Reply With Quote

Old   September 15, 2010, 10:28
Default
  #11
Member
 
Alex
Join Date: Apr 2010
Posts: 32
Rep Power: 16
aloeven is on a distinguished road
Sorry, I didn't notice in your previous post that you are using rhoPisoFoam.

The reference value for the pressure is only needed for the incompressible solvers like simpleFoam or pisoFoam. Since there the actual value of the pressure does not matter, but only the pressure gradient.

For simulations with rhoPisoFoam, you don't need to specify a reference pressure. Even if you specify it in the fvSolution file, it will not be used.
aloeven is offline   Reply With Quote

Old   May 17, 2011, 12:15
Default
  #12
Member
 
Kai
Join Date: May 2010
Location: Shanghai
Posts: 61
Blog Entries: 1
Rep Power: 16
kaifu is on a distinguished road
Hi Alex
Quote:
Originally Posted by aloeven View Post
SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefPoint (1 0 0.5);
pRefValue 0;
}
how could i lookup a vector instead of a scalar?

If we want to lookup a scalar we use
Code:
int pRefValue(readInt(piso.lookup("pRefValue")));
And furthermore, if we made it, and how could we apply pRefPoint instead of pRefCell?
Code:
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
I noticed that both in pisoFoam and simpleFoam, the codes is written as,
Code:
    label pRefCell = 0;
    scalar pRefValue = 0.0;
    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
@createFields.H

It seems that the value "pRefCell and pRefValue " read from system/fvSolution is useless since pRefCell and pRefValue is given in createFields.H.

// Kai
kaifu 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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
specify a reference pressure point in FD method? Rui Main CFD Forum 10 August 30, 2010 09:50
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 01:35
RE: Reference Pressure dilemma CFD USER CFX 7 September 3, 2008 08:51
Changing reference pressure Andrea Siemens 3 May 15, 2008 19:20


All times are GMT -4. The time now is 13:51.