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

[OLAFLOW] The OLAFOAM Thread

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2021, 06:40
Default
  #261
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 17
Phicau is on a distinguished road
Hi Qi Yang,
Yes, forward means waves and current travel in the X+ direction. Backward means waves travel in X+ and current in X-.
There are 3 places that you need to monitor to set the current: 0/U for the absorption boundary, constant/waveDict for the wave generation boundary and (optional) system/setFields to set the initial condition. All need to be consistent.

A very easy way to proceed is to run the currentWaveFlume tutorial included in olaFlow. Start by running the case conditions that are closer to what you want to obtain (select options 1-4 in the runCase script). Then kill the simulation and study how the files look like. Finally, adapt the case to your particular needs.

Your numerical setup seems to have some issues. Probably you selected a wrong BC or configuration, since the water level seems to increase with time in your simulation. Note that this does not happen if you set everything correctly (as is in the currentWaveFlume tutorial). I have compared the pressure for the cases with waves only (red line) and waves + forward and waves + backward currents (red lines) and the results are perfect.

Best,
Pablo
Attached Images
File Type: jpg forward_current.jpg (60.4 KB, 22 views)
File Type: jpg backward_current.jpg (60.9 KB, 18 views)
__________________
Check out my new project: olaFlow --> The olaFlow Support Thread
Phicau is offline   Reply With Quote

Old   November 19, 2021, 10:42
Default
  #262
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 164
Rep Power: 5
qi.yang@polimi.it is on a distinguished road
Quote:
Originally Posted by Phicau View Post
Hi Qi Yang,
Yes, forward means waves and current travel in the X+ direction. Backward means waves travel in X+ and current in X-.
There are 3 places that you need to monitor to set the current: 0/U for the absorption boundary, constant/waveDict for the wave generation boundary and (optional) system/setFields to set the initial condition. All need to be consistent.

A very easy way to proceed is to run the currentWaveFlume tutorial included in olaFlow. Start by running the case conditions that are closer to what you want to obtain (select options 1-4 in the runCase script). Then kill the simulation and study how the files look like. Finally, adapt the case to your particular needs.

Your numerical setup seems to have some issues. Probably you selected a wrong BC or configuration, since the water level seems to increase with time in your simulation. Note that this does not happen if you set everything correctly (as is in the currentWaveFlume tutorial). I have compared the pressure for the cases with waves only (red line) and waves + forward and waves + backward currents (red lines) and the results are perfect.

Best,
Pablo
Thank you for your reply, Pablo. I am simulating wave-current-pile interation. I put my boundary conditions here and also attached the whole simulation files. Could you please give me a look?

alpha.water
Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    	"cylinder.*" 
	{
		type	zeroGradient;
		
	}
    
    
    "inlet.*"
    {
        type            waveAlpha;
        waveDictName    waveDict;
        value           uniform 0;
    }
    "sides.*" //frontAndBack
    {
        type            symmetry;//empty;
    }
    "outlet.*"
    {
        type            zeroGradient;
    }
    "ground.*"//bottom
    {
        type            zeroGradient;
    }
    "top.*"//atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
}
p_rgh
Code:
dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    	"cylinder.*"
	{
	type		fixedFluxPressure;
	value		uniform 0;

	}
    
    
    
    "sides.*"//frontAndBack
    {
        type            symmetry;//empty;
    }
    "outlet.*" 
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
    "inlet.*" 
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
    "ground.*"//bottom
    {
        type            fixedFluxPressure;
        value           uniform 0;
    }
    "top.*"//atmosphere 
    {
        type            totalPressure;
        U               U;
        phi             phi;
        rho             rho;
        psi             none;
        gamma           1;
        p0              uniform 0;
        value           uniform 0;
    }
}
U
Code:
dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
        "cylinder.*"
	{
		type	fixedValue;
		value	uniform (0 0 0);


	}  
    
    
    "inlet.*"
    {
        type            waveVelocity;
        uCurrent        (0 0 0);
        value           uniform (0 0 0);
    }
    "outlet.*"
    {
        type            waveAbsorption3DVelocity;
        value           uniform (0 0 0);
    }
    "ground.*"//bottom
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    "top.*"//atmosphere
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    "sides.*"//frontAndBack
    {
        type    symmetry;//            empty;
    }
}
k
Code:
dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.00000001;

boundaryField
{
   	"cylinder.*"
{
type	kqRWallFunction;
value	uniform 1e-8;

}
   
   
    "inlet.*"
    {
        type            inletOutlet;
        inletValue	    uniform 0.00000001;
        value           uniform 0.00000001;
    }
   "outlet.*"
    {
        type            inletOutlet;
        inletValue	    uniform 0.00000001;
        value           uniform 0.00000001;
    }
    "top.*"//atmosphere
    {
        type            inletOutlet;
        inletValue	    uniform 0.00000001;
        value           uniform 0.00000001;
    }
    "sides.*"//frontAndBack
    {
        type      symmetry;//            empty;
    }
    "ground.*"//bottom
    {
        type            kqRWallFunction;
        value           uniform 0.00000001;
    }
}
omega
Code:
dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 0.001;

boundaryField
{
    
    	"cylinder.*"
{
type	omegaWallFunction;
value	uniform 0.001;

}
    
    
    "inlet.*"
    {
        type            inletOutlet;
        inletValue	    uniform 0.001;
        value           uniform 0.001;
    }
    "outlet.*"
    {
        type            inletOutlet;
        inletValue	    uniform 0.001;
        value           uniform 0.001;
    }
    "top.*"//atmosphere
    {
        type            inletOutlet;
        inletValue	    uniform 0.001;
        value           uniform 0.001;
    }
    "sides.*"//frontAndBack
    {
        type    symmetry;//            empty;
    }
    "ground.*"//bottom
    {
        type            omegaWallFunction;
        value           uniform 0.001;
    }
}
nut
Code:
dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    
    	"cylinder.*"
	{
	type nutkWallFunction;
	value	uniform 0;
	}
    
    
    "inlet.*"
    {
        type            zeroGradient;
    }
    "outlet.*"
    {
        type            zeroGradient;
    }
    "top.*"//atmosphere
    {
        type            calculated;
        value           uniform 0;
    }
    "sides.*"//frontAndBack
    {
        type     symmetry;//       empty;
    }
    "ground.*"//bottom
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
}
Attached Files
File Type: zip system.zip (7.8 KB, 0 views)
File Type: zip 0.org.zip (4.5 KB, 0 views)
File Type: zip constant.zip (2.7 KB, 2 views)
qi.yang@polimi.it is offline   Reply With Quote

Old   November 25, 2021, 18:36
Default
  #263
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 17
Phicau is on a distinguished road
Hi Qi Yang,
Please follow my advice and start simple. 2D, no structure first, when it works, it is easy to extend to 3D and add the cylinder(s). -> A very easy way to proceed is to run the currentWaveFlume tutorial included in olaFlow. Start by running the case conditions that are closer to what you want to obtain (select options 1-4 in the runCase script). Then kill the simulation and study how the files look like. Finally, adapt the case to your particular needs.

At a first glance:
- The current should not be set to 0 in 0/U/inlet, it will be read from waveDict.
- You should use waveAbsorption2DVelocity instead and set the current at the outlet.

Best,
Pablo
__________________
Check out my new project: olaFlow --> The olaFlow Support Thread
Phicau is offline   Reply With Quote

Old   December 1, 2021, 07:20
Default
  #264
Senior Member
 
kimy
Join Date: Mar 2019
Posts: 164
Rep Power: 5
qi.yang@polimi.it is on a distinguished road
Quote:
Originally Posted by Phicau View Post
Hi Qi Yang,
Please follow my advice and start simple. 2D, no structure first, when it works, it is easy to extend to 3D and add the cylinder(s). -> A very easy way to proceed is to run the currentWaveFlume tutorial included in olaFlow. Start by running the case conditions that are closer to what you want to obtain (select options 1-4 in the runCase script). Then kill the simulation and study how the files look like. Finally, adapt the case to your particular needs.

At a first glance:
- The current should not be set to 0 in 0/U/inlet, it will be read from waveDict.
- You should use waveAbsorption2DVelocity instead and set the current at the outlet.

Best,
Pablo
Dear Pablo,

Thanks for your suggestions. In fact, I reduced the domain length and the cells and I got the logical results. Do you think they are reasonable? The plot is the dynamic wave pressure at the bottom.

Bests,
Attached Images
File Type: png result.png (85.9 KB, 22 views)
qi.yang@polimi.it is offline   Reply With Quote

Old   May 19, 2022, 13:07
Default
  #265
New Member
 
AUbuntu
Join Date: Oct 2021
Posts: 5
Rep Power: 3
AUbuntu is on a distinguished road
Dear Pablo,

I am trying to validate the solitary wave generated by olaFlow with theory.
η(t,x)=H 〖sech〗^2 (κ (x-Ct))

In theory we have the below equation.

T= 2h/C √(4h/3H) (3.8+H/h)

for the period of the solitary wave.

So I used T/2 to shift the theory equation to match with the start of the simulation.

η(t,x)=H 〖sech〗^2 (κ (x-Ct-T/2))

but there is a phase difference between the results and I don't know how to justify it!

Could you please let me know how I can fix this.
Kind regards,
Amir
AUbuntu is offline   Reply With Quote

Old   May 26, 2022, 11:44
Default
  #266
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 17
Phicau is on a distinguished road
Hi Kimi,
Please refer to my previous post in which I showed you the time series already.

Hi Amir,
Wave period for a solitary wave is not defined in a universal way. Please check the source code for the definition in olaFlow: 4.0*PII/sqrt(3)*h/sqrt(H/h), that is probably the source of your phase difference.

Best,
Pablo
AUbuntu likes this.
__________________
Check out my new project: olaFlow --> The olaFlow Support Thread
Phicau is offline   Reply With Quote

Old   June 30, 2022, 12:59
Default
  #267
New Member
 
Peicen Wang
Join Date: Nov 2021
Location: Shenzhen, China
Posts: 3
Rep Power: 2
pcwang is on a distinguished road
Hello Pablo,

I've tried to run the tutorial case 'baseWaveFlumeNewAbs' from 'Dev' branch. I've not change anything of this tutorial case, and only run the './runCase' script.

When this script execute the line 'olaFlow > olaFlow.log', the terminal outputs some errors, and olaFlow couldn't work well:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _7bdb509494-20201222 OPENFOAM=2012 patch=210414
Arch   : "LSB;label=32;scalar=64"
Exec   : olaFlow
Date   : Jun 30 2022
Time   : 23:11:43
Host   : hpws13
PID    : 12794
I/O    : uncollated
Case   : /home/wpc/wpcdata/baseWaveFlumeNewAbs
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh staticFvMesh

PIMPLE: Operating solver in PISO mode

Reading field porosityIndex

Porosity NOT activated

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
Selecting laminar stress model Stokes

Reading g

Reading hRef
Calculating field g.h

No MRF models present

No finite volume options present
DICPCG:  Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop

Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 0.00119048
Time = 0.00119048

PIMPLE: iteration 1
MULES: Solving for alpha.water
alpha.water BC on patch inlet

Wave Generation BC
Wave theory: StokesI
H: 10
T: 5
h: 130.156
L: 39.0327
Direction: 0?
Generation in: Deep waters.
Relative depth (kh): 20.9515


Phase-1 volume fraction = 0.765625  Min(alpha.water) = 0  Max(alpha.water) = 1
alpha.water BC on patch inlet
MULES: Solving for alpha.water
alpha.water BC on patch inlet
Phase-1 volume fraction = 0.765625  Min(alpha.water) = 0  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 1, Final residual = 0.0281341, No Iterations 2
time step continuity errors : sum local = 6.76728e-07, global = 1.09967e-19, cumulative = 1.09967e-19
DICPCG:  Solving for p_rgh, Initial residual = 0.013655, Final residual = 0.000664405, No Iterations 20
Velocity BC on patch inlet

Wave Generation BC
Wave theory: StokesI
H: 10
T: 5
h: 130.156
L: 39.0327
Direction: 0?
Generation in: Deep waters.
Relative depth (kh): 20.9515


Active wave absorption BC on patch outlet
"Initial water depths for absorption" 1( 130.156 )

Selecting active wave absorption model extendedRangeAWA
AWA model: patch outlet
    Theory: extendedRangeAWA
    Number of paddles: 1
    Reference water depth: 1(130.156)
    Wave period: 5
Updating extendedRangeAWA absorption model for patch outlet
double free or corruption (out)
My OpenFOAM version is v2012, and my system version is Ubuntu 20.04. It is puzzling that when I ran this tutorial in my VMware virtual machine, everything went well. In my virtual machine, the OpenFOAM version is also v2012, but the system version is Ubuntu 18.04.

Then I tested the tutorial 'baseWaveFlume' which was not using the extendedRangeAWA model in Ubuntu 20.04 system(OpenFOAM-v2012). And olaFlow worked very well. So I think there are no errors when I compiled the olaFlow codes.

This error confused me a few days. Is this something to do with the system version that I am using to run ?

Hope for your answer.

Thanks

Peicen

Updated in July 1st 2022, 10:30 :

This morning, I tried the tutorial case 'baseWaveFlumeNewAbs' in other work station whose system version is CentOS 7.9.2009 and OpenFOAM version is also v2012, and this tutorial runs very well. So I think there must be some difference between these work stations.

Last edited by pcwang; June 30, 2022 at 23:29.
pcwang is offline   Reply With Quote

Old   August 26, 2022, 09:16
Default
  #268
New Member
 
Tianqi Ma
Join Date: Nov 2018
Posts: 1
Rep Power: 0
Tianqi Ma is on a distinguished road
Quote:
Originally Posted by abas.rahmani86 View Post
hi pablo
I have a problem with simulating wave with period less than 3 sec by olafoam
I try to simulate a flume without any structure and get a regular wave in it
but after 30 second i see irregularity in wave.the photo show wave gage at 3,8 and 12 meter from begining of flume(wave maker).I attach source file too.
wave period=1.67 sec
wave height=0.175 m
water depth=0.8 m
I really confuse because i change every parameter for it.
do you meet this ever?
many thanks for your reply Pablo.
abas rahmani
[/IMG]
[/IMG]
[/IMG]
Hi Abas,

Did you solve the problem? I also have the same problem as you posted. The wave elevations at some locations are irregular.

Thanks
Tianqi Ma is offline   Reply With Quote

Reply

Tags
generation, ihfoam, olafoam, waves

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Divergence detected in AMG solver: k when udf loaded google9002 Fluent UDF and Scheme Programming 3 November 8, 2019 00:34
udf problem jane Fluent UDF and Scheme Programming 37 February 20, 2018 05:17
UDF velocity profile willroca Fluent UDF and Scheme Programming 2 January 10, 2016 04:13
Error messages atg enGrid 7 August 30, 2013 12:16
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37


All times are GMT -4. The time now is 18:46.