|
[Sponsors] |
December 7, 2014, 01:49 |
error when port 1.5dev to 230
|
#1 |
New Member
BO
Join Date: Dec 2014
Posts: 21
Rep Power: 11 |
Hi every,
I got a code from my friends which was in 1.5dev version. I was trying to port it to the 230 version I am using now. While I am able to fix some bugs, there are some I have now idea and need some help. Actually, some of the errors are similar. I think they are caused from the changes in thermo and turbulence classes. I have attached the codes. error 1 Code:
ThermoModel/visThermo.C: In constructor ‘Foam::visThermo::visThermo(const Foam::fvMesh&, const volScalarField&, const volScalarField&)’: ThermoModel/visThermo.C:57:5: error: no matching function for call to ‘Foam::basicThermo::basicThermo(const Foam::fvMesh&)’ ) ^ Code:
In file included from coSigmaY.C:50:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:123:68: error: no matching function for call to ‘Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture(Foam::volVectorField&, Foam::surfaceScalarField&, const char [5])’ incompressibleTwoPhaseMixture twoPhaseProperties(U, phi, "Ybar"); ^ Code:
/home/bo/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/IOobject.H:250:35: note: const Foam::objectRegistry& Foam::IOobject::db() const TurbModel/highDensityRatioKEpsilon.C:195:7: error: no matching function for call to ‘Foam::compressible::RASModel::RASModel(const Foam::word&, const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::basicThermo&)’ ) ^ Code:
/home/bo/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels/compressible/RAS/lnInclude/RASModel.H:109:9: note: candidate expects 1 argument, 5 provided In file included from coSigmaY.C:50:0: createFields.H:245:15: error: cannot declare variable ‘thermo’ to be of abstract type ‘Foam::visThermo’ visThermo thermo(mesh, rho, Ybar); Code:
In file included from coSigmaY.C:50:0: createFields.H:257:9: error: no matching function for call to ‘Foam::compressible::turbulenceModel::New(Foam::volScalarField&, Foam::volVectorField&, Foam::surfaceScalarField&, Foam::visThermo&)’ ) ^ Code:
/home/bo/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:76:66: error: cannot allocate an object of abstract type ‘Foam::compressible::RASModels::highDensityRatioKEpsilon’ return autoPtr< baseType >(new baseType##Type parList); \ ^ |
|
December 8, 2014, 02:18 |
|
#2 |
New Member
BO
Join Date: Dec 2014
Posts: 21
Rep Power: 11 |
Update:
With the help of google, I have fixed most of the errors. However, there is last one remain. Code:
ThermoModel/visThermo.C: In constructor ‘Foam::visThermo::visThermo(const Foam::fvMesh&, const Foam::word&)’: ThermoModel/visThermo.C:58:5: error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField()’ ) ^ ThermoModel/visThermo.C:58:5: note: candidates are: In file included from /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/GeometricField.H:601:0, from /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/GeometricScalarField.H:38, from /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/GeometricFields.H:34, from /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/volFields.H:37, from /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/thermophysicalModels/basic/lnInclude/basicThermo.H:38, from ThermoModel/visThermo.H:38, from ThermoModel/visThermo.C:26: Any suggestion on this ? Many thanks . |
|
December 8, 2014, 03:01 |
|
#3 |
Senior Member
|
Hi,
You've got volScalarField mu_ in class definition but for some reason you've omitted its initialization from visThermo constructor (so compiler tries default constructor with no arguments but there's no such constructor of volScalarField). |
|
December 8, 2014, 04:25 |
|
#4 | |
New Member
BO
Join Date: Dec 2014
Posts: 21
Rep Power: 11 |
Quote:
Then I fount another error I have omitted: Code:
usr/bin/ld: cannot find -lbasicThermophysicalModels /usr/bin/ld: cannot find -llduSolvers collect2: error: ld returned 1 exit status make: *** [/home/bo/OpenFOAM/bo-2.3.0/platforms/linux64GccDPOpt/bin/halfcoSigmaY] Error 1 However, after I did this, following error happens: Code:
createFields.H: In function ‘int main(int, char**)’: createFields.H:265:9: error: no matching function for call to ‘Foam::compressible::turbulenceModel::New(Foam::volScalarField&, Foam::volVectorField&, Foam::surfaceScalarField&, Foam::visThermo&)’ ) ^ createFields.H:265:9: note: candidate is: In file included from coSigmaY.C:36:0: /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels/compressible/turbulenceModel/lnInclude/turbulenceModel.H:144:41: note: static Foam::autoPtr<Foam::compressible::turbulenceModel> Foam::compressible::turbulenceModel::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::fluidThermo&, const Foam::word&) static autoPtr<turbulenceModel> New ^ /home/bo/OpenFOAM/OpenFOAM-2.3.0/src/turbulenceModels/compressible/turbulenceModel/lnInclude/turbulenceModel.H:144:41: note: no known conversion for argument 4 from ‘Foam::visThermo’ to ‘const Foam::fluidThermo&’ Code:
Info << "Creating turbulence model\n" << endl; autoPtr<compressible::turbulenceModel> turbulence ( compressible::turbulenceModel::New ( rho, U, phi, thermo ) ); |
||
December 8, 2014, 04:36 |
|
#5 |
Senior Member
|
Here's excerpts from different files that will illustrate final conclusion:
psiThermo.H Code:
class psiThermo : public fluidThermo { ... } Code:
... //- Construct from components turbulenceModel ( const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, const fluidThermo& thermoPhysicalModel, const word& turbulenceModelName = typeName ); ... Code:
class visThermo : public basicThermo { ... } |
|
December 8, 2014, 06:54 |
|
#6 |
New Member
BO
Join Date: Dec 2014
Posts: 21
Rep Power: 11 |
Ah, I forgot to correct this! It seems that there is no fluidThermo class in the early versions. I change the parent class from basicThermo to fluidThermo and it works.
Then more reference problems show up...... : Code:
Make/linux64GccDPOpt/coSigmaY.o: In function `main': coSigmaY.C:(.text.startup+0x19b8): undefined reference to `Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::word const&)' Make/linux64GccDPOpt/visThermo.o: In function `Foam::visThermo::type() const': visThermo.C:(.text._ZNK4Foam9visThermo4typeEv[_ZNK4Foam9visThermo4typeEv]+0x3): undefined reference to `Foam::visThermo::typeName' Make/linux64GccDPOpt/visThermo.o: In function `Foam::HashTable<Foam::autoPtr<Foam::visThermo> (*)(Foam::fvMesh const&, Foam::word const&), Foam::word, Foam::string::hash>::iterator Foam::basicThermo::lookupThermo<Foam::visThermo, Foam::HashTable<Foam::autoPtr<Foam::visThermo> (*)(Foam::fvMesh const&, Foam::word const&), Foam::word, Foam::string::hash> >(Foam::dictionary const&, Foam::HashTable<Foam::autoPtr<Foam::visThermo> (*)(Foam::fvMesh const&, Foam::word const&), Foam::word, Foam::string::hash>*)': visThermo.C:(.text._ZN4Foam11basicThermo12lookupThermoINS_9visThermoENS_9HashTableIPFNS_7autoPtrIS2_EERKNS_6fvMeshERKNS_4wordEES9_NS_6string4hashEEEEENT0_8iteratorERKNS_10dictionaryEPSH_[_ZN4Foam11basicThermo12lookupThermoINS_9visThermoENS_9HashTableIPFNS_7autoPtrIS2_EERKNS_6fvMeshERKNS_4wordEES9_NS_6string4hashEEEEENT0_8iteratorERKNS_10dictionaryEPSH_]+0x873): undefined reference to `Foam::visThermo::typeName' visThermo.C:(.text._ZN4Foam11basicThermo12lookupThermoINS_9visThermoENS_9HashTableIPFNS_7autoPtrIS2_EERKNS_6fvMeshERKNS_4wordEES9_NS_6string4hashEEEEENT0_8iteratorERKNS_10dictionaryEPSH_[_ZN4Foam11basicThermo12lookupThermoINS_9visThermoENS_9HashTableIPFNS_7autoPtrIS2_EERKNS_6fvMeshERKNS_4wordEES9_NS_6string4hashEEEEENT0_8iteratorERKNS_10dictionaryEPSH_]+0xb6e): undefined reference to `Foam::visThermo::typeName' Make/linux64GccDPOpt/visThermo.o: In function `Foam::autoPtr<Foam::visThermo> Foam::basicThermo::New<Foam::visThermo>(Foam::fvMesh const&, Foam::word const&)': visThermo.C:(.text._ZN4Foam11basicThermo3NewINS_9visThermoEEENS_7autoPtrIT_EERKNS_6fvMeshERKNS_4wordE[_ZN4Foam11basicThermo3NewINS_9visThermoEEENS_7autoPtrIT_EERKNS_6fvMeshERKNS_4wordE]+0x14a): undefined reference to `Foam::visThermo::fvMeshConstructorTablePtr_' Make/linux64GccDPOpt/highDensityRatioKEpsilon.o: In function `Foam::compressible::RASModels::highDensityRatioKEpsilon::type() const': highDensityRatioKEpsilon.C:(.text._ZNK4Foam12compressible9RASModels24highDensityRatioKEpsilon4typeEv[_ZNK4Foam12compressible9RASModels24highDensityRatioKEpsilon4typeEv]+0x3): undefined reference to `Foam::compressible::RASModels::highDensityRatioKEpsilon::typeName' collect2: error: ld returned 1 exit status Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lincompressibleTransportModels \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfluidThermophysicalModels \ -lthermophysicalFunctions \ -lspecie \ -lchemistryModel \ -lcompressibleTurbulenceModel |
|
December 8, 2014, 07:59 |
|
#7 |
Senior Member
|
First, you need to change
Code:
//- Runtime type information TypeName("psiThermo"); Code:
//- Runtime type information TypeName("visThermo"); Then you need to add block similar to: Code:
namespace Foam { defineTypeNameAndDebug(visThermo, 0); defineRunTimeSelectionTable(visThermo, fvMesh); } See psiThermo implementation in 2.3.x. Also you need to do the same operation with highDensityRatioKEpsilon class. |
|
December 8, 2014, 09:08 |
|
#8 |
New Member
BO
Join Date: Dec 2014
Posts: 21
Rep Power: 11 |
Thank you for the tips. I have checked visThermo again and compared it to the psiThermo, tried to make them with exactly same structures. Attachments are the updated version.
However, when I finished this, suddenly everything became undeclared...just to name a few in the following: Code:
ThermoModel/visThermo.C:90:8: error: ‘visThermo’ has not been declared void visThermo::setT(const volScalarField& temp) ^ ThermoModel/visThermo.C:90:30: error: ‘volScalarField’ does not name a type void visThermo::setT(const volScalarField& temp) ^ ThermoModel/visThermo.C:90:46: error: ISO C++ forbids declaration of ‘temp’ with no type [-fpermissive] void visThermo::setT(const volScalarField& temp) ^ ThermoModel/visThermo.C: In function ‘void setT(const int&)’: ThermoModel/visThermo.C:92:5: error: ‘T_’ was not declared in this scope T_ = temp; ^ ThermoModel/visThermo.C: At global scope: ThermoModel/visThermo.C:95:8: error: ‘visThermo’ has not been declared void visThermo::update(const volScalarField& rho,const volScalarField& Ybar) ^ ThermoModel/visThermo.C:95:32: error: ‘volScalarField’ does not name a type void visThermo::update(const volScalarField& rho,const volScalarField& Ybar) ^ ThermoModel/visThermo.C:95:48: error: ISO C++ forbids declaration of ‘rho’ with no type [-fpermissive] void visThermo::update(const volScalarField& rho,const volScalarField& Ybar) ^ ThermoModel/visThermo.C:95:58: error: ‘volScalarField’ does not name a type void visThermo::update(const volScalarField& rho,const volScalarField& Ybar) ^ ThermoModel/visThermo.C:95:74: error: ISO C++ forbids declaration of ‘Ybar’ with no type [-fpermissive] void visThermo::update(const volScalarField& rho,const volScalarField& Ybar) ^ Code:
ThermoModel/visThermo.C:90:46: error: ISO C++ forbids declaration of ‘temp’ with no type [-fpermissive] void visThermo::setT(const volScalarField& temp) ^ |
|
December 8, 2014, 09:37 |
|
#9 |
Senior Member
|
Hi,
there's no visThermo class outsize Foam namespace (also there's no volScalarField class outside Foam namespace ). So all your Code:
void visThermo::... { ... } Code:
void Foam::visThermo::... { ... } |
|
December 8, 2014, 22:04 |
|
#10 |
Member
BO WANG
Join Date: Sep 2014
Posts: 37
Rep Power: 11 |
Hi, thanks very much for the tips. I guess I should go over c++ again before I start my next code.
Anyway, problem solved except this one Code:
Make/linux64GccDPOpt/coSigmaY.o: In function `main': coSigmaY.C:(.text.startup+0x19b8): undefined reference to `Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::word const&)' Code:
EXE_INC = \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lincompressibleTransportModels \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfluidThermophysicalModels \ -lthermophysicalFunctions \ -lspecie \ -lchemistryModel \ -lcompressibleTurbulenceModel Code:
incompressibleTwoPhaseMixture ( const volVectorField& U, const surfaceScalarField& phi, const word& alpha1Name = "alpha1" ); Code:
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi, "Ybar"); |
|
December 9, 2014, 02:25 |
|
#11 |
Senior Member
|
It's rather strange as the constructor for incompressibleTwoPhaseMixture is in libincompressibleTransportModels, and this library is included in your options.
I'm afraid you've again redefined something somewhere and would like others to guess your modifications of the code. And I think this is the case as compiler gladly passes your constructor (which is redefined in your H file) while linker rejects it because it is not implemented. |
|
December 12, 2014, 01:48 |
|
#12 |
Member
BO WANG
Join Date: Sep 2014
Posts: 37
Rep Power: 11 |
Hi alexeym,
I turned back to the code this morning. And I think I have managed to fixed it. I linked the code to the original incompressbleTwoPhaseMixture src file and changed its announcement in the creatField.H file accordingly( rather then change the incompressibleTwoPhaseMixture file itself!). Then everything goes well. Thanks again for your patience and all the advice. Regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Paraview 3.98 - errors when saving geometry file | pajot | ParaView | 1 | September 28, 2013 10:45 |
Understanding Port Flow Results | Ospi | FLUENT | 0 | July 15, 2013 23:11 |
IC Engine Exhaust Port Flow | Ospi | ANSYS | 1 | July 10, 2013 22:59 |
IC Engine Exaust Port Flow | Ospi | FLUENT | 0 | July 6, 2013 20:34 |
OpenFOAM Cygwin port updated to 13 | brooksmoses | OpenFOAM Installation | 29 | November 30, 2006 05:49 |