CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   prefcell&prefvalue meaning (

AmirBaqa1987 June 22, 2013 08:42

prefcell&prefvalue meaning
Hi everyone,
what do the following lines do in createFields?

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

thanks in advance

nimasam June 22, 2013 11:58

Dear Behnoud
solvers need the value of pressure at least in one point, so this line consider the value of the pressure of pRefCell equals zero

fumiya June 22, 2013 12:01


If you don't fix the pressure values on any boundaries for the incompressible flow,
the pressure values can not be determined. In this case you need to specify
the pressure value(pRefValue) at the cell(label: pRefCell).

Hope that helps,

musahossein July 31, 2013 12:27

Dear all:

The default pref is set to a high number 1e5 as shown below in the fvsolutions file (sloshingTank2D):

pRefPoint (0 0 0.15);
pRefValue 1e5;

Is this a standard or can it be set to zero? If it can be, how would I set it so that it is absolute zero (like in fortran absolute zero is set as 0.0d0).

I look forward to your reply.

nimasam July 31, 2013 13:25

you can use zero! for incompressible case, but for compressible case you should assign absolute pressure ;)

musahossein July 31, 2013 14:14

thanks for your response! I have another question. I need to probe a point for pressure. I do not want to a probe in controlDict since that would mean that I would have to run the solver each time I need to change the probe location, for example. I would therefore like to have the probe in the sampleDict file. I have the following code in my sampleDict file. But each time I run sample, OpenFoam ignores it. Any suggestions will be greatly appreciated. Thanks!


type probes;
functionObjectLibs ("");
region region1;
(0 0.5 -0.3)

fields (p);


All times are GMT -4. The time now is 12:24.