Difference between revisions of "TestPhicau"
(→Wave Generation Dictionary) |
(→Wave Generation BCs) |
||
Line 220: | Line 220: | ||
* Correction velocity applied in the ''absDir'' direction. When not set or set greater than 360, it defaults the perpendicular direction to the boundary. See the first [[#References_and_Citing | reference]] for a complete explanation on when it is convenient to set ''absDir''. | * Correction velocity applied in the ''absDir'' direction. When not set or set greater than 360, it defaults the perpendicular direction to the boundary. See the first [[#References_and_Citing | reference]] for a complete explanation on when it is convenient to set ''absDir''. | ||
* You can select ''nPaddles'' greater than 1 to obtain a better directional absorption. | * You can select ''nPaddles'' greater than 1 to obtain a better directional absorption. | ||
+ | |||
+ | ==== Wave Formulae Form ==== | ||
+ | All the waves in IHFOAM are generated in a similar way to the following implementation (Stokes I): | ||
+ | |||
+ | <math>\eta = \frac{H}{2} cos \left( k_x x + k_y y - \omega t + \psi \right)</math> | ||
+ | |||
+ | This means that the free surface elevation (eta) is dependent of the patch location. If you want to keep the phase meaningful I would recommend you to locate the wave generation patch at X = 0. | ||
=== Wave Absorption BCs === | === Wave Absorption BCs === |
Revision as of 11:07, 14 July 2014
IHFOAM is a set of solvers and boundary conditions to generate and absorb water waves actively at the boundaries and to simulate their interaction with porous coastal structures.
The main scope of these modelling tools is coastal, marine, hydraulic and offshore engineering.
Contents
1 IHFOAM Overview
The IHFOAM package includes:
- Individual boundary conditions for wave generation and active wave absorption for alpha1 and U fields. (libIHwaveGeneration.so)
- IH_Waves_InletAlpha
- IH_Waves_InletVelocity
- Boundary conditions for pure wave absorption applicable to U field. Based on 2D or 3D theories, both are applicable to 3D cases. (libIHwaveAbsorption.so)
- IH_3D_3DAbsorption_InletVelocity
- IH_3D_2DAbsorption_InletVelocity
- Solvers to be used with your favourite version of OpenFOAM or FOAM-extend. See compatibility below.
- ihFoam
- ihDyMFoam
- Brief reference manual
- Tutorials and validation cases
1.1 About IHFOAM solvers
ihFoam and ihDyMFoam solve two-phase incompressible flows within porous media by means of the VARANS (Volume-Averaged Reynolds-Averaged Navier-Stokes) equations. More information will be added, in the mean time check the references.
Both solvers are derived from interFoam and interDyMFoam. Furthermore, outside the porous media, the VARANS equations are identical to the classic RANS. Therefore, ihFoam and ihDyMFoam can be used instead of interFoam and interDyMFoam even when the case presents no porous zones.
1.2 Supported Versions
Known issues:
- everything works when you compile this version from source, as there is a problem with the precompiled installable pack. Reference [1].
- Otherwise:
- The solvers (even the regular version of interFoam) need to include "-linterfaceProperties" to compile.
- IHFOAM solvers compile and work. Despite the BCs being included, apparently they are not linked, as they are not recognized.
- If the boundary conditions are included dynamically in controlDict and used with the IHFOAM solvers, turbulence modelling does not work.
- Otherwise:
- the boundary conditions compile and work.
- No IHFOAM solver is included, as we are experiencing severe problems with pressure calculations (not linked in any way to IHFOAM implementation) in this version. We are preparing an extensive bug report for the OpenFOAM developers. In the mean time we suggest you stay with prior OpenFOAM versions.
- Should you want to use wave generation and absorption, see below how to link the boundary conditions dynamically in controlDict.
1.3 Ongoing Development
- The current version is 2.0, as released in 15th July 2014.
- Bug fixes will be issued on a regular basis, while the development of version 3.0 is currently ongoing.
- The new version will include major changes in the structure of the boundary conditions, which will not affect the use.
Future releases will include:
- Volume-averaged turbulence models, as seen in the third paper.
- Current generation (already pre-implemented but not referenced, as it needs further work and validation).
- Wave theories implemented as classes, gathered by an autoPtr.
Future releases may include:
- Custom IHdynamicRefineFvMesh to enable dynamic mesh refinement on snappyHexMesh-generated meshes, as seen in the fourth paper.
- Custom boundary condition to generate waves using moving boundaries, as presented in OFW9.
1.4 References and Citing
IHFOAM is a product developed in the frame of a Master and PhD Thesis at the Environmental Hydraulics Institute "IH Cantabria" of the University of Cantabria. The implementation and validation details are published in the following references:
Realistic wave generation and active wave absorption for Navier-Stokes models: Application to OpenFOAM. Higuera, P., Lara, J.L. and Losada, I.J. (2013) Coastal Engineering, Vol. 71, pp. 102-118.
Simulating coastal engineering processes with OpenFOAM. Higuera, P., Lara, J.L. and Losada, I.J. (2013) Coastal Engineering, Vol. 71, pp. 119-134.
Three-dimensional interaction of waves and porous coastal structures using OpenFOAM. Part I: Formulation and validation. Higuera, P., Lara, J.L. and Losada, I.J. (2014) Coastal Engineering, Vol. 83, pp. 243-258
Three-dimensional interaction of waves and porous coastal structures using OpenFOAM. Part II: Application. Higuera, P., Lara, J.L. and Losada, I.J. (2014) Coastal Engineering, Vol. 83, pp. 243-258
1.5 Get Connected
To submit your feedback, suggestions, bugs... you have many options:
- The IHFOAM mail, found here.
- The IHFOAM LinkedIn group.
- At cfd-online forum, username Phicau.
IHFOAM at cfd-online
- IHFOAM Release Thread ---- CREATE and LINK
- IHFOAM Support Thread ---- CREATE and LINK
You can be informed and get all the latest news by joining our mailing list ---- LINK
2 Source Download and Compilation
IHFOAM download site can be found here.
2.1 Source Code Download
You can find IHFOAM in GitHub
To download the source code run the following command:
git clone git://github.com/phicau/IHFOAM.git
Code updates can be downloaded in the future as follows:
git checkout git pull
2.2 Source Code Structure
IHFOAM source code is divided in two main folders:
- genAbs --> Generation and absorption boundary conditions
- waveAbsorption --> (BCs)
- waveGeneration --> (BCs)
- common --> Scripts shared by both BCs
- solvers --> Guess what's inside...
- ihFoamXXXXX --> One for each compatible version, including ihFoam and ihDyMFoam
2.3 Compilation
Compilation has been automatized and needs to be performed only once. Since IHFOAM does not need any dependencies, the source code can be downloaded and compiled anywhere on your computer.
- First compile the boundary conditions:
cd genAbs ./allMake
The script will figure out which version of OpenFOAM or FOAM-extend you are running and set a convenient preprocessor statement to adjust the code automatically to each flavour/version.
- Second compile the solvers: ihFoam and ihDyMFoam
cd solvers/ihFoamXXXXX ./allMake
Where XXXXX denotes your flavour (OpenFOAM - OF, FOAM-extend - FE) and your version. The currently supported versions have already been shown.
2.4 Dynamic Linking of the Boundary Conditions
In order to include the wave generation and active wave absorption boundary conditions without needing to re-compile a solver, write the following code in controlDict:
libs ( "libIHwaveGeneration.so" "libIHwaveAbsorption.so" );
3 IHFOAM Usage
IMPORTANT NOTES:
- IHFOAM is programmed in such a way that gravity has to act in the negative Z direction.
- Currently the X and Y coordinates of each boundary face are substituted by those of the centroid of the paddle to which the face belongs (similarly to what happens in the laboratory). Therefore, to obtain accurate directionality you need several paddles (nPaddles >> 1). Next releases will change the implementation so you can choose.
- Angles such as waveDir and absDir are measured in degrees with respect to the positive X axis (0º), growing towards the positive Y axis (90º).
3.1 Wave Generation BCs
To generate waves you have to set the following boundary conditions.
For alpha1:
inlet { type IH_Waves_InletAlpha; waveDictName IHWavesDict; value uniform 0; }
For U:
inlet { type IH_Waves_InletVelocity; waveDictName IHWavesDict; value uniform (0 0 0); }
3.1.1 Wave Generation Dictionary
- The wave conditions are read from a dictionary file located in the constant folder.
- By default it is named IHWavesDict, however, you can name it differently setting waveDictName.
- This way you can even specify different wave conditions for different patches on your case.
All the options are gathered in the figure on the right. The rectangles indicate the different parameters and the rounded boxes denote the options available. A complete showcase for the different wave theories can be found in the reference/IHWavesDict folder.
Implemented wave theories:
waveType / waveTheory | Reference | Comments |
---|---|---|
regular / StokesI | Dean and Dalrymple (1991) | |
regular / StokesII | Dean and Dalrymple (1991) | |
regular / StokesV | Skjelbreia and Hendrickson (1960) | |
regular / cnoidal | Svendsen (2006) | |
regular / streamfunction | Fenton (1988) | No solver programmed. Use Fenton's Fourier solver (old version tested only, distributed with the materials) to set all the parameters required. |
solitary / Boussinesq | Lee et al. (1982) | |
wavemaker / (tx/tv/txeta/tveta) | Own development | waveTheory depending on what you provide: t (time series), x (paddle displacement), eta (free surface elevation). Note that this BC replicates the wavemaker (constant) profile, but it does not move. |
irregular / () | Dean and Dalrymple (1991) | Linear summation of StokesI components. Second order by Longuet-Higgins and Stewart (1960) completed with Baldock et al. (1996) |
Active wave absorption can be connected on the wave generation boundary so that waves incident to it flow out while still generating the target waves. If no other boundary is absorbing it sould be connected, to avoid a mean water level increase due to the stokes drift.
- Controlled by genAbs bool variable: true/false
- Correction velocity applied in the absDir direction. When not set or set greater than 360, it defaults the perpendicular direction to the boundary. See the first reference for a complete explanation on when it is convenient to set absDir.
- You can select nPaddles greater than 1 to obtain a better directional absorption.
3.1.2 Wave Formulae Form
All the waves in IHFOAM are generated in a similar way to the following implementation (Stokes I):
This means that the free surface elevation (eta) is dependent of the patch location. If you want to keep the phase meaningful I would recommend you to locate the wave generation patch at X = 0.
3.2 Wave Absorption BCs
Why pure active wave absorption conditions when wave generation already includes it? Pure active wave absorption, disregarding wave generation, allows a more sofisticated treatment and better performance.
To absorb waves you have to set the following boundary condition for U. This time nothing is read from a dictionary, so everything is set at the boundary condition level. The default values are shown, so the parameters that need no different value can be left out.
2D-theory version, applicable to 2D/3D:
outlet { type IH_3D_2DAbsorption_InletVelocity;; nPaddles 1; nEdgeMin 0; nEdgeMax 0; absorptionDir 400; value uniform (0 0 0); }
- absorptionDir can be used to obtain Quasi-3D behaviour (see the first reference). Its default value is greater than 360, so absorption is applied to the perpendicular direction to the patch.
3D-theory version, applicable to 3D:
outlet { type IH_3D_3DAbsorption_InletVelocity;; nPaddles 1; nEdgeMin 0; nEdgeMax 0; value uniform (0 0 0); }
The differences between both are explained in the first reference. If you are unsure whether to use the 2D or 3D version, use the 2D, as its range of applicability is wider.
Similarly to wave generation, setting nPaddles > 1 will allow directional absorption, as each paddles (vertical slices of the patch) absorbs the waves independently. For stability reasons try to keep your paddles approximately 5 cells wide at least.
- The patch is splitted in nPaddles vertical transects according to its orientation
- If it is more perpendicular to the X axis, it uses the Y coordinates to divide the patch in nPaddles between YMin and YMax. nEdgeMin starts to count from YMin. nEdgeMax starts to count from YMax.
- If it is more perpendicular to the Y axis, it uses the X coordinates to divide the patch in nPaddles between XMin and XMax. nEdgeMin starts to count from XMin. nEdgeMax starts to count from XMax.
- nEdgeMin and nEdgeMax solve some issues that appear on the corners, selecting a number of paddles that are only capable of taking water out according to the 2D theory.
4 IHFOAM Documentation and Tutorials
aaa