CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Compilation Error: "no matching function for call to ‘div(Foam::volScalarField&)’" (https://www.cfd-online.com/Forums/openfoam-programming-development/160014-compilation-error-no-matching-function-call-div-foam-volscalarfield.html)

abhiv September 29, 2015 20:49

Compilation Error: "no matching function for call to ‘div(Foam::volScalarField&)’"
 
Hi, I am compiling a new solver for a set of equations for weak gas discharge and I am getting this error.

Making dependency list for source file weakdischargeFoam.C
SOURCE=weakdischargeFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude -I/home/OpenFOAM/OpenFOAM-2.4.0/src/meshTools/lnInclude -IlnInclude -I. -I/home/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/home/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/weakdischargeFoam.o

weakdischargeFoam.C: In function ‘int main(int, char**)’:
weakdischargeFoam.C:54:22: error: no matching function for call to ‘div(Foam::volScalarField&)’
fvm::div(Ji) + alpha*Je
^
weakdischargeFoam.C:54:22: note: candidates are:
In file included from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.H:94:0,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvm.H:45,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvCFD.H:10,
from weakdischargeFoam.C:32:
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:45:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
div
^
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:45:1: note: template argument deduction/substitution failed:
weakdischargeFoam.C:54:22: note: cannot convert ‘Ji’ (type ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’) to type ‘const surfaceScalarField& {aka const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&}’
fvm::div(Ji) + alpha*Je
^
In file included from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.H:94:0,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvm.H:45,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvCFD.H:10,
from weakdischargeFoam.C:32:
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:62:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
div
^
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:62:1: note: template argument deduction/substitution failed:
weakdischargeFoam.C:54:22: note: cannot convert ‘Ji’ (type ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’) to type ‘const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&’
fvm::div(Ji) + alpha*Je
^
In file included from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.H:94:0,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvm.H:45,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvCFD.H:10,
from weakdischargeFoam.C:32:
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:77:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
div
^
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:77:1: note: template argument deduction/substitution failed:
weakdischargeFoam.C:54:22: note: cannot convert ‘Ji’ (type ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’) to type ‘const surfaceScalarField& {aka const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&}’
fvm::div(Ji) + alpha*Je
^
In file included from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.H:94:0,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvm.H:45,
from /home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvCFD.H:10,
from weakdischargeFoam.C:32:
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:88:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
div
^
/home/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvmDiv.C:88:1: note: template argument deduction/substitution failed:
weakdischargeFoam.C:54:22: note: cannot convert ‘Ji’ (type ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’) to type ‘const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&’
fvm::div(Ji) + alpha*Je
^

I have checked parameters mentioned in createFields.H and also in the weakdischargeFoam.C but couldn't find much. I would be thankful for help.

alexeym September 30, 2015 02:47

Hi,

If you look into documentation (http://foam.sourceforge.net/docs/cpp...8d576632b33d25 and below), there is no fvm::div function that has single volume field as argument. First argument should always be flux as surface field.

Solution to the problem depends on what exactly you are trying to achieve.


All times are GMT -4. The time now is 19:50.