|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16 ![]() |
I am trying to create table of species from the wordList defined in one of the dictionary.
Here is my code: Info<< nl << "Reading thermophysicalProperties" << endl; PtrList<volScalarField> Y(3); IOdictionary speciesProperties ( IOobject ( "speciesProperties", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); wordList speciesName ( speciesProperties.lookup("speciesNames") ); speciesTable speciesTable s(wordList speciesName); dimensionedScalar source_r ( speciesProperties.lookup("source_r") ); word inertSpecie(speciesProperties.lookup("inertSpecie" )); Info << "Reading field p\n" << endl; volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info << "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); # include "createPhi.H" label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); singlePhaseTransportModel laminarTransport(U, phi); autoPtr<incompressible::RASModel> turbulence ( incompressible::RASModel::New(U, phi, laminarTransport) ); The compilation error with speciesTable constructor is: createFields.H: In function 'int main(int, char**)': createFields.H:23: error: 'speciesTable' was not declared in this scope createFields.H:23: error: expected `;' before 'speciesTable' /export/apps/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readSIMPLEControls.H:6: warning: unused variable 'momentumPredictor' /export/apps/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readSIMPLEControls.H:9: warning: unused variable 'fluxGradp' /export/apps/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readSIMPLEControls.H:12: warning: unused variable 'transonic' make: *** [Make/linux64GccDPOpt/simpleMyFoam.o] Error 1 Any suggestions, please? Hrushikesh |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 29 ![]() |
Hi Hrushikesh,
It seems to me that the problem lies in this line: Code:
speciesTable speciesTable s(wordList speciesName); Code:
speciesTable s(speciesName); |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16 ![]() |
Hi Marco,
I changed the line you have suggested. But the compiler throws up the same error again. I checked speciesTable.C again. Below is the constructor. // Construct from list of specie names Foam::speciesTable::speciesTable(const wordList& specieNames) : wordList(specieNames) { setIndices(); } I am now confused what to do? I don't understand the error createFields.H:23: error: 'speciesTable' was not declared in this scope Hrushikesh |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41 ![]() ![]() |
Quote:
Perhaps it is just something quite banal - like a missing include? In the Make/options: Code:
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude Code:
#include "speciesTable.H" |
||
![]() |
![]() |
![]() |
![]() |
#5 | |
Member
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16 ![]() |
Quote:
I have included the above suggestions. The error message is the same. Here is the error message: In file included from simpleMyFoam.C:44: createFields.H:1:26: error: speciesTable.H: No such file or directory In file included from simpleMyFoam.C:44: createFields.H: In function 'int main(int, char**)': createFields.H:25: error: 'speciesTable' was not declared in this scope createFields.H:25: error: expected `;' before 'species' /export/apps/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readSIMPLEControls.H:6: warning: unused variable 'momentumPredictor' /export/apps/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readSIMPLEControls.H:9: warning: unused variable 'fluxGradp' /export/apps/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readSIMPLEControls.H:12: warning: unused variable 'transonic' make: *** [Make/linux64GccDPOpt/simpleMyFoam.o] Error 1 Line no 44 in simpleMyFoam is createFields.H line Hrushikesh |
||
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 18 ![]() |
Hi Hrushikesh,
I think you have to insert the #include inside the header of your code, i.e. before Code:
int main(int argc, char *argv[]) Regards, Stefan |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16 ![]() |
Hi Stefan/Mark/Marco,
Thanks for your help. The problem is solved now. Thanks ![]() ![]() Hrushi |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 04:43 |
Incoherent problem table in hollow-fiber spinning | Gianni | FLUENT | 0 | April 5, 2008 10:33 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 06:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 19:13 |
convergence problem | Trushar | Phoenics | 5 | August 27, 2002 23:40 |