1.06k likes | 1.3k Views
Midterm-Review. GLY-5835. Basic Fluid Dynamics. Momentum. p = mv F = dp/dt = m dv/dt. Viscosity. Resistance to flow; momentum diffusion Low viscosity: Air High viscosity: Honey Kinematic viscosity. Poiseuille Flow.
E N D
Midterm-Review GLY-5835
Momentum • p = mv • F = dp/dt = m dv/dt
Viscosity • Resistance to flow; momentum diffusion • Low viscosity: Air • High viscosity: Honey • Kinematic viscosity
Poiseuille Flow • In a slit or pipe, the velocities at the walls are 0 (no-slip boundaries) and the velocity reaches its maximum in the middle • The velocity profile in a slit is parabolic and given by: u(x) • G can be gravitational acceleration or (linear) pressure gradient (Pin – Pout)/L x = 0 x = a
Reynolds Number • The Reynolds Number (Re) is a non-dimensional number that reflects the balance between viscous and inertial forces and hence relates to flow instability (i.e., the onset of turbulence) • Re = v L/n • L is a characteristic length in the system • Dominance of viscous force leads to laminar flow (low velocity, high viscosity, confined fluid) • Dominance of inertial force leads to turbulent flow (high velocity, low viscosity, unconfined fluid)
Re = 30 Re = 40 Re = 47 Re = 55 Re = 67 Re = 100 Eddies and Cylinder Wakes Re = 41
Laplace Law • There is a pressure difference between the inside and outside of bubbles and drops. • The pressure is always higher on the inside of a bubble or drop (concave side) – just as in a balloon. • The pressure difference depends on the radius of curvature and the surface tension for the fluid pair of interest: DP = g/r
Young-Laplace Law • When solid surfaces are involved, in addition to the fluid1/fluid2 interface – where the interaction is given by the surface tension -- we have interfaces between both fluids and the surface • Often one of the fluids preferentially ‘wets’ the surface • This phenomenon is captured by the contact angle • Zero contact angle means perfect wetting; • DP = g cos q/r
Kinetic Theory • Complete set of position (r) and momentum (p) coordinates for all individual particles gives exact dynamical state of system • Together with classical mechanics, allows exact prediction of future states • However, this level of description is essentially not possible
Statistical Mechanics • Represent system by ensemble of many copies • Describe by distribution function f(N)(rN,pN,t); N is number of particles • Changes in f(N)(rN,pN,t) with time given by Liouville equation (6N variables) • Usually interested in low order distribution functions (N = 1, 2)
First Order Distribution Function • f(1)(r,p,t) gives probability of finding a particular molecule with given position and momentum; positions and momenta of remaining N-1 molecules unspecified • No experiment can distinguish between molecules, so the choice of which molecule doesn’t matter • f(1) adequate for describing all gas properties that don’t depend on relative positions of molecules (dilute gas with long mfp)
External force Xi (small relative to intermolecular forces) • For each component i there is an fi(1)(r,pi,t) such that probable number of type i molecules with position coordinates in the range r±dr and momentum coordinates pi±dpi is fi(1)(r,pi,t) dr dpi
Expected Evolution w/o Collisions • If no collisions, then at time t + dt, the new positions of molecules starting at r are [r + (pi/mi)dt] • New momenta are pi = pi +Xidt • Thus,
Collisions • But there are collisions that result in some phase points starting at (r,pi) not arriving at (r + pi/mi dt, pi+Xi dt) and some not starting at (r,pi) arriving there too • Set Gij(-)drdpidt equal to the number of molecules that do not arrive in the expected portion of phase space due to collisions with type j particles during time dt • Similarly, set Gij(+)drdpidt equal to the number of molecules that start somewhere other than (r, pi) and arrive in the portion of phase space due to collisions with type j particles during time dt
CA Components Transition Rule: State of Neighbors/Self Last Time Step New State
Wolfram’s Binary Rule Numbers • 3 neighbor, 2 state CAs 7 6 5 4 3 2 1 0 27 26 25 24 23 22 21 20 Block diagram from http://mathworld.wolfram.com/ElementaryCellularAutomaton.html
FHP Lattice Gas Cellular Automaton • Fundamental basis is mass and momentum conservation • All particles have the same mass and speed so that momentum conservation reduces to conservation of the vector sum of the velocities S = Solid, R = Random Boolean variables n = (n1, n2, …, n8) 8 bits 256 possibilities Maximum of 1 particle per direction
Zero net momentum, head-on, 2- and 3-particle collisions Possible post-collision configurations Pre-collision Choose based on random bit R Post-collision Pre - collision
Pre-collision Post-collision Unchangeable configurations No configurations other than the original conserve mass and momentum All 5 and 6 particle collisions are similar; no configurations other than the original conserve momentum
Collision ‘Look up’ Table • Configurations 64 through 127 and 192 through 255 (01000000 through 01111111 and 11000000 through 11111111) are on solids • Bounce back
Collision ‘Look up’ Table • Two-particle head-on collisions
Collision ‘Look up’ Table • Three-particle head-on collisions
Noise • Averaging • Real thermodynamics
e1 e2 e6 e3 e5 e4 Lattice Boltzmann Model Unit Vectors ea D2Q9 FHP
Velocities 0,1 1,1 -1,1 1,0 -1,0 0,0 1,-1 -1,-1 0,-1 D2Q9
f2 f1 e1 e2 f6 f3 f4 e6 f5 e3 e5 e4 Lattice Boltzmann Model Unit Vectors ea Direction-specific particle densities fa f7 (rest) Macroscopic flows Density Velocity
Collide and Stream Streaming Collision (i.e., relaxation towards local equilibrium) Collision and streaming steps must be separated if solid boundaries are present (bounce back boundary is a separate collision)
D2Q9 6 2 5 e2 e6 e5 0 3 1 e3 e1 e4 e8 e7 7 4 8 Define velocity vectors • In MATLAB, can write ex(0+1)=0, ex(1+1)=1, etc. • %define es • ex(0)= 0; ey(0)= 0 • ex(1)= 1; ey(1)= 0 • ex(2)= 0; ey(2)= 1 • ex(3)=-1; ey(3)= 0 • ex(4)= 0; ey(4)=-1 • ex(5)= 1; ey(5)= 1 • ex(6)=-1; ey(6)= 1 • ex(7)=-1; ey(7)=-1 • ex(8)= 1; ey(8)=-1
Problem definition LY=10 LX=20 tau = 1 g=0.00001 %set solid nodes is_solid_node=zeros(LY,LX) for i=1:LX is_solid_node(1,i)=1 is_solid_node(LY,i)=1 end LY LX % if ~is_interior_solid_node(j,i)
Initialize density and fs (assuming zero velocity) %define initial density and fs rho=ones(LY,LX); f(:,:,1) = (4./9. ).*rho; f(:,:,2) = (1./9. ).*rho; f(:,:,3) = (1./9. ).*rho; f(:,:,4) = (1./9. ).*rho; f(:,:,5) = (1./9. ).*rho; f(:,:,6) = (1./36.).*rho; f(:,:,7) = (1./36.).*rho; f(:,:,8) = (1./36.).*rho; f(:,:,9) = (1./36.).*rho;
// Computing macroscopic density, rho, and velocity, u=(ux,uy). for( j=0; j<LY; j++) { for( i=0; i<LX; i++) { u_x[j][i] = 0.0; u_y[j][i] = 0.0; rho[j][i] = 0.0; if( !is_solid_node[j][i]) { for( a=0; a<9; a++) { rho[j][i] += f[j][i][a]; u_x[j][i] += ex[a]*f[j][i][a]; u_y[j][i] += ey[a]*f[j][i][a]; } u_x[j][i] /= rho[j][i]; u_y[j][i] /= rho[j][i]; } } }
On boundary, ‘neighboring’ point is on opposite boundary Periodic Boundaries ip = ( i<LX-1)?( i+1):( 0 ); in = ( i>0 )?( i-1):( LX-1); jp = ( j<LY-1)?( j+1):( 0 ); jn = ( j>0 )?( j-1):( LY-1); where LHS = (COND)?(TRUE_RHS):(FALSE_RHS); means if( COND) { LHS=TRUE_RHS;} else{ LHS=FALSE_RHS;}
// Compute the equilibrium distribution function, feq. f1=3.; f2=9./2.; f3=3./2.; for( j=0; j<LY; j++) { for( i=0; i<LX; i++) { if( !is_solid_node[j][i]) { rt0 = (4./9. )*rhoij; rt1 = (1./9. )*rhoij; rt2 = (1./36.)*rhoij; ueqxij = uxij; //Can add forcing here; see MATLAB code ueqyij = uyij; uxsq = ueqxij * ueqxij; uysq = ueqyij * ueqyij; uxuy5 = ueqxij + ueqyij; uxuy6 = -ueqxij + ueqyij; uxuy7 = -ueqxij + -ueqyij; uxuy8 = ueqxij + -ueqyij; usq = uxsq + uysq;
feqij[0] = rt0*( 1. - f3*usq); feqij[1] = rt1*( 1. + f1*ueqxij + f2*uxsq - f3*usq); feqij[2] = rt1*( 1. + f1*ueqyij + f2*uysq - f3*usq); feqij[3] = rt1*( 1. - f1*ueqxij + f2*uxsq - f3*usq); feqij[4] = rt1*( 1. - f1*ueqyij + f2*uysq - f3*usq); feqij[5] = rt2*( 1. + f1*uxuy5 + f2*uxuy5*uxuy5 - f3*usq); feqij[6] = rt2*( 1. + f1*uxuy6 + f2*uxuy6*uxuy6 - f3*usq); feqij[7] = rt2*( 1. + f1*uxuy7 + f2*uxuy7*uxuy7 - f3*usq); feqij[8] = rt2*( 1. + f1*uxuy8 + f2*uxuy8*uxuy8 - f3*usq); } } }
Collide // Collision step. for( j=0; j<LY; j++) for( i=0; i<LX; i++) if( !is_solid_node[j][i]) for( a=0; a<9; a++) { fij[a] = fij[a] + ( fij[a] - feqij[a])/tau; }
Bounceback Boundaries • Bounceback boundaries are particularly simple • Played a major role in making LBM popular among modelers interested in simulating fluids in domains characterized by complex geometries such as those found in porous media • Their beauty is that one simply needs to designate a particular node as a solid obstacle and no special programming treatment is required