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

error compile with new Thermo class (OF9)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexale

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2022, 17:37
Default error compile with new Thermo class (OF9)
  #1
New Member
 
alex
Join Date: Jan 2018
Posts: 3
Rep Power: 8
alexale is on a distinguished road
Hello everyone!
I want implement new Thermo model in OF9.

My action:
1. I take solver: RhoSimpleFoam.
2.I take library : fluidThermophysicalModel (copy and compile in $FOAM_USER_LIBBIN )
3. In my copy of fluidThermophysicalModel i try to make new Thermo class:
- copy existing rhoThermo(rhoThermo.C, rhoThermo.H) with name flameletThermo(rename all rhoThermo on flameletThermo)
- compile this new library fluidThermophysicalModel(with my flameletThermo)
4. In RhoSimpleFoam instead fluidThermo try to use my flameletThermo class

5. I get error:
/usr/bin/ld.bfd: Make/linux64GccDPInt32Debug/rhoSimpleFoamFlamelet.o: in function `main':
/home/alex/OpenFOAM/alex-9/applications/rhoSimpleFoamFlamelet/./createFields.H:13: undefined reference to `Foam::flameletThermo::New(Foam::fvMesh const&, Foam::word const&)'
/usr/bin/ld.bfd: Make/linux64GccDPInt32Debug/rhoSimpleFoamFlamelet.o: in function `main':
/home/alex/OpenFOAM/alex-9/applications/rhoSimpleFoamFlamelet/createFields.H:13: undefined reference to `Foam::flameletThermo::New(Foam::fvMesh const&, Foam::word const&)'
/usr/bin/ld.bfd: Make/linux64GccDPInt32Debug/rhoSimpleFoamFlamelet.o: in function `Foam::autoPtr<Foam::flameletThermo>:perator()() ':
/opt/openfoam9/src/OpenFOAM/lnInclude/autoPtrI.H:142: undefined reference to `typeinfo for Foam::flameletThermo'
collect2: error: ld returned 1 exit status
make: *** [/opt/openfoam9/wmake/makefiles/general:154: /home/alex/OpenFOAM/alex-9/platforms/linux64GccDPInt32Debug/bin/rhoSimpleFoamFlamelet] Error 1


Could anyone give me suggestion related this.

Thank you in advance for any help.
alexale is offline   Reply With Quote

Old   June 1, 2022, 18:05
Default
  #2
New Member
 
Sen Wang
Join Date: Jul 2018
Location: Singapore / Notre Dame, U.S.
Posts: 20
Blog Entries: 1
Rep Power: 8
wangsen992 is on a distinguished road
Hi Alex, I recently also had this problem and I think i can offer some tips on this. All thermo classes written as templates, so check those source files that ends with "*s.C" (e.g. rhoThermos.C). They contain macros to specialize the thermo class templates with all the sub-modules (e.g. equationOfState, mixture, etc). You need to look at the "makeThermos.C" and "rhoThermos.C" to change accordingly for your class. Also check "thermophysicalModels/specie/include" for all the necessary macro definitions. It quite convoluted and I hope this can help you navigate through the code.
wangsen992 is offline   Reply With Quote

Old   June 2, 2022, 06:08
Default
  #3
New Member
 
alex
Join Date: Jan 2018
Posts: 3
Rep Power: 8
alexale is on a distinguished road
Thank you a lot for help.

I changed all related name in rhoThermos, but it did not help (even more if i change name rhoThermo in all files to some new name i had the same message). It seems that there some new feature in OF9.

I deside change existing rhoThermo for my purpose.
Thank you a lot for advice.


PS: I will try figure out right solution in future (if i find i will post messsage)
alexale is offline   Reply With Quote

Old   June 2, 2022, 11:00
Default
  #4
Member
 
Join Date: Jan 2022
Location: Germany
Posts: 72
Rep Power: 4
überschwupper is on a distinguished road
In my experience the undefined reference error arises when I forgot to update the option file or when defining a function without a definition/implementation.


I would asusme that you either

1. not included your flameletThermo library (-lflameletThermo) in options or
2. only declared the New function without defining it or
3. forgot to include flameletThermoNew.C in your "file"-file


Maybe it helps
überschwupper is offline   Reply With Quote

Old   June 3, 2022, 11:47
Default
  #5
New Member
 
alex
Join Date: Jan 2018
Posts: 3
Rep Power: 8
alexale is on a distinguished road
Thak you a lot.
You give me right direction. It seems i figure out solution.
I describe my action - may be it help somebody



Task:
I want implement new class like rhoThermo with new property for solver rhoSimpleFoam



My previous wrong way:

1. I try to use in rhoSimpleFoam usual rhoThermo(change fluidThermo to rhoThermo in solver)- it works.

2. I implement flameletThermo In thermopysicalModel/basic ->i copy all stuff related rhoThermo and heRhoThermo rename (to flameletThermo change ...Thermos and so on) and compile to my lfluidThermophysicalModels.
3.In rhoSimpleFoam change fluidThermo to myThermo

4 link my lfluidThermophysicalModels instead standard (add -L$(FOAM_USER_LIBBIN))
5 and get error (see above)
5.I try anothe way - take rhoThermo and change all names in all dir thermopysicalModel/basic on rho1Thermo ->try to use and get error.


You (thank a lot ) give advise use small my own library.

- So I compile only my new flameletThermo (in file option leave only flameletThermo and flameletThermos) to new library flameletLibrary
- link my new library to SimpleFoam - it works


Thank you all friends for all advice.
You give me way to find solution.
wangsen992 likes this.
alexale 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
chtMultiRegionTwoPhaseEulerFoam thermo package not available Roham..Seif OpenFOAM Running, Solving & CFD 9 April 10, 2024 11:36
[OpenFOAM.com] Installing superThermo with Allwmake command Dekkers OpenFOAM Installation 0 January 28, 2022 06:32
The udf.h headers are unable to open- in VISUAL STUDIO 13 sanjeetlimbu Fluent UDF and Scheme Programming 4 May 2, 2016 06:38
Access thermo package in a new reactionRate class Essy OpenFOAM Programming & Development 0 October 11, 2014 07:58
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30


All times are GMT -4. The time now is 07:00.