
[Sponsors] 
June 12, 2013, 23:01 

#441 
Member

Dear Neils,
As i had say earlier I am interested by adding the wind. But i am stuck with this problem is that i would like to apply a different wind condition than the one proposed in your module. I would like to know (I had search but unfortunately not found) where you did modifies the module for adding the wind. Greg Last edited by gregjunqua; June 13, 2013 at 03:53. 

June 13, 2013, 03:09 
compiling waves2Foam

#442  
New Member
Shashank Reddy
Join Date: Jun 2013
Posts: 4
Rep Power: 5 
Dear Neils,
Quote:
Thanks in advance, shashank 

June 13, 2013, 12:13 

#443 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Hi Shashank,
Either you have forgotten to source the OpenFoam bashrc script (see the OpenFoam installation REAME) or you have not installed OpenFoam at all. Good luck, Niels 

June 13, 2013, 14:23 

#444  
New Member
Shashank Reddy
Join Date: Jun 2013
Posts: 4
Rep Power: 5 
Quote:
I have sourced the OpenFoam bashrc script, and I have run several tutorials of sloshing tank, floating object etc., without errors, although , I have not compiled the files on my machine but have copied the already compiled files. And moreover, the error with version number seems to be in the code, as I am operating in 2.1.1, where the value of x is supposed to be 1, instead it takes the version number as 0 and searches for solvers0 folder in /applications/solvers . Pl correct me if I am wrong I am new to OpenFaom. Thanks in advance. shashank 

June 13, 2013, 15:02 

#445 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Hello,
The fact that you are told that wmake does not exist and that neither WAVES_APPBIN nor WAVES_LIBBIN are given any value suggests to me that something is wrong with your installation. These things means that you have not compiled anything on your OpenFoam installation and that the native OpenFoam environmental variables FOAM_USER_APPBIN and FOAM_USER_LIBBIN are not set. With respect to the latter I have no clue, why this happens. These are fundamental problems, which I do not have the answer for, but I would suggest that you search the forum for the "wmake command not found" string. Kind regards Niels P.S. No, version 2.1.1. is not an xversion. Xversions are e.g. 1.7.x, 2.1.x and 2.2.x. 

June 14, 2013, 10:55 

#446  
New Member
Hf
Join Date: Nov 2012
Posts: 24
Rep Power: 6 
Quote:
Hello Kumar, Thanks very much for the matlab script. It works well for the waveFlume tutorial. But I doubt whether it also works for nonrectangular mesh, for example mesh with sloping beaches. By the way, I suggest you use this funccontour(XX,YY,alpha1,1), to get a clear surface profile, like shown in the link below. https://www.dropbox.com/s/ii6b0yuuph...ve%20flume.jpg Thank you. 

June 14, 2013, 15:25 

#447  
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 9 
Quote:
Great it works for you. The image looks good. It should work for the sloping beach too ( I have not yet done the sloping beach). So when the griddata works outside the region where there is no actual data, it will simply put in NaNs. Cheers Kumar 

June 14, 2013, 17:37 
wave2foam

#448 
New Member
Javier Añez Perdomo
Join Date: May 2013
Location: Rouen, France
Posts: 6
Rep Power: 5 
Hello all
I'm new to OpenFOAM and to this Forum as well. I was wondering if the wave2foam utility or the wavefoam solver would solve the secondorder nonlinear wave equation? Kind regards Javier 

June 17, 2013, 05:43 
compiling waves2Foam

#449  
New Member
Shashank Reddy
Join Date: Jun 2013
Posts: 4
Rep Power: 5 
Quote:
Dear Niels, I understood what you have told above, and even installed openfoam2.2.0 again, which is working fine( i mean, I have been able to run tutorials successfully), but upon compiling waves2Faom, it still gives the same error I have mentioned to you before ( i.e WAVES_APPBIN WAVES_LIBBIN do not take any values), is there any other way to resolve this, I am unable to find any other direction, I even went through the wmake string. you asked me to. 

June 18, 2013, 10:05 
Jonswap

#450 
New Member
Jan Löhrmann
Join Date: Sep 2010
Posts: 21
Rep Power: 8 
Dear Niels,
I'm currently testing the spectral analysis in waveFoam. Therefore I've set up a 2Dcase and wanted to generate a JONSWAP spectrum. I've attached the waveProperties file, which I've used. Strangely, to get setWaveField to work, I had to define amplitude, frequency, phaselag, omega and waveNumber, although all of those parameters are defined through the calculation of the wave spectra (as far as I understood from looking at JONSWAP.C). Furthermore, when setting writeSpectrum true, and having a look at the written waveProperties file, those parameters aren't written out anymore. Could you tell me what those parameters are needed for in case of wave spectra? When running the case with the waveProperties file using initializationName inlet, I do get strange results looking at the waves. The amplitude is far too big (approximately by factor N, which is 10 in my case) and the resulting elevation doesn't quite suit the analytical result (I've attached both files for comparison, where I computed the analytical result by using the values for amplitude, frequency, phaselag and waveNumber written out into the waveProperties file). Using intitializationName outlet (potentialCurrent in my case) the amplitude is correct but still the surfaceElevation is wrong (might be a problem in the accuracy of the generated waves as it looks not too bad in the beginning but getting worse over time as can be seen in the attached figure!?). I suspect that my grid resolution isn't high enough to accurately considers the smallest generated waves. Or does something else come to your mind? My last problem is, when initializing the wave field, there appears a strange vertical displacement of alpha at the inlet (see attached figure). Again, I have the feeling waveFoam uses a superposed amplitude or something similar. The amplitudes, which are generated in my spectrum are much smaller! I have the feeling, that this displacement afflicts the phase in the first time steps. Or is there something I'm doing wrong for the initialization? Any hints would be highly appreciated! Best regards Jan Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 1.5   \\ / A nd  Web: http://www.OpenFOAM.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; object environmentalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // timeShift 0.0; seaLevel 0.00; wind (0 0 0); // A list of the relaxation zones in the simulation. The parameters are given // in <name>Coeffs below. relaxationNames (inlet outlet); initializationName outlet; pName p_rgh; inletCoeffs { waveType irregular; spectrum JONSWAP; N 10; Tsoft 0; writeSpectrum true; Hs 0.2; amplitude uniform 0.1; frequency uniform 0.4266; phaselag uniform 0; omega 2.6804; waveNumber uniform (0.7323 0 0); Tp 2.3441; gamma 3.3; depth 6.25; direction (1 0 0); // Specifications on the relaxation zone shape and relaxation scheme relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType INLET; startX ( 13.6 0.0 11.2 ); endX ( 4.6 0.0 0 ); orientation ( 1.0 0.0 0.0 ); } }; outletCoeffs { waveType potentialCurrent; U ( 0 0 0 ); Tsoft 0; relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType OUTLET; startX ( 8 0.0 11.2 ); endX ( 28.7 0.0 0 ); orientation ( 1.0 0.0 0.0 ); } }; // ************************************************************************* // 

June 18, 2013, 12:16 

#451 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
@Jan:
I have just tested that I can run setWaveParameters and subsequently setWaveField (using the inlet parameters), and I get something which looks like an irregular wave train. Important to note that I did not have to do any modifications what so ever. I am using the most recent SVN revision, which is #2000. Furthermore, I do actually get the spectrum written, so we are probably not synchronised in terms of version. The only thing I can say about your time series analysis is that you should consider the effect of nonlinear interactions inside the computational domain. This will make the wave train deviate from the analytical solution. @Shashi: You should first try and see, whether you can compile any of the solvers in OpenFoam. I suggest that you begin with icoFoam. You will probably get the same wmakerelated error. I cannot help you on that, as it will be the fundamental OFsettings which are then wrong. Kind regards Niels 

June 21, 2013, 04:32 
wave generation duration problems

#452 
New Member
Abdel Abdel
Join Date: Jun 2013
Location: UE
Posts: 4
Rep Power: 5 
Hi everyone,
I'm studying a wave Flume case and I have a little problem. I just want to generate my waves during 10s but let running my simulation during 60s. I don't know how I should proceed ... Can somebody help me please ? Thank You in advance I wrote this scipt in waveProperties file : timeShift 0.0; seaLevel 0.00; // A list of the relaxation zones in the simulation. The parameters are given // in <name>Coeffs below. relaxationNames (); initializationName init; pName p_rgh; inletCoeffs { // Wave type to be used at boundary "inlet" and in relaxation zone "inlet" waveType stokesFirst; // Ramp time of 2 s Tsoft 2; // Water depth at the boundary and in the relaxation zone depth 0.700000; //0.4 // Cyclic wave frequency omega 3,141593; //0.546882617 // Phase shift in the wave phi 0.000000; // Wave number vector, k. waveNumber (1.70048 0.0 0.0); // Wave height height 0.05; //0.10 // Tstart 0; // Not required (Default 0.0); Tend 5; // Not required (Default GREAT); // Specifications on the relaxation zone shape and relaxation scheme /* relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType INLET; startX (0 0.0 1); endX (0.5 0.0 1); orientation (1.0 0.0 0.0); } */ }; initCoeffs { waveType potentialCurrent; U (0 0 0); Tsoft 2; }; // 

June 21, 2013, 09:53 

#453 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Hi Abdel,
Such functionality is not available, but you should be able to modify the code in order to achieve what you want. Kind regards Niels 

June 25, 2013, 05:31 
SRC files modifications

#454  
New Member
Abdel Abdel
Join Date: Jun 2013
Location: UE
Posts: 4
Rep Power: 5 
Quote:
Hi Niels, First and foremost I'd like to thank You for your response. I already had this idea and start to write in the src files : wavestheories/regular/stokesFirst .C and .H scripts. and in setwavesProperties/regular/stokesFirstProperties .C and .H scipts. But I haven't the results I want ... I wrote this : stokesFirst.C // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // stokesFirst::stokesFirst ( const word & subDictName, const fvMesh & mesh_ ) : waveTheory(subDictName, mesh_), H_(readScalar(coeffDict_.lookup("height"))), h_(readScalar(coeffDict_.lookup("depth"))), omega_(readScalar(coeffDict_.lookup("omega"))), period_(2 * PI_ / omega_), phi_(readScalar(coeffDict_.lookup("phi"))), k_(vector(coeffDict_.lookup("waveNumber"))), K_(mag(k_)), Twend_(readScalar(coeffDict_.lookup("Twend"))), //ajout Tsoft_(coeffDict_.lookupOrDefault<scalar>("Tsoft", period_)) {} void stokesFirst:rintCoeffs() { Info << "Loading wave theory: " << typeName << endl; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // scalar stokesFirst::factor(const scalar & time) const { scalar factor(1.0); /* if (Tsoft_ > 0.0) if ( time = 0.0) //Tend_(readScalar(coeffDict_.lookup("Twend"))), //ajout else if ( Twend_ < 10.1) factor = Foam::sin(2 * PI_ / (4.0 * Tsoft_) * Foam::min(Tsoft_, time)); return factor; */ while (Twend_ < 10.1) factor = Foam::sin(2 * PI_ / (4.0 * Tsoft_) * Foam::min(Tsoft_, time)); return factor; } stokesFirst.H // Member Functions Switch conflictTSoftInitialise() const { /* if ( Tsoft_ > 0 ) return true; else return false; */ while (Twend_ < 10.1) return true; else return false; stokesFirstProperties.C // Info << "\nConstructing: " << this>type() << "(Dummy)"<< endl; period_ = 0.0; depth_ = 0.0; omega_ = 0.0; Twend_ = 0.0;//ajout } stokesFirstProperties::stokesFirstProperties ( const Time & rT, dictionary & dict, bool write ) : setWaveProperties(rT, dict, write) { Info << "\nConstructing: " << this>type() << endl; period_ = readScalar( dict.lookup("period") ); depth_ = readScalar( dict.lookup("depth") ); omega_ = 2.0 * PI_ / period_ ; Twend_ = readScalar( dict.lookup("Twend"); //ajout } stokesFirstProperties::stokesFirstProperties ( const Time & rT, dictionary & dict, bool write, word string ) : setWaveProperties(rT, dict, write) { Info << "\nConstructing: " << this>type() << " (Used by another wave theory)"; period_ = readScalar( dict.lookup("period"+string) ); depth_ = readScalar( dict.lookup("depth") ); omega_ = 2.0 * PI_ / period_; Twend_ = readScalar( dict.lookup("Twend") ); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void stokesFirstProperties::set( Ostream & os ) { scalar k = linearWaveNumber(); // Write the beginning of the subdictionary writeBeginning( os ); // Write the already given parameters writeGiven( os, "waveType" ); if ( dict_.found( "Tsoft" ) ) writeGiven( os, "Tsoft"); writeGiven( os, "depth"); writeGiven( os, "period" ); writeGiven( os, "direction" ); writeGiven( os, "phi"); writeGiven( os, "height"); writeGiven(os, "Twend"); //ajout if ( write_ ) { vector direction( vector(dict_.lookup("direction"))); direction /= Foam::mag(direction); direction *= k; writeDerived( os, "waveNumber", direction ); writeDerived( os, "omega", omega_); and stokesFirstProperties.H namespace Foam { class stokesFirstProperties : public setWaveProperties { private: scalar period_; scalar omega_; scalar depth_; scalar Twend_; //Ajout .................................................. ....................... I'm sorry for this very long post. Kind regards, Abdel 

June 25, 2013, 12:29 

#455 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,713
Rep Power: 27 
Hi Abdel,
It is hard to help you, when you do not state, what type of result you get, now that you do not get the one you want. Secondly, I am very scared over your use of Code:
while Thirdly, please do use the Code:
[ CODE ] [ /CODE ] Kind regards Niels 

June 26, 2013, 04:17 
wave generation duration problems

#456 
New Member
Abdel Abdel
Join Date: Jun 2013
Location: UE
Posts: 4
Rep Power: 5 
Hi Niels,
thank You for your post ! modification I added are useless : in fact, I obtain the same results as always. I'm not a professional in programmation language but I made some modifications again .. I know "while" isn't the best idea so I replaced them by "if" I wrote this but I don't see the results I want when I use paraFoam : / * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // stokesFirst::stokesFirst ( const word & subDictName, const fvMesh & mesh_ ) : waveTheory(subDictName, mesh_), H_(readScalar(coeffDict_.lookup("height"))), h_(readScalar(coeffDict_.lookup("depth"))), omega_(readScalar(coeffDict_.lookup("omega"))), period_(2 * PI_ / omega_), phi_(readScalar(coeffDict_.lookup("phi"))), k_(vector(coeffDict_.lookup("waveNumber"))), K_(mag(k_)), Twend_(readScalar(coeffDict_.lookup("Twend"))), //ajout Tsoft_(coeffDict_.lookupOrDefault<scalar>("Tsoft", period_)) {} void stokesFirst:rintCoeffs() { Info << "Loading wave theory: " << typeName << endl; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // scalar stokesFirst::factor(const scalar & time) const { scalar factor(1.0); /* if (Tsoft_ > 0.0) if ( time = 0.0) //Tend_(readScalar(coeffDict_.lookup("Twend"))), //ajout else if ( Twend_ < 10.1) factor = Foam::sin(2 * PI_ / (4.0 * Tsoft_) * Foam::min(Tsoft_, time)); return factor; */ if (Twend_ < 10.1) factor = Foam::sin(2 * PI_ / (4.0 * Tsoft_) * Foam::min(Tsoft_, time)); //ajout return factor; } scalar stokesFirst::eta ( const point & x, const scalar & time ) const { scalar eta = H_ / 2.0 * Foam::cos(omega_ * time  (k_ & x) + phi_) * factor(time) + seaLevel_; return eta; } scalar stokesFirst::ddxPd ( const point & x, const scalar & time, const vector & unitVector ) const { scalar Z(returnZ(x)); scalar arg(omega_ * time  (k_ & x) + phi_); scalar ddxPd(0); ddxPd = ( rhoWater_ * mag(g_) * K_ * H_ / 2.0 * Foam::cosh(K_ * (Z + h_)) / Foam::cosh(K_ * h_) * Foam::sin(arg) ) * factor(time); // ddxPd += rhoWater * Foam::mag(G) * k_ * height_ / 2 * Foam::cosh(k_ * (c[cI].component(1)  seaLevel_ + depth_)) // / Foam::cosh(k_ * depth_) * Foam::sin(omega_ * db().time().value() + mathematicalConstant:i / 2) * factor; // Info << "ddxPd still isn't implemented. Need to think about the gradient on arbitrary directed mesh with arbitrary wave number vector! and arbitrary gdirection!!!" << endl; return ddxPd; } vector stokesFirst::U ( const point & x, const scalar & time ) const { scalar Z(returnZ(x)); scalar Uhorz = PI_ * H_ / period_ * Foam::cosh(K_ * (Z + h_)) / Foam::sinh(K_ * h_) * Foam::cos(omega_ * time  (k_ & x) + phi_); Uhorz *= factor(time); scalar Uvert =  PI_ * H_ / period_ * Foam::sinh(K_ * (Z + h_)) / Foam::sinh(K_ * h_) * Foam::sin(omega_ * time  (k_ & x) + phi_); Uvert *= factor(time); return Uhorz * k_ / K_  Uvert * direction_; // Note "" because of "g" working in the opposite direction } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace waveTheories } // End namespace FoamThank You very much for your advices Kind regards, Abdel 

June 27, 2013, 03:36 
wave dies/smears out after long period simulation time

#457 
Member
YS
Join Date: Jan 2010
Posts: 79
Rep Power: 8 
Hi Niels,
I had a test run using stokeFifth of waves2Foam. The domain is around 8 wave lengths long, with a relaxation zone of 1.8 wave length long at the outlet side. Just notice the wave trains are beautifully produced at the initial tens of seconds, but start to diminish afterward and completely smeared out at the late stage of the simulation. Please have a look of the pictures attached. I wonder whether this is due to the domain is not quite long enough? 1.0002.jpg 1.0015.jpg 1.0030.jpg 1.0170.jpg 

June 27, 2013, 04:01 

#458 
Member
YS
Join Date: Jan 2010
Posts: 79
Rep Power: 8 
And here's the waveProperties:
timeShift 0; seaLevel 0; wind ( 0 0 0 ); relaxationNames ( inlet outlet ); initializationName inlet; pName p_rgh; inletCoeffs { waveType stokesFifth; height 15; period 10; depth 100; stokesDrift 0; direction ( 1 0 0 ); Tsoft 0; phi 0; waveNumber (0.0378937298104 0 0); waveLength 165.810685267; omega 0.628318530718; relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType INLET; startX ( 500 300 105 ); endX ( 400 300 105 ); orientation ( 1 0 0 ); } } outletCoeffs { waveType potentialCurrent; U ( 0 0 0 ); Tsoft 0; relaxationZone { relaxationScheme Spatial; relaxationShape Rectangular; beachType Empty; relaxType OUTLET; startX ( 400 300 105 ); endX ( 700 300 105 ); orientation ( 1 0 0 ); } } 

June 27, 2013, 08:51 

#459  
Senior Member
Join Date: Mar 2013
Location: USA
Posts: 120
Rep Power: 5 
Quote:
I am having exactly the same problem. Thanks, kilroy 

June 27, 2013, 19:18 

#460 
New Member

I am currently using Star CCM+ for my wave work, but I noticed something that may help. I had a region of larger mesh cell size next to a region with smaller cell size perpendicular to the wave. When running the wave, the wave in the larger cells moved slower and appeared to dissipate compared to the smaller cell region. Could your problem be with cell size?


Thread Tools  
Display Modes  


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  CFDWiki  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 