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

[waves2Foam] 5th Order Stokes Wave Initialization

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2015, 12:08
Default 5th Order Stokes Wave Initialization
  #1
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Ni Niels,

I want to initialized by simulation with a stokes 5th order theory over the whole domain. I want to shift the initial solution by specifying the phi value. However, it seems that I can't do it for the stokes 5th, the initialized solution is the same as when the phi is zero. It works without any problem for the 2nd order stokes theory though.

Part of the waveProperties.input dictionary is as follows:

Code:
relaxationNames     ( inlet outlet );

initializationName  inlet;

pName               p_rgh;

inletCoeffs
{
    waveType    stokesFifth;  
    Tsoft       0.00;
    depth       1.50;
    period      1.00;
    phi         3.1416;
    direction  (1.0 0.0 0.0);
    height      0.10;
    stokesDrift 0.00;

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           INLET;
        startX              ( -5.0 -99.0 -99.0);
        endX                ( -4.0  99.0  99.0);
        orientation         (  1.0   0.0   0.0);
    }
};
Am I doing something wrong with the wave properties specification?

Kind regards,
katakgoreng
katakgoreng is offline   Reply With Quote

Old   August 15, 2015, 04:42
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Good morning Katakgoreng,

Unfortunately I do not have access to the source code at the moment, but a bug is likely. You will get the quickest answer by looking into the source code yourself.

According to the wiki 'phi' is accepted as a variable (even required).

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 17, 2015, 00:34
Default
  #3
New Member
 
Pablo Montalvo
Join Date: Feb 2015
Location: Taiwan
Posts: 9
Rep Power: 11
Olbap is on a distinguished road
Hello Katakgoreng,
in StokesFifth.C, the cosine argument is defined for eta and U as
Code:
 scalar arg((k_ & x) - omega_*time);
instead of
Code:
 scalar arg((k_ & x) - omega_*time + phi_);
as it is for StokesSecond.C. So I guess that is part of the issue. Maybe you have found it already, did you solve your problem?
Olbap is offline   Reply With Quote

Old   August 17, 2015, 04:59
Default
  #4
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
Good morning Katakgoreng,

Unfortunately I do not have access to the source code at the moment, but a bug is likely. You will get the quickest answer by looking into the source code yourself.

According to the wiki 'phi' is accepted as a variable (even required).

Kind regards,

Niels
Hi Niels,

I guess it is a bug as pointed out by Pablo.

Quote:
Originally Posted by Olbap View Post
Hello Katakgoreng,
in StokesFifth.C, the cosine argument is defined for eta and U as
Code:
 scalar arg((k_ & x) - omega_*time);
instead of
Code:
 scalar arg((k_ & x) - omega_*time + phi_);
as it is for StokesSecond.C. So I guess that is part of the issue. Maybe you have found it already, did you solve your problem?
Hi Pablo,

Many thanks for pointing this out. I added phi to both eta & U routine, recompile & it works now.

Kind regards,
katakgoreng
katakgoreng is offline   Reply With Quote

Old   August 17, 2015, 05:06
Default
  #5
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Good morning

Thank you for the bug-fixing to Pablo and Katakgoreng. I will put it on the list, so it is corrected, when I make the next update of the code.

Small question: Have you written it as "+ phi" or "- phi" and is it behaving as expected in terms of the shift in the free surface, when you give a small value of phi; e.g. phi = 0.1 = displacement in the propagation direction? Could you please check this for me, now that you have it all up and running?

Thank you and kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 17, 2015, 06:26
Default
  #6
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Hi Niels,

My implementation of phi for Stokes Fifth is as follows:

Code:
scalar arg((k_ & x) - omega_*time + phi_);
I ran a few cases corresponding to phi=0, pi/4, pi/2, 3/4pi, pi.
The plot of eta vs x for all cases (Stokes Fifth):



I ran the same cases for Stokes 2nd Order and got the following result:



Hmmm..I guess the implementation for stokes fifth should be -phi then..

Kind regards,
katakgoreng
katakgoreng is offline   Reply With Quote

Old   August 17, 2015, 06:40
Default
  #7
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Thank you very much for this very clear analysis. I will adjust the stokesFifth theory with "-phi", when I am back at a computer with OF. This is a minor change, so the change will be communicated through the Wiki:

http://openfoamwiki.net/index.php/Co..._.28History.29

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Reply


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
[IHFOAM] The IHFOAM Thread Phicau OpenFOAM Community Contributions 392 September 8, 2023 19:10
VOF wave getting damped. arun7328 STAR-CCM+ 16 July 8, 2019 16:06
Weird time step initialization behavior - Wave generation model liadpaskin CFX 3 July 11, 2015 07:21
weno upwind 5th order 1 d code Chi Main CFD Forum 1 March 11, 2007 23:44
4th and 5th Order TVD Runge-Kutta Methods saygin Main CFD Forum 2 January 30, 2006 12:45


All times are GMT -4. The time now is 21:04.