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

having trouble using declareRunTimeSelectionTable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2014, 08:27
Default having trouble using declareRunTimeSelectionTable
  #1
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12
wenxu is on a distinguished road
hello, everyone. happy weekend!
i am implementing a new combustions models, but i encounter the following errors.
The compile was succeed,but when i run a case, the model was crush!!!
#4 Foam::autoPtr<Foam::edcChemistryModel> Foam::basicChemistryModel::New<Foam::edcChemistryM odel>(Foam::fvMesh const&) in "/root/OpenFOAM/root-2.3.0/platforms/linuxGccDPOpt/lib/libedcChemistryModel.so"
#5 Foam::edcChemistryModel::New(Foam::fvMesh const&) in "/root/OpenFOAM/root-2.3.0/platforms/linuxGccDPOpt/lib/libedcChemistryModel.so"
And when i come to the source code, i also get the the ChemistryModel::fvMeshConstructorTablePtr_ stays at zero....that means nothing was addedd to the HashTable except to the baseClass typename.
So i think that's may be the derived class error, in the derived class,i use the makeChemistryModel.H :

#define makeChemistryModel(SS, Comp, Thermo) \
\
typedef SS<Comp, Thermo> SS##Comp##Thermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
SS##Comp##Thermo, \
(#SS"<"#Comp"," + Thermo::typeName() + ">").c_str(), \
0 \
);

and use the
makeChemistryModel
(
myModel,
edcChemistryModel,
constGasHThermoPhysics
);
to instantized it.


anyone has some ideas, any suggestions would be helpful!!!

Thank you in advance!
best,
Wen
wenxu is offline   Reply With Quote

Old   November 9, 2014, 00:30
Default
  #2
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12
wenxu is on a distinguished road
Now, i have found that in the :
/################################################## #####/
template<class ChemistryModel>
Foam::autoPtr<ChemistryModel> Foam::basicChemistryModel::New
(
const fvMesh& mesh
)
member function, these lines:
Info<<"hello,i'm the sedond!"<<endl;
Info<<"hello,i'm the third "<<ChemistryModel::fvMeshConstructorTablePtr_<<endl;
typename ChemistryModel::fvMeshConstructorTable::iterator cstrIter =
ChemistryModel::fvMeshConstructorTablePtr_->find(edcChemistryModelType);
Info<<"hello,I'm first point"<<endl;
/################################################## #####/
the code crush between third and first point, ChemistryModel::fvMeshConstructorTablePtr_ stays at zero,that means the pointer is a NULL pointer!
So I think the derived class was not "selected" to the runTimeSelectionTable. So i deduced to the makeChemistryModel.H file and find this line:

/################################################## #########/
defineTemplateTypeNameAndDebugWithName \
( \
SS##Comp##Thermo, \
(#SS"<"#Comp"," + Thermo::typeName() + ">").c_str(), \
0 \
);
/################################################## ###########/
I try to dig out what this line mean but it was so tough and i have no idea about that. Please help me...(may be this line was not the one making the code crush ) . Thank you very much!

Best regards, and happy weekend!
wen
wenxu is offline   Reply With Quote

Old   June 14, 2018, 14:54
Default
  #3
Member
 
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 11
raunakbardia is on a distinguished road
Hi,

Were you able to figure this out? I am looking at something similar right now.

Thank you.
raunakbardia 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
Trouble with Nozzle boundary condition lehoanganh07 OpenFOAM Running, Solving & CFD 0 October 26, 2013 07:24
[ICEM] trouble with mesh quality from ICEM in CFX Solver escher25 ANSYS Meshing & Geometry 0 February 28, 2011 07:38
[GAMBIT] Trouble meshing complex VOF geometry RPJones ANSYS Meshing & Geometry 2 February 14, 2011 18:54
trouble with Source Term sambatra OpenFOAM Running, Solving & CFD 2 October 5, 2010 03:28
equivalencing trouble Steve Collie CFX 6 August 22, 2001 18:26


All times are GMT -4. The time now is 15:52.