|
[Sponsors] |
June 25, 2013, 21:28 |
control reaches end of non-void function
|
#1 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17 |
Hi,
I want to modify the "muf" and "nuf"'s function in twoPhaseMixture.C. The function is this: Code:
"muf", rho2_*fvc::interpolate(nuModel2_->nu()) + (rho1_*fvc::interpolate(nuModel1_->nu()) - rho2_*fvc::interpolate(nuModel2_->nu())) *(exp(128*alpha1f)-1) /exp(2) Code:
cfd@cfd:~/myCase/mylib/incompressibleTwoPhaseMixture/incompressible$ wmake libso Making dependency list for source file incompressibleTwoPhaseMixture/twoPhaseMixture.C SOURCE=incompressibleTwoPhaseMixture/twoPhaseMixture.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I.. -I/opt/openfoam220/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/twoPhaseMixture.o incompressibleTwoPhaseMixture/twoPhaseMixture.C: In member function ‘Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::twoPhaseMixture::muf() const’: incompressibleTwoPhaseMixture/twoPhaseMixture.C:160:19: error: call of overloaded ‘exp(int)’ is ambiguous incompressibleTwoPhaseMixture/twoPhaseMixture.C:160:19: note: candidates are: In file included from /opt/openfoam220/src/OpenFOAM/lnInclude/floatScalar.H:78:0, from /opt/openfoam220/src/OpenFOAM/lnInclude/scalar.H:39, from /opt/openfoam220/src/OpenFOAM/lnInclude/IOstream.H:49, from /opt/openfoam220/src/OpenFOAM/lnInclude/Ostream.H:39, from /opt/openfoam220/src/OpenFOAM/lnInclude/UILListIO.C:27, from /opt/openfoam220/src/OpenFOAM/lnInclude/UILList.C:92, from /opt/openfoam220/src/OpenFOAM/lnInclude/UILList.H:285, from /opt/openfoam220/src/OpenFOAM/lnInclude/ILList.H:39, from /opt/openfoam220/src/OpenFOAM/lnInclude/IDLList.H:35, from /opt/openfoam220/src/OpenFOAM/lnInclude/entry.H:45, from /opt/openfoam220/src/OpenFOAM/lnInclude/dictionary.H:53, from /opt/openfoam220/src/OpenFOAM/lnInclude/IOdictionary.H:42, from incompressibleTwoPhaseMixture/transportModel.H:39, from incompressibleTwoPhaseMixture/twoPhaseMixture.H:38, from incompressibleTwoPhaseMixture/twoPhaseMixture.C:26: /opt/openfoam220/src/OpenFOAM/lnInclude/Scalar.H:260:1: note: Foam::floatScalar Foam::exp(Foam::floatScalar) In file included from /opt/openfoam220/src/OpenFOAM/lnInclude/doubleScalar.H:78:0, from /opt/openfoam220/src/OpenFOAM/lnInclude/scalar.H:40, from /opt/openfoam220/src/OpenFOAM/lnInclude/IOstream.H:49, from /opt/openfoam220/src/OpenFOAM/lnInclude/Ostream.H:39, from /opt/openfoam220/src/OpenFOAM/lnInclude/UILListIO.C:27, from /opt/openfoam220/src/OpenFOAM/lnInclude/UILList.C:92, from /opt/openfoam220/src/OpenFOAM/lnInclude/UILList.H:285, from /opt/openfoam220/src/OpenFOAM/lnInclude/ILList.H:39, from /opt/openfoam220/src/OpenFOAM/lnInclude/IDLList.H:35, from /opt/openfoam220/src/OpenFOAM/lnInclude/entry.H:45, from /opt/openfoam220/src/OpenFOAM/lnInclude/dictionary.H:53, from /opt/openfoam220/src/OpenFOAM/lnInclude/IOdictionary.H:42, from incompressibleTwoPhaseMixture/transportModel.H:39, from incompressibleTwoPhaseMixture/twoPhaseMixture.H:38, from incompressibleTwoPhaseMixture/twoPhaseMixture.C:26: /opt/openfoam220/src/OpenFOAM/lnInclude/Scalar.H:260:1: note: Foam::doubleScalar Foam::exp(Foam::doubleScalar) In file included from incompressibleTwoPhaseMixture/viscosityModel.H:55:0, from incompressibleTwoPhaseMixture/twoPhaseMixture.H:39, from incompressibleTwoPhaseMixture/twoPhaseMixture.C:26: /opt/openfoam220/src/OpenFOAM/lnInclude/dimensionedScalar.H:73:19: note: Foam::dimensionedScalar Foam::exp(const dimensionedScalar&) incompressibleTwoPhaseMixture/twoPhaseMixture.C:163:1: warning: control reaches end of non-void function [-Wreturn-type] make: *** [Make/linux64GccDPOpt/twoPhaseMixture.o] Error 1 cfd@cfd:~/myCase/mylib/incompressibleTwoPhaseMixture/incompressible$ BTW,if I want to over exp(128), how to make it? |
|
June 26, 2013, 11:36 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21 |
exp() is defined for all types, and you are giving it a literal constant. The compiler can't tell which exp() function to call. Try giving it more scope:
scalar::exp(2.0) or exp(scalar(2.0)) Share and enjoy!
__________________
~~~ Follow me on twitter @DavidGaden |
|
June 26, 2013, 20:54 |
|
#3 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17 |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simulation of a single bubble with a VOF-method | Suzzn | CFX | 21 | January 29, 2018 01:58 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
FSI: Pressure and Normal Force don't match with expected values | Geraud | CFX | 6 | August 21, 2012 16:34 |
natural convection | mehrdadeng | CFX | 10 | February 25, 2011 06:25 |
CFX does not continue | Shafiul | CFX | 10 | February 17, 2011 08:57 |