CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   error: no match for ‘operator-' (

udiitm April 25, 2012 13:58

error: no match for ‘operator-'
Hi All,

I am getting the following error message :

In file included from myInterFoam.C:94:0:
pEqn.H:27:28: error: no match for ‘operator-’ in ‘Foam:Operator*

this is while i am compiling using wmake for pEqn.H.

Here in pEqn.H, I am using the following codes:

phi = phiU +
- ghf*fvc::snGrad(rho)

The above bold line shows the error line.

Similar kind of error I am getting for UEqn.H also

Please suggest me what can be the error.

Thanking you all in advance.

Thanks & Regards,

Yudhast Kumar

adhiraj April 25, 2012 16:27

It could be that the problem is you are trying to pre multiply the result from fvc::snGrad(rho) with something.
Try creating a variable GradRho(volScalar(or volVector)Field with proper dimensions) to store fvc::snGrad(p).
Then in this step, use -ghf*GradRho.

udiitm April 26, 2012 00:34

Dear Adhiraj,
Thanks for your reply.
actually the syntax is the same for general interFoam. I have just changed interpolation to average.


Even the change you have suggested is giving same error.


All times are GMT -4. The time now is 11:32.