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

error: cannot allocate an object of abstract type...

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 24, 2013, 04:39
Default error: cannot allocate an object of abstract type...
  #1
New Member
 
Bojan Sekutkovski
Join Date: Oct 2012
Posts: 13
Rep Power: 4
Bojan is on a distinguished road
Hello,

After successful compilation of OpenFOAM-1.6-ext on Ubuntu 12.04 64bit, i tried to add a compressible LES turbulence model to the library, i.e. kOmegaSSTSAS turbulence model. I managed to compile this model and use it within versions of OpenFOAM 2.0, and I got nice results. Making minor changes to the code, I almost have succeeded to compile it within the OpenFOAM-1.6-ext. The following error message appears after running command "wmake" or "wmake libso" (short version):

error: cannot allocate an object of abstract type ‘Foam::compressible::LESModels::kOmegaSSTSAS’
kOmegaSSTSAS/kOmegaSSTSAS.H:77:7: note: because the following virtual functions are pure within ‘Foam::compressible::LESModels::kOmegaSSTSAS’:


Or full version:


wmake libso
SOURCE=kOmegaSSTSAS/kOmegaSSTSAS.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/turbulenceModels -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/turbulenceModels/LES/LESdeltas/lnInclude -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/turbulenceModels/LES/LESfilters/lnInclude -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/basic/lnInclude -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/meshTools/lnInclude -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/bojan/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc46DPOpt/kOmegaSSTSAS.o
In file included from kOmegaSSTSAS/kOmegaSSTSAS.H:60:0,
from kOmegaSSTSAS/kOmegaSSTSAS.C:26:
lnInclude/LESModel.H: In static member function ‘static Foam::autoPtr<Foam::compressible::LESModel> Foam::compressible::LESModel::adddictionaryConstru ctorToTable<LESModelType>::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::basicThermo&) [with LESModelType = Foam::compressible::LESModels::kOmegaSSTSAS, Foam::volScalarField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>, Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’:
lnInclude/LESModel.H:128:1: instantiated from ‘Foam::compressible::LESModel::adddictionaryConstr uctorToTable<LESModelType>::adddictionaryConstruct orToTable(const Foam::word&) [with LESModelType = Foam::compressible::LESModels::kOmegaSSTSAS]’
kOmegaSSTSAS/kOmegaSSTSAS.C:44:1: instantiated from here
lnInclude/LESModel.H:116:9: error: cannot allocate an object of abstract type ‘Foam::compressible::LESModels::kOmegaSSTSAS’
kOmegaSSTSAS/kOmegaSSTSAS.H:77:7: note: because the following virtual functions are pure within ‘Foam::compressible::LESModels::kOmegaSSTSAS’:
lnInclude/LESModel.H:215:37: note: virtual Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::compressible::LESModel::alphaEff() const
lnInclude/LESModel.H:116:9: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [Make/linux64Gcc46DPOpt/kOmegaSSTSAS.o] Error 1



Actually, I've found the problem...after removing the following line from kOmegaSSTSAS.C, the building goes successfully:

addToRunTimeSelectionTable(LESModel, kOmegaSSTSAS, dictionary);


I've been comparing kOmegaSSTSAS.C & kOmegaSSTSAS.H with other turbulence model files, but without a little success...

I'm not sure if I have to add some lines to files and options files in Make folder...?


Regards!


Regards
Bojan is offline   Reply With Quote

Old   November 5, 2013, 12:45
Default The solution:
  #2
New Member
 
Bojan Sekutkovski
Join Date: Oct 2012
Posts: 13
Rep Power: 4
Bojan is on a distinguished road
After two weeks of searching for a solution, the problem was solved by adding the following function definition in kOmegaSSTSAS.H file:

//- Return thermal conductivity
virtual tmp<volScalarField> alphaEff() const
{
return tmp<volScalarField>
(
new volScalarField("alphaEff", alphaSgs_ + alpha())
);
}



Bojan is offline   Reply With Quote

Reply

Tags
compressible, error, komegasstsas, lesmodel

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 2 August 30, 2013 07:42
Simulation of Radial Fan with simpleFoam MRF nash OpenFOAM Running, Solving & CFD 1 August 15, 2013 05:44
rhoSimpleFoam claco OpenFOAM 7 April 20, 2010 04:32
Problems with Turbulence Modeling ezsoal OpenFOAM Running, Solving & CFD 4 November 26, 2009 16:12
Flow Around a Cylinder ronaldo OpenFOAM 5 September 18, 2009 08:13


All times are GMT -4. The time now is 18:57.