|
[Sponsors] |
September 18, 2019, 01:08 |
Compile old solver in new version of OF
|
#1 |
New Member
Fantastic Boy
Join Date: Oct 2017
Posts: 12
Rep Power: 9 |
Hi everyone.
I have OF 6 installed on the server but I wanted to compile a solver from OF141 to validate a test case. I am facing a problem with configure the Code:
wmake/options The original file is Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/transportModels EXE_LIBS = \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools \ /* $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o */ Code:
EXE_INC = \ -I</home/mgt-aaibe/OpenFOAM/mgt-aaibe-6/src>/finiteVolume/lnInclude \ -I</home/mgt-aaibe/OpenFOAM/mgt-aaibe-6/src>/turbulenceModels \ -I</home/mgt-aaibe/OpenFOAM/mgt-aaibe-6/src>/transportModels EXE_LIBS = \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools \ /* $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o */ HTML Code:
https://cfd.direct/openfoam/user-guide/v7-compiling-applications/ Code:
EXE_INC = \\ -I<directoryPath1> \\ The second question is where is the LIBS store? I need to set it to read from my own directory too. Appreciate your help. |
|
September 18, 2019, 03:11 |
|
#2 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 8 |
Hey there,
unless the libraries you are using are not provided in your openfoam version (lets call it OF-standard), you do not need to change the paths. To better understand, just type in your console (after sourcing your new openfoam version): Code:
echo $FOAM_SRC EXE_INC = \ -I</home/mgt-aaibe/OpenFOAM/mgt-aaibe-6/src>/finiteVolume/lnInclude \ to EXE_INC = \ -I/home/mgt-aaibe/OpenFOAM/mgt-aaibe-6/src/finiteVolume/lnInclude \ in a same way you can get the path to the libraries with: Code:
echo $FOAM_LIBBIN RP |
|
September 18, 2019, 05:22 |
|
#3 |
New Member
Fantastic Boy
Join Date: Oct 2017
Posts: 12
Rep Power: 9 |
Hi Raumpolizei,
Thank for your quick response. The reason that I want to add all the path to the new solver is that I want to use the old solver from OF 1.4.1 in OF 6. I noticed there is a lot of changes been made when they release the new version especially from OF 2 to OF3. Therefore, I think is will be better for me to add the path to read the library. Also, may I know what is the correct expression adding the new path to the libraries? Is it the below is a correct expression? Can you provide me an example on that too? Code:
-L/home/mgt-aaibe/OpenFOAM/mgt-aaibe-6/lincompressibleTurbulenceModels |
|
September 18, 2019, 06:06 |
|
#4 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 8 |
Hey,
do I understand you correctly, you would like to compile an application in OF6 using libraries from OF 1.4? Even if that would be working, by doing that you would lose all the new functionalities of OF6. Generally, as you said, the code may have changed a lot which could be problematic (using a mix of OF6 and OF1.4 libraries will probably also not work). The clean way to do it would be to use the new OF6 libraries and then go over the compile errors one after another. So basically just use the same Make/files and Make/options with your new OF version sourced. You can still post the error message here (And also the Make/files & Make/options) To your second question: In order to include a path so that the libraries to be linked with can be found, you need the following syntax (90% sure, should be the way though): -L<directoryContainingLibraryPath> \ -l<aLibraryInThatDirectory> Your example becomes: Code:
-L/home/mgt-aaibe/OpenFOAM/mgt-aaibe-6 \ -lincompressibleTurbulenceModels |
|
September 18, 2019, 07:37 |
|
#5 |
New Member
Fantastic Boy
Join Date: Oct 2017
Posts: 12
Rep Power: 9 |
Hi there,
Basically I want to compile a solver from OF 1.4 with it's own libraries in OF6 where the UEqn.H and pEqn.H is v1.4. Is it possible for me to set only the new solver will access the OF1.4 libraries and other remains as OF6? Thank you. |
|
Tags |
compile solver |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PEMFC model with FLUENT | brahimchoice | FLUENT | 22 | April 19, 2020 16:44 |
Unable to compile solver | hwsv07 | OpenFOAM Programming & Development | 10 | February 21, 2018 10:41 |
Converting custom solver from old version to openFoam4.1 | Nigel Bruce Khan | OpenFOAM Running, Solving & CFD | 2 | August 11, 2017 11:45 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
How to compile an unsteady solver based on solver of MRFSimpleFoam? | renyun0511 | OpenFOAM Running, Solving & CFD | 0 | April 27, 2010 12:16 |