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

Error compiling kEpsilon model

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By mAlletto
  • 1 Post By mAlletto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2018, 16:57
Default Error compiling kEpsilon model
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
Hello,

I'm trying to compile a kEpsilon template (https://github.com/OpenFOAM/OpenFOAM...lon/kEpsilon.C on OpenFOAM 5.x) and am encountering two errors, which are described in the link: https://paste.ubuntu.com/p/DHHHqrgcnz/

It's a bit difficult to explain my goal, but believe me, it's very important to me. When I comment the lines from 144 to 208 (kEpsilon.C), I can compile the solver avoiding ERROR 1.
I can compile (avoiding the ERRO2 described in the link) the solver when I comment lines 254 and 256 (kEpsilon.C).

I hope you can help me.
gu1 is offline   Reply With Quote

Old   November 19, 2018, 08:58
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
From you error I assume you took a kEpsilon model from versions prior to 3.0 and tried to compile it with a newer version. In the newer versions (from 3.0 on I guess) you need to write epsEqn.ref().relax();


Have a look at https://www.openfoam.com/documentati...8C_source.html
mAlletto is offline   Reply With Quote

Old   November 19, 2018, 10:10
Default
  #3
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
Thanks, I was able to compile (... yes, the version is 2.4.x).

Now there is only one ERROR to solve my problem...
gu1 is offline   Reply With Quote

Old   November 19, 2018, 10:49
Default
  #4
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
can you post the error in this thread?
mAlletto is offline   Reply With Quote

Old   November 19, 2018, 10:53
Default
  #5
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
Thank you very much for your attention ... it's very important to me.

Quote:
$ wmake

Making dependency list for source file mykEpsilon.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam5/src/finiteVolume/lnInclude -I/opt/openfoam5/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam5/src/OpenFOAM/lnInclude -I/opt/openfoam5/src/OSspecific/POSIX/lnInclude -fPIC -c turbulent/mykEpsilon/mykEpsilon.C -o Make/linux64GccDPInt32Opt/turbulent/mykEpsilon/mykEpsilon.o
turbulent/mykEpsilon/mykEpsilon.C: In member function ‘virtual Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> > Foam::mykEpsilon::R() const’:
turbulent/mykEpsilon/mykEpsilon.C:157:17: error: ‘((const Foam::mykEpsilon*)this)->Foam::turbulent::U’ does not have class type
U.time().timeName(),
^
/opt/openfoam5/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/turbulent/mykEpsilon/mykEpsilon.o' failed
make: *** [Make/linux64GccDPInt32Opt/turbulent/mykEpsilon/mykEpsilon.o] Error 1
gu1 is offline   Reply With Quote

Old   November 19, 2018, 13:08
Default
  #6
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
You have to write probably something like this->U_ instead of U_
gu1 likes this.
mAlletto is offline   Reply With Quote

Old   November 19, 2018, 13:43
Default
  #7
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
I was able to solve my problem Michael (replaces U.time().timeName(), with runTime_.timeName(),.. I hope this solution is correct.). Thank you very much.
But now I've got a new problem ... I've created a way to read an external library (it's highlighted below):

Quote:
turbulenceModel::turbulenceModel
(
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
)
:
IOdictionary
(
IOobject
(
"stressProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
rho_(dict.lookup("rho")),
tau_(dict.lookup("lambda")),
lawPtr_(RASModel::New(word::null, U, phi, subDict("stress")))
{}
...Even after compiling successfully, when I run the solver, it shows the error:

Quote:
kEpsilonTurbulentFoam: symbol lookup error: kEpsilonTurbulentFoam: undefined symbol: _ZN4Foam17viscoelasticModelC1ERKNS_14GeometricFiel dINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEERK NS1_IdNS_13fvsPatchFieldENS_11surfaceMeshEEE
Funny that he had previously presented a similar error...:
Quote:
$ kEpsilonTurbulentFoam

kEpsilonTurbulentFoam: symbol lookup error: /home/cae/OpenFOAM/cae-5.0/platforms/linux64GccDPInt32Opt/lib/libturbkEpsilonModel.so: undefined symbol: _ZN4Foam15RASModel8typeName
Can you solve any of these? Especially the last...
gu1 is offline   Reply With Quote

Old   November 21, 2018, 06:08
Default
  #8
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
I still get the error below if you can help me...:
Quote:
$ kEpsilonTurbulentFoam

kEpsilonTurbulentFoam: symbol lookup error: /home/cae/OpenFOAM/cae-5.0/platforms/linux64GccDPInt32Opt/lib/libturbkEpsilonModel.so: undefined symbol: _ZN4Foam15RASModel8typeName
I tried everything I read in the forums but it did not work out.

EDIT1: I discovered some things about the error...
... in the kEpsilon.C:

Quote:
namespace Foam
{
defineTypeNameAndDebug(kEpsilon, 0);
// addToRunTimeSelectionTable(RASModel, kEpsilon, dictionary); //error!
}
If I compile with this commented line, it compiles right, BUT... when I try to compile the solver that fetches that library (a solver based on the PISO algorithm) it gives the following error:

Quote:
/home/cae/OpenFOAM/cae-5.0/platforms/linux64GccDPInt32Opt/lib/libkEpsilonModel.so: undefined reference to para `Foam::RASModel::New(Foam::word const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::dictionary const&)'
/home/cae/OpenFOAM/cae-5.0/platforms/linux64GccDPInt32Opt/lib/libkEpsilonModel.so: undefined reference to para `Foam::RASModel::correct()'
collect2: error: ld returned 1 exit status
/opt/openfoam5/wmake/makefiles/general:140: recipe for target '/home/cae/OpenFOAM/cae-5.0/platforms/linux64GccDPInt32Opt/bin/kEpsilonTurbulentFoam' failed
make: *** [/home/cae/OpenFOAM/cae-5.0/platforms/linux64GccDPInt32Opt/bin/kEpsilonTurbulentFoam] Error 1
If I compile with the uncommented line, it does not compile (kEpsilon.C) ... it throws error.

Quote:
$ wmake
Making dependency list for source file kEpsilon.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam5/src/finiteVolume/lnInclude -I/opt/openfoam5/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam5/src/OpenFOAM/lnInclude -I/opt/openfoam5/src/OSspecific/POSIX/lnInclude -fPIC -c RASModel/kEpsilon/kEpsilon.C -o Make/linux64GccDPInt32Opt/RASModel/kEpsilon/kEpsilon.o
In file included from /opt/openfoam5/src/OpenFOAM/lnInclude/token.H:49:0,
from /opt/openfoam5/src/OpenFOAM/lnInclude/Istream.H:47,
from /opt/openfoam5/src/OpenFOAM/lnInclude/ISstream.H:39,
from /opt/openfoam5/src/OpenFOAM/lnInclude/IOstreams.H:38,
from /opt/openfoam5/src/OpenFOAM/lnInclude/VectorSpace.C:27,
from /opt/openfoam5/src/OpenFOAM/lnInclude/VectorSpace.H:233,
from /opt/openfoam5/src/OpenFOAM/lnInclude/Vector.H:44,
from /opt/openfoam5/src/OpenFOAM/lnInclude/vector.H:39,
from /opt/openfoam5/src/OpenFOAM/lnInclude/fieldTypes.H:35,
from /opt/openfoam5/src/finiteVolume/lnInclude/volFieldsFwd.H:37,
from /opt/openfoam5/src/finiteVolume/lnInclude/fvmDdt.H:38,
from /opt/openfoam5/src/finiteVolume/lnInclude/fvm.H:43,
from lnInclude/RASModel.H:44,
from RASModel/kEpsilon/kEpsilon.H:42,
from RASModel/kEpsilon/kEpsilon.C:26:
lnInclude/RASModel.H: In instantiation of ‘static Foam::autoPtr<Foam::RASModel> Foam::RASModel::adddictionaryConstructorToTable<RA SModelType>::New(const Foam::word&, const volVectorField&, const surfaceScalarField&, const Foam::dictionary&) [with RASModelType = Foam::kEpsilon; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’:
lnInclude/RASModel.H:115:9: required from ‘Foam::RASModel::adddictionaryConstructorToTable<R ASModelType>::adddictionaryConstructorToTable(cons t Foam::word&) [with RASModelType = Foam::kEpsilon]’
RASModel/kEpsilon/kEpsilon.C:37:5: required from here
/opt/openfoam5/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:72:64: error: invalid new-expression of abstract class type ‘Foam::kEpsilon’
return autoPtr<baseType>(new baseType##Type parList); \
^
lnInclude/RASModel.H:115:9: note: in expansion of macro ‘declareRunTimeSelectionTable’
declareRunTimeSelectionTable
^
In file included from RASModel/kEpsilon/kEpsilon.C:26:0:
RASModel/kEpsilon/kEpsilon.H:53:7: note: because the following virtual functions are pure within ‘Foam::kEpsilon’:
class kEpsilon
^
In file included from RASModel/kEpsilon/kEpsilon.H:42:0,
from RASModel/kEpsilon/kEpsilon.C:26:
lnInclude/RASModel.H:227:37: note: virtual Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::RASModel::divDevRhoReff(Foam::volVectorField &) const
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0;
^
/opt/openfoam5/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/RASModel/kEpsilon/kEpsilon.o' failed
make: *** [Make/linux64GccDPInt32Opt/RASModel/kEpsilon/kEpsilon.o] Error 1
gu1 is offline   Reply With Quote

Old   November 21, 2018, 13:06
Default
  #9
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
probably you tried to follows the steps in tutorials how to add a new turbulence model for OF versions prior to 3.0


In this blog http://hassankassem.me/posts/newturbulencemodel/ it is described how to do it for versions from 3.0 on
gu1 likes this.
mAlletto 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
simplifiedSiwek - error in calculating the position of a coal error guitar_love_15 OpenFOAM Running, Solving & CFD 0 November 4, 2018 04:06
use laminar and kEpsilon model in one case openfoam super1 OpenFOAM Programming & Development 0 December 28, 2016 07:52
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
add a source term in kEpsilon model maurice OpenFOAM Running, Solving & CFD 0 May 18, 2009 07:54


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