100% found this document useful (1 vote)
349 views66 pages

Python-Based Computational Fluid-Structure Interactions

This document summarizes a Master's thesis presentation on computational fluid-structure interactions (FSI) modeling of rain-wind induced vibrations in cable-stayed bridges using Python-based tools. The presentation covers the motivation for studying this problem, an overview of the physics, the goals of developing a loose coupling FSI algorithm using Python programming tools, results of a Python-enabled simulation, and plans for future work and improvements.

Uploaded by

dileepaero
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
349 views66 pages

Python-Based Computational Fluid-Structure Interactions

This document summarizes a Master's thesis presentation on computational fluid-structure interactions (FSI) modeling of rain-wind induced vibrations in cable-stayed bridges using Python-based tools. The presentation covers the motivation for studying this problem, an overview of the physics, the goals of developing a loose coupling FSI algorithm using Python programming tools, results of a Python-enabled simulation, and plans for future work and improvements.

Uploaded by

dileepaero
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 66

Python-based Computational

Fluid-Structure Interactions

Satish Kumar Chimakurthi


Mechanical Eng, University of Kentucky

Dr.Raymond LeBeau
Dr.Suzanne Weaver Smith
University of Kentucky
&
Dr.Thomas Hauser
Utah State University

Supported by KY NASA EPSCOR

Master’s thesis presentation – 6th of July 2004


Presentation Outline
 Motivation
 Physics of Rain-Wind induced vibrations
 Goals of the project
 Fluid-Structure Interactions
 FSI algorithm
 Python related programming tools
 Python-enabled simulation
 Results
 Conclusions
 Future Work
 Acknowledgements
STIMULUS-I
Problems related to rain-wind induced vibrations in
cable-stayed bridges remain unsolved till date. The
complex flow fields around inclined cables and the
effect of rain added to that make the problem a grand
scientific and computational challenge
Rain-Wind Induced Vibrations (RWIV) in Cable-Stayed
Bridges
 Peculiar vibration of cables in windy and rainy days
 Rivulets of water – upper and lower surfaces of the cable
 Rivulet changes cross section of the cable
 Complex interaction between structure, wind, and rain
 Cable size and shape, wind speed, direction and turbulence, rain intensity,
material repellency and roughness, cable weight, damping, and pre-strain
 Cable-water-rivulet interaction
 Rivulet is the key reason for the motion instability of the cable

Photo courtesy: http://www.sri-hybrid.co.jp/en/civil/cable_damper.html


Meiko Nishi Bridge in Japan

Tacoma Narrows Bridge


RWIV VIDEO – COCHRANE BRIDGE (ALABAMA)

Movie courtesy: University of Wisconsin at Milwaukee


How to Model RWIV ?
 All forces acting on the cable
 Forces on the upper water-rivulet
 Rivulet should be subjected to inertial and gravity forces,
pressure gradients and air-water-cable frictions
 Fluid-Structure Interaction between cable and rivulet
 Modeling these on a large-scale model experimentally, is
unrealistic
 Computational methods are therefore, very crucial and
indispensable
Goals of this Thesis
 Understand FSI (fluid-structure interaction) and the impact of
rain-wind induced vibrations in cable-stayed bridges

 Develop a loose coupling algorithm to automate the fluid-


structure interaction process with the help of software tools

 Simulate 2D FSI in the case of a simple harmonic oscillator


What is FSI ??

 FSI is a true Multiphysics phenomenon where a fluid


flowing around or within a structure causes it to
move, spin or even change shape due to flow-induced
pressure and shear loads – ANSYS Inc

 Fluid-structure interaction (FSI) scenarios are those


that involve the coupling of fluid mechanics and
structural mechanics – FLUENT Inc
FLUID-STRUCTURE-MESH COUPLING

FSI

CFD CSD CMD

 CFD – Computational Fluid Dynamics


 CSD – Computational Structural Dynamics
 CMD – Computational Mesh Dynamics
General classification
 Transient FSI: The structure’s reaction forces continuously vary with
time
 Steady-state FSI: The loads induced by the fluid are exactly balanced
by the structure’s reaction forces and the structure reaches a displaced
equilibrium position
FSI-coupling schemes

 Strong: Fluid and structure are modeled as a continuum


with a single system of partial differential equations
 Loose: Separate solvers for both fluid and structure
LOOSE-FSI ALGORITHM
BEGIN
Initial Data
Reads displacements
Grid Generator

Fluid solver Reads velocities from structure solver in


each sub-iteration

Pressure transfer Sub-iteration loop

Structure
Displacement & Velocity of Center and
FSI interface
Fluid, Structure solvers {U } t  {U }
i  1 i t
  NO
restart {U i} t
FSI iteration loop
YES

t=t+∆t

YES
t ≤ tfsi
NO

END
T≤t+i

Blue region – Key to implicit method


FSI-Time stepping methods

 Implicit – Coupling with sub-iterations


 Explicit – Coupling without sub-iterations
FSI in this project

TIME DEPENDENT + LOOSE + EXPLICIT


RWIV-Need for loose coupling
 Nonlinear structural solver and a nonlinear fluid solver are
minimum requirements for the problem under consideration
 It would be computationally inefficient to develop a new
Aeroelastic / FSI tool to study this problem
 Best alternative would be to exploit the utility of well proven
CFD and CSD codes and combine them

ANSYS+CFX & ABAQUS+FIDAP
Computational Data Transfer
Pressures
Fluid Solver Structural Code

New Fluid Deflections


Grid

Fluids Grid Structures and


Deformation Fluids Interface

Structural Grid
deflections
STIMULUS-II
Python is simple enough to stay out of the way of
the creative process -- like the pencil used by a
sketch artist -- yet powerful enough to create
sophisticated systems -- like an expensive CAD
program

- Guido van Rossum


Why Python ?
 A clean syntax
Ex: print ‘RWIV’ not print *, ‘RWIV’ as in Fortran
not cout << “RWIV” << ; as in C++
 A flexible interface to compiled languages
 Automatic interface generators for C/C++ and Fortran
 Large library of reusable code, both general and scientific
 Robust guidance and support from python users throughout
the world
Versatility of “Python”
 PyMat – Matlab
 PyMPI - MPI
 PyCGNS – A python binding to CGNS
 PyVTK – Visualization tool kit
 SciPy – Scientific computing tool kit
 NumPy- Numeric python
 PIL – Imaging library
 Python and TCL/TK
 PySQL
 SWIG
 F2PY
 Pyxmgrace
 SIP for C++ bindings, similar to SWIG
 PyFort similar to F2PY
 Visual Python
Different codes considered for this project
• Ogen – overlapping grid generator
from LLNL, California
 Compatible with OVERFLOW

• ANSYS – Nonlinear Structural solver


• GHOST – Solves 2D incompressible Navier stokes equations

 incompressible, fully structured multiblock Navier-Stokes solver


 2nd order in space and 2nd order in time
 Supports MPI
 ALE enabled

• LESTool - Solves 3D compressible Navier stokes equations


 Used on numerous platforms
(IBM SP2, SGI Origin 2000, PC Cluster KFC1)
 5th order accuracy in space, 2nd order accuracy in time
 Implicit time discretization (Modified ADI)
 Distributed parallelism using MPI and OpenMP
 Turbulence models: RANS, DES, LES, DNS
 CGNS based input/output
Software codes - characteristics

 Ogen – written in C++ - Source accessible


 LESTool – Fortran 90 - Source accessible
 GHOST – Fortran 90 - Source accessible
 ANSYS – based on fortran 77 libraries – No source access
Linking with Python


Ogen Python
SWIG


LESTool Python
F2PY


GHOST Python
F2PY

ANSYS Fortran Python


Library linking F2PY
SWIG – Simplified Wrapper and
Interface Generator
 SWIG is a software development tool that connects programs
written in C and C++, primarily used with common scripting
languages such as Python

Input file for SWIG

%module overturec
%{
#include </home/satish/OVERTURE/Overture.v19/include/OvertureInit.h >
%}

class Overture
{
public:
static int start(int argc, char *argv[]);
static int finish();
};

swig -c++ -python <input file>


>>import overturec
>>map1=overturec.Overture
>>map1.start()
>>map1.finish()
F2PY – Fortran to Python Interface
Generator
 Provides a connection between Fortran and Python
languagues
 To call Fortran 77/90/95 external subroutines and Fortran
90/95 module subroutines as well as C functions
 To access Fortran 77 COMMON blocks and Fortran 90/95
module data, including allocatable arrays
subroutine ansys_input(xcenter,ycenter)
real::xcenter,ycenter,rad,depth
open(1,file=‘cylinder.dat')
write(1,*)'/PREP7'
write(1,*)'CYL4' , ',' ,xcenter, ',' ,ycenter
write(1,*)'et', ',' , '1' , ',' , 'shell63‘
End subroutine ansys_input

Just do this : f2py –c –m ansysinput ansys_input.f90

>>import ansysinput
>>ansysinput.ansys_input(5,6)
ANSYS as a Subroutine
 ANSYS can become one of the subroutines of your fortran program
 A “Makefile” to link ANSYS libraries was written
 Programmatically more efficient
 mainan() is the key !!

open (177,file=‘ANSYS input file')


do
read(177,'(A)',iostat=ioerror)cmd
if(ioerror /=0)exit
ncommand = len_trim(cmd)
where = mainan(ncommand,cmd)
enddo
close(177)
ANSYS Fortran Python
Library linking F2PY
ALE – Arbitrary Lagrangian Eulerian formulation

ui  p 1  ui
 (ui u j )    ( )
t x j xi Re x j xi

Incompressible NS equations

ui ui p 1  ui


 (u j  u grid )    ( )
t x j xi Re x j xi
Ugrid is the velocity of grid
Python-FSI Modules
 Python – GHOST – ANSYS
 Python – Ogen – LESTool - ANSYS
Python-enabled simulation

Python Displacements and Velocities

Input Files,
Forces
Pressures
Input Files
F2PY
Input Files

Grid GHOST ANSYS

Grid.dat
Python-Driver Script
Python Displacements and
Velocities
def fsi_iterate():
grid_generator()
fluid_solver()
pressure_to_force()
Input
structure()
Files,
Input
def grid_generator():
import overturec #imports module created by SWIG
# Creates grid with user parameters Pressures Forces
def fluid_solver():

Files
def structure(): #imports F2PY module for interface with ANSYS
# uses ANSYS as a subroutine
fsi_iterate()
F2PY
Input
Files

Grid GHOST ANSYS

Grid.dat
SETUP FOR FSI Simulations
VORTEX-INDUCED VIBRATIONS - FSI

 Fluid flow around a bluff object at subsonic flows

Vortex Shedding at Re= 3000

 Boundary layers separate and two shear layers that aft trail in the flow
are formed
SCHEMATIC OF FLUID GRID

Inflow velocity = 1
Diameter of cylinder (D) = 1
Length = 80D, Width = 40D, Overset grid = 8D
98000 GRID POINTS (Background + Overset)

**GHOST input parameters are non-dimensional**


Structural Model in ANSYS

Diameter of cylinder: 100 mm


Mass of the structure: 6157.31 gm
Damping constant for x-damper: 3.614 g/s

Damping constant for y-damper: 0.337 g/s


Damping factor = 0.00032

Actual flow velocity: 30 mm/sec

•2D cylinder with 2 springs and 2 dampers


•Rotational DOF constrained
Handling units
 Actual flow velocity = 30 mm/sec
 Actual Diameter = 100 mm
 TIME SCALE = 100/30 = 3.33 sec

ANSYS TIMESTEP = 3.33 * GHOST


Validation of CFD code GHOST
 2 test cases based on the two-dimensional viscous laminar flow over a
2-D  circular cylinder
 CFD Test Case 1: Vortex Shedding at Re=300
Diameter of cylinder in fluid: 1
Fluid Flow Velocity: 1
Fluid Density: 1
Fluid Viscosity: 0.00333
Timestep: 0.005

 CFD Test Case 2: Vortex Shedding at Re = 1000


Diameter of cylinder in fluid: 1
Fluid Flow Velocity: 1
Fluid Density: 1
Fluid Viscosity: 0.001
Timestep: 0.005
Vortex shedding over a circular cylinder in cross flow

Lift and Drag at Re=300 Lift and Drag at Re=1000


Summary of previous and present computational
results for CFD test cases

Reynolds Number 300 1000

Present results CL= 0.771 CL=1.263


CD= 1.3530.077 CD=1.4530.212
St= 0.207 St=0.230
Chen et al [103] CL=0.869 CL=1.378
CD=1.3540.072 CD=1.4890.198
St=0.21 St=0.239

Ronald et al. [106] CL=0.841


CD=1.34
St=0.2036

Qian and Vezza [105] CD=1.52


St=0.24
FSI Test cases (based on Fan et al)
FSI TEST CASE FSI TIME STEP FSI TECHNIQUE SPRING STIFFNESS
X,Y directions

1(a) 0.016666 First order explicit X- 5032.392 g/s2


(Classical Staggered Y- 1258.8 g/s2
Scheme)

1(b) 0.006666 First order explicit X- 5032.392 g/s2


(Classical Staggered Y- 1258.8 g/s2
Scheme)

1(c) 0.016666 First order explicit X- 4.092e7 g/s2


(High spring (Classical Staggered Y- 4.751e7 g/s2
stiffness case) Scheme)

1(d) 0.016666 Adam-Bashforth third X- 5032.392 g/s2


order method Y- 1258.8 g/s2

1(e) 0.16666 First order explicit X- 5032.392 g/s2


(Classical Staggered Y- 1258.8 g/s2
Scheme)
TIMESTEPPING METHOD FOR FSI Test cases 1(a,b,c,e)
Farhat et al
Initial Conditions for FSI test cases

 Oscillatory vortex street in the


case of flow over a 2D cylinder
at Re=3000

Lift frequency= 0.239 Hz
 Drag frequency=0.496 Hz
 Cylinder freq (y)= 0.072 Hz
 Cylinder freq (x)=0.143 Hz

VORTICITY
Results for Re=3000 initial conditions case

 Lift coefficient from figure 6.3 = 1.506


 Drag coefficient from 6.3 = 1.5660.254
 Strouhal number = 0.239 ( based on lift frequency ) – (f*D)/U
 Reduced Velocity = Inverse of Strouhal number = 4.184

1.25 < Ur < 2.7 – The cylinder performs steady oscillations in the drag direction
with a small amplitude in the lift direction
2.7 < Ur < 4.5: Expected path of the cylinder motion is a Lissajou figure

Ur > 4.5 – The cylinder motion is predominantly in the lift direction


PRESSURE(P) AND VORTICITY(V) CONTOUR SNAPSHOTS
Fluid time: 67.7 sec (P) Fluid time: 75.4 sec (P)

Fluid time: 72.7 sec (P) Fluid time: 75.4 sec (V)
Snap shot of pressure contour at 75.4 seconds
Lower pressure at the top

-ve max lift coefficient at 75.4 seconds


Higher pressure at the bottom
FSI test case 1(a) results
 Time step: 0.01666
 Technique: First order explicit-CSS
 X spring- 5032.392 g/s2 Vorticity
 Y spring- 1258.800 g/s2
Fluid time: 82.77 sec

Pressure

CL and CD variation
Displacement and velocity histories – Case 1(a)
X-Displacement history Y-Displacement history

X-Velocity history Y-Velocity history


Plots of comparison without including the region of instability
(Also showing the inherent phase difference between the quantities)

Drag, X-displacement and velocity Lift, Y-displacement and velocity

**Velocity scaled up by 50 times for clarity**


PRESSURE CONTOUR at FLUID TIME 80.4 seconds SNAPSHOT

Lower pressure at the top

CL peak at 80.4 seconds


Higher pressure at the bottom
FSI along with FLUID – CL & CD variation
VORTICITY CONTOURS – FSI case 1(a)
FSI test case 1(b) - results
Changed from 1(a)
Displacements history (0-10: x-axis scale)

 Time step: 0.00666


 Technique: First order explicit-CSS
 X spring- 5032.392 g/s2
 Y spring- 1258.800 g/s2
X-displacement
CL & CD

Y-displacement
Cylinder velocity history plots

x-velocity y-velocity
Cases 1(a) and 1(b) agree until FSI time 8 seconds

CL – case 1(a) & 1(b) CD – case 1(a) & 1(b)

X-displacement Y-displacement
FSI test case 1(c) - results

Timestep: 0.01666
Technique: First order explicit-CSS
X spring- 4.092e7 g/s2
Y spring- 4.751e7 g/s2

Changed from 1(a)

Higher stiffness for springs


Displacement & Velocity history plots for case 1(c)

Unstable region similar to that of case 1(a)


FSI test case 1(d)
ADAMS-BASHFORTH METHOD – Implemented in Python

 First step: yk + h*fk

 Second step: Second order Adams-Bashforth method: yk+1= y k+ (h/2)*(3fk –


fk-1)

 Third step and beyond: yk+1= yk + (h/12)*(23fk - 16fk-1+ 5fk-2)

‘k’ is the time level and the product hfk denotes the change in the value at that time level
FSI test case 1(d) – results
(ADAMS-BASHFORTH THIRD ORDER METHOD)

These plots compare 1(a) and 1(d) cases


CL CD

Unstable region at 80 seconds


FSI test case 1(e) – results
Never went unstable
CL & CD
Technique: First order explicit-CSS
X spring- 5032.392 g/s2
Y spring- 1258.800 g/s2

ANSYS Time step: 0.1666


GHOST Time step: 0.05

Changed from 1(a)


Displacements history
Velocities history
FSI CASE 1(e) – VORTICITY CONTOURS

Zoomed view of cylinder


SUMMARY OF RESULTS
FSI TEST FSI TIME FSI SPRING RESULT
CASE STEP TECHNIQUE STIFFNESS
X,Y directions
1(a) 0.016666 First order X- 5032.392 g/s2 UNSTABLE at
explicit Y- 1258.8 g/s2 FSI 18 sec
(Classical
Staggered
Scheme)
1(b) 0.006666 First order X- 5032.392 g/s2 UNSTABLE at
explicit Y- 1258.8 g/s2 FSI 18 sec
(Classical
Staggered
Scheme)
1(c) 0.016666 First order X- 4.092e7 g/s2 SLIGHT
(High explicit Y- 4.751e7 g/s2 INSTABILITY
spring (Classical at FSI 18 sec
stiffness Staggered
case) Scheme)
1(d) 0.016666 Adam-Bashforth X- 5032.392 g/s2 UNSTABLE at
third order Y- 1258.8 g/s2 FSI 18 sec
method
1(e) 0.16666 First order X- 5032.392 g/s2 COMPLETELY
explicit Y- 1258.8 g/s2 STABLE
(Classical
Staggered
Scheme)
Conclusions
 The results of current FSI simulations appear qualitatively
correct
 Response of the cylinder is very sensitive to time stepping
 Higher time step may be a solution to certain FSI cases
 Python and Python based programming tools are efficient
means of automating loose coupling algorithms for
FSI/Aeroelasticity
Future Work
 The results of simulations in this project may be checked with other
benchmarks for quantitative accurate
 Future implementation of MPI using PyMPI for parallel computation on
commodity clusters
 Optimize Python code with Numerical Python arrays
 Implement interpolation algorithms in Python for flexible body FSI
 Future comparison of results with those of ANSYS-CFX, ADINA-FSI,
NISA-FSI, LINFLOW and such other readily available fluid-structure
interaction software's for more complex FSI benchmarks
Acknowledgements
 Dr.Raymond LeBeau
 Dr.Suzanne Weaver Smith
 Dr.Thomas Hauser
 Dr.Jamey Jacob
 Dr.Peter Attar, Airforce Research Labs,Dayton
 Mr.Satish Vanimisetti, ECS
 Dr.Bora Suzen, CFD Group
 Friends

You might also like