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 Tree76Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 12, 2013, 23:01
Default
  #441
Member
 
Gregoire Junqua
Join Date: Jun 2011
Location: China
Posts: 58
Blog Entries: 1
Rep Power: 6
gregjunqua is on a distinguished road
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.
gregjunqua is offline   Reply With Quote

Old   June 13, 2013, 03:09
Angry compiling waves2Foam
  #442
New Member
 
Shashank Reddy
Join Date: Jun 2013
Posts: 4
Rep Power: 4
shashi is on a distinguished road
Dear Neils,

Quote:
Originally Posted by ngj View Post
Dear Norman, Dennis and others,

I have made a small correction to the compilation of waves2Foam, so now compilation of the same part of the source code should be achievable.

I defined an additional environmental variable WAVES_XVERSION, so please remember to update your waves2Foam/bin/bashrc file based on the changes to waves2Foam/bin/bashrc.org.

Also, the changes are done in the dark, as I do have neither 2.2.0 nor 2.2.x, so please report any difficulties.

All the best,

Niels
I am trying to compile the waves2Faom, and have encountered the 2 errors. There is some error with the bin/bashrc where the $WM_PROJECT_VERSION takes in a wrong value. Is this what you are referring to above. Can you please help with resolving the other error also which says wmake command not found used in the respective ./Allwmakes .

Thanks in advance,
shashank
Attached Files
File Type: txt error.txt (1.8 KB, 7 views)
shashi is offline   Reply With Quote

Old   June 13, 2013, 12:13
Default
  #443
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is online now   Reply With Quote

Old   June 13, 2013, 14:23
Default
  #444
New Member
 
Shashank Reddy
Join Date: Jun 2013
Posts: 4
Rep Power: 4
shashi is on a distinguished road
Quote:
Originally Posted by ngj View Post
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
Dear Niels,

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
shashi is offline   Reply With Quote

Old   June 13, 2013, 15:02
Default
  #445
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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 x-version. X-versions are e.g. 1.7.x, 2.1.x and 2.2.x.
ngj is online now   Reply With Quote

Old   June 14, 2013, 10:55
Default
  #446
New Member
 
Hf
Join Date: Nov 2012
Posts: 22
Rep Power: 4
jasonchen is on a distinguished road
Quote:
Originally Posted by kumar2 View Post
Hi Jason,

I first use the OF utility writeCellCenters to write the cell centers then I use the following matlab function readOpenFoamWithMatlab.m to read the cell centers as shown way down.

%%%%%%%%%%%%%function readOpenFoamWithMatlab.m %%%
function alpha1=readOpenFoamWithMatlab(str,no_of_headerLine s) % no spaces.

fid=fopen(str,'r');
%no_of_headerLines=20;
for i=1:no_of_headerLines, fgets(fid); end
no_of_cells=fscanf(fid,'%d'); fgets(fid);
data=textscan(fid,'%f');
alpha1=data{1,1}(; % no smiley face, the editor is inputing this !
[r,c]=size(alpha1); if r~=no_of_cells, pause; end
fclose(fid);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Read the cell centers into MATLAB as shown below:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
no_of_headerLines=20; % I am pretty sure, but good to check..
ccx=readOpenFoamWithMatlab('ccx',no_of_headerLines );
ccy=readOpenFoamWithMatlab('ccy',no_of_headerLines );
ccz=readOpenFoamWithMatlab('ccz',no_of_headerLines );
XX=unique(ccx); YY=unique(ccy);
X=zeros(length(YY),length(XX)); Y=zeros(length(YY),length(XX));
for i=1:length(YY), X(i,: )=XX; end
for i=1:length(XX), Y(:,i)=YY; end
[r,c]=size(X);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Now read alpha fields
%%%%
alpha=readOpenFoamWithMatlab('alpha1',no_of_header Lines);
alpha_i=griddata(ccx,ccy,alpha,X,Y);
figure; pcolor(X,Y,alpha1); colorbar; shading flat;


Please let me know if this does not work.

Best regards

Kumar

Hello Kumar,

Thanks very much for the matlab script. It works well for the waveFlume tutorial. But I doubt whether it also works for non-rectangular mesh, for example mesh with sloping beaches.

By the way, I suggest you use this func-contour(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.
jasonchen is offline   Reply With Quote

Old   June 14, 2013, 15:25
Default
  #447
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Quote:
Originally Posted by jasonchen View Post
Hello Kumar,

Thanks very much for the matlab script. It works well for the waveFlume tutorial. But I doubt whether it also works for non-rectangular mesh, for example mesh with sloping beaches.

By the way, I suggest you use this func-contour(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.
Hi Jason,

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
kumar2 is offline   Reply With Quote

Old   June 14, 2013, 17:37
Default wave2foam
  #448
New Member
 
Javier A˝ez Perdomo
Join Date: May 2013
Location: Maracaibo, Venezuela
Posts: 3
Rep Power: 4
javierjap is on a distinguished road
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 second-order non-linear wave equation?

Kind regards
Javier
javierjap is offline   Reply With Quote

Old   June 17, 2013, 05:43
Default compiling waves2Foam
  #449
New Member
 
Shashank Reddy
Join Date: Jun 2013
Posts: 4
Rep Power: 4
shashi is on a distinguished road
Quote:
Originally Posted by ngj View Post
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 x-version. X-versions are e.g. 1.7.x, 2.1.x and 2.2.x.

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.
shashi is offline   Reply With Quote

Old   June 18, 2013, 10:05
Default Jonswap
  #450
New Member
 
Jan L÷hrmann
Join Date: Sep 2010
Posts: 21
Rep Power: 6
JanL is on a distinguished road
Dear Niels,


I'm currently testing the spectral analysis in waveFoam.
Therefore I've set up a 2D-case 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 );
    }
};



// ************************************************************************* //
Attached Images
File Type: jpg initializationName_inlet.jpg (41.8 KB, 38 views)
File Type: jpg initializationName_outlet.jpg (47.4 KB, 34 views)
File Type: jpg alpha(t=0).jpg (12.3 KB, 31 views)
JanL is offline   Reply With Quote

Old   June 18, 2013, 12:16
Default
  #451
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
@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 non-linear 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 wmake-related error. I cannot help you on that, as it will be the fundamental OF-settings which are then wrong.

Kind regards

Niels
ngj is online now   Reply With Quote

Old   June 21, 2013, 04:32
Default wave generation duration problems
  #452
New Member
 
Abdel Abdel
Join Date: Jun 2013
Location: UE
Posts: 4
Rep Power: 4
Abdel is on a distinguished road
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;
};

//
Abdel is offline   Reply With Quote

Old   June 21, 2013, 09:53
Default
  #453
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is online now   Reply With Quote

Old   June 25, 2013, 05:31
Default SRC files modifications
  #454
New Member
 
Abdel Abdel
Join Date: Jun 2013
Location: UE
Posts: 4
Rep Power: 4
Abdel is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi Abdel,

Such functionality is not available, but you should be able to modify the code in order to achieve what you want.

Kind regard

Niels

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 sub-dictionary
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
Abdel is offline   Reply With Quote

Old   June 25, 2013, 12:29
Default
  #455
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
-operator, as you will easily end up in an infinite loop.

Thirdly, please do use the
Code:
[ CODE ]
[ /CODE ]
brackets (without the spaces) around all code you put in the forum, as this will keep the formatting and not it easier to read.

Kind regards

Niels
ngj is online now   Reply With Quote

Old   June 26, 2013, 04:17
Default wave generation duration problems
  #456
New Member
 
Abdel Abdel
Join Date: Jun 2013
Location: UE
Posts: 4
Rep Power: 4
Abdel is on a distinguished road
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 g-direction!!!" << 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
Abdel is offline   Reply With Quote

Old   June 27, 2013, 03:36
Default wave dies/smears out after long period simulation time
  #457
Member
 
YS
Join Date: Jan 2010
Posts: 66
Rep Power: 7
Ya_Squall2010 is on a distinguished road
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
Ya_Squall2010 is offline   Reply With Quote

Old   June 27, 2013, 04:01
Default
  #458
Member
 
YS
Join Date: Jan 2010
Posts: 66
Rep Power: 7
Ya_Squall2010 is on a distinguished road
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 );
}
}
Ya_Squall2010 is offline   Reply With Quote

Old   June 27, 2013, 08:51
Default
  #459
Senior Member
 
kilroy's Avatar
 
Join Date: Mar 2013
Location: USA
Posts: 120
Rep Power: 4
kilroy is on a distinguished road
Quote:
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?
Ya_Squall201;

I am having exactly the same problem.

Thanks,

kilroy
kilroy is offline   Reply With Quote

Old   June 27, 2013, 19:18
Default
  #460
New Member
 
David Hickerson
Join Date: Aug 2009
Location: Monument, CO
Posts: 17
Rep Power: 7
dahicke is on a distinguished road
Send a message via AIM to dahicke
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?
dahicke 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 05:56.