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

[waves2Foam] Internal Solitary Wave

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 8, 2014, 10:50
Default Internal Solitary Wave
  #1
New Member
 
AI
Join Date: Jun 2014
Posts: 17
Rep Power: 11
sherif35 is on a distinguished road
Dear Niels,

Thank you for developing the waves2Foam tool box, very helpful.

I'd like to simulate internal solitary wave in the ocean, the equations are very similar to the solitaryFirst theory you have in waves2Foam but with minor modifications to account for the small difference in densities of the upper and lower layers of the flow (1000 & 1025) and the depth of each layer.

I was able to make the changes and run a test case but I can see velocities are initialized in the lower layer only.

I was wondering if you can point me in the correct direction to be able to initialize the velocities in the top layer as well.

I have used the following equations for the velocities in the waves theory ".C" file:

scalar Z(returnZ(x));
scalar etaVal = eta(x,time);

scalar Uhorz(0.0);

if (Z < etaVal)

Uhorz = (c0_/h2_)*((H_*(-1.0))/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0));

else

Uhorz = (c0_/h1_)*(H_*1.0/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0));



scalar Uvert(0.0);

if (Z < etaVal)

Uvert = (c0_/h2_)*((H_*(-1.0))/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0))
* (Foam::tanh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_))
* (2*(Z +h2_)/ww_);

else

Uvert = (c0_/h1_)*(H_*1.0/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0))
* (Foam::tanh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_))
* (2*(Z +h1_)/ww_);


return Uhorz*propagationDirection_ - Uvert*direction_;

Thank you,

Ahmed

Last edited by sherif35; December 8, 2014 at 12:55.
sherif35 is offline   Reply With Quote

Old   December 9, 2014, 04:04
Default
  #2
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
Hallo Ahmed,

It is the relaxationScheme-classes that you have to look into. E.g.

Code:
waves2Foam/src/waves2Foam/relaxationZone/relaxationScheme/spatial
Here, you will find that I have hard-coded that the velocity in the air vanishes, so modifying this classes (or creating a new), should solve your problems.

Happy to hear feedback, if you can get it to work or not. I had never imagined that the toolbox would be used to study internal waves.

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   February 26, 2023, 04:12
Default
  #3
y99
New Member
 
ysh
Join Date: Nov 2022
Posts: 5
Rep Power: 3
y99 is on a distinguished road
Quote:
Originally Posted by sherif35 View Post
Dear Niels,

Thank you for developing the waves2Foam tool box, very helpful.

I'd like to simulate internal solitary wave in the ocean, the equations are very similar to the solitaryFirst theory you have in waves2Foam but with minor modifications to account for the small difference in densities of the upper and lower layers of the flow (1000 & 1025) and the depth of each layer.

I was able to make the changes and run a test case but I can see velocities are initialized in the lower layer only.

I was wondering if you can point me in the correct direction to be able to initialize the velocities in the top layer as well.

I have used the following equations for the velocities in the waves theory ".C" file:

scalar Z(returnZ(x));
scalar etaVal = eta(x,time);

scalar Uhorz(0.0);

if (Z < etaVal)

Uhorz = (c0_/h2_)*((H_*(-1.0))/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0));

else

Uhorz = (c0_/h1_)*(H_*1.0/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0));



scalar Uvert(0.0);

if (Z < etaVal)

Uvert = (c0_/h2_)*((H_*(-1.0))/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0))
* (Foam::tanh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_))
* (2*(Z +h2_)/ww_);

else

Uvert = (c0_/h1_)*(H_*1.0/Foam:ow(
cosh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_) ,2.0))
* (Foam::tanh(((-1.0)*c_*time + ((x - x0_) & propagationDirection_))/ww_))
* (2*(Z +h1_)/ww_);


return Uhorz*propagationDirection_ - Uvert*direction_;

Thank you,

Ahmed
Dear Ahmed,
I wonder if you've been successful in simulating internal solitary wave in the ocean.If you succeed, would you please share your experience with me?
Any help would be appreciated.
Thank you,
Ysh
y99 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
Solitary wave propagation Dronzer STAR-CCM+ 0 September 30, 2017 03:28
How to set up initial solitary wave in the domain Ted Chu FLUENT 2 September 27, 2016 02:45
Solitary wave run up on a conical island premal Main CFD Forum 0 April 15, 2014 09:31
Solitary wave Kourosh Hejazi Main CFD Forum 4 July 24, 2003 14:37
simulation of breaking solitary wave mehdi icho Main CFD Forum 0 July 2, 2002 04:35


All times are GMT -4. The time now is 00:35.