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

Error trying to compile new solver.C

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By floquation
  • 2 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2017, 10:11
Default Error trying to compile new solver.C
  #1
Member
 
Join Date: May 2017
Posts: 47
Rep Power: 8
LThomes is on a distinguished road
Hello,
I'm trying to control the Courrant number and my ajustTimeStep is not working. So I think i have to modify the icoFoam.C to be able to make it work. However, I'm facing some trouble.
I'm following this tutorial http://www.tfd.chalmers.se/~hani/kur...tersReport.pdf to create a new solver "myIcoFoam".
So I've done these steps:
_____________________________________
Code:
sol
cp -r incompressible/icoFoam/ $WM_PROJECT_USER_DIR/applications/solvers/
cd $WM_PROJECT_USER_DIR/applications/solvers
mv icoFoam myIcoFoam
cd myIcoFoam
mv icoFoam.C myIcoFoam.C
sed -i s/icoFoam/myIcoFoam/g myIcoFoam.C
sed -i s/icoFoam/myIcoFoam/g Make/files
To set the library path right, do following change in Make/files:
change
EXE = $(FOAM_APPBIN)/icoFoam
to
EXE = $(FOAM_USER_APPBIN)/myIcoFoam
And also change in Make/options:
-I../dieselEngineFoam \
to
-I$(LIB_SRC)/../applications/solvers/combustion/dieselEngineFoam \
____________________________________________

I did not understand this last step very well, so I wrote this:
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/applications/solvers/lnInclude \
    -I$(LIB_SRC)/meshTools/applications/solvers/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lmeshTools
The previous "options" was:
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lmeshTools
Finally, I'm getting the following error:
Code:
[ofuser@default myIcoFoam]$ wmake
Making dependency list for source file myIcoFoam.C
could not open file fvCFD.H for source file myIcoFoam.C due to No such file or directory
could not open file pisoControl.H for source file myIcoFoam.C due to No such file or directory
could not open file createPhi.H for source file myIcoFoam.C due to No such file or directory
could not open file initContinuityErrs.H for source file myIcoFoam.C due to No such file or directory
could not open file CourantNo.H for source file myIcoFoam.C due to No such file or directory
could not open file continuityErrs.H for source file myIcoFoam.C due to No such file or directory
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1612 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/applications/solvers/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/meshTools/applications/solvers/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OSspecific/POSIX/lnInclude   -fPIC -c myIcoFoam.C -o Make/linux64GccDPInt32Opt/myIcoFoam.o
myIcoFoam.C:63:19: fatal error: fvCFD.H: No such file or directory
 #include "fvCFD.H"
Can anybody help me? I'm using OpenFOAM for Windows, so I'm fiding it a little bit difficult to modify these things
LThomes is offline   Reply With Quote

Old   June 20, 2017, 10:31
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Quote:
Originally Posted by LThomes View Post
I did not understand this last step very well, so I wrote this:
That's why it goes wrong there.

Quote:
Originally Posted by LThomes View Post
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/applications/solvers/lnInclude \
    -I$(LIB_SRC)/meshTools/applications/solvers/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lmeshTools
The previous "options" was:
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lmeshTools
Clearly, the directory I put in bold does not exist, so you are bound to get an error!
The -I option should link to the directory that contains some common OF headers... This should be exactly the same for both icoFoam and my_icoFoam, so it is very simple what you need to do there: don't touch anything.

This replacement:
Code:
-I../dieselEngineFoam \
to
-I$(LIB_SRC)/../applications/solvers/combustion/dieselEngineFoam \
links your copied solver to the original solver, allowing you to use its header files, rather than copying them.
Clearly, this is a nicer thing to do (as you don't have to duplicate unnecessary things), but I recommend you don't do so, as you are not yet comfortable with making those judgment calls.

Quote:
Originally Posted by LThomes View Post
Can anybody help me? I'm using OpenFOAM for Windows, so I'm fiding it a little bit difficult to modify these things
Disclaimer: I don't know about using OpenFOAM on Windows.
Whereas I like Windows for the "normal" things, Linux beats Windows by far when we talk about software development.
arashma and LThomes like this.
floquation is offline   Reply With Quote

Old   June 21, 2017, 09:29
Default
  #3
Member
 
Join Date: May 2017
Posts: 47
Rep Power: 8
LThomes is on a distinguished road
floquation,
Thanks for your prompt reply. But if I don't touch anything in the "options", I have the following error:
Code:
[ofuser@default myIcoFoam]$ wmake
Making dependency list for source file myIcoFoam.C
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1612 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/meshTools/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OSspecific/POSIX/lnInclude   -fPIC -c myIcoFoam.C -o Make/linux64GccDPInt32Opt/myIcoFoam.o
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1612 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/meshTools/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/myIcoFoam.o -L/opt/OpenFOAM/OpenFOAM-v1612+/platforms/linux64GccDPInt32Opt/lib \
            -lfiniteVolume -lmeshTools -lOpenFOAM -ldl  \
             -lm -o /home/ofuser/OpenFOAM/ofuser-v1612+/platforms/linux64GccDPInt32Opt/bin/myIcoFoam
Quote:
Whereas I like Windows for the "normal" things, Linux beats Windows by far when we talk about software development.
It's not my choice to use Windows xD
LThomes is offline   Reply With Quote

Old   June 21, 2017, 10:16
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
That's not an error.

When a compiler is called, it shows you the entire command. That's what the Makefile does.

The three lines you see right there do the following:
  1. It finds the dependencies of myIcoFoam, such that it can compile the dependencies before compiling myIcoFoam. You have no dependencies that need compilation, so it then proceeds with:
  2. It compiles myIcoFoam.C to Make/.../myIcoFoam.o
  3. It links Make/.../myIcoFoam.o, which gives you the executable myIcoFoam in $FOAM_USER_APPBIN
If you'd now type "wmake" again, it will show you "myIcoFoam is up to date", which indicates that everything was successful.
jiahui_93 and ARTisticCFD like this.
floquation is offline   Reply With Quote

Old   June 22, 2017, 07:04
Default
  #5
Member
 
Join Date: May 2017
Posts: 47
Rep Power: 8
LThomes is on a distinguished road
Thank you so much. I'm so used to getting error messages, that I thought it was another one

Last edited by LThomes; June 23, 2017 at 06:25.
LThomes is offline   Reply With Quote

Old   June 22, 2017, 07:23
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Did you go through all these hoops just to control the time step? Why not use pimpleFoam?
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   June 23, 2017, 06:24
Default
  #7
Member
 
Join Date: May 2017
Posts: 47
Rep Power: 8
LThomes is on a distinguished road
Quote:
Originally Posted by akidess View Post
Did you go through all these hoops just to control the time step? Why not use pimpleFoam?
I didn't know that the ajustTimeStep would work with pimpleFoam, if it works it's a great idea indeed. Thank you.
LThomes is offline   Reply With Quote

Old   June 23, 2017, 10:24
Default
  #8
Member
 
Join Date: May 2017
Posts: 47
Rep Power: 8
LThomes is on a distinguished road
Hello again,
Now I'm trying to modify the myIcoFoam.C file to enable the ajustTimeStep. This is what I did:
Code:
int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"

    pisoControl piso(mesh);

    #include "createFields.H"
    #include "initContinuityErrs.H"
	

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<< "\nStarting time loop\n" << endl;

    //while (runTime.loop())	// dropped
	while (runTime.run())       // added
    {
		#include "readTimeControls.H"	// added
		#include "setDeltaT.H" // added

        runTime++;            // added
		
        Info<< "Time = " << runTime.timeName() << nl << endl;
		

        #include "CourantNo.H"

        // Momentum predictor

        fvVectorMatrix UEqn
        (
             .
             .
             .
But when I try to compile it, this message appears:
Code:
[ofuser@default myPisoFoam]$ wmake
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1612 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1612+/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/TurbulenceModels/incompressible/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/transportModels -I/opt/OpenFOAM/OpenFOAM-v1612+/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/meshTools/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/sampling/lnInclude -IlnInclude -I[ofuser@default myIcoFoam]$ wmake
Making dependency list for source file myIcoFoam.C
g++ -std=c++11 -m64 -DOPENFOAM_PLUS=1612 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/meshTools/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-v1612+/src/OSspecific/POSIX/lnInclude   -fPIC -c myIcoFoam.C -o Make/linux64GccDPInt32Opt/myIcoFoam.o
In file included from myIcoFoam.C:79:0:
/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude/readTimeControls.H: In function ‘int main(int, char**)’:
/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude/readTimeControls.H:32:1: error: ‘adjustTimeStep’ was not declared in this scope
 adjustTimeStep =
 ^
/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude/readTimeControls.H:35:1: error: ‘maxCo’ was not declared in this scope
 maxCo =
 ^
/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude/readTimeControls.H:38:1: error: ‘maxDeltaT’ was not declared in this scope
 maxDeltaT =
 ^
In file included from myIcoFoam.C:90:0:
/opt/OpenFOAM/OpenFOAM-v1612+/src/finiteVolume/lnInclude/setDeltaT.H:36:35: error: ‘CoNum’ was not declared in this scope
     scalar maxDeltaTFact = maxCo/(CoNum + SMALL);
                                   ^
make: *** [Make/linux64GccDPInt32Opt/myIcoFoam.o] Error 1
The readTimeControls.H has the following lines:
Code:
adjustTimeStep =
    runTime.controlDict().lookupOrDefault("adjustTimeStep", false);

maxCo =
    runTime.controlDict().lookupOrDefault<scalar>("maxCo", 1.0);

maxDeltaT =
    runTime.controlDict().lookupOrDefault<scalar>("maxDeltaT", GREAT);
Could anybody help me fix this error?
LThomes is offline   Reply With Quote

Old   June 23, 2017, 10:29
Default
  #9
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
You are missing
Code:
    #include "createTimeControls.H"
next to createTime.H etc.

You can easily figure that out by opening a solver that supports this, like pimpleFoam or interFoam.
floquation is offline   Reply With Quote

Old   June 26, 2017, 08:44
Default
  #10
Member
 
Join Date: May 2017
Posts: 47
Rep Power: 8
LThomes is on a distinguished road
Quote:
You can easily figure that out by opening a solver that supports this, like pimpleFoam or interFoam.
I actually did that, I can't believe I missed that line, I'm sorry >.< . Thank you very much for your patience.
LThomes is offline   Reply With Quote

Old   November 28, 2017, 09:54
Default wmake error for new solver
  #11
Member
 
Saleh Abuhanieh
Join Date: Nov 2017
Posts: 82
Rep Power: 8
Saleh Abuhanieh is on a distinguished road
Quote:
Originally Posted by floquation View Post
That's not an error.

When a compiler is called, it shows you the entire command. That's what the Makefile does.

The three lines you see right there do the following:
  1. It finds the dependencies of myIcoFoam, such that it can compile the dependencies before compiling myIcoFoam. You have no dependencies that need compilation, so it then proceeds with:
  2. It compiles myIcoFoam.C to Make/.../myIcoFoam.o
  3. It links Make/.../myIcoFoam.o, which gives you the executable myIcoFoam in $FOAM_USER_APPBIN
If you'd now type "wmake" again, it will show you "myIcoFoam is up to date", which indicates that everything was successful.


Hi Kevin, Actually what LThomes did (modifying the Make/option file)is one of the solution posted in web to solve the errors which are related to compiling new solver. I almost tried all the ways!
now, I am trying to compile new solver (first exercise only changing the name and the Make/file) and when I execute the wmake command, I receive the following error:

make: *** No rule to make target '/opt/OpenFOAM-dev-debug/platforms/linux64GccDPInt32Debug/applications/solvers/incompressible/my_icoFoam/my_icoFoam.C.dep', needed by '/opt/OpenFOAM-dev-debug/platforms/linux64GccDPInt32Debug/applications/solvers/incompressible/my_icoFoam/my_icoFoam.o'. Stop."

Thank you in advance
Saleh Abuhanieh is offline   Reply With Quote

Old   May 16, 2018, 09:42
Default
  #12
Member
 
Join Date: Jan 2018
Location: Malaysia
Posts: 58
Rep Power: 8
jiahui_93 is on a distinguished road
Quote:
Originally Posted by floquation View Post
That's not an error.

When a compiler is called, it shows you the entire command. That's what the Makefile does.

The three lines you see right there do the following:
  1. It finds the dependencies of myIcoFoam, such that it can compile the dependencies before compiling myIcoFoam. You have no dependencies that need compilation, so it then proceeds with:
  2. It compiles myIcoFoam.C to Make/.../myIcoFoam.o
  3. It links Make/.../myIcoFoam.o, which gives you the executable myIcoFoam in $FOAM_USER_APPBIN
If you'd now type "wmake" again, it will show you "myIcoFoam is up to date", which indicates that everything was successful.
Hi, your explanation made me at least understand the main steps of compilation thx
i am facing a problem when trying to compile my own modified movingConeTopFvMesh which existed in openfoam4 and 5. I followed the steps to change the name of C and H file, their contents, as well as edit Make/file and run wmake. But it output errors:

When I run wmake in openfoam4,
Code:
wmakeLnInclude: linking include files to ./lnInclude
make: *** No rule to make target '/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh2.C.dep', needed by '/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/topoChangerFvMesh/topoChangerFvMesh/topoChangerFvMesh2.o'.  Stop.
When i run wmake libso in openfoam5,
Code:
wmakeLnInclude: linking include files to ./lnInclude
make: *** No rule to make target 'Make/linux64GccDPInt32Opt/topoChangerFvMesh/JH_topoChangerFvMesh.C.dep', needed by 'Make/linux64GccDPInt32Opt/topoChangerFvMesh/JH_topoChangerFvMesh.o'.  Stop.
i tried to wclean and allwmake in src dir, and got some error output at the end of compilation.
Code:
/opt/openfoam4/src/parallel/decompose/scotchDecomp
Making dependency list for source file scotchDecomp.C
could not open file scotch.h for source file scotchDecomp.C due to No such file or directory
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_MPICXX -I/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent -I/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -I/include -I/opt/ThirdParty-4.1/platforms/linux64GccDPInt32/scotch_6.0.3/include -I/usr/include/scotch -I../decompositionMethods/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude   -fPIC -c scotchDecomp.C -o /opt/openfoam4/platforms/linux64GccDPInt32Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o
scotchDecomp.C:36:20: fatal error: scotch.h: No such file or directory
compilation terminated.
/opt/openfoam4/wmake/rules/General/transform:8: recipe for target '/opt/openfoam4/platforms/linux64GccDPInt32Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o' failed
make: *** [/opt/openfoam4/platforms/linux64GccDPInt32Opt/src/parallel/decompose/scotchDecomp/scotchDecomp.o] Error 1
I tried uninstall and re install openfoam4, and even tried compiling my new class to openfoam5. But both of them didn't work.
May i get some advice here on how to solve this? thanks a lot

Last edited by jiahui_93; May 27, 2018 at 22:44.
jiahui_93 is offline   Reply With Quote

Old   May 26, 2018, 23:55
Default
  #13
Member
 
Join Date: Jan 2018
Location: Malaysia
Posts: 58
Rep Power: 8
jiahui_93 is on a distinguished road
Quote:
Originally Posted by Saleh Abuhanieh View Post
Hi Kevin, Actually what LThomes did (modifying the Make/option file)is one of the solution posted in web to solve the errors which are related to compiling new solver. I almost tried all the ways!
now, I am trying to compile new solver (first exercise only changing the name and the Make/file) and when I execute the wmake command, I receive the following error:

make: *** No rule to make target '/opt/OpenFOAM-dev-debug/platforms/linux64GccDPInt32Debug/applications/solvers/incompressible/my_icoFoam/my_icoFoam.C.dep', needed by '/opt/OpenFOAM-dev-debug/platforms/linux64GccDPInt32Debug/applications/solvers/incompressible/my_icoFoam/my_icoFoam.o'. Stop."

Thank you in advance
hi, i'm getting the exactly same message as you. Do you solve your problem? Do you mind to share here? thanks
jiahui_93 is offline   Reply With Quote

Old   May 2, 2020, 15:34
Default
  #14
New Member
 
TX
Join Date: May 2020
Posts: 3
Rep Power: 5
SHANRU is on a distinguished road
Quote:
Originally Posted by jiahui_93 View Post
hi, i'm getting the exactly same message as you. Do you solve your problem? Do you mind to share here? thanks
you need to replace the icoFoam with my_icoFoam in the my_icoFoam.C
sed -i 's/icoFoam/my_icoFoam/g' my_icoFoam.C
SHANRU is offline   Reply With Quote

Old   May 8, 2020, 04:44
Default Problem in linearSpring custom utility function
  #15
New Member
 
sreekanth
Join Date: Dec 2019
Posts: 13
Rep Power: 6
neko2650 is on a distinguished road
I tried to customise the linearSpring restrain to mylinearSpring and to make the source file readable by any solver I provided the path for executable in files

Code:
mylinearSpring.C

LIB = $(FOAM_USER_LIBBIN)/libmylinearSpring
and in the options, I gave flags as follows

Code:
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(WM_PROJECT_DIR)/src/functionObjects/forces/lnInclude \
    -I$(WM_PROJECT_DIR)/src/sixDoFRigidBodyMotion/lnInclude

LIB_LIBS = \
    -lfluidThermophysicalModels \
    -lincompressibleTransportModels \
    -lcompressibleTransportModels \
    -lturbulenceModels \
    -lincompressibleTurbulenceModels \
    -lcompressibleTurbulenceModels \
    -lspecie \
    -lfileFormats \
    -lfiniteVolume \
    -lmeshTools \
The make file compiled and provided .so file which I added to controlDict in floatingObject example and while running simulation blockMesh, topoSet, subsetMesh, setFields are compiled and while compiling interFoam it gave me the following error
Code:
sreekanth@sreekanth-VirtualBox:~/OpenFOAM/sreekanth-7/run/floatingObject$ interFoam 
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 7-1ff648926f77
Exec   : interFoam
Date   : May 06 2020
Time   : 09:45:05
Host   : "sreekanth-VirtualBox"
PID    : 2589
I/O    : uncollated
Case   : /home/sreekanth/OpenFOAM/sreekanth-7/run/floatingObject
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning : 
    From function void* Foam::dlOpen(const Foam::fileName&, bool)
    in file POSIX.C at line 1251
    dlopen error : /home/sreekanth/OpenFOAM/sreekanth-7/platforms/linux64GccDPInt32Opt/lib/libmylinearSpring.so: undefined symbol: _ZTIN4Foam30sixDoFRigidBodyMotionRestraintE
--> FOAM Warning : 
    From function bool Foam::dlLibraryTable::open(const Foam::fileName&, bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 105
    could not load "libmylinearSpring.so"
Create mesh for time = 0

Using #calcEntry at line 50 in file "/home/sreekanth/OpenFOAM/sreekanth-7/run/floatingObject/constant/dynamicMeshDict.rigidBodyMotionCoeffs.bodies.floatingObject"
Using #codeStream with "/home/sreekanth/OpenFOAM/sreekanth-7/run/floatingObject/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_96bd56ab6d599ebbc648462330c624ef71f2258c.so"
Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Using #calcEntry at line 50 in file "/home/sreekanth/OpenFOAM/sreekanth-7/run/floatingObject/constant/dynamicMeshDict.rigidBodyMotionCoeffs.bodies.floatingObject"
Selecting motion solver: rigidBodyMotion


--> FOAM FATAL ERROR: 
Unknown restraint type mylinearSpring

Valid restraint types are : 
4
(
linearAxialAngularSpring
linearDamper
linearSpring
sphericalAngularDamper
)
    From function static Foam::autoPtr<Foam::RBD::restraint> Foam::RBD::restraint::New(const Foam::word&, const Foam::dictionary&, const Foam::RBD::rigidBodyModel&)
    in file restraints/restraint/rigidBodyRestraintNew.C at line 45.

FOAM exiting
While checking the code I found that there is a error in loading sixDoFRigidBodyMotionRestraint library using
Code:
 ldd <library path>
In the next step, I added sixDoFRigidBodyMotion in the options

Code:
 EXE_INC = \
    -I$(LIB_SRC)/fileFormats/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(WM_PROJECT_DIR)/src/functionObjects/forces/lnInclude \
    -I$(WM_PROJECT_DIR)/src/sixDoFRigidBodyMotion/lnInclude

LIB_LIBS = \
    -lfluidThermophysicalModels \
    -lincompressibleTransportModels \
    -lcompressibleTransportModels \
    -lturbulenceModels \
    -lincompressibleTurbulenceModels \
    -lcompressibleTurbulenceModels \
    -lspecie \
    -lfileFormats \
    -lfiniteVolume \
    -lmeshTools \
    -lsixDoFRigidBodyMotion \
and checked again mylinearSpring.so libraries for the included libsixDoFRigidBodyMotion.so library using
Code:
 ldd <library path>
Code:
 sreekanth@sreekanth-VirtualBox:~$ ldd /home/sreekanth/OpenFOAM/sreekanth-7/platforms/linux64GccDPInt32Opt/lib/libmylinearSpring.so
	linux-vdso.so.1 =>  (0x00007ffea23ef000)
	libfluidThermophysicalModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so (0x00007f45475ef000)
	libincompressibleTransportModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libincompressibleTransportModels.so (0x00007f454734d000)
	libcompressibleTransportModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libcompressibleTransportModels.so (0x00007f4547149000)
	libturbulenceModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libturbulenceModels.so (0x00007f4546d10000)
	libincompressibleTurbulenceModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libincompressibleTurbulenceModels.so (0x00007f4546853000)
	libcompressibleTurbulenceModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libcompressibleTurbulenceModels.so (0x00007f45463af000)
	libspecie.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libspecie.so (0x00007f4545caf000)
	libfileFormats.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libfileFormats.so (0x00007f4545a24000)
	libfiniteVolume.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so (0x00007f4543d1a000)
	libmeshTools.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so (0x00007f4543659000)
	libsixDoFRigidBodyMotion.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libsixDoFRigidBodyMotion.so (0x00007f45433cd000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f454304b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4542d42000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4542b2c000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4542762000)
	libOpenFOAM.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so (0x00007f4541bc1000)
	libthermophysicalProperties.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libthermophysicalProperties.so (0x00007f45418aa000)
	libPstream.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/openmpi-system/libPstream.so (0x00007f454169a000)
	libtwoPhaseMixture.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libtwoPhaseMixture.so (0x00007f454147a000)
	libsolidThermo.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libsolidThermo.so (0x00007f4541198000)
	libsolidSpecie.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libsolidSpecie.so (0x00007f4540f6e000)
	libtriSurface.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libtriSurface.so (0x00007f4540ccd000)
	libsurfMesh.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libsurfMesh.so (0x00007f45409c0000)
	libforces.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libforces.so (0x00007f454074e000)
	libdynamicMesh.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so (0x00007f453ffe8000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4547d8a000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f453fdce000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f453fbb1000)
	libmpi.so.12 => /usr/lib/libmpi.so.12 (0x00007f453f8db000)
	libreactionThermophysicalModels.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libreactionThermophysicalModels.so (0x00007f453ed2c000)
	libextrudeModel.so => /opt/openfoam7/platforms/linux64GccDPInt32Opt/lib/libextrudeModel.so (0x00007f453eb0c000)
	libibverbs.so.1 => /usr/lib/libibverbs.so.1 (0x00007f453e8fd000)
	libopen-rte.so.12 => /usr/lib/libopen-rte.so.12 (0x00007f453e683000)
	libopen-pal.so.13 => /usr/lib/libopen-pal.so.13 (0x00007f453e3e6000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f453e1e2000)
	libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007f453dfa8000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f453dda0000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f453db9d000)
	libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f453d992000)
	libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f453d788000)
Now using the above mylinearSpring.so library file when I try to run my floatingObject example it give me error in blockMesh utility
Code:
sreekanth@sreekanth-VirtualBox:~/OpenFOAM/sreekanth-7/run/floatingObject$ !block
blockMesh 
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 7-1ff648926f77
Exec   : blockMesh
Date   : May 07 2020
Time   : 13:47:33
Host   : "sreekanth-VirtualBox"
PID    : 19301
I/O    : uncollated
Case   : /home/sreekanth/OpenFOAM/sreekanth-7/run/floatingObject
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::Hasher(void const*, unsigned long, unsigned int) at ??:?
#4  Foam::HashTable<Foam::autoPtr<Foam::sixDoFRigidBodyMotionRestraint> (*)(Foam::word const&, Foam::dictionary const&), Foam::word, Foam::string::hash>::set(Foam::word const&, Foam::autoPtr<Foam::sixDoFRigidBodyMotionRestraint> (* const&)(Foam::word const&, Foam::dictionary const&), bool) at ??:?
#5  Foam::sixDoFRigidBodyMotionRestraint::adddictionaryConstructorToTable<Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring>::adddictionaryConstructorToTable(Foam::word const&) at ??:?
#6  ? at linearAxialAngularSpring.C:?
#7  ? in "/lib64/ld-linux-x86-64.so.2"
#8  ? in "/lib64/ld-linux-x86-64.so.2"
#9  ? in "/lib64/ld-linux-x86-64.so.2"
#10  ? in "/lib64/ld-linux-x86-64.so.2"
#11  ? in "/lib64/ld-linux-x86-64.so.2"
#12  ? in "/lib/x86_64-linux-gnu/libdl.so.2"
#13  ? in "/lib64/ld-linux-x86-64.so.2"
#14  ? in "/lib/x86_64-linux-gnu/libdl.so.2"
#15  dlopen in "/lib/x86_64-linux-gnu/libdl.so.2"
#16  Foam::dlOpen(Foam::fileName const&, bool) at ??:?
#17  Foam::dlLibraryTable::open(Foam::fileName const&, bool) at ??:?
#18  Foam::dlLibraryTable::open(Foam::dictionary const&, Foam::word const&) at ??:?
#19  Foam::Time::Time(Foam::word const&, Foam::argList const&, Foam::word const&, Foam::word const&) at ??:?
#20  ? at ??:?
#21  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#22  ? at ??:?
Segmentation fault (core dumped)
How should I proceed? Any suggestions will be very helpful
neko2650 is offline   Reply With Quote

Reply

Tags
compile, error, openfoam, solver, windows


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
How to compile OpenFOAM-1.7.x on CrunchBang linux 10 gwierink OpenFOAM Installation 0 April 5, 2011 04:38
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 17:22
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 13:24
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 21:51


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