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

Compile error kEpsilonViollet for OF 2.1.1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 1, 2012, 19:21
Default Compile error kEpsilonViollet for OF 2.1.1
  #1
New Member
 
Andreas Herwig
Join Date: Jan 2011
Posts: 6
Rep Power: 15
Andreas.Herwig is on a distinguished road
Hi,

while compiling the kEpsilonViollet model (it is written for OF 1.7 and works fine with OF 1.7)

http://openfoamwiki.net/index.php/Co...EpsilonViollet

under OF 2.1.1 a strange (at least to me) error occurs:

Quote:
kEpsilonViollet/kEpsilonViollet.C: In member function ‘virtual void Foam::incompressible::RASModels::kEpsilonViollet:: correct()’:
kEpsilonViollet/kEpsilonViollet.C:254:9: error: reference to ‘db’ is ambiguous
/opt/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/IOobject.H:246:35: error: candidates are: const Foam:bjectRegistry& Foam::IOobject::db() const
/opt/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/IOobject.H:246:35: error: const Foam:bjectRegistry& Foam::IOobject::db() const
I am using the latest gcc (version 4.6.2) compiler. By searching the problem in the web i found something which might be related (but I am not sure):

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27775

From the original source code of kEpsilonViollet.C it is the part:

Code:
    const uniformDimensionedVectorField& g_ =
        db().lookupObject<uniformDimensionedVectorField>("g");
    const volScalarField& T_ = db().lookupObject<volScalarField>(TName_);
which causes the problem. By the way: you can find the similar code snippet
Code:
    const uniformDimensionedVectorField& g_ =
        db().lookupObject<uniformDimensionedVectorField>("g");
for example in

alphaFixedPressureFvPatchScalarField.C (from /src/transportModels/...)

which compiles without any problems.

If there is somebody knowing what to do to fix this problem: Thank you very much!

Greetings

Andreas
Andreas.Herwig is offline   Reply With Quote

Old   July 2, 2012, 07:25
Default maybe fixed ?
  #2
New Member
 
Andreas Herwig
Join Date: Jan 2011
Posts: 6
Rep Power: 15
Andreas.Herwig is on a distinguished road
Dear all,

while trying to solve the problem described above i found this thread

http://www.cfd-online.com/Forums/ope...-buoyancy.html

There something similar is discribed and it is said that there is something before the db(). is needed, like ???.db(). So i tried U_.db()

Code:
const uniformDimensionedVectorField& g_ =
        U_.db().lookupObject<uniformDimensionedVectorField>("g");
    
    const volScalarField& T_ = U_.db().lookupObject<volScalarField>(TName_);
and it seems to solve the problem. The objectRegistry seems to be attached to a field and does not exist (anymore?) "stand alone", but maybe someone who knows the openfoam source code better then me should answer on this question.

There are some more parts of the kEpsilonViollet code to modify for to transfer it from OF 1.7 to OF 2.1.1. I will publish the fully transferd version later in this thread after i did some tests e.g. comparing the results of a test case calculated with the original code under OF 1.7 to the results with my transfered code under OF 2.1.1

Best regards

andreas
Andreas.Herwig is offline   Reply With Quote

Reply

Tags
compile error, kepsilonviollet


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
OpenFOAM Foundation Releases OpenFOAM® Version 2.1.1 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 May 31, 2012 10:07
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 18:22
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 14:24
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51


All times are GMT -4. The time now is 20:46.