
[Sponsors] 
November 19, 2021, 05:40 

#261 
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 18 
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 14 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 

November 19, 2021, 09:42 

#262  
Senior Member

Quote:
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; } } 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; } } 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; } } Code:
dimensions [0 2 2 0 0 0 0]; internalField uniform 0.00000001; boundaryField { "cylinder.*" { type kqRWallFunction; value uniform 1e8; } "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; } } 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; } } 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; } } 

November 25, 2021, 17:36 

#263 
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 18 
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 14 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 

December 1, 2021, 06:20 

#264  
Senior Member

Quote:
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, 

May 19, 2022, 12:07 

#265 
New Member
AUbuntu
Join Date: Oct 2021
Posts: 6
Rep Power: 3 
Dear Pablo,
I am trying to validate the solitary wave generated by olaFlow with theory. η(t,x)=H 〖sech〗^2 (κ (xCt)) 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 (κ (xCtT/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 

May 26, 2022, 10:44 

#266 
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 18 
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 

June 30, 2022, 11:59 

#267 
New Member
Peicen Wang
Join Date: Nov 2021
Location: Shenzhen, China
Posts: 4
Rep Power: 3 
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 : _7bdb50949420201222 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 runtime modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20) allowSystemOperations : Allowing usersupplied 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 Phase1 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 Phase1 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.76728e07, global = 1.09967e19, cumulative = 1.09967e19 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) Then I tested the tutorial 'baseWaveFlume' which was not using the extendedRangeAWA model in Ubuntu 20.04 system(OpenFOAMv2012). 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 22:29. 

August 26, 2022, 08:16 

#268  
New Member
Tianqi Ma
Join Date: Nov 2018
Posts: 1
Rep Power: 0 
Quote:
Did you solve the problem? I also have the same problem as you posted. The wave elevations at some locations are irregular. Thanks 

Tags 
generation, ihfoam, olafoam, waves 
Thread Tools  Search this Thread 
Display Modes  


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 7, 2019 23:34 
udf problem  jane  Fluent UDF and Scheme Programming  37  February 20, 2018 04:17 
UDF velocity profile  willroca  Fluent UDF and Scheme Programming  2  January 10, 2016 03:13 
Error messages  atg  enGrid  7  August 30, 2013 11:16 
Phase locked average in run time  panara  OpenFOAM  2  February 20, 2008 14:37 