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

Compile solver with custom thermophysicalModels

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By raumpolizei

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 6, 2019, 10:30
Post Compile solver with custom thermophysicalModels
  #1
New Member
 
Vincent
Join Date: Aug 2019
Location: Germany
Posts: 14
Rep Power: 6
vince_cfd is on a distinguished road
Hello everyone,

I want to to simulate the warming of PCM (phase change material). In approximation their phase change has constant volume. To attribute for the heat of fusion, I want to model a very high cp value, while using the regular cp value for the solid and fluid state. I found an already existing tabularThermophysicalPropertiesModel.

Following all the given steps, tutorials and the documentation I've been able to:

-create my own solver -> chtPCMFoam (equals chtMultiRegionFoam)
-compile the tabularThermophysicalPropertiesModel
-run the tutorial to check if the tabular model is installed correctly

Now I want to add the tabular model to my own solver, but it is giving me a hard time. As far as I understand it, I have to make changes to the Make/options file, and link my lnInclude and my shared libraries in there.

The libraries seem to work like this:
Code:
EXE_LIBS = \
    -L{$FOAM_USER_LIBBIN} \
    -L{$FOAM_USER_LIBBIN}/libTabularThermophysicalModels.so \
    -L{$FOAM_USER_LIBBIN}/libuserspecie.so
But the lnInclude part is returning an error all the time:
Code:
 EXE_INC = \
   -I$(HOME)/cfd/CFD/newSolver/tabulatedThermophysicalProperties-Feature_OF7/src/thermophysicalModels/specie/lnInclude \
   -I$(HOME)/cfd/CFD/newSolver/tabulatedThermophysicalProperties-Feature_OF7/src/thermophysicalModels/basis/lnInclude
Code:
wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
    unknown option: '-I/home/cfd/CFD/newSolver/tabulatedThermophysicalProperties-Feature_OF7/src/thermophysicalModels/specie/lnInclude'

Usage: wmakeLnInclude [OPTION] dir

options:
  -update | -u      update
  -silent | -s      use 'silent' mode (do not echo command)
  -help   | -h      print the usage

    Link all the source files in the <dir> into <dir>/lnInclude

Note
    The '-u' option forces an update when the lnInclude directory already exists
    and changes the default linking from 'ln -s' to 'ln -sf'.

    wmakeLnInclude error: base directory \ does not exist
    unknown option: '-I/home/cfd/CFD/newSolver/tabulatedThermophysicalProperties-Feature_OF7/src/thermophysicalModels/basis/lnInclude'
I'm very thankful for any advice on how to do this the right way.
vince_cfd is offline   Reply With Quote

Old   September 22, 2020, 10:30
Default
  #2
Member
 
ssa
Join Date: Sep 2018
Posts: 93
Rep Power: 7
ssa_cfd is on a distinguished road
Did you solve this error.? I am facing the same problem.
ssa_cfd is offline   Reply With Quote

Old   September 23, 2020, 04:30
Default
  #3
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
Hey, to use wmake correctly, please check this page: https://cfd.direct/openfoam/user-gui...g-applications . You may for instance realize that the L prefix is to include an additional directory to the library lookup path and cant be used as shown in the initial post. It should be something like this:

Code:
EXE_LIBS = \
    -L<PATHTODIRCONTAININGLIBFILES> \
    -l<libname without "lib"in front and".so" at the end>
For the example shown in the first post:

Code:
EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lTabularThermophysicalModels \
    -luserspecie
Hope this helps.

RP
raumpolizei is offline   Reply With Quote

Old   September 23, 2020, 04:34
Default
  #4
Member
 
ssa
Join Date: Sep 2018
Posts: 93
Rep Power: 7
ssa_cfd is on a distinguished road
The problem is not with EXE_LIBS, The problem is with EXE_INC.

For example if I give

-I$/chemistryModel/lnInclude

it is not working with openfoam 6. But the same works with openfoam 2.4.x
ssa_cfd is offline   Reply With Quote

Old   September 23, 2020, 06:50
Default
  #5
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
Ok, the problem here is the use of $. In the Make/options $(<asd>) is used to access a predefined name. Type in your terminal
Code:
>echo $FOAM_SRC
>echo $FOAM_USER_LIBBIN
wmake accesses these variables through the following syntax: $(FOAM_SRC) and $(FOAM_USER_LIBBIN).
Your EXE_INC has to give the compiler a location to search for the different header files that you include in your application. The path has to be complete and here using predefined names can be helpful so that you don't have to type <ultralongpathtoOpenFOAM/OpenFOAM-<version>/src> all the time. But this can also look like this
Code:
EXE_INC = \
    -$(HOME)/myPrivateOpenFOAMLibraries/lib1/lnInclude
Juan Daniel likes this.
raumpolizei is offline   Reply With Quote

Reply

Tags
compile, lninclude, solver


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
PEMFC model with FLUENT brahimchoice FLUENT 22 April 19, 2020 15:44
Converting custom solver from old version to openFoam4.1 Nigel Bruce Khan OpenFOAM Running, Solving & CFD 2 August 11, 2017 10:45
Hybrid discretisation - blend factor gcoopermax CFX 5 September 23, 2016 08:05
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
How to compile an unsteady solver based on solver of MRFSimpleFoam? renyun0511 OpenFOAM Running, Solving & CFD 0 April 27, 2010 11:16


All times are GMT -4. The time now is 16:01.