CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Wave tank - what to do against the rising water? (https://www.cfd-online.com/Forums/openfoam-solving/96551-wave-tank-what-do-against-rising-water.html)

Leech January 25, 2012 12:01

Wave tank - what to do against the rising water?
 
Hi,

i just played around with the groovyBC. I got a wave tank pretty similar to the old "groovyWaveTank" tutorial. But as the waves progress and the time goes by, alpha1 is injected and the water is beginning to rise in the tank..

What possibilities do i have to keep the water height almost constant but to still generate some waves?

I guess ill need a tricky outletBC?



Thanks!
Greetings
Leech

Phicau January 25, 2012 12:33

Hi,

very true, this is the result of the net in-flux of water, due to the excess of mass in the wave crests.

Active wave absorption linked with your generation BC is what you need. We are preparing to release a wave generation and absorption BC bundle, which I hope will be available as soon as some papers are accepted.

Regards

Pablo

Leech January 25, 2012 15:03

Hi Pablo,

thanks for your answer!
Will this boundle be released with the OpenFOAM package or will it be extra?
Where do i have to look to get it?

Anyway: is there a way to realise this functionality with the OpenFOAM 2.1.0 release? (+ swak4foam)

Thanks!
Greets
Leech

Phicau January 25, 2012 15:23

Hello,

it is an external boundary condition, as for example GroovyBC, there is only the need to compile it and it is ready to go.

Unfortunately it cannot be released yet. I will post it when it is ready, but some results will be posted in advance for sure, as soon as a couple of papers get accepted.

I have never used swak4foam, I guess it is not capable of such a thing, as it must support water level measurement in front of the patch.

Regards

Pablo

ngj January 26, 2012 04:07

Hi Leech

There is another possibility, as I have recently released a wave generation/absorption toolbox into OpenFoam. You can find the necessary information here:

http://openfoamwiki.net/index.php/Contrib/waves2Foam

@Pablo: In stead of having two 'competing' software lines, we might consider working together on one common toolbox. If you are interested, feel free to contact me, when the release date approaches.

Kind regards,

Niels

ngj January 26, 2012 06:41

Hi Leech

To answer your question posed by email:

Yes, waves2Foam does indeed work with interDymFoam, however, the solver is not distributed along with waves2Foam, thus you need to modify interDymFoam into e.g. waveDymFoam by following the description on the wiki.

Kind regards,

Niels

Leech January 26, 2012 09:44

Hi,

thanks again for your fast answer. Last 2 questions before i will try to get waveDyMFoam.
(1) In the wiki is a section 3.2 (how to modify interFoam). I guess this is the routine ill have to follow, as the wmake-script only works with interFoam?
(2) In the compatibility-section only Foams up to the version 1.7.1 are mentioned. Anyways i red threads of users how got Foam 2.0 working. And in section 3.2 is described the way for more recent Foam-versions. Can i use Foam 2.0.0 or 2.1.0 and follow 3.2 to get waveDyMFoam? If you dont know, as it is not official, do you know if somebody already tried is?

Thank you!
Greets
Leech

ngj January 26, 2012 09:54

Ad. 1: Yes, follow the Wiki but use interDymFoam as baseline instead.

Ad. 2: It is not by me officially released for 2.0/2.1 as I have neither, but people can compile it without any problems as of SVN revision no. 1934. That is the reason I added the "How-To", so the users could make make waveFoam for themselves.

- Niels

Leech January 26, 2012 16:06

Thank you Niels.
I'll try to get it compiled tomorrow and will tell about my progress here!

Phicau January 27, 2012 03:57

Quote:

Originally Posted by ngj (Post 341238)
Hi Leech

There is another possibility, as I have recently released a wave generation/absorption toolbox into OpenFoam. You can find the necessary information here:

http://openfoamwiki.net/index.php/Contrib/waves2Foam

@Pablo: In stead of having two 'competing' software lines, we might consider working together on one common toolbox. If you are interested, feel free to contact me, when the release date approaches.

Kind regards,

Niels

Hi,

I've been talking to my boss and, when the time comes, we will be willing to collaborate between both departments. We'll keep in touch.

Regards

Leech January 27, 2012 04:45

Quote:

Originally Posted by ngj (Post 341304)
Ad. 1: Yes, follow the Wiki but use interDymFoam as baseline instead.

Ad. 2: It is not by me officially released for 2.0/2.1 as I have neither, but people can compile it without any problems as of SVN revision no. 1934. That is the reason I added the "How-To", so the users could make make waveFoam for themselves.

- Niels

Hi,

i am actually trying to install wavesDyMFoam.
I changed the interDyMFoam files the way it is described in the wiki. I got them in a folder. I installed GSL (the version that was mentioned in the README from the svn checkout).
I checked out waves2foam 1935 by svn.
Now i got the start the allwmake script? But how can it know were my modified interDyMFOam files are located? How do i get sure it is using these files?

Thank you!
Leech

ngj January 29, 2012 04:10

Hi

@Pablo: Great! Good luck with the review process.

@Leech: I am not quite sure what you are asking, however, the step by step is:

1. Instal GSL (DONE!)

2. Download waves2Foam (DONE!)

3. Run the Allwmake-script. This will compile libraries and the utilities but not the solvers, soforth you are using 2.0/2.1.

4. Locate interDymFoam and copy all the solver-files to e.g. a folder in your waves2Foam-installation.

5. Change the files as listed on the wiki - including Make/options and Make/files, where especially the output name in Make/files should be changed to avoid overwriting the original interDymFoam.

6. Type wmake in the waveDymFoam folder.

Good luck,

Niels

Leech January 29, 2012 10:39

Quote:

Originally Posted by ngj (Post 341700)
Hi

@Pablo: Great! Good luck with the review process.

@Leech: I am not quite sure what you are asking, however, the step by step is:

1. Instal GSL (DONE!)

2. Download waves2Foam (DONE!)

3. Run the Allwmake-script. This will compile libraries and the utilities but not the solvers, soforth you are using 2.0/2.1.

4. Locate interDymFoam and copy all the solver-files to e.g. a folder in your waves2Foam-installation.

5. Change the files as listed on the wiki - including Make/options and Make/files, where especially the output name in Make/files should be changed to avoid overwriting the original interDymFoam.

6. Type wmake in the waveDymFoam folder.

Good luck,

Niels


When i run the allwmake-script from waves2Foam i get the following:
Quote:

make[2]: *** [/opt/openfoam210/platforms/linux64GccDPOpt/bin/relaxationZoneLayout] Fehler 1
make[2]: Verlasse Verzeichnis '/home/mstrlnxwindows/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[1]: *** [relaxationZoneLayout] Fehler 2
make[2]: Betrete Verzeichnis '/home/mstrlnxwindows/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]: Verlasse Verzeichnis '/home/mstrlnxwindows/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[2]: Betrete Verzeichnis '/home/mstrlnxwindows/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-100 -I/opt/openfoam210/src/finiteVolume/lnInclude -DOFVERSION=21 -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/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-100 -I/opt/openfoam210/src/finiteVolume/lnInclude -DOFVERSION=21 -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/setWaveField.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
-lfiniteVolume -lwaves2Foam -lOpenFOAM -ldl -lm -o /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveField
/usr/bin/ld: cannot open output file /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveField: Permission denied
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [/opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveField] Fehler 1
make[2]: Verlasse Verzeichnis '/home/mstrlnxwindows/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[1]: *** [setWaveField] Fehler 2
make[2]: Betrete Verzeichnis '/home/mstrlnxwindows/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]: Verlasse Verzeichnis '/home/mstrlnxwindows/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[2]: Betrete Verzeichnis '/home/mstrlnxwindows/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-100 -DOFVERSION=21 -I/opt/openfoam210/src/finiteVolume/lnInclude -I./../../../../src/lnInclude -I./../../../../src/lnInclude -I/usr/local/include -I/include -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/setWaveParameters.o
setWaveParameters.C: In Funktion »int main(int, char**)«:
setWaveParameters.C:108:31: Warnung: Der Rückgabewert von »int system(const char*)«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result]
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -DOFVERSION=21 -I/opt/openfoam210/src/finiteVolume/lnInclude -I./../../../../src/lnInclude -I./../../../../src/lnInclude -I/usr/local/include -I/include -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/setWaveParameters.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
-lfiniteVolume -lgsl -lgslcblas -lwaves2Foam -lOpenFOAM -ldl -lm -o /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveParameters
/usr/bin/ld: cannot open output file /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveParameters: Permission denied
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [/opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveParameters] Fehler 1
make[2]: Verlasse Verzeichnis '/home/mstrlnxwindows/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[1]: *** [setWaveParameters] Fehler 2
make[1]: Das Target »application« wurde wegen Fehlern nicht aktualisiert.
make[1]: Verlasse Verzeichnis '/home/mstrlnxwindows/waves2Foam/applications/utilities/preProcessing'
make: *** [preProcessing] Fehler 2
make: Das Target »application« wurde wegen Fehlern nicht aktualisiert.

I guess it doesn't worked, problem is that the error messages aren't that clear to me..

Nonetheless i copied the changed files from interDyMFOam to the waves folder and tried to run the script and then i get the following:

Quote:

mstrlnxwindows@mstrlnxwindows-VirtualBox:~/waves2Foam$ wmake
SOURCE=waveDyMFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -DOFVERSION=<The first two digits in the OF-version number> -I./../../../../src/lnInclude -I/opt/openfoam210/src/transportModels -I/opt/openfoam210/src/transportModels/incompressible/lnInclude -I/opt/openfoam210/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam210/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam210/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/waveDyMFoam.o
/bin/sh: cannot open The: No such file
make: *** [Make/linux64GccDPOpt/waveDyMFoam.o] Fehler 2

Leech January 29, 2012 11:14

I tried the whole procedure again on a fresh installed Kubuntu-machine.

1. I installed GSL libgsl0-dev (by sudo apt-get)
2. I cheked out waves2foam
3. i typed wmake all

He got the same error message. When i try then to run the script again the following is printed:

Quote:

/usr/bin/ld: cannot open output file /opt/openfoam210/platforms/linux64GccDPOpt/lib/libwaves2Foam.so: Permission denied
collect2: ld gab 1 als Ende-Status zurück
make: *** [/opt/openfoam210/platforms/linux64GccDPOpt/lib/libwaves2Foam.so] Fehler 1
./Allwmake: Zeile 43: cd: applications/solvers/solvers21: Datei oder Verzeichnis nicht gefunden
make[1]: Betrete Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/misc'
make[2]: Betrete Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/misc/matlab'
make[2]: Für das Ziel »application« ist nichts zu tun.
make[2]: Verlasse Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/misc/matlab'
make[1]: Verlasse Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/misc'
make[1]: Betrete Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing'
make[2]: Betrete Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam210/src/finiteVolume/lnInclude -DOFVERSION=21 -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/relaxationZoneLayout.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
-lfiniteVolume -lwaves2Foam -lOpenFOAM -ldl -lm -o /opt/openfoam210/platforms/linux64GccDPOpt/bin/relaxationZoneLayout
/usr/bin/ld: cannot open output file /opt/openfoam210/platforms/linux64GccDPOpt/bin/relaxationZoneLayout: Permission denied
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [/opt/openfoam210/platforms/linux64GccDPOpt/bin/relaxationZoneLayout] Fehler 1
make[2]: Verlasse Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[1]: *** [relaxationZoneLayout] Fehler 2
make[2]: Betrete Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing/setWaveField'
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam210/src/finiteVolume/lnInclude -DOFVERSION=21 -I./../../../../src/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/setWaveField.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
-lfiniteVolume -lwaves2Foam -lOpenFOAM -ldl -lm -o /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveField
/usr/bin/ld: cannot open output file /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveField: Permission denied
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [/opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveField] Fehler 1
make[2]: Verlasse Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[1]: *** [setWaveField] Fehler 2
make[2]: Betrete Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -DOFVERSION=21 -I/opt/openfoam210/src/finiteVolume/lnInclude -I./../../../../src/lnInclude -I./../../../../src/lnInclude -I/usr/local/include -I/include -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/setWaveParameters.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
-lfiniteVolume -lgsl -lgslcblas -lwaves2Foam -lOpenFOAM -ldl -lm -o /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveParameters
/usr/bin/ld: cannot open output file /opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveParameters: Permission denied
collect2: ld gab 1 als Ende-Status zurück
make[2]: *** [/opt/openfoam210/platforms/linux64GccDPOpt/bin/setWaveParameters] Fehler 1
make[2]: Verlasse Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[1]: *** [setWaveParameters] Fehler 2
make[1]: Das Target »application« wurde wegen Fehlern nicht aktualisiert.
make[1]: Verlasse Verzeichnis '/home/mstrlnx64/waves2Foam/applications/utilities/preProcessing'
make: *** [preProcessing] Fehler 2
make: Das Target »application« wurde wegen Fehlern nicht aktualisiert.


For me it looks like he isnt able to locate or create some files or libraries?

wyldckat January 29, 2012 11:55

Greetings to all!

That's a simple mistake people tend to make when developing software for OpenFOAM: one should never make the packages build by default onto the main OpenFOAM library and application folders! Always use the "user" ones ;) namely "FOAM_USER_LIBBIN" and "FOAM_USER_APPBIN". Using the main folders sort-of implies that you are distributing the code along with the original code, which isn't the usual scenario.

The fix should be quite simple... OK, first go into the master folder of the "waves2Foam" source code and then run this command:
Code:

find . -name files | xargs sed -i -e 's=FOAM_LIBBIN=FOAM_USER_LIBBIN='
find . -name files | xargs sed -i -e 's=FOAM_APPBIN=FOAM_USER_APPBIN='

It will replace all entries that are causing the issues. Now try building it again :)

Best regards,
Bruno

Leech January 29, 2012 12:07

Hi Bruno,

i runned your suggested commands directly in the waves2foam folder (means no subfolder). But it didnt help :(
I still get the same error messages when running wmake all...
Could it be a problem that i allready runned the script and it crashed? Do I need a complete fresh beginning?

ngj January 29, 2012 12:47

Hi Bruno

Thanks for your comment. You go directly into one of my TODO's, but I have up to now not been able to successfully compile waves2Foam with "USER".

The strange thing is that even though $FOAM_USER_LIBBIN is present in both $PATH and $LD_LIBRARY_PATH, then I cannot successfully compile, as it complains over the missing library, which is placed in $FOAM_USER_LIBBIN.

I do not know if the following help, but the status is:

Code:

waves2Foam $ locate libwaves2Foam.so
/home/ngj/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64GccDPOpt/libwaves2Foam.so
/home/ngj/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libwaves2Foam.so

and

Code:

waves2Foam $ which libwaves2Foam.so
/home/ngj/OpenFOAM/ngj-1.6-ext/lib/linux64GccDPOpt/libwaves2Foam.so

With respect to the 'locate' command, the first library does not exist, whereas the 'which' finds the correct library. I am really confused, so I hope you are able to shed a light onto this.

Kind regards,

Niels

ngj January 29, 2012 13:04

Hi Bruno and Leech

Problem solved - I had a look at the SVN-rep, and what I was missing is the following in the options file, as it should read

Code:

-L$(FOAM_USER_LIBBIN) \
-lwaves2Foam

instead of

Code:

-lwaves2Foam
Now it compiles. Enjoy the rest of your weekend :)

/ Niels

P.S. The SVN-repository for waves2Foam will be updated shortly.

ngj January 29, 2012 13:28

Hi Leech

Type

Code:

svn update
in the waves2Foam folder, and you will get the most recent version. Furthermore, in the application you are trying to compile, the line in Make/options

Code:

-DOFVERSION=<The first two digits in the OF-version number> \
should not read that explicitly, but you have to replace <...> by whatever you current version is; e.g. 2.0.1 gives
Code:

-DOFVERSION=20 \
and version 2.1.x gives
Code:

-DOFVERSION=21 \
Good luck

Niels

Leech January 29, 2012 16:46

Quote:

Originally Posted by ngj (Post 341762)
Hi Leech

Type

Code:

svn update
in the waves2Foam folder, and you will get the most recent version. Furthermore, in the application you are trying to compile, the line in Make/options

Code:

-DOFVERSION=<The first two digits in the OF-version number> \
should not read that explicitly, but you have to replace <...> by whatever you current version is; e.g. 2.0.1 gives
Code:

-DOFVERSION=20 \
and version 2.1.x gives
Code:

-DOFVERSION=21 \
Good luck

Niels

Thanks for your great support!
Wmake worked now :)
Now i got to get this solver compiled..


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