CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Pressure reference cell (https://www.cfd-online.com/Forums/openfoam-solving/58040-pressure-reference-cell.html)

maka November 22, 2006 04:16

There are two lines that need
 
There are two lines that need to be commented in any channel solver that was written for OpenFOAM V 1.2 to work under V 1.3:

// fvScalarMatrix::reference pRef =
// pEqn.unsetReference(pRef);

otherwise we get errors like:
---------------------
channelOoddns.3.C: In function 'int main(int, char**)':
channelOoddns.3.C:126: error: 'reference' is not a member of 'Foam::fvScalarMatrix'
channelOoddns.3.C:126: error: expected `;' before 'pRef'
channelOoddns.3.C:129: error: 'struct Foam::fvScalarMatrix' has no member named 'unsetReference'
channelOoddns.3.C:129: error: 'pRef' was not declared in this scope
-----------------------------

My question, were unsetting the referenceCell unnecessary or it was included somewhere else in the code? I noticed that the same change was applied to icoFoam. Thanks.

Best regards,
Maka

hjasak November 22, 2006 04:42

I am not sure I know what you
 
I am not sure I know what you mean: if you have a pressure equations with boundaries that do not fix pressure level, you have to fix a reference pressure.

In OpenFOAM-1.3 the syntax has changed:

pEqn.setReference(pRefCell, pRefValue);

and you can see it in all the solvers.

Hrv

maka November 22, 2006 05:17

I understand that but there we
 
I understand that but there were a statement on V1.2 that used to unset the reference pressure after solving pEq.

pEqn.unsetReference(pRef);

where pRef used to be defined as :

fvScalarMatrix::reference pRef =
pEqn.setReference(pRefCell, pRefValue);

In V 1.3:
a) one can not define a variable of type fvScalarMatrix::reference; not a big problem.

b) one can not unset the reference pressure after solve pEq with a code like:

pEqn.unsetReference(pRef)

since the member function unsetReference does not exit any more.

my question, why we can not unset the reference cell pressure after solving in V1.3 (see b))? is such unsetReference process included by default in pEq.solve() implementation? Thanks for your prompt reply.

Best regards,
Maka

hjasak November 22, 2006 05:22

It is because the way the pres
 
It is because the way the pressure reference is set has changed: OF-1.2 uses a constraint, which needs to be removed and OF-1.3 uses a lighter touch method, slightly boosting the diagonal (does not need to be removed).

Hrv

maka November 22, 2006 10:46

Thanks Hrv.
 
Thanks Hrv.

maddalena January 28, 2009 05:47

Hi all, sorry for the stupid
 
Hi all,
sorry for the stupid question but... how can I get the pRefCell value? I am wondering if I can reference it using its coordinates (as I would do with Fluent) or if I have to extract the ref cell number from my grid... And in this case, how can I do that?
Thanks a lot.
Mad

maddalena January 28, 2009 09:40

As the user guide says: "Chang
 
As the user guide says: "Changing either of these values will change the absolute
pressure field, but not, of course, the relative pressure field or velocity field.
... Thus no need to know that value... ;-)
Cheers, mad


All times are GMT -4. The time now is 14:15.