Ship Hull Response In cylBumpInterIbFoam Tutorialhani/kurser/OS_CFD_2016/... · • Introduce...
Transcript of Ship Hull Response In cylBumpInterIbFoam Tutorialhani/kurser/OS_CFD_2016/... · • Introduce...
-
Ship Hull Response In cylBumpInterIbFoam Tutorial
Mohsen Irannezhad
Marine Technology/Naval Architecture,
Chalmers University of Technology,
Gothenburg, Sweden
2016-12-08
-
1. Introduction
2. Theory
• Immersed Boundary Method
• IBM boundary conditions
• IBM in FOAM-extend
3. Test Case
• Idea formation
• Workflow
• cylBumpInterIbFoam tutorial modification
4. Results and Discussion
• wave patterns
• Future work
-
Introduction
Fluid Flow Around An Immersed Body
• Body Fitted Computational Grid
Advantages
Easy boundary condition application
Good for simple geometries
Disadvantages
Complicated geometries difficulties
Moving geometry handling problem
Deforming geometry handling problem
• General Grid Interface, Over-set Mesh,
Mesh Morphing, Immersed Boundary Method
-
Immersed Boundary Method• History
• Mesh Generation
• Governing Equations
Advantages over body fitted method
Re-evaluating cell types
• Boundary Condition
Problem with fluid equation
Different methods to solve the problem
• Dead-to-Live Cells
Problem when body is deforming or/and moving
Solved by assuming that the cell has the condition of closest live cell for the first time step after change
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2015/Hrvo
jeJasak/ImmersedBoundary.pdf
-
Boundary Condition in IBM
• Continuous Forcing IBM
Direct applied force/source term in governing equations prior to discretization
e.g. momentum equation
Simple and efficient for deforming bodies
Difficult for rigid bodies e.g. ship hull and numerically unstable and inaccurate
• Discrete Forcing IBM
Equations modifications after discretization
Scheme dependency results in more control over accuracy and stability of simulation
Two different methods: Indirect Forcing and Direct Forcing
1. Indirect Forcing DFIBM
continuous source term – immersed body boundary is not sharply represented
2. Direct Forcing DFIBM
not continuous source term – immersed body boundary is sharply represented
-
Comparison of Methods
CFIBM
Pros
Easy to implement
Good for deforming bodies
Good for moving bodies
Good for defined mechanical force
Good in handling dead-to-live cells
Cons
Accuracy and stability issues
Stiff equation for rigid body
Bad at high Reynolds numbers
Indirect Forcing DFIBM
Pros
Good for rigid bodies
Good in handling dead-to-live cells
More control over accuracy and stability
Cons
More difficult to implement
Bad at high Reynolds numbers
Direct Forcing DFIBM
Pros
Good for rigid bodies
More control over accuracy and stability
good at high Reynolds numbers
Cons
More difficult to implement
bad in handling dead-to-live cells
-
Immersed Boundary in OpenFOAM
• Indirect Forcing DFIBM in FOAM-extend
Idea is solving equations using boundary values and neighboring live cell values
Moving the boundary from actual geometry to IB cell centers surrounding it
Usual process of solving governing equations
Approximation process is the same for all equations except for pressure
• IB Cell Value Approximation In FOAM-extend
Assumption that all quantities follow a quadratic behavior near the boundary
Using least square weighting function
Both Dirichlet and Neumann boundary conditions
• IBM class implementation in FOAM-extend
Implementation through three classes
• Immersed boundary wall functions in FOAM-extend
Introducing a sample point
-
Dirichlet & Neumann Boundary Conditions
• Dirichlet BC
Such as no slip condition on the walls
Coefficients are calculated through least square curve fitting
to neighboring stencil cells
• Neumann BC
Such as specified heat flux walls
Introduction of local coordinate system
Coefficients are calculated in same way as Dirichlet BC
Pictures http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2015/HrvojeJasak/ImmersedBoundary.pdf
-
IBM Class Implementation in FOAM-extend
• The immersedBoundaryPolyPatch class
Takes care of basic mesh support functions for IBM meshes
• The immersedBoundaryFvPatch class
Supports basic and derive Fv properties of IBM
Recognizes live and dead cells
Calculates the background mesh and surface mesh intersection points, normal and distances
Calculates interpolation matrices used in imposition of boundary condition
• The immersedBoundaryFvPatchField class
Using the interpolation matrices to evaluate boundary condition
Evaluate patch fields for IB patches
Takes care of any boundary updates due to movement or deformation
-
Immersed Boundary Wall Functions in FOAM-
extend
• Implementation complexity in comparison with body fitted grids
• Sampling point is introduces at distance 1.5 times the grid resolution normal to body
• Calculation of flow properties at that point using neighboring live cells
The mesh resolution should be finer than body fitted approach
One possible solutions is to refine the mesh around the immersed body
Mesh refinement could be performed using refineImmersedBoundaryMesh
utility
-
Test Case• Idea is simulating the flow around a ship hull with IBM support, using similar case
Immersed boundary method available in FOAM-extend-4.0
Ship hull geometry, DTC-scaled hull available in OpenFOAM
Two fluids and a structure interaction
• Similar case is cylBumpInterIbFoam tutorial in immersedBoundary tutorials
Two fluids and a rigid body (ibCylinder) interaction
VOF approach for free surface simulation
-
Idea Formation
• Use DTC-Scaled hull geometry and use it as a ”bump”
• Place and fixed the hull in a 3D tank with a water level depth
• Introduce different boundary conditions for the tank
• Introduce some simple conditions at inlet
Constant velocity of water condition
Wave propagating condition
• Study the response of the
ship to the introduces conditions
-
WorkFlow1. Copy cylBumpInterIbFoam tutorial to the run directory
2. Replace the ibCylinder with DTC-hull in triSurface directory
3. Define and create a new volume mesh using blockMeshDict dictionary in polyMesh directory
4. Include immersedBoundaryPolyPatch into boundary in polyMesh directory
5. Refine the volume mesh around the immersed boundary using refineImmersedBoundaryMesh utility and make a new boundary file (optional)
6. Modify properties in constant directory
7. Modify solution control in fvSolution in system directory and continue with…
• 8. Constant Velocity case
Modify setFieldsDict and controlDict dictionaries
Modify boundary fields of alpha1, U and pd
• 8. Wave propagating case
Download, install and utilize swak4Foam library
Make funkySetFieldsDict dictionary and modify the controlDict
Modify boundary fields of alpha1, U and pd with groovyBC
9. Run the case and post process with paraview
-
Case Setup
• Geometry
DTC-hull available in OpenFOAM as ”.stl ” format (water tight)
Use surfaceConvert utility to make ”.ftr ”
f40NR
mkdir -p $FOAM_RUN
run
cp -r $FOAM_TUTORIALS/immersedBoundary/cylBumpInterIbFoam .
cd cylBumpInterIbFoam/constant/triSurface
rm ibCylinder.ftr ibCylinder.stl
• In OpenFOAM terminal window
OF4x
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz $FOAM_RUN
run
gunzip DTC-scaled.stl.gz
surfaceConvert DTC-scaled.stl DTC-scaled.ftr
mv DTC-scaled.stl hull.stl
mv DTC-scaled.ftr hull.ftr
Replace the ibCylinder with the hull in consant/triSurface directory
-
Case Setup
• Volume Mesh Modification
blockMeshDict modified to have two blocks
f40NR
run
cd cylBumpInterIbFoam
gedit constant/polyMesh/blockMeshDict
One block containing geometry and inlet with finer mesh and another block
containing the outlet to the first one
Modify the boundary file by including the geometry in that
blockMesh
gedit constant/polyMesh/boundary
-
Immersed Boundary Mesh Refinement
• refineImmersedBoundaryMesh Utility implementation (Optional)
Three different level of mesh refinement (ibCells, ibCellCells, ibCellCellFaces)
Refine the mesh by running refineImmersedBoundaryMesh utility with
one of the available levels flag
A 0 directory is produced containing a polyMesh directory
Copy it to the constant/polyMesh directory and remove 0 directory
-
Case Setup
• Modify properties in constant directory
Gravity g should be modified
• fvSolution and fvSchemes remain untouched interIbFoam solver
Solver for 2 incompressible, isothermal immiscible fluids
using VOF approach
immersed boundary support
-
Case Setup
Constant Velocity case
• Modify setFieldsDict to introduce water depth of 0.2 m
• Adjust the time step in controlDict
• Modify alpha1, U and pd by including immersed boundary (hull)
• Modify boundary condition according to the case
• Run the case by running interIbFoam
• Post process the results in paraview
-
Case Setup Wave Propagating case• Download, install and utilize swak4Foam library
Use funkySetFields and groovyBC for wave generation (2nd-order stokes)
Introduce wave as expressions
groovyWaveTank designed to run with interFoam
For alpha1 at inlet e.g. wave with length of 5 m and amplitude of 0.3 m
inlet {
type groovyBC;
valueExpression "(pos().z
-
Results
Initial condition
Constant Velocity Case
Time step 90
-
Results
Constant Velocity Case
Time step 120 Time step 120
-
Results
Wave Propagating Case
wave trough reaches the front part wave peak reaches the front part
-
Future Work
• Change the simulation to turbulence
• Introduce moving of the hull, possibly by pitchingPlate tutorial and
interDyMIbFoam solver
• Utilizing the forceSectional utility available in swak4Foam library to calculate
the forces on the body
• Introduce other boundary conditions e.g. wave from side and etc.
-
Thank You