CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Compilation Error: "no matching function for call to ‘div(Foam::volScalarField&)’"

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 29, 2015, 20:49
Default Compilation Error: "no matching function for call to ‘div(Foam::volScalarField&)’"
  #1
New Member
 
Join Date: Sep 2015
Location: California, US
Posts: 3
Rep Power: 3
abhiv is on a distinguished road
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.

Last edited by abhiv; September 29, 2015 at 23:05.
abhiv is offline   Reply With Quote

Old   September 30, 2015, 02:47
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
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.
alexeym is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 115 October 11, 2016 12:21
non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
Elements that limit the Courant number skabilan OpenFOAM Running, Solving & CFD 9 July 3, 2008 12:07
No matching function multiplying tensors for BC Erik OpenFOAM 3 March 20, 2008 14:05


All times are GMT -4. The time now is 21:37.