CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Waves2Foam Related Topics

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree63Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   April 19, 2012, 10:35
Default
  #81
New Member
 
Nima
Join Date: Feb 2012
Location: Perth, Western Australia
Posts: 13
Rep Power: 5
nima3906m is on a distinguished road
Quote:
Originally Posted by ngj View Post
The problem is in your Make/options file. You need to manually add the two first two digits replacing the long string in the brackets.

Kind regards,

Niels
Dear Niels
Thanks It solved my problem and everything is working fine now
nima3906m is offline   Reply With Quote

Old   April 19, 2012, 13:35
Default New wave theory - waves + current
  #82
New Member
 
Dominic Piro
Join Date: Dec 2009
Location: South Kingstown, RI
Posts: 11
Rep Power: 7
djpiro is on a distinguished road
All,

I had the same problem as Björn when doing waves+current. I noticed larger amplitudes for the waves that were slightly delayed from theory. Therefore I created a new waveTheory (stokesFirstwCurrent) that includes a current velocity.

If anyone wants to use this theory, I have attached the source. One additional entry is needed to stokesFirst called "current", which is the current velocity vector. Also, you should use the wave frequency for omega and not the encounter frequency. The current velocity is not affected by "Tsoft", though there is no reason you could not change that. As a result, when I've used this waveTheory, I set the wave field with a potentialCurrent with "Tsoft" of zero and outlet the same.

My initial tests indicate that this works pretty well, but let me know if you find a problem.

Thanks,
Dominic

Quote:
Originally Posted by winden View Post

This seems to give the correct encounter period and the wave keeps it's wavelength when it leaves the relaxation zone. However; there is still something that is not right in that the wave increases slightly in amplitude when leaving the relaxation zone (see attached image, red line is end of zone and propagation direction is left->right.)
Attached Files
File Type: gz stokesFirstwCurrent.tar.gz (5.2 KB, 57 views)
djpiro is offline   Reply With Quote

Old   April 20, 2012, 04:28
Default Waves2Foam Related Topics
  #83
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   April 30, 2012, 10:01
Default
  #84
New Member
 
Join Date: Apr 2012
Posts: 5
Rep Power: 5
Nektos is on a distinguished road
Hello Niels,

First of all thanks for your work.

I have followed the installation tutorial on the openFOAM Wiki to put waves2foam on my Mac (OS X 10.6.8 Snow Leopard).
The problem is, I think the applications you created in the waves2foam directory are not taken into account when making ./Allwmake.
I have this message :
Quote:
In file included from waveTheories/waveTheory/waveTheory.C:27:
waveTheories/waveTheory/waveTheory.H:62:5: error: invalid suffix "n1n0" on integer constant
waveTheories/waveTheory/waveTheory.C:54:5: error: invalid suffix "n1n0" on integer constant
waveTheories/waveTheory/waveTheory.C:64:5: error: invalid suffix "n1n0" on integer constant
And then :
Quote:
make: Target `application' not remade because of errors.
My openFOAM version is 2.1.0, maybe that is why it gives n1n0 ?

Furthermore, there is also a dependency list problem :
Quote:
Making dependency list for source file relaxationZoneLayout.C
could not open file primitiveMeshI.H for source file relaxationZoneLayout.C
could not open file pointIOField.H for source file relaxationZoneLayout.C
My other question is : do I have to put waves2foam inside the openFOAM folder ?
Where exactly shall I put the waves2foam directory ?

Thanks in advance,
Nektos is offline   Reply With Quote

Old   April 30, 2012, 11:11
Default
  #85
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Nektos

I might not be able to help you, as I am not a MAC-person, but I will give me best guess. First of all, resolving the first error is the most important thing, as the other might disappear in doing so.

To me the error suggests that the environmental variable WM_PROJECT_VERSION_NUMBER is not being set correctly in the waves2Foam/Allwmake and waves2Foam/src/Allwmake scripts. This is probably due to a difference between linux and MAC, since we have made a smooth compilation on 2.1.x on Ubuntu/Red hat.

Thus, the first step is to figure out, whether or not this environmental variable is set at all, e.g. put
Code:
echo "My variable: "$WM_PROJECT_VERSION_NUMBER
in waves2Foam/src/Allwmake and comment the following line with
Code:
#wmake libso
Go to waves2Foam/src and execute the script with './Allwmake'. Hopefully, the to first digits in the version number is written to the standard output.

With respect to the location of waves2Foam it really does not matter. I, however, always place it here:
Code:
$FOAM_RUN/../applications/utilities
Kind regards,

Niels
ngj is offline   Reply With Quote

Old   April 30, 2012, 11:31
Default
  #86
Member
 
Björn Windén
Join Date: Feb 2012
Location: University of Southampton UK
Posts: 37
Rep Power: 5
winden is on a distinguished road
Quote:
Originally Posted by djpiro View Post
I had the same problem as Björn when doing waves+current. I noticed larger amplitudes for the waves that were slightly delayed from theory. Therefore I created a new waveTheory (stokesFirstwCurrent) that includes a current velocity.
Thank you very much for sharing this Dominic. I tried it on a coarse mesh and it looks like it works but I am trying it on a very fine mesh now to see how well the amplitude/period is recreated. I will let you know how I get along.

//Björn
winden is offline   Reply With Quote

Old   April 30, 2012, 12:27
Default
  #87
New Member
 
Join Date: Apr 2012
Posts: 5
Rep Power: 5
Nektos is on a distinguished road
Hey Niels,

Thanks for your answer.
I have corrected manually all the "if" in the waves2foam files, it was quite long but now there is no problem with this 2n1n0.
When I use "wmake" on the application folder, the only thing that does not work is "waveFoam".

I have followed the Wiki instructions but I get this message :
Quote:
No rule to make target `interFoam.C', needed by `interFoam.dep'. Stop.
Do you have an idea what I could do ?

Thx,

Pierre.
Nektos is offline   Reply With Quote

Old   April 30, 2012, 12:53
Default
  #88
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Pierre,

First of all, what was needed to succeed with the compilation?

Secondly: Have you renamed interFoam.C to waveFoam.C? If that is the case and if you have corrected waveFoam/Make/files, then do the following in this succession in the waveFoam directory:

Code:
wclean all
wmake
Kind regards,

Niels
ngj is offline   Reply With Quote

Old   May 1, 2012, 04:45
Default
  #89
New Member
 
Join Date: Apr 2012
Posts: 5
Rep Power: 5
Nektos is on a distinguished road
Hi Niels,

First to succeed with the compilation I modified all the files in which you had the "if" concerning the openFOAM version. After that, it works.

Then, I followed the exact tutorial on the wiki (modifying interFoam.C into waveFoam.C, and Make/Options and Make/Files, but I still get the message :
Quote:
make: *** No rule to make target `interFoam.dep', needed by `Make/darwinIntel64GccDPOpt/dependencies'. Stop.
Should I modify the first line of the Make/Files,
Quote:
interFoam.C
into

Quote:
waveFoam.C
?

When I do that I get many errors like "*** was not declared in this scope".

Thanks,

Pierre.
Nektos is offline   Reply With Quote

Old   May 1, 2012, 05:02
Default
  #90
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Pierre,

Could you please be more specific on what was needed in relation to the "pre-processor if"s? Did you delete the if-statements and merely kept those lines relevant for 2.1.0?

Secondly, the wiki was not completely clear on the naming. It has been updated, however, the essence is that interFoam.C -> waveFoam.C in Make/files.

Besides that, you give so little information on the compilation errors that it is not possible to help.

Regards,

Niels
ngj is offline   Reply With Quote

Old   May 1, 2012, 05:15
Default
  #91
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Dominic and Björn,

I tried to have a look in the modified stokesFirstCurrent, and to me the most prominent difference is that the current is not ramped. Is that true?

In that case, I believe you should be able to reproduce the results using combinedWaves with stokesFirst and potentialCurrent, where "Tsoft 0.0;" is stated in the latter waveTheory. Otherwise, there might be a bug in combinedWaves.

Kind regards,

Niels
ngj is offline   Reply With Quote

Old   May 1, 2012, 05:37
Default
  #92
New Member
 
Join Date: Apr 2012
Posts: 5
Rep Power: 5
Nektos is on a distinguished road
Sorry Niels, I am a beginner in computer science.
I deleted the "if-statements" and only left the condition appropriate for openFoam 2.1.0.

I changed the Make/files as you said in your last post.

The errors I have are in my .txt attached file.

I hope it will help.

Thanks for your help,
Attached Files
File Type: txt erreurs.txt (83.1 KB, 22 views)
Nektos is offline   Reply With Quote

Old   May 1, 2012, 06:14
Default
  #93
Member
 
Björn Windén
Join Date: Feb 2012
Location: University of Southampton UK
Posts: 37
Rep Power: 5
winden is on a distinguished road
Quote:
Originally Posted by ngj View Post
In that case, I believe you should be able to reproduce the results using combinedWaves with stokesFirst and potentialCurrent, where "Tsoft 0.0;" is stated in the latter waveTheory. Otherwise, there might be a bug in combinedWaves.
Hi Niels. I had Tsoft set to zero for the potentialCurrent in my attempts using combinedWaves and I still experienced increased amplitude and a (small) shift in the wavelength.

//Björn
winden is offline   Reply With Quote

Old   May 1, 2012, 06:18
Default
  #94
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Pierre

Thanks for the log file. It also helped me to identify the problem in compiling on a Mac. There will, as soon as I am on my linux installation, be made an update of the Allwmake script. The problem was a difference in the handling of newline characters between linux and Mac (Darwin) in "sed".

Secondly, you get a lot of unpleasant errors, which I really do not understand the origin of, so in order to get it working, I suggests the following:

1. Copy the needed files from the interFoam directory to your own solver directory under waves2Foam.

2. Change interFoam.C -> waveFoam.C

3. Change the Make/files into
Code:
waveFoam.C

EXE = $(FOAM_USER_APPBIN)/waveFoam
4. Compile without any changes in the context of the files. If you are successful then you can start adding the different lines as stated on the wiki.

Furthermore, note that you have put "-DOFVERSION=2n1n0" in the options file, when you compile the solver, however, it should merely read "-DOFVERSION=21".

Kind regards,

Niels
ngj is offline   Reply With Quote

Old   May 1, 2012, 06:19
Default
  #95
New Member
 
Feng
Join Date: Oct 2011
Posts: 6
Rep Power: 5
fg118 is on a distinguished road
Quote:
Originally Posted by ngj View Post
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
Dear All,
I have followed the installation tutorial on the openFOAM Wiki to put waves2foam on my linux desktop. The version of openFoam I used is 2.0.1. I have modified interfoam to wavefoam in a new folder. But when I wmake it, the following error happed:

[QUOTE][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-100 -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/transportModels -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/transportModels/incompressible/lnInclude -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/transportModels/interfaceProperties/lnInclude -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/turbulenceModels/incompressible/turbulenceModel -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/OpenFOAM/lnInclude -I/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/waveFoam.o
waveFoam.C:50:28: error: relaxationZone.H: No such file or directory
waveFoam.C:67:36: error: readWaveProperties.H: No such file or directory
In file included from waveFoam.C:70:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:148: error: ‘relaxationZone’ was not declared in this scope
createFields.H:148: error: expected ‘;’ before ‘relaxing’
waveFoam.C:97: error: ‘relaxing’ was not declared in this scope
/home/users/feng/OpenFOAM/OpenFOAM-2.0.1/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
make: *** [Make/linux64GccDPOpt/waveFoam.o] Error 1/QUOTE]

Do you have an idea what I could do ?

Best Regards

feng
fg118 is offline   Reply With Quote

Old   May 1, 2012, 06:21
Default
  #96
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Björn

Thanks, keep me posted on your progress, such that we can get these problems eliminated.

All the best,

Niels

P.S. You should be able to use the new surfaceElevation utility to track the surface elevation in your domain easily.
ngj is offline   Reply With Quote

Old   May 1, 2012, 06:24
Default
  #97
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,582
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Feng,

You have not modified the Make/options file in your waveFoam directory as stated on the wiki (http://openfoamwiki.net/index.php/Co...2Foam#waveFoam).

Kind regards,

Niels
ngj is offline   Reply With Quote

Old   May 1, 2012, 06:42
Default
  #98
Member
 
Björn Windén
Join Date: Feb 2012
Location: University of Southampton UK
Posts: 37
Rep Power: 5
winden is on a distinguished road
Hi Niels.

The only difference I can see is that combinedWaves sums up the velocity contributions from different components in

Code:
        U += combinedWavesPtr_[cI]->U(x, time);
whereas the modified stokesFirst also corrects for the frequency as we=w+kU in

Code:
scalar Uhorz = PI_ * H_ / period_ *
                   Foam::cosh(K_ * (Z + h_)) / Foam::sinh(K_ * h_) * 
                   Foam::cos(omega_ * time - (k_ & x) + (k_ & current_) * time + phi_);
as well as adding on the current velocity

Code:
return Uhorz * k_ / K_ - Uvert * direction_ + current_
In combinedWaves, I found that to get the correct frequency out I had to put, T of the wave, k of the wave and omega of the encountered wave in waveProperties which seems odd. I don't see exactly why there is an increase in amplitude though. I guess there is excess energy put in somehow by the combinedWaves approach that gets suppressed by the relaxation region but that builds up as increased amplitude when it is set free.

//Björn
winden is offline   Reply With Quote

Old   May 1, 2012, 08:03
Default
  #99
New Member
 
Join Date: Apr 2012
Posts: 5
Rep Power: 5
Nektos is on a distinguished road
Thanks Niels for your answer, wmake worked on waveFoam when I did what you said.
I will wait for your Allwmake file, and come back if i have any further problem.
Nektos is offline   Reply With Quote

Old   May 1, 2012, 08:17
Smile
  #100
New Member
 
Feng
Join Date: Oct 2011
Posts: 6
Rep Power: 5
fg118 is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi Feng,

You have not modified the Make/options file in your waveFoam directory as stated on the wiki (http://openfoamwiki.net/index.php/Co...2Foam#waveFoam).

Kind regards,

Niels
Dear Niels,
Thank you very for your apply. I have double cheak the Make/options file, I found that I just miss a "\" before -DOFVERSION=20 \
what a stupid mistake.
I will follow the tuitions in waves2foam to learn about it. Hope it will help me for my research.
best Rehards

Feng
fg118 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Other Topics at OpenFOAM Workshop Milan 2008 hjasak OpenFOAM 2 October 26, 2013 04:33
Sections / Topics in CFD Wiki Roberthealy1 CFD-Wiki 6 August 23, 2007 17:58
CFD Related Educational Programmes Jonas Larsson Main CFD Forum 3 February 9, 2007 11:11
project topics vivekanand CFX 0 October 27, 2004 05:17
Advanced Topics in Aerodynamics Antonio Filippone Main CFD Forum 0 August 28, 1999 12:16


All times are GMT -4. The time now is 17:49.