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

Issue compiling solver for OF 2.4

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By klausb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2015, 16:07
Default Issue compiling solver for OF 2.4
  #1
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
Hello,

I use OpenFoam 2.4.

When I try to compile solvers developed for earlier versions of OpenFoam, (basically any 2.x version) I run into the same problem:

...
/opt/openfoam240/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:77:9: warning: control reaches end of non-void function [-Wreturn-type]
} \
^
/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:125:9: note: in expansion of macro ‘declareRunTimeSelectionTable’
declareRunTimeSelectionTable
^
make: *** [Make/linux64GccDPOpt/SSTtransition.o] Fehler 1

(Fehler means error)

What has changed and how can I fix it?

Klaus
klausb is offline   Reply With Quote

Old   November 6, 2015, 18:13
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Guess, Fehler is somewhere else, since the excerpt you have posted contains only warning. Could you post the whole output?

Last edited by alexeym; November 7, 2015 at 01:57. Reason: extra "in"
alexeym is offline   Reply With Quote

Old   November 6, 2015, 18:45
Default full output
  #3
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
wmakeLnInclude: linking include files to ./lnInclude
ln: Die symbolische Verknüpfung »./additional.H“ konnte nicht angelegt werden: Die Datei existiert bereits
ln: Die symbolische Verknüpfung »./SSTtransition.H“ konnte nicht angelegt werden: Die Datei existiert bereits
ln: Die symbolische Verknüpfung »./SSTtransition.C“ konnte nicht angelegt werden: Die Datei existiert bereits
Making dependency list for source file SSTtransition.C
SOURCE=SSTtransition.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam240/src/turbulenceModels -I/opt/openfoam240/src/transportModels -I/opt/openfoam240/src/finiteVolume/lnInclude -I/opt/openfoam240/src/meshTools/lnInclude -I/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude -I/home/klaus/OpenFOAM/klaus-2.4.0/run/findroot -IlnInclude -I. -I/opt/openfoam240/src/OpenFOAM/lnInclude -I/opt/openfoam240/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/SSTtransition.o
In file included from /opt/openfoam240/src/OpenFOAM/lnInclude/token.H:49:0,
from /opt/openfoam240/src/OpenFOAM/lnInclude/Istream.H:47,
from /opt/openfoam240/src/OpenFOAM/lnInclude/ISstream.H:39,
from /opt/openfoam240/src/OpenFOAM/lnInclude/IOstreams.H:38,
from /opt/openfoam240/src/OpenFOAM/lnInclude/VectorSpace.C:27,
from /opt/openfoam240/src/OpenFOAM/lnInclude/VectorSpace.H:171,
from /opt/openfoam240/src/OpenFOAM/lnInclude/Vector.H:44,
from /opt/openfoam240/src/OpenFOAM/lnInclude/vector.H:39,
from /opt/openfoam240/src/OpenFOAM/lnInclude/fieldTypes.H:35,
from /opt/openfoam240/src/OpenFOAM/lnInclude/primitiveFieldsFwd.H:36,
from /opt/openfoam240/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H:46,
from /opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:47,
from SSTtransition.H:81,
from SSTtransition.C:26:
/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H: In instantiation of ‘static Foam::autoPtr<Foam::incompressible::RASModel> Foam::incompressible::RASModel::adddictionaryConst ructorToTable<RASModelType>::New(const volVectorField&, const surfaceScalarField&, Foam::transportModel&, const Foam::word&) [with RASModelType = Foam::incompressible::RASModels::SSTtransition; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’:
/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:125:9: required from ‘Foam::incompressible::RASModel::adddictionaryCons tructorToTable<RASModelType>::adddictionaryConstru ctorToTable(const Foam::word&) [with RASModelType = Foam::incompressible::RASModels::SSTtransition]’
SSTtransition.C:43:1: required from here
/opt/openfoam240/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:76:66: error: cannot allocate an object of abstract type ‘Foam::incompressible::RASModels::SSTtransition’
return autoPtr< baseType >(new baseType##Type parList); \
^
/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:125:9: note: in expansion of macro ‘declareRunTimeSelectionTable’
declareRunTimeSelectionTable
^
In file included from SSTtransition.C:26:0:
SSTtransition.H:97:7: note: because the following virtual functions are pure within ‘Foam::incompressible::RASModels::SSTtransition’:
class SSTtransition
^
In file included from /opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:47:0,
from SSTtransition.H:81,
from SSTtransition.C:26:
/opt/openfoam240/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H:217:37: note: virtual Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::incompressible::turbulenceModel::divDevRhoRe ff(const volScalarField&, Foam::volVectorField&) const
virtual tmp<fvVectorMatrix> divDevRhoReff
^
In file included from /opt/openfoam240/src/OpenFOAM/lnInclude/token.H:49:0,
from /opt/openfoam240/src/OpenFOAM/lnInclude/Istream.H:47,
from /opt/openfoam240/src/OpenFOAM/lnInclude/ISstream.H:39,
from /opt/openfoam240/src/OpenFOAM/lnInclude/IOstreams.H:38,
from /opt/openfoam240/src/OpenFOAM/lnInclude/VectorSpace.C:27,
from /opt/openfoam240/src/OpenFOAM/lnInclude/VectorSpace.H:171,
from /opt/openfoam240/src/OpenFOAM/lnInclude/Vector.H:44,
from /opt/openfoam240/src/OpenFOAM/lnInclude/vector.H:39,
from /opt/openfoam240/src/OpenFOAM/lnInclude/fieldTypes.H:35,
from /opt/openfoam240/src/OpenFOAM/lnInclude/primitiveFieldsFwd.H:36,
from /opt/openfoam240/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H:46,
from /opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:47,
from SSTtransition.H:81,
from SSTtransition.C:26:
/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H: In static member function ‘static Foam::autoPtr<Foam::incompressible::RASModel> Foam::incompressible::RASModel::adddictionaryConst ructorToTable<RASModelType>::New(const volVectorField&, const surfaceScalarField&, Foam::transportModel&, const Foam::word&) [with RASModelType = Foam::incompressible::RASModels::SSTtransition; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’:
/opt/openfoam240/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:77:9: warning: control reaches end of non-void function [-Wreturn-type]
} \
^
/opt/openfoam240/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:125:9: note: in expansion of macro ‘declareRunTimeSelectionTable’
declareRunTimeSelectionTable
^
make: *** [Make/linux64GccDPOpt/SSTtransition.o] Fehler 1
klausb is offline   Reply With Quote

Old   November 7, 2015, 02:08
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

The real error is here:

Code:
/opt/openfoam240/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:76:66: error: cannot allocate an object of abstract type ‘Foam::incompressible::RASModels::SSTtransition’
return autoPtr< baseType >(new baseType##Type parList); \
And this means that in 2.4.0 RASModel has additional pure virtual methods compared to 2.x (divDevRhoReff if I correctly parsed output you have posted). And you have to implement them in your model.
alexeym is offline   Reply With Quote

Old   November 7, 2015, 11:07
Default library is created but isn't recognized
  #5
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
ok, I added the required function to the source code and compilation worked BUT the library isn't recognized. I added it to the controlDict.

libs ("libSSTtransition.so");

I know that the code was initially created on Ubuntu 10.04 for OF2.1, I am running Ubuntu LTS 14.04 and OF2.4


this is the log:


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : /home/klaus/OpenFOAM/klaus-2.4.0/platforms/linux64GccDPOpt/lib/libSSTtransition.so: undefined symbol: _ZNK4Foam14incompressible9RASModels4SSTtransition1 3divDevRhoReffERKNS_14GeometricFieldIdNS_12fvPatch FieldENS_7volMeshEEERNS3_INS_6VectorIdEES4_S5_EE
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libSSTtransition.so"
Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model SSTtransition
[0]
[0]
[0] --> FOAM FATAL ERROR:
[0] Unknown RASModel type SSTtransition

Valid RASModel types:

18
(
LRR
LamBremhorstKE
LaunderGibsonRSTM
LaunderSharmaKE
LienCubicKE
LienCubicKELowRe
LienLeschzinerLowRe
NonlinearKEShih
RNGkEpsilon
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kkLOmega
laminar
qZeta
realizableKE
v2f
)
[0]
[0]
[0] From function RASModel::New(const volVectorField&, const surfaceScalarField&, transportModel&, const word&)
[0] [3]
[3]
[3] --> FOAM FATAL ERROR:
[3] Unknown RASModel type SSTtransition

Valid RASModel types:

18
(
LRR
LamBremhorstKE
LaunderGibsonRSTM
LaunderSharmaKE
LienCubicKE
LienCubicKELowRe
LienLeschzinerLowRe
NonlinearKEShih
RNGkEpsilon
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kkLOmega
laminar
qZeta
realizableKE
v2f
)
[3]
[3]
[3] From function RASModel::New(const volVectorField&, const surfaceScalarField&, transportModel&, const word&)
[1]
[1]
[1] --> FOAM FATAL ERROR: [2]
[2]
[2] --> FOAM FATAL ERROR:
in file RASModel/RASModel.C at line 140.
[0]
FOAM parallel run exiting
[0]
[3] in file RASModel/RASModel.C at line 140.
[3]
FOAM parallel run exiting
[3]

[1] Unknown RASModel type SSTtransition

Valid RASModel types:

18
(
LRR
LamBremhorstKE
LaunderGibsonRSTM
LaunderSharmaKE
LienCubicKE
LienCubicKELowRe
LienLeschzinerLowRe
NonlinearKEShih
RNGkEpsilon
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kkLOmega
laminar
qZeta
realizableKE
v2f
)
[1]
[1]
[1] [2] Unknown RASModel type SSTtransition

Valid RASModel types:

18
(
LRR
LamBremhorstKE
LaunderGibsonRSTM
LaunderSharmaKE
LienCubicKE
LienCubicKELowRe
LienLeschzinerLowRe
NonlinearKEShih
RNGkEpsilon
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kkLOmega
laminar
qZeta
realizableKE
v2f
)
[2]
[2]
[2] From function From function RASModel::New(const volVectorField&, const surfaceScalarField&, transportModel&, const word&)
[1] in file RASModel/RASModel.C at line 140.
[1]
FOAM parallel run exiting
[1]
RASModel::New(const volVectorField&, const surfaceScalarField&, transportModel&, const word&)
[2] in file RASModel/RASModel.C at line 140.
[2 PyFoam WARNING on line 248 of file /usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/PyFoam/Execution/FoamThread.py : Process 4382 was already dead (B
]
FOAM parallel run exiting
[2]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 2 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun has exited due to process rank 0 with PID 4389 on
node klaus-Aspire-V3-771 exiting improperly. There are two reasons this could occur:

1. this process did not call "init" before exiting, but others in
the job did. This can cause a job to hang indefinitely while it waits
for all processes to call "init". By rule, if one process calls "init",
then ALL processes must call "init" prior to termination.

2. this process called "init", but exited without calling "finalize".
By rule, all processes that call "init" MUST call "finalize" prior to
exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[klaus-Aspire-V3-771:04383] 3 more processes have sent help message help-mpi-api.txt / mpi-abort
[klaus-Aspire-V3-771:04383] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
Killing PID 4382
klausb is offline   Reply With Quote

Old   November 7, 2015, 17:50
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, at this point, since you did not post any source code, I can only start to guess what it wrong. So

Code:
dlopen error : /home/klaus/OpenFOAM/klaus-2.4.0/platforms/linux64GccDPOpt/lib/libSSTtransition.so: undefined symbol: _ZNK4Foam14incompressible9RASModels4SSTtransition1 3divDevRhoReffERKNS_14GeometricFieldIdNS_12fvPatch FieldENS_7volMeshEEERNS3_INS_6VectorIdEES4_S5_EE
maybe you have only declared the method divDevRhoReff and did not care to implement it? Right now I can imagine only this reason for the error. Maybe you could post source code of your model? It would be much easier to diagnose the problem and find a solution.
alexeym is offline   Reply With Quote

Old   November 9, 2015, 14:44
Default fixed
  #7
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
thank you for your support.

I just copied the missing method code snippet from the OF2.4 version src into .H and .C and it works fine now.

Klaus
klausb is offline   Reply With Quote

Old   July 26, 2018, 12:08
Default
  #8
Member
 
Join Date: Nov 2009
Posts: 43
Rep Power: 17
aerospaceman is on a distinguished road
Hi Klaus,



Could you be slightly more specific about how you solved this problem? I think I am facing the same issue, and it would be great to see your solution.



Thanks.
aerospaceman is offline   Reply With Quote

Old   August 1, 2018, 20:15
Default
  #9
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
I suggest to use an editor which allows to compare files side-by-side. "Meld" works fine (http://meldmerge.org/) for me.


If you load a code file from two OpenFOAM versions, you'll clearly see the differences. In case something is missing in one version, you can copy the relevant sections like the declaration and implementation of a function.


BUT there have been major code structure changes from version 3 to 4 to 5 which may require a deep understanding of the underlying changes when porting models from older versions of OpenFOAM.
aerospaceman likes this.
klausb is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling own solver: 'libNULL.so' is up to date. but not executable lindstroem OpenFOAM Programming & Development 18 November 30, 2020 06:32
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
Compiling Solver: Clang error linker commander failed schwam OpenFOAM Programming & Development 11 May 25, 2014 05:31
Error in compiling a modified solver immortality OpenFOAM Running, Solving & CFD 3 March 29, 2013 01:29
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43


All times are GMT -4. The time now is 17:45.