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

Generate the irregular wave with piston wavemaker in OpenFOAM ESI

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 4 Post By victor13165

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2020, 19:36
Default Generate the irregular wave with piston wavemaker in OpenFOAM ESI
  #1
New Member
 
Alex
Join Date: Mar 2020
Posts: 2
Rep Power: 0
Arefhm is on a distinguished road
Hi
I am trying to make a focused wave by using a piston wavemaker in OpenFOAM, but apparently I can only enter scaler input for the wave period. Thus, my question is that is it possible to make the irregular waves with a piston wavemaker without changing the BC source code or I have to edit the source code for it?

Thank you in advance
Please help me.
Arefhm is offline   Reply With Quote

Old   July 10, 2020, 04:16
Default
  #2
New Member
 
Join Date: Jun 2020
Posts: 3
Rep Power: 6
Jonas_cfd is on a distinguished road
Hello Foamers!
I'm trying to understand the "WavePistonMaker" tutorial (OF_19.12). where can I find documentation about it?
I read the source code but still have several doubts.

Jonas_cfd is offline   Reply With Quote

Old   May 11, 2021, 08:02
Default Piston irregular wave motion from tabulated data file
  #3
New Member
 
Victor Baconnet
Join Date: Apr 2021
Location: Cannes, France
Posts: 9
Rep Power: 5
victor13165 is on a distinguished road
Quote:
Originally Posted by Arefhm View Post
Hi
I am trying to make a focused wave by using a piston wavemaker in OpenFOAM, but apparently I can only enter scaler input for the wave period. Thus, my question is that is it possible to make the irregular waves with a piston wavemaker without changing the BC source code or I have to edit the source code for it?

Thank you in advance
Please help me.
Hello,

This is a bit of a late answer, but maybe it can help somebody else.

You can check out olaFlow and the wavemakerFlume tutorial : https://github.com/phicau/olaFlow/tr...wavemakerFlume. This would be the "cleanest" way to do it. If you are doing coastal engineering, olaFlow is great and has lots of great tools. You may want to check out IHFoam as well.

If you don't want to use olaFlow, here is what I have tried. I'm using OpenFOAM v2006.

EDIT : My original post did not reproduce the piston movement properly. I edited the right way to do it.

Here is an overview of all the steps I did:

1. You need a file (.dat, .csv...) that contains the irregular motion of the piston. The irregular motion is usually generated from a theoretical spectrum (in my case, JONSWAP). This file has to be formatted in the following way:

Code:
(
    //Format (time   (displacement_x displacement_y displacement_z))
    (0.0     (0.0          0 0))
    (0.005 (0.000112 0 0))
    (0.01   (0.000229 0 0))
    (0.015 (0.000351 0 0)) 
    (0.02   (0.000476 0 0))
    (0.025 (0.000606 0 0))
    (0.03   (0.000739 0 0))
    (0.035 (0.000876 0 0))

    // etc...
    //go until (tfinal (x_final y_final z_final))

  );
The sample above moves the piston along the x axis. Depending, on your geometry, you may need to adjust the file.

A few additional things:

- tfinal has to be equal or greater than your simulation time.

- The timestep between each entry doesn't really matter, because the values will be interpolated. For example, if your simulation happens at t = 0.0075, the motion will be interpolated from the values given at 0.005 and 0.01. Still, make sure the timestep between each entry is small enough so that interpolated values would still follow the irregular motion you want to achieve.

2. Copy the waveMakerPiston case from $FOAM_TUTORIALS/multiphase/interFoam/laminar/waves/waveMakerPiston


Code:
cp -r $FOAM_TUTORIALS/multiphase/interFoam/laminar/waves/waveMakerPiston .
3. Edit the pointDisplacement file in your 0.orig folder to the following :

Code:
leftwall
    {
        type              uniformFixedValue;
        uniformValue tableFile;
        file                "meshMotionData.dat"; //Path to your file
        outOfBounds   clamp;
    }
The dynamicMesh solver displacementLaplacian needs to be told which points in the mesh have to be moved and how. This is where you tell displacementLaplacian to move your piston according to the motion you gave in your own file. Mine is named "meshMotionData.dat" and is located in my case directory, i.e. in the same folder as constant, system and 0.orig. Adjust the path to your own file accordingly.

This should do the trick. Let me know if you would like more information on how to generate the irregular motion data file, or anything else you can think of that is unclear. Happy to help.


Cheers,


Victor

Last edited by victor13165; May 17, 2021 at 03:46. Reason: First answer didn't give the correct result
victor13165 is offline   Reply With Quote

Old   May 18, 2021, 04:16
Default Questions about pointDisplacement
  #4
Member
 
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 7
Stan Zhou is on a distinguished road
Quote:
Originally Posted by victor13165 View Post
Hello,

This is a bit of a late answer, but maybe it can help somebody else.

You can check out olaFlow and the wavemakerFlume tutorial : https://github.com/phicau/olaFlow/tr...wavemakerFlume. This would be the "cleanest" way to do it. If you are doing coastal engineering, olaFlow is great and has lots of great tools. You may want to check out IHFoam as well.

If you don't want to use olaFlow, here is what I have tried. I'm using OpenFOAM v2006.

EDIT : My original post did not reproduce the piston movement properly. I edited the right way to do it.

Here is an overview of all the steps I did:

1. You need a file (.dat, .csv...) that contains the irregular motion of the piston. The irregular motion is usually generated from a theoretical spectrum (in my case, JONSWAP). This file has to be formatted in the following way:

Code:
(
    //Format (time   (displacement_x displacement_y displacement_z))
    (0.0     (0.0          0 0))
    (0.005 (0.000112 0 0))
    (0.01   (0.000229 0 0))
    (0.015 (0.000351 0 0)) 
    (0.02   (0.000476 0 0))
    (0.025 (0.000606 0 0))
    (0.03   (0.000739 0 0))
    (0.035 (0.000876 0 0))

    // etc...
    //go until (tfinal (x_final y_final z_final))

  );
The sample above moves the piston along the x axis. Depending, on your geometry, you may need to adjust the file.

A few additional things:

- tfinal has to be equal or greater than your simulation time.

- The timestep between each entry doesn't really matter, because the values will be interpolated. For example, if your simulation happens at t = 0.0075, the motion will be interpolated from the values given at 0.005 and 0.01. Still, make sure the timestep between each entry is small enough so that interpolated values would still follow the irregular motion you want to achieve.

2. Copy the waveMakerPiston case from $FOAM_TUTORIALS/multiphase/interFoam/laminar/waves/waveMakerPiston


Code:
cp -r $FOAM_TUTORIALS/multiphase/interFoam/laminar/waves/waveMakerPiston .
3. Edit the pointDisplacement file in your 0.orig folder to the following :

Code:
leftwall
    {
        type              uniformFixedValue;
        uniformValue tableFile;
        file                "meshMotionData.dat"; //Path to your file
        outOfBounds   clamp;
    }
The dynamicMesh solver displacementLaplacian needs to be told which points in the mesh have to be moved and how. This is where you tell displacementLaplacian to move your piston according to the motion you gave in your own file. Mine is named "meshMotionData.dat" and is located in my case directory, i.e. in the same folder as constant, system and 0.orig. Adjust the path to your own file accordingly.

This should do the trick. Let me know if you would like more information on how to generate the irregular motion data file, or anything else you can think of that is unclear. Happy to help.


Cheers,


Victor
Hi Victor,

I'm using olaFlow to do coastal engineering as well but I have a question about the pointDisplacement.

AFAIK, the .dat file contains the rigid movement of the whole boundary. However, I want to add specific displacement on different mesh nodes on the boundary (like the figure in the attachment). How can I specify the nodes and how to give them different displacements?

Thank you in advance!
Attached Images
File Type: jpg mesh deformation on the boundary.jpg (27.2 KB, 39 views)
Stan Zhou is offline   Reply With Quote

Old   May 18, 2021, 04:32
Default
  #5
New Member
 
Victor Baconnet
Join Date: Apr 2021
Location: Cannes, France
Posts: 9
Rep Power: 5
victor13165 is on a distinguished road
Hello!

Can the motion of each point be described by a mathematical function? For example, if it's a wave it would be something like cos(wt - kx)?

If that is the case, you can refer to this tutorial https://www.youtube.com/watch?v=C1NCtBJ0BtM. It uses swak2Foam and groovyBC boundary conditions.



EDIT : This tutorial https://www.youtube.com/watch?v=3zcTxGHxuok might be easier to understand. It uses the codedFixedValue and doesn't require you to download anything.


However, if you want to give an individual motion to each cell point, I have to say I don't know how that can be done.

I would love to get more information on what you are trying to do and about the motion you are trying to input on the nodes.

Cheers,

Victor
victor13165 is offline   Reply With Quote

Old   May 18, 2021, 04:50
Default
  #6
Member
 
Haoran Zhou
Join Date: Nov 2019
Posts: 49
Rep Power: 7
Stan Zhou is on a distinguished road
Quote:
Originally Posted by victor13165 View Post
Hello!

Can the motion of each point be described by a mathematical function? For example, if it's a wave it would be something like cos(wt - kx)?

If that is the case, you can refer to this tutorial https://www.youtube.com/watch?v=C1NCtBJ0BtM. It uses swak2Foam and groovyBC boundary conditions.

However, if you want to give an individual motion to each cell point, I have to say I don't know how that can be done.

I would love to get more information on what you are trying to do and about the motion you are trying to input on the nodes.

Cheers,

Victor
Hi Victor,

I've seen this video and it's not what I really need. I am trying to do partitioned FSI coupling by adopting OpenFOAM (fluid solver) and our in-house solver (solid solver). Recently I found a useful library called "preCICE" which is able to do CHT and FSI coupling. It employs ALE method to make the mesh nodes on the interface move according to the displacement increment obtained from the solid solver (https://precice.discourse.group/t/fs...e-solver/522/5). Since this mesh deformation is managed in OpenFOAM rather than preCICE, I've been searching for more details about pointDisplacement but I hardly get some helpful information.

If you're interested in partitioned coupling, you can go to this link https://precice.org to check it out.

Best regards,

Stan
Stan Zhou is offline   Reply With Quote

Old   May 18, 2021, 04:54
Default
  #7
New Member
 
Victor Baconnet
Join Date: Apr 2021
Location: Cannes, France
Posts: 9
Rep Power: 5
victor13165 is on a distinguished road
Hi Stan,
Very cool stuff! I will definitely check it out for my personal projects.
Maybe someone knows the appropriate tools for this.


Cheers and good luck,

Victor
victor13165 is offline   Reply With Quote

Old   February 11, 2023, 16:07
Default Irregular motion data file
  #8
New Member
 
Freddie Lawie
Join Date: Feb 2023
Posts: 1
Rep Power: 0
FreddieLawie is on a distinguished road
Quote:
Originally Posted by victor13165 View Post
Hello,

This is a bit of a late answer, but maybe it can help somebody else.

You can check out olaFlow and the wavemakerFlume tutorial : https://github.com/phicau/olaFlow/tr...wavemakerFlume. This would be the "cleanest" way to do it. If you are doing coastal engineering, olaFlow is great and has lots of great tools. You may want to check out IHFoam as well.

If you don't want to use olaFlow, here is what I have tried. I'm using OpenFOAM v2006.

EDIT : My original post did not reproduce the piston movement properly. I edited the right way to do it.

Here is an overview of all the steps I did:

1. You need a file (.dat, .csv...) that contains the irregular motion of the piston. The irregular motion is usually generated from a theoretical spectrum (in my case, JONSWAP). This file has to be formatted in the following way:

Code:
(
    //Format (time   (displacement_x displacement_y displacement_z))
    (0.0     (0.0          0 0))
    (0.005 (0.000112 0 0))
    (0.01   (0.000229 0 0))
    (0.015 (0.000351 0 0)) 
    (0.02   (0.000476 0 0))
    (0.025 (0.000606 0 0))
    (0.03   (0.000739 0 0))
    (0.035 (0.000876 0 0))

    // etc...
    //go until (tfinal (x_final y_final z_final))

  );
The sample above moves the piston along the x axis. Depending, on your geometry, you may need to adjust the file.

A few additional things:

- tfinal has to be equal or greater than your simulation time.

- The timestep between each entry doesn't really matter, because the values will be interpolated. For example, if your simulation happens at t = 0.0075, the motion will be interpolated from the values given at 0.005 and 0.01. Still, make sure the timestep between each entry is small enough so that interpolated values would still follow the irregular motion you want to achieve.

2. Copy the waveMakerPiston case from $FOAM_TUTORIALS/multiphase/interFoam/laminar/waves/waveMakerPiston


Code:
cp -r $FOAM_TUTORIALS/multiphase/interFoam/laminar/waves/waveMakerPiston .
3. Edit the pointDisplacement file in your 0.orig folder to the following :

Code:
leftwall
    {
        type              uniformFixedValue;
        uniformValue tableFile;
        file                "meshMotionData.dat"; //Path to your file
        outOfBounds   clamp;
    }
The dynamicMesh solver displacementLaplacian needs to be told which points in the mesh have to be moved and how. This is where you tell displacementLaplacian to move your piston according to the motion you gave in your own file. Mine is named "meshMotionData.dat" and is located in my case directory, i.e. in the same folder as constant, system and 0.orig. Adjust the path to your own file accordingly.

This should do the trick. Let me know if you would like more information on how to generate the irregular motion data file, or anything else you can think of that is unclear. Happy to help.


Cheers,


Victor


Hi,

I'm trying to do something similar to this - creating a .dat file to specify the piston motion. How did you generate the file for the JONSWAP spectrum?

Thanks,

Freddie
FreddieLawie is offline   Reply With Quote

Old   January 19, 2024, 07:28
Default
  #9
Senior Member
 
IHFOAM Team's Avatar
 
IHFOAM The Environmental Hydraulics Institute "IHCantabria"
Join Date: Sep 2017
Location: Santander (Spain)
Posts: 120
Rep Power: 9
IHFOAM Team is on a distinguished road
HI Jonas

Quote:
Originally Posted by Jonas_cfd View Post
I'm trying to understand the "WavePistonMaker" tutorial (OF_19.12). where can I find documentation about it?
You can find all the equations in this great book: https://www.worldscientific.com/worl...54#t=aboutBook

(Chapter 7)

Best,
IHFOAM Team
__________________
http://ihfoam.ihcantabria.com/
IHFOAM Team is offline   Reply With Quote

Reply

Tags
focus waves, irregular waves, openfoam, piston motion, wavemaker


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
Getting Started with OpenFOAM wyldckat OpenFOAM 26 June 21, 2024 07:54
generate Waves in openfoam anon_c OpenFOAM 30 November 16, 2016 02:48
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 12:50
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55


All times are GMT -4. The time now is 22:52.