CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Solver Compiling error - OF 1.6 ext. (http://www.cfd-online.com/Forums/openfoam-programming-development/108760-solver-compiling-error-1-6-ext.html)

raditz November 1, 2012 00:05

Solver Compiling error - OF 1.6 ext.
 
Dear Foamers

I am looking forward to carrying out FSI simulations using an external solver.
I am trying to compile an external solver which is compatible with OF 1.6-ext.I followed the instructions at http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

Initially wmake gave the following results.

Making dependency list for source file tractionDisplacement/tractionDisplacementFvPatchVectorField.C
Making dependency list for source file pimpleFsiFoam.C
could not open file dynamicFvMesh.H for source file pimpleFsiFoam.C
could not open file tetFemMatrices.H for source file pimpleFsiFoam.C
could not open file tetPointFields.H for source file pimpleFsiFoam.C
could not open file faceTetPolyPatch.H for source file pimpleFsiFoam.C
could not open file tetPolyPatchInterpolation.H for source file pimpleFsiFoam.C
could not open file fixedValueTetPolyPatchFields.H for source file pimpleFsiFoam.C
could not open file createDynamicFvMesh.H for source file pimpleFsiFoam.C
could not open file readPIMPLEControls.H for source file pimpleFsiFoam.C
could not open file meshCourantNo.H for source file pimpleFsiFoam.C
SOURCE=tractionDisplacement/tractionDisplacementFvPatchVectorField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/dynamicMesh/dynamicFvMesh/lnInclude -I/opt/openfoam211/src/dynamicMesh/dynamicMesh/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -I/opt/openfoam211/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/tetDecompositionFiniteElement/lnInclude -I/opt/openfoam211/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/tractionDisplacementFvPatchVectorField.o
tractionDisplacement/tractionDisplacementFvPatchVectorField.C: In member function ‘virtual void Foam::tractionDisplacementFvPatchVectorField::upda teCoeffs()’:
tractionDisplacement/tractionDisplacementFvPatchVectorField.C:190:19: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
tractionDisplacement/tractionDisplacementFvPatchVectorField.C:190:62: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
tractionDisplacement/tractionDisplacementFvPatchVectorField.C:191:19: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
SOURCE=pimpleFsiFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/dynamicMesh/dynamicFvMesh/lnInclude -I/opt/openfoam211/src/dynamicMesh/dynamicMesh/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -I/opt/openfoam211/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/tetDecompositionFiniteElement/lnInclude -I/opt/openfoam211/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/pimpleFsiFoam.o
pimpleFsiFoam.C:38:27: fatal error: dynamicFvMesh.H: No such file or directory
compilation terminated.


dynamicFvMesh.H is located at
/home/kaustubh/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H
/home/kaustubh/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/dynamicFvMesh/lnInclude/dynamicFvMesh.H

After changing permissions for /home/kaustubh/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/dynamicFvMesh/lnInclude/dynamicFvMesh.H

I get the following output
SOURCE=pimpleFsiFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/dynamicMesh/dynamicFvMesh/lnInclude -I/opt/openfoam211/src/dynamicMesh/dynamicMesh/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -I/opt/openfoam211/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam211/src/transportModels -I/opt/openfoam211/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/tetDecompositionFiniteElement/lnInclude -I/opt/openfoam211/src/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/pimpleFsiFoam.o
pimpleFsiFoam.C:38:27: fatal error: dynamicFvMesh.H: No such file or directory
compilation terminated.

OF 1.6 ext has been installed as per
http://openfoam-extend.git.sourceforge.net/git/gitweb.cgi?p=openfoam-extend/OpenFOAM-1.6-ext;a=blob;f=doc/buildInstructions/Ubuntu/12.04/Compilation_Ubuntu_12.04_64-bit.txt;h=f63910903ca238ae6bad5f54126b1afa84cb6bbd ;hb=15629037bfb27b3324dd925e203472fd1ef579fa
and the tests at the end work well.

Additionally do we need to set any particular environment variables manually for OF 1.6 ext which might be causing these errors.

Any help,tips suggestions (on this one or FSI Solvers in general) are highly appreciated!!!

kathrin_kissling November 1, 2012 03:43

Hey,

can you post the content of your Make/options file?

Best

Kathrin

wyldckat November 1, 2012 04:42

Greetings to both!

@raditz: The main problem seems to be that while you say you've installed 1.6-ext, it is 2.1.1 that is on the surface of it all:
Code:

/opt/openfoam211
As explained here: Advanced tips for working with the OpenFOAM shell environment - you can have the two or more versions installed, as long as you use a way of keeping version separated, namely by changing in your "~/.bashrc" file to have something like this:
Code:

alias of211='. /opt/openfoam211/OpenFOAM-1.6-ext/etc/bashrc'
alias of16ext='. $HOME/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc'

Then on each new terminal you start, you can activate the desired version by running the respective alias command. For example, for 2.1.1, simply run:
Code:

of211
Best regards,
Bruno

raditz November 1, 2012 23:59

Thank you for the prompt reply.
I had installed OF 1.6-ext alone. wmake gave output as follows.
~/OpenFOAM/OpenFOAM-1.6-ext/applications/solvers/pimpleFsiFoam$ sudo wmake
[sudo] password for *****:
sudo: wmake: command not found

Hence I installed OF 2.1.1 thinking I will be able to some how export the wmake command to 1.6ext.

On following your instructions I changed bash script, activated of16ext and still wmake gave the same error.
Command not found

Should I provide any specific environment variables for clarity.

Thanks again.

raditz November 2, 2012 00:16

The Make/option file contains are as follows
EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
$(WM_DECOMP_INC) \
-I$(LIB_SRC)/tetDecompositionFiniteElement/lnInclude \
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude



EXE_LIBS = \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-ldynamicMesh \
-lmeshTools \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-llduSolvers \
$(WM_DECOMP_LIBS)

On closer look echo $(LIB_SRC) does not give any output but I read on another thread that it is not supposed to be visible in terminal shell and stored in wmake/Makefile Even the variable $FOAM_SRC is not visible.
Anyway I could verify compilation status.

wyldckat November 3, 2012 16:44

Quote:

Originally Posted by raditz (Post 389787)
Anyway I could verify compilation status.

:confused: Just to confirm: do you mean that it now successfully compiles/builds?

raditz November 3, 2012 16:54

No. I enquired whether there was any way of finding out the compilation status.

wyldckat November 4, 2012 04:34

Hi Raditz,

:eek: I'm glad I asked!

OK, there are a few details to take into account:
  1. Don't use wmake as super user (such as using sudo), unless you've already fully understood how things work! ;)
  2. If you're trying to compile pimpleFsiFoam from 1.6-ext, but with 2.1.1, it probably will not work... there are several changes necessary for such to be possible and I don't even know where to start :(
  3. Now, thinking in general of a personalized custom solver, such as the one described in http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam, here is the summary of the main details that you need to take into account:
    1. Create a copy of the solver you want to modify, preferably copy to the area designated by OpenFOAM. As an example for 1.6-ext, it would be "~/OpenFOAM/username-1.6-ext". This folder is usually created when you follow the tutorial instructions. In this case, you can run:
      Code:

      mkdir -p $FOAM_RUN
      cd $FOAM_RUN
      cd ..

      Which will place you in said designated folder.
    2. Now, you need to at the very least modify the last line of "Make/files", as exemplified in the "add temperature" tutorial:
      • Replace this:
        Code:

        EXE = $(FOAM_APPBIN)/icoFoam
      • With this:
        Code:

        EXE = $(FOAM_USER_APPBIN)/my_icoFoam
      This way you avoid collision problems with the original name, as well as avoiding to mix the new custom binary into the middle of the over 200 binaries that OpenFOAM has. And you'll avoid the need to build as root!
    3. As for building the new custom solver, you can simply run:
      Code:

      wmake
      If it gives a lot of stuff and you can't figure out if anything is wrong, then run it again:
      Code:

      wmake
      If all goes well, the second time it executes, it will only show a message indicating that the binary is already built and where it is located!
I hope this answers all of the previous questions you had!

Best regards,
Bruno

raditz November 4, 2012 09:53

Thanks a lot for the approach.I will try to follow the procedure from now on.
Thank you again.


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