CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [waves2Foam] Waves2Foam Related Topics (https://www.cfd-online.com/Forums/openfoam-community-contributions/100091-waves2foam-related-topics.html)

ngj November 10, 2011 06:00

Waves2Foam Related Topics
 
ANNOUNCEMENT: On the 17th of August of 2018, this thread was closed and the posts that seem to be regarding a particular topic have been or are being moved to their own individual threads, all under the prefix [waves2Foam] at the OpenFOAM Community Contributions sub-forum.

If your posts have not yet been moved from this master thread, then please create a new thread and copy-paste a link to your previous post on the topic you want to continue discussing about, so that I can move your posts to that new thread.


You can quickly jump to the prefix [waves2Foam] on the sub-forum by clicking on this link.

If you are looking for your own posts and/or new threads, then please visit your subscriptions page, which is accessible from the top left menu or simply by clicking on this link (requires you to be logged in): Subscriptions List Page


Below is the original post of this master thread.
----------


Dear all,

This thread has been started to replace the discussions in the announcement thread for waves2Foam, as most activities are not related to actually announcements.

Please use this thread as of now for any discussions, questions, problems or suggestions in relation to waves2Foam.

Thanks a lot for your corporation,

Niels

PS:


[Moderator note: The original post is actually this one: https://www.cfd-online.com/Forums/op...tml#post355762 ]

tfuwa November 16, 2011 11:25

Waves2Foam Related Topics
 
Dear Niels,

Thanks so much for providing such a wonderful tool. I am doing some calculations of hydrodynamics around ocean structures, so wave2Foam is really a great toolbox for me. I am trying to install it at FOAM_USER_APPBIN. But after changing all the files-files (for instance, EXE = $(FOAM_USER_APPBIN)/wave2Foam), I got the following error.

Code:

SOURCE=relaxationZone/numericalBeach/numericalBeach.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I/opt/openfoam171/src/meshTools/lnInclude    -I/usr/local/include    -I/usr/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/numericalBeach.o
SOURCE=relaxationZone/numericalBeach/newNumericalBeach.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I/opt/openfoam171/src/meshTools/lnInclude    -I/usr/local/include    -I/usr/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/newNumericalBeach.o
SOURCE=relaxationZone/numericalBeach/empty/numericalBeachEmpty.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I/opt/openfoam171/src/meshTools/lnInclude    -I/usr/local/include    -I/usr/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/numericalBeachEmpty.o
SOURCE=relaxationZone/relaxationZone.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I/opt/openfoam171/src/meshTools/lnInclude    -I/usr/local/include    -I/usr/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/relaxationZone.o
'/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/libwaves2Foam.so' is up to date.
make[1]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/solvers/solvers/waveFoam'
SOURCE=waveFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/transportModels    -I/opt/openfoam171/src/transportModels/incompressible/lnInclude    -I/opt/openfoam171/src/transportModels/interfaceProperties/lnInclude    -I/opt/openfoam171/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=16    -I./../../../../src/lnInclude      -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/waveFoam.o
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nCorr’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8:10: warning: unused variable ‘momentumPredictor’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/transportModels    -I/opt/openfoam171/src/transportModels/incompressible/lnInclude    -I/opt/openfoam171/src/transportModels/interfaceProperties/lnInclude    -I/opt/openfoam171/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=16    -I./../../../../src/lnInclude      -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/waveFoam.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -linterfaceProperties    -lincompressibleTransportModels    -lincompressibleTurbulenceModel    -lincompressibleRASModels    -lincompressibleLESModels    -lfiniteVolume    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/waveFoam
/opt/openfoam171/lib/linux64GccDPOpt/libinterfaceProperties.so: undefined reference to `typeinfo for Foam::alphaContactAngleFvPatchScalarField'
collect2: ld returned 1 exit status

make[1]: *** [/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/waveFoam] Error 1
make[1]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/solvers/solvers/waveFoam'
make: *** [waveFoam] Error 2

make: Target `application' not remade because of errors.
make[1]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc/matlab'
make[2]: Nothing to be done for `application'.
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc/matlab'
make[1]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc'
make[1]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing'
options:6:12: warning: backslash-newline at end of file
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
SOURCE=relaxationZoneLayout.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/relaxationZoneLayout.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/relaxationZoneLayout.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -lfiniteVolume    -lwaves2Foam  -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/relaxationZoneLayout
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveField'
SOURCE=setWaveField.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude    -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/setWaveField.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude    -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/setWaveField.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -lfiniteVolume    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/setWaveField
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
SOURCE=setWaveParameters.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I./../../../../src/lnInclude    -I./../../../../src/lnInclude    -I/usr/local/include    -I/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/setWaveParameters.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I./../../../../src/lnInclude    -I./../../../../src/lnInclude    -I/usr/local/include    -I/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/setWaveParameters.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -lfiniteVolume    -lgsl    -lgslcblas    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/setWaveParameters
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[1]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing'

As you may see, I am using OF171 and Ubuntu 11.04 natty. Can you please help me come out from this problem? Any suggestions would be greatly appreciated.

Kind regards,
Albert

ngj November 16, 2011 12:24

Hi Albert

Thanks a lot for the kind comments.

I have just tried making a local compilation, and I did not experience any problems. What I can note from your installation is:

1. To preserve consistency you should do LIB=$(FOAM_USER_LIBBIN)/libwaves2Foam and not $(FOAM_USER_APPBIN) as it appears from your log-file. If you have a problem compiling the code, then it is because you have not created the directory /home/tfuwa/OpenFOAM/tfuwa-1.7.1/lib

2. From the log, it seems that all of the utilities are compiled correctly (can you verify that, i.e. by running them?) Only the solver, waveFoam, is not compiled correctly and it is due to a problem with libinterfaceProperties, which is natively OpenFOAM. To narrow down the problem, could you try to compile interFoam in your USER directory.

Kind regards,

Niels

tfuwa November 17, 2011 05:33

2 Attachment(s)
Hi Niels,

Thanks very much for your quick reply and your time considering this error.

1, I made the change as you suggested LIB=$(FOAM_USER_LIBBIN)/libwaves2Foam . While I can compile, the error consists. But yes, you are right that utilities(setWaveParameters, setWaveFields) are compiled successfully and can be run.

Code:

tfuwa@tfuwa:~/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam$ ./Allwmake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file convexPolyhedral/convexPolyhedral.C
....
Making dependency list for source file relaxationZone/relaxationZone.C
SOURCE=convexPolyhedral/convexPolyhedral.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I/opt/openfoam171/src/meshTools/lnInclude    -I/usr/local/include    -I/usr/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/convexPolyhedral.o
....
SOURCE=relaxationZone/relaxationZone.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I/opt/openfoam171/src/meshTools/lnInclude    -I/usr/local/include    -I/usr/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/relaxationZone.o
'/home/tfuwa/OpenFOAM/tfuwa-1.7.1/lib/linux64GccDPOpt/libwaves2Foam.so' is up to date.
Making dependency list for source file waveFoam.C
make[1]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/solvers/solvers/waveFoam'
SOURCE=waveFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/transportModels    -I/opt/openfoam171/src/transportModels/incompressible/lnInclude    -I/opt/openfoam171/src/transportModels/interfaceProperties/lnInclude    -I/opt/openfoam171/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=16    -I./../../../../src/lnInclude      -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/waveFoam.o
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nCorr’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8:10: warning: unused variable ‘momentumPredictor’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/transportModels    -I/opt/openfoam171/src/transportModels/incompressible/lnInclude    -I/opt/openfoam171/src/transportModels/interfaceProperties/lnInclude    -I/opt/openfoam171/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=16    -I./../../../../src/lnInclude      -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/waveFoam.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -linterfaceProperties    -lincompressibleTransportModels    -lincompressibleTurbulenceModel    -lincompressibleRASModels    -lincompressibleLESModels    -lfiniteVolume    -L/home/tfuwa/OpenFOAM/tfuwa-1.7.1/lib/linux64GccDPOpt    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/waveFoam
/opt/openfoam171/lib/linux64GccDPOpt/libinterfaceProperties.so: undefined reference to `typeinfo for Foam::alphaContactAngleFvPatchScalarField'
collect2: ld returned 1 exit status
make[1]: *** [/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/waveFoam] Error 1

make[1]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/solvers/solvers/waveFoam'
make: *** [waveFoam] Error 2
make: Target `application' not remade because of errors.
make[1]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc/matlab'
make[2]: Nothing to be done for `application'.
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc/matlab'
make[1]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/misc'
make[1]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
Making dependency list for source file relaxationZoneLayout.C
could not open file readEnvironmentalProperties.H for source file relaxationZoneLayout.C
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
SOURCE=relaxationZoneLayout.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/relaxationZoneLayout.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/relaxationZoneLayout.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -lfiniteVolume    -L/home/tfuwa/OpenFOAM/tfuwa-1.7.1/lib/linux64GccDPOpt    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/relaxationZoneLayout
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveField'
Making dependency list for source file setWaveField.C
could not open file readEnvironmentalProperties.H for source file setWaveField.C
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveField'
SOURCE=setWaveField.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude    -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/setWaveField.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude    -DOFVERSION=171    -I./../../../../src/lnInclude    -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/setWaveField.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -lfiniteVolume    -L/home/tfuwa/OpenFOAM/tfuwa-1.7.1/lib/linux64GccDPOpt    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/setWaveField
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
Making dependency list for source file setWaveParameters.C
could not open file readEnvironmentalProperties.H for source file setWaveParameters.C
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[2]: Entering directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
SOURCE=setWaveParameters.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I./../../../../src/lnInclude    -I./../../../../src/lnInclude    -I/usr/local/include    -I/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/setWaveParameters.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=171    -I/opt/openfoam171/src/finiteVolume/lnInclude    -I./../../../../src/lnInclude    -I./../../../../src/lnInclude    -I/usr/local/include    -I/include -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/setWaveParameters.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -lfiniteVolume    -lgsl    -lgslcblas    -L/home/tfuwa/OpenFOAM/tfuwa-1.7.1/lib/linux64GccDPOpt    -lwaves2Foam -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/setWaveParameters
make[2]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing/setWaveParameters'

2, interFoam can be compiled in both USER and ROOT directory.
Code:

tfuwa@tfuwa:~/OpenFOAM/tfuwa-1.7.1/applications/interFoamTestCompile$ ./Allwmake
+ wmake
Making dependency list for source file interFoamTestCompile.C
SOURCE=interFoamTestCompile.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/transportModels    -I/opt/openfoam171/src/transportModels/incompressible/lnInclude    -I/opt/openfoam171/src/transportModels/interfaceProperties/lnInclude    -I/opt/openfoam171/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/openfoam171/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/interFoamTestCompile.o
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nCorr’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8:10: warning: unused variable ‘momentumPredictor’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/transportModels    -I/opt/openfoam171/src/transportModels/incompressible/lnInclude    -I/opt/openfoam171/src/transportModels/interfaceProperties/lnInclude    -I/opt/openfoam171/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/openfoam171/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/interFoamTestCompile.o -L/opt/openfoam171/lib/linux64GccDPOpt \
        -ltwoPhaseInterfaceProperties    -lincompressibleTransportModels    -lincompressibleTurbulenceModel    -lincompressibleRASModels    -lincompressibleLESModels    -lfiniteVolume -lOpenFOAM -liberty -ldl  -lm -o /home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/bin/linux64GccDPOpt/interFoamTestCompile

make[1]: Leaving directory `/home/tfuwa/OpenFOAM/tfuwa-1.7.1/applications/waves2Foam/applications/utilities/preProcessing'

3, I assume some parts of the OpenFOAM maybe not compiled correctly at the beginning, so reinstall a fresh new OpenFOAM-1.7.x as root. (download through: git clone git://github.com/OpenCFD/OpenFOAM-1.7.x.git ; install without any error) Then compile waves2Foam, but failed both as root (with no changes to waves2Foam) and as user (with changes to options and files files), due to the same error.

Code:


'/opt/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libwaves2Foam.so' is up to date.
Making dependency list for source file waveFoam.C
make[1]: Entering directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/solvers/solvers/waveFoam'
$SOURCE -o Make/linux64GccDPOpt/waveFoam.o
/opt/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
....
/opt/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/transportModels    -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/transportModels/incompressible/lnInclude    -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/transportModels/interfaceProperties/lnInclude    -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/turbulenceModels/incompressible/turbulenceModel    -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude    -DOFVERSION=16    -I./../../../../src/lnInclude      -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/waveFoam.o -L/opt/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt \
        -linterfaceProperties    -lincompressibleTransportModels    -lincompressibleTurbulenceModel    -lincompressibleRASModels    -lincompressibleLESModels    -lfiniteVolume    -lwaves2Foam -lOpenFOAM -ldl  -lm -o /opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/waveFoam
/opt/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt/libinterfaceProperties.so: undefined reference to `typeinfo for Foam::alphaContactAngleFvPatchScalarField'
collect2: ld returned 1 exit status
make[1]: *** [/opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/waveFoam] Error 1

make[1]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/solvers/solvers/waveFoam'
make: *** [waveFoam] Error 2
make: Target `application' not remade because of errors.
make[1]: Entering directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/misc'
make[2]: Entering directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/misc/matlab'
make[2]: Nothing to be done for `application'.
make[2]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/misc/matlab'
make[1]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/misc'
make[1]: Entering directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/preProcessing'
options:6:12: warning: backslash-newline at end of file
make[2]: Entering directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
Making dependency list for source file relaxationZoneLayout.C
could not open file readEnvironmentalProperties.H for source file relaxationZoneLayout.C
make[2]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
.....
SOURCE=setWaveParameters.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=17    -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude    -I./../../../../src/lnInclude    -I./../../../../src/lnInclude    -I/usr/local/include    -I/include -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/setWaveParameters.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -DOFVERSION=17    -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/finiteVolume/lnInclude    -I./../../../../src/lnInclude    -I./../../../../src/lnInclude    -I/usr/local/include    -I/include -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/setWaveParameters.o -L/opt/OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt \
        -lfiniteVolume    -lgsl    -lgslcblas    -lwaves2Foam -lOpenFOAM -ldl  -lm -o /opt/OpenFOAM/OpenFOAM-1.7.x/applications/bin/linux64GccDPOpt/setWaveParameters
make[2]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[1]: Leaving directory `/opt/OpenFOAM/OpenFOAM-1.7.x/applications/solvers/multiphase/waves2Foam/applications/utilities/preProcessing

This is quite strange as I encountered this error several times in different ways, but you cannot reproduce it. :mad:. I include the complete installing log below. Please let me know if more information is needed to find the reason (forgive me as I do not know what are necessary messages to narrow the problem). Thanks again for your help.

Kind regards,
Albert

ngj November 17, 2011 08:16

Hi

I suspect that it might be a problem with the solver-source. I have based it on OF-1.6-ext, however, I have never myself compiled it on 1.7.1, but one of my former colleagues did. Maybe he did not use my waveFoam but instead modified the interFoam distributed along with 1.7.1. Therefore:

Do a
Code:

grep "relaxing\|relaxationZone" *C *H
in the existing solver and edit interFoam in 1.7.1 according to those three lines from the grep. If you can then compile yourWaveFoam succesfully, please inform my, as I will update the svn and the Allwmake-script.

Kind regards,

Niels

ngj November 18, 2011 03:31

Hi Albert

I have been talking with my colleagues, and he did indeed base the solver on 1.7.1. material. I will make an update tonight or tomorrow. Unfortunately, I do not have an active 1.7-compilation on this computer.

Please accept my apologies for promising 1.7-compatibility.

- Niels

jordi.muela January 17, 2012 05:22

Hi all,

I was having the same compilation error that Albert, and i've found the solution to the problem.

If i'm not wrong, you should have installed the OF 1.7.1 Ubuntu (or suse) Pack installed with sudo apt-get ... like i had, and there's the problem, there is some error in the compilated installable pack, because i've downloaded the source pack and compiled it, and then i've compiled wave2foam without any problem! (well, i modified the Make files for install the solver in my USER path...).

So try to download and compile a new OF1.7.1, and then compile wave2foam. Hope it works!

I also like to congratulate Niels for develop this great tool! Thanks!

Jordi.

ngj January 17, 2012 05:24

Thanks for noting the difference :) I hope you can benefit from my work!

- Niels

dkingsley January 23, 2012 12:00

Waves2Foam --> of2+
 
Niels,

Thanks for all your work on the waves2Foam library and the tutorial on converting interFoam to waveFoam.

When compiling on of20x and of21x I had to removed the lines you commented with "//" in src/Make/files. It seems that the dependency tools in the of2+ versions do not like that form of commenting out a line.

thanks
Dennis

ngj January 23, 2012 12:42

Thanks for the bug-report. It is actually a shell/OS problem, as some OSs require lines to be commented by /* */ in stead of //.

I will change the SVN as soon as I am at my computer again.

Kind regards,

Niels

dkingsley January 23, 2012 12:48

I did build waves2Foam for of1.6ext with no changes on the same system prior to the of2+ versions. The system is a Rocks + RHEL 5.4 based cluster.

ngj January 23, 2012 12:52

Hmm, interesting, as we experienced the problem when moving to another OS.

Good luck with your endeavors with free surface flows.

- Niels

aka January 26, 2012 03:36

Hi Niels,
It is a great work. I also read your thesis and it is wonderful. Do you have a plan to release the sediment transport module you implmented for your dissertation?

Thanks,

ngj January 26, 2012 03:58

Hi all

@AKA: Thanks. No, we do not have any immediate plans for a release of the sediment transport/morphology module. Its state is by far mature enough.

Kind regards,

Niels

P.S. Forgot to mention that I have updated the waves2Foam/src/Make/files in the SVN. I also made a tiny change in the Allwmake, so if anyone experience problems with that, please tell me.

tfuwa February 2, 2012 04:51

Hi all Foamers,

Just wonder is it possible to simulate wave + current with this tool?

kind regards,
Albert

ngj February 2, 2012 05:30

Waves2Foam Related Topics
 
Hi Albert

Yes, I have been using it to generate waves+current. In specific I generated stream-function waves with a non-zero stokes drift at the inlet. As I had a beach I modified some source terms and removed the net flux inside the computational domain, however, I think you should be able to use potentialCurrent as an outlet condition, where the target velocity differs from (0 0 0) and instead matches the velocity corresponding to the net flux at the inlet.

If you want to have other wave theories, then you must figure out (look up) the mathematical formulation and do the necessary implementation, as I have not done it with any other wave theory than stream function.

I hope that this answers you questions. There are some unknowns, but it should be feasible.

Kind regards,

Niels

s_braendli February 3, 2012 09:10

Hi to all

I just got started with waves2Foam (with OF 2.1.0) and I really enjoy it. Thanks a lot Niels!

Just a few minor comments:

- It looks like in the "squarePile" tutorial there is no p_rgh.org which is needed in 1.7 and later versions. I just copied the pd.org, I hope this is ok.

- In the "periodicSolitary" tutorial I had to run foamUpgradeCyclics before Allrun.

- Compiling with 2.1.0:

I got the following compiler error:

Code:

In file included from ./../../../../src/lnInclude/relaxationScheme.H:64:0,
                from ./../../../../src/lnInclude/relaxationZone.H:44,
                from waveFoam.C:48:
./../../../../src/lnInclude/waveTheory.H:62:5: error: floating constant in preprocessor expression

Solution: Just comment lines 62 and 64 in waveTheory.H -> Might cause problems if somebody intends to compile it with 1.5 later...

- fvSolution in 2.1.0:

I replaced

Code:

PISO
{
    pdRefCell 0;
    pdRefValue 0;
    momentumPredictor yes;
    nOuterCorrectors 1;
    nCorrectors    3;
    nNonOrthogonalCorrectors 1;
    nAlphaCorr      1;
    nAlphaSubCycles 1;
    cAlpha          1;
}

by

Code:

PIMPLE
{
    momentumPredictor yes;
    nCorrectors    3;
    nNonOrthogonalCorrectors 1;
    nAlphaCorr      1;
    nAlphaSubCycles 1;
    cAlpha          1;
}

So far it looks OK. Please correct me if you see something strange...

Have fun

Silvan

ngj February 3, 2012 09:25

Hi Silvan

Thanks. I have added the missing file from squarePile into the repository.

I will keep the other changes in mind, when I make a proper 2.0/2.1 supported version. I hope that you can survive with the manual labour until further notice.

/ Niels

P.S. Yes, the lines in waveTheory.H is needed for 1.5 support. Similar lines are also scattered around in the utilities. However, it does surprise me that you get that error, as you are the first one to report it, even though other people have successfully compiled on 2.0/2.1 (one of my students included).

s_braendli February 7, 2012 04:22

Sorry about the compiling error, that was my fault. In solvers21/waveFoam/make/options I had

Code:

-DOFVERSION=2.1 \
but it should be

Code:

-DOFVERSION=21 \
or simply

Code:

-DOFVERSION=$(WM_PROJECT_VERSION_NUMBER) \
Best regards
Silvan

daveatstyacht February 11, 2012 16:59

Dear Niels,
Thank you! This is great for both ship still water resistance using the relaxation zone and sea keeping. The relaxation method is much more effective than the numerical beach I was using before. I've managed to compile it on OF 2.1.0 after some effort and it runs great. I was playing with a test case using the potential current BC with relaxation zones with a non-zero velocity and noticed that the setWaveField command sets the air phase velocity to 0 while the water phase is correct. I noticed that it also does this in the square pile tutorial. Obviously for a moving ship the air speed should be non-zero. Is this a built in attribute or can the user change the velocity of the air to be something other than 0 ? I was hoping to eventually be able to model following seas while the ship is undergoing forward motion and a non-zero air velocity would help with startup stability. Is the setWaveField command necessary to initialize the relaxation zones?

Dave

ngj February 11, 2012 18:11

Greetings Dave,

Thanks for your feedback - did you have some particular problems, if so, could I convince you to make a small section at the Wiki in order to help others using 2.1 with waves2Foam?

With respect to your questions, I will answer it in several steps, as the question itself have several layers in it:

1. You do not need to use setWaveField at all. I have merely included this utility for two reasons:
1.a. It makes the initialisation of a still water level more correct, if the cells are not aligned with the location of the free surface. At least more correct in terms of mass conservation, however, you will still experience the standard spurious velocities in the air.
1.b. Say that you want first order Stokes waves in the entire domain and the bed is horizontal, then one can save computational time by using setWaveField to have the hydrodynamics initialised to that given wave theory in the entire domain.

2. Stability issues using (the utility) setWaveField with a moving ship.
In this case, you have to look into the file src/setWaveField/setWaveField.C which is the one, which is utilised in setWaveField for the initialisation. I am currently not at a computer with waves2Foam, so I cannot answer your question explicitly. Nevertheless, as I recall the implementation, setWaveField.C (the class, there is a bit of naming confusion here), calls the waveTheory, which is specified through waveProperties, to be used for the initilisation. If the computational cell is above the free surface, I believe the velocity is explicitly set to zero in setWaveField.C.

3. During runTime, the same thing happens for the relaxation zones. Here, the easiest thing for you might be to derive a new class from relaxationScheme, which calls a variable from waveProperties.subDict, say shipVelocity, and sets the velocity in the air to this given velocity. Or you could get the velocity from either the boundary condition of the ship, or where ever.

4. The conflict between 2 and 3 might be solvable, however, this would require any of two things:
4.a. Let setWaveField.C (the class) call autoPtr to relaxationScheme rather than waveTheory. However, in this case the user has to remember that the defined extend of the relaxation zone should span the entire domain! I do not like such "and please remember that you have to do this in this particular case".
4.b. Have a special constructor in relaxationScheme, which do not look into waveProperties for the spatial extend of the relaxation, but automatically uses the entire domain, i.e. all of the computational cells, and which to do not weight the 'computed' solution with a target, but uses the target directly. This might actually be a good approach, however, as I said my waves2Foam is one computer away, so I have to look at this on Monday. The benefit of this would be that you could use your derived class with the ship velocity in the initialisation without any manual interaction.

5. The golden version would be to have a accompanying 'airTheories' abstract class, which is called, and if the user do not care about the air velocities, then an 'empty' (= vector::zero) is returned for the air velocity, whereas non-zero velocities are returned in other cases.

I hope that this fully answers your questions and thank you for the feedback. I am sincerely happy to receive any comments, suggestions, submissions, etc.

Kind regards,

Niels

daveatstyacht February 12, 2012 13:11

Niels,
Thanks, for your response. My compiling issues were really just related to the option file when I went to create my own waveFoam in a different location other then within wave2Foam and not an issue caused by the wave2Foam package itself (which compiled on the first try). I was a little confused about where to put the wave2Foam folder since when I got it off sourceforge it placed it in my home directory so I moved it to the applications folder before compiling it.

I went back and found the places where the air velocity is set to zero as you pointed out. I think I may add vector definition in one of the dictionary files (was thinking waveProperties as well) and replace the instances of the vector: UTarget(vector::zero);

with the user defined vector: UTarget(windvector);
along with the equivalent line in RelaxationSchemeSpatial.C

If still air is desired by the user, then the vector can simply be set equal to (0 0 0). By making it user defined it also allows for wind in any direction to be specified. Where I could see an "airTheories" class coming in handy is if a wind velocity profile was desired though I can't imagine that would be easy to do for an inlet with waves present.

The meaning of waveVelocity BC parameters is a little confusing. The choice of "value" versus "refvalue" is not entirely clear to me along with valueFraction.
inlet
}
type waveVelocity;
refValue uniform ( 0 0 0 );
refGradient uniform ( 0 0 0 );
valueFraction uniform 1;
value uniform (0 0 0);
}


Dave

ngj February 13, 2012 04:10

Hi Dave

Yes, your approach seems, at least at the moment, to be the simplest modification to the source code. After looking through the code yesterday, I have become unhappy with the reappearance of the same piece of code in both setWaveField and relaxationScheme, so I might end up making a more general implementation at some point, when I have figured out the structure.

You could even make a lookupOrDefault, where the default value is a vector::zero. In this way, the user only needs to specify the velocity, if needed. When you have got it working, could I convince you to make a submit or send me a patch-file; I will obviously give you the proper acknowledgement.

Yes, wave/air flow is a difficult topic and finding some expressions to use for the air flow is not straight forward, however, the point was raised in the review of the article, which we have published on waves2Foam :)

With respect to the value and refValue, those are needed by mixedFvField<Type>, which is the parent class of the wave***** boundaryConditions. It does essentially not matter what you specify, as the values will be overwritten in the very first time step.

Kind regards,

Niels

daveatstyacht February 13, 2012 14:30

Niels,
Yes, there is certainly a great deal of repeated code. I count 3 instance of gravity being defined (setWaveProperties.C, waveTheory.C, and relaxationShape.C) with a lot of other similar code in those files. It may make sense to create a class which does all of the reading from waveProperties to condense all of that repeated code. I have gone ahead and added a wind vector in all of the relevant places with an input in the waveProperties file. I have not added the lookupOrDefault functionality since I am unfamiliar with how to do that in this context. If you have any examples of it that you can point to in OpenFOAM I can go ahead and add it. I have not checked if this works with version 1.5 though I don't believe I have done anything that should make it incompatible. I have made modifications to the following:
waveTheory.H/C
setWaveField.H/C
relaxationSchemeSpatial.H/C

I will send you a message with my email and will send a tar file of the changed files once I confirm that the results appear correct (currently running).

Dave

s_braendli February 14, 2012 02:36

Hi Dave

You will need something like

Code:

windVelocity_(lookupOrDefault("windVelocity",dimensionedVector("windV",dimLength/dimTime,vector(0,0,0))))
with the meaning:

Code:

<<variable_name>>(lookupOrDefault("<<name_in_dict>>",<<default_value>>))
Silvan

PS: If your class is not derived from IOdictionary try myDict_.lookupOrDefault(...)

daveatstyacht February 14, 2012 13:48

Silvan,
Thank you, once you pointed out the format it became fairly straight forward to apply. The changes have been made and sent to Niels for incorporation.

Dave

jordi.muela February 15, 2012 05:53

Hi all,

some people asked me about how to couple waves2Foam with dynamic mesh motion. I've wrote a little 'how to' about how do it. You can find it here:

https://sites.google.com/site/jordim...ic-mesh-motion

Best regards,

Jordi.

ngj February 15, 2012 06:00

Hi Jordi

Great :) I keep smiling, whenever someone puts an effort into improving the usability of waves2Foam! Could I convince you to put a section on the wiki and incorporating your description there or simply put a link to your website?

Thanks a lot,

Niels

jordi.muela February 16, 2012 03:42

Quote:

Originally Posted by ngj (Post 344545)
Hi Jordi

Great :) I keep smiling, whenever someone puts an effort into improving the usability of waves2Foam! Could I convince you to put a section on the wiki and incorporating your description there or simply put a link to your website?

Thanks a lot,

Niels

The wiki is updated ;)

ngj February 16, 2012 04:09

Thanks!

Enjoy this wonderful Thursday,

Niels

jordi.muela February 16, 2012 07:26

Hi Niels,

have you experienced with decomposed cases running in parallel? I've launched a case with a floating 3D box and my surprise is that the waves dissipates in the internal boundaries normal to wave direction!

Here you can see the dissipation effect: http://dl.dropbox.com/u/23292595/floatingBox3DWave.png

Now I'm running the same case with no domain descomposition in x direction to see if that's the problem...

kind regards,

Jordi.

ngj February 16, 2012 07:45

No, I have never, ever seen anything like that!

Is the relaxation zone coinciding with the decomposition boundary?

What version of OF are you using?

The relaxationZone is completely local, so it should not have any problems with decomposed mode. Is the inertia transmitted correctly across the boundary, thus merely a problem with the processor boundary on alpha1, or is both pressure, velocity and alpha1 discontinuous across the processor boundary?

Lots of questions and no answers - sorry.

/ Niels

jordi.muela February 17, 2012 09:08

Hi Niels,

the problem isn't the domain decomposition nor the info exchange between domains. The problem was the lateral walls BC. Since i designed the simulation like a wave channel, first I used zeroGradient for alpha and fixedValue (0 0 0) for U (BCs for a wall..), second i tried with a first zone with lateral walls using waveAlpha and waveVelocity (like 3Dwave case tutorial) followed by a zone with lateral walls using previous BCs, but in the transition zone between BCs the wave dissipates sharply. Only if I use waveAlpha and waveVelocity along the domain the wave cross all the channel... but how to do properly the transition to the relaxation zone?

btw, i use OF1.7.1.

Kind regards,

Jordi.

ngj February 17, 2012 09:39

Okay, I really do not understand what you are saying. Are you modifying the processor boundaries? If that is the case, you should not do that.

Otherwise, you would need to make a sketch of your set-up in order for me to understand.

Have a nice weekend

Niels

jordi.muela February 20, 2012 04:23

2 Attachment(s)
Hi Niels,

ok, sorry for my bad explanation :(. As you seen before, the study domain is as follows:

Attachment 11387

The problem I'm having is to set properly the boundary condition of lateral walls. See in the next image an schematic representation of lateral wall divided en three zones (the wave travels fromt left to right):

Attachment 11388

Some setting that I've used:

1. If I use for zones 1, 2 and 3 the b.c. zeroGradient for scalar field alpha1, and fixedValue (0 0 0) for vector field U, then the wave dissiaptes sharply...

2. If i use in zone 1 (or 1 and 2) the bc's waveAlpha and waveVelocity (specifyng the patches as 'inlet'), and for the other lateral patches the bc's specified in point 1, in the transition zone the behaviour of the wave is very unrealistic, the field alpha isn't continous, looks like a cut..

3. Alternatively, I tried setting the bc's for alpha1 and U as waveAlpha and waveVelocity respectively in the three zones, but i'm not sure that's a good option... for example in the outlet zone (zone 3), in the patch the wave is not dissipated, but in the bulk zone is it dissipated.

I hope that with this explanation you can understand better my problem... so...

Sorry if that's a silly question... but which boundary conditions suggest I use? I'm thinking other alternatives, but maybe you can help me to fix it quickly.

Btw, in simulations where exists a transition between patches (as i exposed in point 2) some simulations get suddenly frozen calculating p_rgh, not show any error message, simply the process remains active until you stop it... but the simulation doesn't advance...

Thanks a lot,

Kind regards,

Jordi.

ngj February 20, 2012 05:07

Waves2Foam Related Topics
 
Hi Jordi

I am really confused - not over your explanation - but on what goes wrong. Could you please send me a test case, which exhibits these problems, but please try to make it as small as possible, so the simulation time is kept low.

Yes, I have also experienced problems with the stalling at the pressure equation. I have not found any good reason for it. It happens out of the blue on both static and dynamic meshes.

Kind regards,

Niels

s_braendli March 1, 2012 11:05

Good afternoon everybody

I am working with the 3Dwaves-tutorial and have a few questions coming up:

1.) seaLevel is set to 0.01, although 0.0 would make sense. However, when I set seaLevel to 0.0 I get a floating point exception after approx. 1.7 seconds. Is there a known reason for this behaviour?

2.) The cell height in 3Dwaves is 0.25 meters, and we are dealing with a wave height of 0.2 meters. I would have expected, that we need a bigger number of cells over the wave height.

3.) When I try to increase the wave height in 3Dwaves from 0.2 to 0.5 I also get a floating point exception after approx. 6 seconds.

Im glad to read your opinions and hints.

Best regards
Silvan

PS: Many thanks to Jordi. I am also working with moving grids and was happy to find your description.

PPS: I am using OF 2.1, the 3Dwaves-tutorial is slightly modified: fvSolution as described in my first post, and I left away the wall since I have problems with createBaffles in OF 2.1.

ngj March 2, 2012 03:20

1 Attachment(s)
Hi Silvan

I have just tried to do what you reported, and I can reproduce the problems at this end. I believe the problem is related to the unboundedness of alpha1, see screen dump. These values occur right the corner at one of the inlet zones and the outlet zone (white boxes). It might call for a special boundary condition for the lateral boundaries, but since I have not worked intensively with 3D wave problems, I have not considered whether or not it is a problem. Changing seaLevel to 0.01 apparently keeps the magnitude of the negative number small enough for the simulation to complete.

With respect to the discretisation, it is merely a tutorial used to convey the functionality of waves2Foam, so for real life applications you would indeed need more cells.

Kind regards,

Niels

s_braendli March 2, 2012 03:27

Hi Niels

Thanks for your reply. I will try around with different discretisations and relaxations zones.

Best regards
Silvan

ngj March 2, 2012 04:42

Hi

I have two suggestions:

1. Try retracting the relaxation zone some distance from the corner in the domain and see what happens.

2. The problem might be that the lateral boundaries are waveTheory-type boundaries, but the relaxation zone does not alter the values at the boundaries, merely in the interior. What is potentially needed is a boundary condition on the lateral boundary, which extrapolate from the relaxed interior values.

All the best,

Niels


All times are GMT -4. The time now is 20:50.