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/)
-   -   an Error in compiling:Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam (https://www.cfd-online.com/Forums/openfoam-programming-development/118337-error-compiling-foam-zerofield-foam-fvm-sp-const-foam-zero-const-foam.html)

immortality May 25, 2013 13:04

an Error in compiling:Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam
 
this error occurred while compiling pimpleFoam:
Code:

ehsan@Ehsan-com:~/Desktop/Solvers/pimpleFoamModified$ wclean
ehsan@Ehsan-com:~/Desktop/Solvers/pimpleFoamModified$ wmake
Making dependency list for source file pimpleFoamModified.C
SOURCE=pimpleFoamModified.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/pimpleFoamModified.o
In file included from pimpleFoamModified.C:89:0:
gasEqn.H: In function ‘int main(int, char**)’:
gasEqn.H:6:22: error: no matching function for call to ‘Sp(Foam::volScalarField&)’
gasEqn.H:6:22: note: candidates are:
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:100:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::DimensionedField<double, Foam::volMesh>&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:126:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:140:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:154:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:180:1: note: template<class Type> Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
make: *** [Make/linux64GccDPOpt/pimpleFoamModified.o] Error 1


wyldckat May 25, 2013 13:17

You didn't show the lines of code around the actual error, "gasEqn.H:6", namely from the file "gasEqn.H", around line 6.

The error indicates that you tried to use "Sp(something)", namely only used one argument, when it actually needs 2 or more arguments.

immortality May 25, 2013 15:53

1 Attachment(s)
:confused:I copied the whole message!
Code:

ehsan@Ehsan-com:~/Desktop/Solvers/pimpleFoamModified$ wclean
ehsan@Ehsan-com:~/Desktop/Solvers/pimpleFoamModified$ wmake
Making dependency list for source file pimpleFoamModified.C
SOURCE=pimpleFoamModified.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/pimpleFoamModified.o
In file included from pimpleFoamModified.C:89:0:
gasEqn.H: In function ‘int main(int, char**)’:
gasEqn.H:6:22: error: no matching function for call to ‘Sp(Foam::volScalarField&)’
gasEqn.H:6:22: note: candidates are:
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:100:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::DimensionedField<double, Foam::volMesh>&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:126:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:140:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:154:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:180:1: note: template<class Type> Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
make: *** [Make/linux64GccDPOpt/pimpleFoamModified.o] Error 1

I removed rho because of your saying that this solver hasn't rho field,then should remove SP line totally?

wyldckat May 25, 2013 16:03

Here we go, this is the line I wanted to see, since it's the one the compiler is complaining about, on line 6:
Code:

-fvm::Sp(gas)
Well, if you don't know what else to use as reference for this line, then I can only guess that you should remove it...

immortality May 25, 2013 16:23

thanks.I now asked it in passive scalar thread to write the equation for an incompressible flow.


All times are GMT -4. The time now is 08:04.