Presentation is loading. Please wait.

Presentation is loading. Please wait.

IGERT: SPH and Free Surface Flows Robert A. Dalrymple Civil Engineering.

Similar presentations


Presentation on theme: "IGERT: SPH and Free Surface Flows Robert A. Dalrymple Civil Engineering."— Presentation transcript:

1 IGERT: SPH and Free Surface Flows Robert A. Dalrymple Civil Engineering

2 Wave Theories Flat Bottom Theories Small Amplitude (Airy Theory, 1845) Shallow Water (Boussinesq, 1871, KdV, 1895) Intermediate and Deep Depths (Stokes, 1856, Stokes V)

3 Wave Modeling Numerical modeling began in the 1960’s Numerically assisted analytical methods Finite difference modeling (marker and cell)Numerical modeling began in the 1960’s Numerically assisted analytical methods Finite difference modeling (marker and cell)

4 Stream Function on the Web

5 Finite Difference and Finite Elements in the 70’s 2-D to 3-D Multiple numbers of waves Shoaling, refraction, diffraction

6 Parabolic Modeling (REF/DIF) Scripps Canyon--NCEX http://science.whoi.edu/users/elgar/NCEX/wp-refdif.html

7 Boussinesq Model Empirical breaking Wave-induced currents! Much more computing time

8 Perturbation Theory O( /ε n ) Direct Wavefield Simulation O(100 ) DNS/LES O( ) ~ O(10) Wave Theory & Modeling Laboratory Experiments O(10 ) / Field Measurements O(100 ) Kinematic and dynamic boundary conditions on interface Mud energy dissipation for wavefield simulation Cross validation Shear instability characteristics Parameter for simulations Cross validation Interfacial boundary conditions Parameters for simulations Dissipation model development HOS/SNOW (MIT, JHU)

9 Meshfree Lagrangian Numerical Method for Wave Breaking Water Particles 2h r Boundary Particles Radius of Kernel function, W Fluid is described by quantities at discrete nodes Approximated by a summation interpolant; other options: MLS

10 Topics Meshfree methods Interpolation methods SPH modeling Results GPU : the future

11 Mesh-Free Methods Smoothed particle hydrodynamics (SPH) (1977) Diffuse element method (DEM) (1992) Element-free Galerkin method (EFG / EFGM) (1994) Reproducing kernel particle method (RKPM) (1995) hp-clouds Natural element method (NEM) Material point method (MPM) Meshless local Petrov Galerkin (MLPG) Generalized finite difference method (GFDM) Particle-in-cell (PIC) Moving particle finite element method (MPFEM) Finite cloud method (FCM) Boundary node method (BNM) Boundary cloud method (BCM) Method of finite spheres (MFS) Radial Basis Functions (RBF)

12 Particle Methods Discrete Element Method Molecular Dynamics SPH Vortex Methods

13 Why Interpolation? For discrete models of continuous systems, we need the ability to interpolate values in between discrete points. Half of the SPH technique involves interpolation of values known at particles (or nodes).

14 Interpolation To find the value of a function between known values. Consider the two pairs of values (x,y): (0.0, 1.0), (1.0, 2.0) What is y at x = 0.5? That is, what’s (0.5, y)?

15 Linear Interpolation Given two points, (x 1,y 1 ), (x 2,y 2 ): Fit a straight line between the points. y(x) = a x +b y 1 = a x 1 + b y 2 = a x 2 + b a=(y 2 -y 1 )/(x 2 -x 1 ), b= (y 1 x 2 -y 2 x 1 )/(x 2 -x 1 ), Use this equation to find y values for any x 1 < x < x 2 x 1 x 2 y1y1 y2y2

16 Polynomial Interpolants Given N (=4) data points, Find the interpolating function that goes through the points: If there were N+1 data points, the function would be with N+1 unknown values, a i, of the N th order polynomial

17 Polynomial Interpolant Force the interpolant through the four points to get four equations: Rewriting: The solution for a is found by inverting p

18 Example Data are: (0,2), (1,0.3975), (2, -0.1126), (3, -0.0986). Fitting a cubic polynomial through the four points gives:

19 Matlab code for polynomial fitting % the data to be interpolated (in 1D) x=[-0.2.44 1.0 1.34 1.98 2.50 2.95 3.62 4.13 4.64 4.94]; y=[2.75 1.80 -1.52 -2.83 -1.62 1.49 2.98 0.81 -2.14 -2.93 -1.81]; plot(x,y,'bo') n=size(x,2) % CUBIC FIT p=[ones(1,n) x x.*x x.*(x.*x)]' a=p\y' %same as a=inv(p)*y' yp=p*a hold on; plot(x,yp,'k*') Note: linear and quadratic fit: redefine p

20 Polynomial Fit to Example Exact: red Polynomial fit: blue

21 Beware of Extrapolation An N th order polynomial has N roots! Exact: red

22 Least Squares Interpolant For N points, we will use a lower order fitting polynomial of order m < (N-1). The least squares fitting polynomial is similar to the exact fit form: Now p is N x m matrix. Since we have fewer unknown coefficients as data points, the interpolant cannot go through each point. Define the error as the amount of “miss” Sum of the (errors) 2 :

23 Least Squares Interpolant Minimizing the sum with respect to the coefficients a: Solving, This can be rewritten in this form, which introduces a pseudo-inverse. Reminder: for cubic fit

24 Question Show that the equation above leads to the following expression for the best fit straight line:

25 Matlab: Least-Squares Fit %the data to be interpolated (1d) x=[-0.2.44 1.0 1.34 1.98 2.50 2.95 3.62 4.13 4.64 4.94]; y=[2.75 1.80 -1.52 -2.83 -1.62 1.49 2.98 0.81 -2.14 -2.93 -1.81]; plot(x,y,'bo') n=size(x,2) % CUBIC FIT p=[ones(1,n) x x.*x x.*(x.*x)]' pinverse=inv(p'*p)*p' a=pinverse*y' yp=p*a plot(x,yp,'k*')

26 Cubic Least Squares Example x: -0.2.44 1.0 1.34 1.98 2.50 2.95 3.62 4.13 4.64 4.94 y: 2.75 1.80 -1.52 -2.83 -1.62 1.49 2.98 0.81 -2.14 -2.93 -1.81 Data irregularly spaced

27 Least Squares Interpolant Cubic Least Squares Fit: * is the fitting polynomial o is the given data Exact

28 Piecewise Interpolation Piecewise polynomials: fit all points Linear: continuity in y +, y - (fit pairs of points) Quadratic: +continuity in slope Cubic splines: +continuity in second derivative RBF All of the above, but smoother

29 Moving Least Squares Interpolant are monomials in x for 1D (1, x, x 2, x 3 ) x,y in 2D, e.g. (1, x, y, x 2, xy, y 2 ….) Note a j are functions of x

30 Moving Least Squares Interpolant Define a weighted mean-squared error: where W(x-x i ) is a weighting function that decays with increasing x-x i. Same as previous least squares approach, except for W(x-x i )

31 Weighting Function q=x/h

32 Moving Least Squares Interpolant Minimizing the weighted squared errors for the coefficients:,,,

33 Moving Least Squares Interpolant Solving The final locally valid interpolant is:

34 Moving Least Squares (1) % generate the data to be interpolated (1d) x=[-0.2.44 1.0 1.34 1.98 2.50 2.95 3.62 4.13 4.64 4.94]; y=[2.75 1.80 -1.52 -2.83 -1.62 1.49 2.98 0.81 -2.14 -2.93 -1.81]; plot(x,y,'bo') n=size(x,2) % QUADRATIC FIT p=[ones(1,n) x x.*x]' xfit=0.30; sum=0.0 % compute msq error for it=1:18, % fiting at 18 points xfit=xfit+0.25; d=abs(xfit-x) for ic=1:n q=d(1,ic)/.51; % note 0.3 works for linear fit; 0.51 for quadratic if q <= 1. Wd(1,ic)=0.66*(1-1.5*q*q+0.75*q^3); elseif q <= 2. Wd(1,ic)=0.66*0.25*(2-q)^3; else Wd(1,ic)=0.0; end end

35 MLS (2) Warray=diag(Wd); A=p'*(Warray*p) B=p'*Warray acoef=(inv(A)*B)*y' % QUADRATIC FIT yfit=acoef'*[1 xfit xfit*xfit]' hold on; plot(xfit, yfit,'k*') sum=sum+(3.*cos(2.*pi*xfit/3.0)-yfit)^2; end

36 MLS Fit to (Same) Irregular Data Given data: circles; MLS: *; exact: line h=0.51

37 .3.5 1.0 1.5 Varying h Values

38 Basis for Smoothed Particle Hydrodynamics SPH From astrophysics (Lucy,1977; Gingold and Monaghan, 1977)) An integral interpolant (an approximation to a Dirac delta function): kernel

39 The Kernel (or Weighting Function) Compact support: 2D-circle of radius h 3D-sphere of radius h 1D-line of length 2h h

40 Fundamental Equation of SPH where W(s-x,h) is a kernel, which behaves like Dirac  function.

41 Delta Function (1 D)

42 Consistency Consistency is the ability of the method to reproduce polynomials. The kernel is known as a reproducing kernel. For constant consistency: let Then is a requirement for kernels. Sometimes this is referred to as the partition of unity.

43 Kernel Requirements (Monaghan) Monotonically decreasing with distance |s-x| Symmetric with distance

44 Numerical Approximations of the Integrals The incremental volume: m j /  j, where the mass is constant. which is an interpolant! Partition of unity

45 Kernels Gaussian: Not compactly supported -- extends to infinity.

46 Kernels Moving Particle Semi-implicit (MPS): Quadratic: (discontinuous slope at q=1)

47 Spline Kernel Same kernel as used in MLS interpolant.

48 Kernels Infinite variety of kernels possible, just have to follow the rules: monotonic decreasing, symmetric, and compact support.

49 Gradients Given SPH interpolant: Find the gradient directly and analytically: O.K., but when u j is a constant, there is a problem.

50 Gradients (2) To fix problem, recall partition of unity equation: The gradient of this equation is zero: So we can multiply by u i = u(x) and subtract from Eq.(A) (A)

51 Consistency Taylor series expansion of u(x,t) about point s (1-D): Consistency conditions are then: Integrals of all higher moments must be zero.

52 Numerical Consistency Shepard Interpolant for Constant h for constant consistency Solve for

53 MLS and Shepard Interpolant

54 Governing Equations Kinematics Conservation of Mass Conservation of Momentum Equation of State: Pressure = f(  )

55 Kinematic Equation for i=1, n p Mass Conservation

56 Conservation of Mass Integrate both sides by the kernel and integrate over the domain: Next use Gauss theorem:

57 Conservation of Mass (2) 0 Put in discrete form: j

58 Conservation of Mass (3) From before (consistency condition): The derivative of this expression is Multiplying by u i and adding to previous conservation equation:

59 Conservation of Mass (4) To determine the density at a given point s: A more accurate approach is: During computations, the density can be regularly redetermined through this expression, due to Randles and Liberski.

60 Conservation of Momentum Equations of motion: Multiply by  and the kernel and integrate as before: Subtract the zero sum:

61 Conservation of Momentum Equations of motion: Multiply by and the kernel and integrate as before:

62 Conservation of Momentum (2) Another formulation (used in JHU SPH):

63 Equation of State: Weak Compressibility which implies a speed of sound, C S: where  is usually 7 and B is a constant No need to solve PDE for pressure

64 Closure Submodels Viscosity generally accounted for by an artificial empirical term (Monaghan 1992):

65 Sub-Particle Scale (SPS) Turbulence Model Spatial-filter over the governing equations (compressible): (Favre-averaging) = SPS stress tensor with elements : Eddy viscosity: Smagorinsky constant: C s  0.12 See Lo & Shao (2002), Gotoh et al. (2002) for incompressible SPS S ij = strain tensor *

66 Neighbor Lists Which particles within 2h of particle i? In principle, each particle interacts with every other particle in the domain: N x N calculations (“all pair search”) Linked List: “Cells”: Examine particles in neighboring cells; only 9 cells to examine. Tree Search Develop a tree. Search geometrically.

67 Neighbor List Link list is reconstructed each time step. Cells are 2h x 2h in size. from SPHysics Users Manual

68 Time Stepping Discretize time: Take an Euler step (first order derivative expression): Use this to get a value of Then make a corrector step: Monaghan; more accurate than Euler step

69 Time Stepping (Verlet-Newmark) Taylor Series: Add these equations: where Extremely accurate equation to advance particle position. va

70 Verlet Subtracting the two Taylor series for x: The Velocity Verlet equation is:

71 Operational Velocity Verlet To avoid three time levels, the half-step Verlet method:

72 Beeman’s Method Better velocity estimate (but more storage, and needs a n+1 ) Predictor-corrector version (for velocity):

73 Boundary conditions are problematic in SPH due to: the boundary is not well defined kernel sum deficiencies at boundaries, e.g. density Ghost (or virtual) particles (Takeda et al. 1994) Leonard-Jones forces (Monaghan 1994) Boundary particles with repulsive forces (Monaghan 1999) Rows of fixed particles that masquerade as interior flow particles (Dalrymple & Knio 2001) (Can use kernel normalization techniques to reduce interpolation errors at the boundaries, Bonet and Lok 2001) Boundary Conditions (slip BC)

74 Ghost Particles Fluid domain Boundary Ghosts are white Virtual boundaries; slip boundary condition

75 Leonard-Jones Boundary Forces Monaghan, 1994 Physically derived BC: Bumpy!

76 Monaghan Repulsive Boundary x n y n u

77 Fixed Boundary Particles Two layers of fixed particle are sufficient to contain particles. Slip or non-slip. Boundary particles do everything but move. Numbering of particles: 1 to n b (fixed), n b+1 to n p (moving) Dalrymple & Knio (2001)

78 DEVELOPED JOINTLY BY RESEARCHERS AT: Universita di Roma “La Sapienza” (Italy) Universidade de Vigo (Spain) Johns Hopkins University (USA) University of Manchester (U.K.) SPHYSICS

79 Model Validation – hydrodynamics model – Star points are experiment data

80 Model Validation – hydrodynamics model – Star points are experiment data

81 Model Validation – hydrodynamics model – Star points are experiment data

82 Bore in a Box Tsunami represented by a dam break

83 Bore in a Box: 2004

84 3D Weak Plunger

85 Coherent Structures The rate of strain tensor and the rotation tensor are Q criterion Second invariant of the velocity gradient tensor Positive values of Q imply vorticity greater than strain, velocity gradient tensor

86 Coherent Structures: Q Criterion

87 Paradigm Shift: GPU Models

88 CPU vs GPU Floating point operations per second: GPU vs CPU Nvidia CUDA Programming Guide, 1.1

89 CPU/GPU Architectures

90 Bore in a Box Real time: CPU vs GPU on a laptop

91 Bore in a Box 677,360 particles

92 Nvidia Tesla Computing Card 4 Gb/240 = 16 Mb/ core


Download ppt "IGERT: SPH and Free Surface Flows Robert A. Dalrymple Civil Engineering."

Similar presentations


Ads by Google