CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[waves2Foam] Waves2Foam Related Topics

Register Blogs Community New Posts Updated Threads Search

Like Tree162Likes

Closed Thread
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 13, 2012, 11:01
Default
  #201
Member
 
Sagun Tripathi
Join Date: Aug 2012
Location: Amherst, USA
Posts: 78
Rep Power: 13
Sagun is on a distinguished road
Thank you so much, both of you.
Sagun is offline  

Old   November 14, 2012, 12:03
Default
  #202
mf.
New Member
 
Marco Fitzner
Join Date: Nov 2012
Posts: 3
Rep Power: 13
mf. is on a distinguished road
Dear Niels,

I'm interested in simulating moving ships in waves. For this I have experiment with waveFoam, stokes waves and combinedWaves and all looks fine for me.

Now to simulate the movement of the ship I will add a constant velocity to the wave velovities in x-dir and move the wave generating boundary time dependent.
To realize this I have tryed to create a new waveType like stokesFirstFwd. I create new folders in waveTheories and setWaveProperties out of the existing folders for stokesFirst. After renaming all files and entries I modify the files file and compiled all with wmake libso. (I have tryed this method, because creating new BC's will working in this way) The compiling works fine but when I uses the new wavetype I get this message.

Quote:
[1] --> FOAM FATAL ERROR:
[1] Unknown wave theory type stokesFirstFwd
..
[1] From function waveTheory::New(const word &, const fvMesh &)
[1] in file waveTheories/waveTheory/newWaveTheory.C at line 68.
After this I checked the linux64GccDPOpt folder and there are no files generated for the new wavetype. Could it be that I have to modify the newWaveTheory.C too? I guess I do something wrong.

Thank you for this toolbox, it looks like a lot of work till keep this code going. (out of my limited view in programming)

Kind regards
Marco
mf. is offline  

Old   November 14, 2012, 14:33
Default
  #203
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Marco,

It sounds as if you have done the right thing. I do not know about the missing object file in case you have actually renamed all the files.

What about the lines including
Code:
defineTypeNameAndDebug(stokesFirst, 0);
addToRunTimeSelectionTable(waveTheory, stokesFirst, dictionary);
have you remembered to change the name there?

Otherwise, you might have made a mistake in your Make/files file.

This is all I can think of.

/ Niels
ngj is offline  

Old   November 14, 2012, 15:18
Default
  #204
mf.
New Member
 
Marco Fitzner
Join Date: Nov 2012
Posts: 3
Rep Power: 13
mf. is on a distinguished road
Hi Niels,

I checked the files again, it seems to be ok. I modify the Make/files file in the main folder of wave2Foam were the waveTheories and relaxationZone folders are locaded. There I added only the two lines

Quote:
$(waveTheories)/$(regular)/stokesFirstFwd/stokesFirstFwd.C
$(waveProp)/$(regular)/stokesFirstFwdProperties/stokesFirstFwdProperties.C
did I miss something? Only to make it clear I didn't need to modify the newWaveTheory.C.

thanks again
Marco
mf. is offline  

Old   November 14, 2012, 16:14
Default
  #205
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Marco,

You are doing the same thing, as I would have done in the case of adding a new wave theory.

Could I get you to type "wclean all" in the waves2Foam-directory and then recompile everything.

You could also see, if you are able to run setWaveParameters, and if this is successful, then the problem is only related to the waveTheory.

Correct, you do not need to change newWaveTheory.C - this is the beauty of the runtime selection in OpenFoam, which I am benefiting from.

/ Niels
ngj is offline  

Old   November 19, 2012, 13:17
Default waveFoam install
  #206
New Member
 
ross
Join Date: Aug 2012
Posts: 16
Rep Power: 13
rosswin is on a distinguished road
Dear Niels,

I have been getting this error in my log files for waveFoam.

Quote:
/opt/openfoam171/bin/tools/RunFunctions: line 45: waveFoam: command not found
I am assuming I have made a mistake in the install however I have followed all the instructions on the wiki.
I have the OpenFoam version: 1.7.1.
Linux version: Ubuntu 12.04

Is there any other information that I should provide?
I have tried searching the forum, but I haven't managed to find any similar threads.

Thanks
Regards
Ross
rosswin is offline  

Old   November 19, 2012, 13:57
Default
  #207
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Ross,

Can you provide us with the output from the run of the Allwmake script in the waves2Foam directory.

It seems that something went wrong during the compilation somewhere.

Kind regards,

Niels
ngj is offline  

Old   November 19, 2012, 14:08
Default
  #208
New Member
 
ross
Join Date: Aug 2012
Posts: 16
Rep Power: 13
rosswin is on a distinguished road
Hi Niels

I don't have a record of the first compilation of ./Allwmake so I compiled it again. I hope this is ok. If not I can uninstall and reinstall waves2Foam.

Quote:
ross@ubuntu:~/waves2Foam$ ./Allwmake | tee log
'/home/ross/OpenFOAM/ross-1.7.1/lib/linux64GccDPOpt/libwaves2Foam.so' is up to date.
./Allwmake: line 47: cd: applications/solvers/solvers171: No such file or directory
make[1]: Entering directory `/home/ross/waves2Foam/applications/utilities/misc'
make[2]: Entering directory `/home/ross/waves2Foam/applications/utilities/misc/matlab'
make[3]: Entering directory `/home/ross/waves2Foam/applications/utilities/misc/matlab/postprocessing'
make[3]: Nothing to be done for `application'.
make[3]: Leaving directory `/home/ross/waves2Foam/applications/utilities/misc/matlab/postprocessing'
make[3]: Entering directory `/home/ross/waves2Foam/applications/utilities/misc/matlab/preprocessing'
make[3]: Nothing to be done for `application'.
make[3]: Leaving directory `/home/ross/waves2Foam/applications/utilities/misc/matlab/preprocessing'
make[2]: Leaving directory `/home/ross/waves2Foam/applications/utilities/misc/matlab'
make[1]: Leaving directory `/home/ross/waves2Foam/applications/utilities/misc'
make[1]: Entering directory `/home/ross/waves2Foam/applications/utilities/postProcessing'
make[2]: Entering directory `/home/ross/waves2Foam/applications/utilities/postProcessing/surfaceElevation'
make[2]: `/home/ross/OpenFOAM/ross-1.7.1/applications/bin/linux64GccDPOpt/surfaceElevation' is up to date.
make[2]: Leaving directory `/home/ross/waves2Foam/applications/utilities/postProcessing/surfaceElevation'
make[1]: Leaving directory `/home/ross/waves2Foam/applications/utilities/postProcessing'
make[1]: Entering directory `/home/ross/waves2Foam/applications/utilities/preProcessing'
make[2]: Entering directory `/home/ross/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[2]: `/home/ross/OpenFOAM/ross-1.7.1/applications/bin/linux64GccDPOpt/relaxationZoneLayout' is up to date.
make[2]: Leaving directory `/home/ross/waves2Foam/applications/utilities/preProcessing/relaxationZoneLayout'
make[2]: Entering directory `/home/ross/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[2]: `/home/ross/OpenFOAM/ross-1.7.1/applications/bin/linux64GccDPOpt/setWaveField' is up to date.
make[2]: Leaving directory `/home/ross/waves2Foam/applications/utilities/preProcessing/setWaveField'
make[2]: Entering directory `/home/ross/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[2]: `/home/ross/OpenFOAM/ross-1.7.1/applications/bin/linux64GccDPOpt/setWaveParameters' is up to date.
make[2]: Leaving directory `/home/ross/waves2Foam/applications/utilities/preProcessing/setWaveParameters'
make[1]: Leaving directory `/home/ross/waves2Foam/applications/utilities/preProcessing'
Thank you for your help.

Regards
Ross
rosswin is offline  

Old   November 19, 2012, 14:16
Default
  #209
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Ross

It is me being unaware of the 1.7.1 version. Could you please test the following for me:

1. Go to waves2Foam/applications/solvers

2. Do in the command line:
Code:
cp -r solvers170 solvers171
cd solvers171
find ./ -name ".svn" | xargs rm -rf
cd waveFoam
wclean
wmake
This should make a clean directory accessible for the Allwmake script. The "find" command is for cleaning it for svn-related files.

If everything compiles nicely, then please notify me, and I will make it a part of the repository. If it does not work, then you have to follow the instructions on the wiki on how to modify interFoam into waveFoam.

Kind regards,

Niels
ngj is offline  

Old   November 19, 2012, 15:00
Default
  #210
New Member
 
ross
Join Date: Aug 2012
Posts: 16
Rep Power: 13
rosswin is on a distinguished road
Hi Niels

No luck with that unfortunately.

I followed the wiki instructions to modify interFoam to WaveFoam but that didn't work either.

I got this result after wclean and wmake
Quote:
ross@ubuntu:~/OpenFOAM/waveFoam$ wclean all
wclean ./
ross@ubuntu:~/OpenFOAM/waveFoam$ wmake
/bin/sh: 1: cannot open Replace: No such file
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=<Replace brackets with the first two digits in the OF-version number> -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
/bin/sh: 1: cannot open Replace: No such file
make: *** [Make/linux64GccDPOpt/waveFoam.o] Error 2
Thanks

Ross
rosswin is offline  

Old   November 19, 2012, 15:09
Default
  #211
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Ross,

Please try to read the following line. This is incorrect

Code:
-DOFVERSION=<Replace brackets with the first two digits in the OF-version number> \
Replace it with

Code:
-DOFVERSION=171 \
/ Niels

P.S. Wiki is updated, as it should read "the first three digits".
ngj is offline  

Old   November 19, 2012, 15:16
Default
  #212
New Member
 
ross
Join Date: Aug 2012
Posts: 16
Rep Power: 13
rosswin is on a distinguished road
Hi Niels

Sorry to bother you again. I know I am making silly mistakes. I haven't been using OpenFoam for very long.

I have got another error.

Quote:
ross@ubuntu:~/OpenFOAM/waveFoam$ wclean all
wclean ./
ross@ubuntu:~/OpenFOAM/waveFoam$ wmake
Making dependency list for source file waveFoam.C
could not open file relaxationZone.H for source file waveFoam.C
could not open file readWaveProperties.H for source file waveFoam.C
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=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/waveFoam.o
waveFoam.C:47:28: fatal error: relaxationZone.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/waveFoam.o] Error 1
Thanks
Ross
rosswin is offline  

Old   November 19, 2012, 15:23
Default
  #213
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
The line

Code:
-I./../../../../src/lnInclude
is a relative path pointing to the waves2Foam/src/lnInclude directory. If you place the solver in another relative location, then this line has to be changed accordingly.

The relative path assumes that you places the solver-directory in the same location as waveFoam for the other OF-versions. In your case
Code:
waves2Foam/applications/solvers/solvers171
/ Niels
ngj is offline  

Old   November 20, 2012, 13:15
Default
  #214
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Hi Niels,

I noticed that when using the setWaveParameters utility, a temporary file called wavePropertiesTEMP is written to, then moved to waveProperties. This is usually fine, though if the Foam::mv( ) operation fails, the utility does not report that back to the user. It might be good to have some error handling there, to either throw a fatal error, or at least alert the user that moving the file failed.

Kind regards,
Kevin
kev4573 is offline  

Old   November 20, 2012, 13:43
Default
  #215
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Kevin

True. Have you experienced that the move is not successful? This would be extremely unfortunate, since you would loose everything? Or is the temp file still preserved?

One of my colleagues asked for a backup of the old waveProperties file, which will be added to the repository at some time.

Kind regards,

Niels
ngj is offline  

Old   November 20, 2012, 14:53
Default
  #216
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
This happened recently while I was working inside a virtualbox VM, with the case residing in a host OS shared folder.. So I was doing something a bit out of the ordinary . The temp file remained after running the utility and the original waveProperties file was intact. Once I moved the case to a guest partition on the VM, everything worked fine.

I've been using the *.org file pattern to keep the original wave file around.

Kevin
kev4573 is offline  

Old   November 20, 2012, 15:40
Default
  #217
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Kevin

I see. It was a bit of a special operation, but it should nonetheless be supported. So, I am thinking aloud; would this work:

1. Read from a waveProperties.input file. This file contains the needed input parameters.

2. Run setWaveParameters and the file waveProperties is written (no move operation).

3. Setting of wave parameters is done, and the two files waveProperties.input and waveProperties are still in <case>/constant.

It makes sense to do it this way, especially when using e.g. irregular waves, then the waveProperties.input gives the possibility of a quick view on the parameters.

Kind regards,

Niels
ngj is offline  

Old   November 20, 2012, 16:22
Default
  #218
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Niels,

I'm personally okay with manually copying the waveProperties.org file, since I already do this sort of thing with the fields in the zero directory. I think your proposed approach makes sense anyway.

Kevin
kev4573 is offline  

Old   November 20, 2012, 16:50
Default
  #219
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Kevin

Good, I will put it on my waves2Foam-TODO.

With respect the need of two files during the running of setWaveParameters, then the reason is very simple.

Previously, I wrote generated wave parameters of the type Field<Type> to a separate file using the IOField<Type> method in OpenFoam. However, it turned out that it worked perfectly in serial, but for versions >= 2.0, the data files could suddenly not be read in parallel. In order to overcome this problem, those of my colleagues who are running irregular waves, had to run setWaveParameters and manually copy the data into waveProperties. The need of IOField<Type> is due to a restriction in the IOdictionary format, which does not support adding a nonuniform List<Type> to the dict. It was added per say, however, as a raw list without any formatting. For some reason the data was then read in the waveTheory as a bunch of zeros.

As the practical work-around was too cumbersome and error-prone, I am now writing a completely fresh waveProperties file, where all the data are either read from the source file or computed in setWaveProperties. This gives me complete control over the output format, hence it is also possible to have nonuniform fields in the output - so parallel runs can be executed.

The drawback is that the final waveProperties file is stripped of all comments, etc, since each derived class from setWaveProperties know exactly, which bits and piece are needed for say stokesSecond - everything else is disregarded.

I hope that someone liked this long explanation

Have a nice evening,

Niels
kev4573 likes this.
ngj is offline  

Old   November 21, 2012, 11:09
Default
  #220
New Member
 
niall o sullivan
Join Date: Jan 2011
Posts: 2
Rep Power: 0
niallosully is on a distinguished road
Hi Niels,

I am preforming pimplefoam LES simulations of airflow over research vessels and wanted to implement the wave2foam at the air-sea interface. my question is it possible to apply a uniforminletvelocity at the air section of the wave2foam simulation using this type of simulation with a K-epsilon model in place and would you have any pointers on where i would start changing the waves2foam tutorials to achieve this.

Niall
niallosully is offline  

Closed Thread


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
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 05:29
Re-Project topics protocol STAR-CCM+ 0 March 22, 2016 05:25
Waves2Foam Related Topics seoseonguk OpenFOAM Running, Solving & CFD 0 March 1, 2016 22:18
Waves2Foam Related Topics seoseonguk OpenFOAM Running, Solving & CFD 0 March 1, 2016 22:14
Error: "Cannot find file points" related to changing parallelized code to serial? Suyf OpenFOAM Running, Solving & CFD 0 February 12, 2015 04:31


All times are GMT -4. The time now is 09:13.