how to add radiation model into OpenFOAM1.5-dev+cantera?
Hi,Foamers, can you help me?
I want to add radiation model into OpenFOAM1.5-dev+cantera (alternateReactingFoam) , but I have no idea. or if you have added radiation models into reactingFOAM, please share your experience with me . thank you in advance. dahlia |
its a document which shows how radiation model has been added to simpleFoam and make simpleRadiationFoam, maybe its helpful
http://www.google.com/url?sa=t&source=web&cd=4&sqi=2&ved=0CDEQFjAD&url=h ttp%3A%2F%2Fwww.tfd.chalmers.se%2F~hani%2Fkurser%2 FOS_CFD_2009%2FAlexeyVdovin%2FRadiation_in_OpenFoa m_final.pdf&rct=j&q=Radiation%20heat%20transfer%20 in%20openFOAm&ei=2toVTsPiIovG-QbQ_LUv&usg=AFQjCNGhBHaJavPcTtxBAmmN8q1mQE8Xlw&sig 2=J3LsuEJJUpGWhhp0TbLkFw&cad=rja |
thanks a lot, nimasam.
I modified the alternateReactingFoam according to the document, but when I wmake this solver, there are some errors as follows, SOURCE=alternateReactingFoam.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -I../XiFoam -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/turbulenceModels/RAS -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/combustion/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/basic/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/chemistryModel/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/ODE/lnInclude -I/home/hly/OpenFOAM/hly-1.5-dev/Libraries/alternateChemistryModels/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/radiation/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPDebug/alternateReactingFoam.o In file included from alternateReactingFoam.C:62: createRadiationModel.H: In function ‘int main(int, char**)’: createRadiationModel.H:3: error: ‘class Foam::autoPtr<Foam::hCombustionThermo>’ has no member named ‘T’ In file included from alternateReactingFoam.C:87: hEqn.H:11: error: no matching function for call to ‘Foam::radiation::radiationModel::Sh(Foam::autoPtr <Foam::hCombustionThermo>&)’ radiationModel.H:177: note: candidates are: virtual Foam::tmp<Foam::fvMatrix<double> > Foam::radiation::radiationModel::Sh(Foam::basicThe rmo&) const createFields.H:43: warning: unused variable ‘T’ make: *** [Make/linuxGccDPDebug/alternateReactingFoam.o] error 1 can anyone give me some suggestion? :confused: |
from here you can find suitable candidate:
note: candidates are: virtual Foam::tmp<Foam::fvMatrix<double> > Foam::radiation::radiationModel::Sh(Foam::basicThermo&) const 1)add into alternateReactingFoam.C #include "basicPsiThermo.H" 2) add in creatFields.H autoPtr<basicPsiThermo> pThermo ( basicPsiThermo::New(mesh) ); basicPsiThermo& thermo1 = pThermo(); 2) then in energy equation add radiation->Sh(thermo1) |
nima, many thanks to you.
"2) then in energy equation add radiation->Sh(thermo1) " -------------------Do you mean " radiation->Sh(thermo)"? yes, I add the three sentences in creatFields.H, but the result is as follows: Making dependency list for source file alternateReactingFoam.C SOURCE=alternateReactingFoam.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -I../XiFoam -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/turbulenceModels/RAS -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/combustion/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/basic/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/chemistryModel/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/ODE/lnInclude -I/home/hly/OpenFOAM/hly-1.5-dev/Libraries/alternateChemistryModels/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/radiation/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPDebug/alternateReactingFoam.o In file included from alternateReactingFoam.C:57: createFields.H: In function ‘int main(int, char**)’: createFields.H:108: error: ‘basicPsiThermo’ was not declared in this scope createFields.H:108: error: template argument 1 is invalid createFields.H:109: error: invalid type in declaration before ‘(’ token createFields.H:110: error: ‘basicPsiThermo’ is not a class or namespace createFields.H:113: error: ‘pThermo’ cannot be used as a function In file included from alternateReactingFoam.C:62: createRadiationModel.H:3: error: ‘class Foam::autoPtr<Foam::hCombustionThermo>’ has no member named ‘T’ In file included from alternateReactingFoam.C:87: hEqn.H:11: error: no matching function for call to ‘Foam::radiation::radiationModel::Sh(Foam::autoPtr <Foam::hCombustionThermo>&)’ radiationModel.H:177: note: candidates are: virtual Foam::tmp<Foam::fvMatrix<double> > Foam::radiation::radiationModel::Sh(Foam::basicThe rmo&) const createFields.H:43: warning: unused variable ‘T’ make: *** [Make/linuxGccDPDebug/alternateReactingFoam.o] error 1 Do you know the reason? |
i edited last thread , look it again;)
|
nima, thank you very much!:) sorry for the late reply.
I have modified alternateReactingFoam.C, creatFields.H , and hEqn.H according to your suggestions. The result seems better, but there still are some errors as follows: SOURCE=alternateReactingFoam.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -I../XiFoam -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/turbulenceModels/RAS -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/combustion/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/basic/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/chemistryModel/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/ODE/lnInclude -I/home/hly/OpenFOAM/hly-1.5-dev/Libraries/alternateChemistryModels/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/radiation/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPDebug/alternateReactingFoam.o In file included from alternateReactingFoam.C:64: createRadiationModel.H: In function ‘int main(int, char**)’: createRadiationModel.H:3: error: ‘class Foam::autoPtr<Foam::hCombustionThermo>’ has no member named ‘T’ createFields.H:43: warning: unused variable ‘T’ make: *** [Make/linuxGccDPDebug/alternateReactingFoam.o] error 1 :confused: Thanks again. |
look into error:
error: ‘class Foam::autoPtr<Foam::hCombustionThermo>’ has no member named ‘T’ so in createRadiationModel.H: line 3 there should be thermo, am i right? change it in thermo1 |
nima, thanks a million!
Yes, you are right, now I have changed "thermo" to ''thermo1'' in createRadiationModel.H. The result is as follows: Making dependency list for source file alternateReactingFoam.C SOURCE=alternateReactingFoam.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -I../XiFoam -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/turbulenceModels/RAS -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/combustion/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/basic/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/chemistryModel/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/ODE/lnInclude -I/home/hly/OpenFOAM/hly-1.5-dev/Libraries/alternateChemistryModels/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/radiation/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPDebug/alternateReactingFoam.o createFields.H: In function ‘int main(int, char**)’: createFields.H:43: warning: unused variable ‘T’ g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -I../XiFoam -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/turbulenceModels/RAS -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/specie/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/combustion/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/basic/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/chemistryModel/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/ODE/lnInclude -I/home/hly/OpenFOAM/hly-1.5-dev/Libraries/alternateChemistryModels/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/radiation/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/reactionThermo/lnInclude -IlnInclude -I. -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/hly/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread Make/linuxGccDPDebug/alternateReactingFoam.o -L/home/hly/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPDebug \ -lcompressibleRASModels -lcombustionThermophysicalModels -lfiniteVolume -lspecie -lbasicThermophysicalModels -lchemistryModel -lODE -L/home/hly/OpenFOAM/hly-1.5-dev/lib/linuxGccDPDebug -lradiation -lalternateChemistryModels -lOpenFOAM -ldl -ggdb3 -DFULLDEBUG -lm -o /home/hly/OpenFOAM/hly-1.5-dev/applications/bin/linuxGccDPDebug/alternateReactingFoam Make/linuxGccDPDebug/alternateReactingFoam.o: In function `main': /home/hly/OpenFOAM/hly-1.5-dev/Libraries/AlternateChemistry/Transient/alternateReactingFoam/createFields.H:111: undefined reference to `Foam::basicPsiThermo::New(Foam::fvMesh const&)' collect2: ld returned 1 exit status make: *** [/home/hly/OpenFOAM/hly-1.5-dev/applications/bin/linuxGccDPDebug/alternateReactingFoam] error 1 in fact, I have added #include "basicPsiThermo.H" into alternateReactingFoam.C. what should I do ................... |
Hi Nimasam
I am just starting to explore openfoam. I have a quick question in the following. autoPtr<basicThermo> pThermo I understand that in above line pThermo is an object of the template class autoptr. basicThermo& thermo = pThermo(); But I don't understand is that how the object pThermo is used as pThermo(). I understand that thermo is a reference variable of type basicThermo. Please explain the use of pThermo(). Regards |
All times are GMT -4. The time now is 10:35. |