CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Bug in enterDymFoam? (https://www.cfd-online.com/Forums/openfoam/98200-bug-enterdymfoam.html)

som March 5, 2012 14:37

Bug in enterDymFoam?
 
Hi

While working on custom solver based on enterDymFoam and erfConvectiveMeltingPimpleFoam found some strange thing in pEqn.H file in the enterDymFoam directory :
------------
p == p_rgh + rho*gh;

if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rho*gh;
}
--------------------

Does p == p_rgh + rho*gh do anything or just return Bool ? Sorry for stupid question

ps: openfoam v 2.1

nimasam March 6, 2012 02:17

as you may know! p contains gravity term, so
p == p_rgh + rho*gh
add the term rho*gh (gravity term ) into p_rgh ( pressure with out gravity term)

if your question is about "==" vs "=", it returns to definition of "==" which update both internalField and boundary condition of p vs "=" just update the internalField

som March 6, 2012 02:41

Quote:

Originally Posted by nimasam (Post 347838)
as you may know! p contains gravity term, so
p == p_rgh + rho*gh
add the term rho*gh (gravity term ) into p_rgh ( pressure with out gravity term)

if your question is about "==" vs "=", it returns to definition of "==" which update both internalField and boundary condition of p vs "=" just update the internalField


Yes, the question was about "==". In C++ basicly "==" is a comparison operator, returns true or false. Do you mean that it was overloaded somewhere?
Sorry again for stupid question i'm very beginner in openfoam & c++ .


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