lbm_matlab-master.zip

  • rupak504
    了解作者
  • matlab
    开发工具
  • 85KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 21
    下载次数
  • 2018-01-28 04:55
    上传日期
LBM code based on matlab latform
lbm_matlab-master.zip
  • lbm_matlab-master
  • diffusion
  • d1q2.m
    992B
  • d2q4.m
    1.9KB
  • d2q9.m
    3.2KB
  • advection_diffusion
  • d1q2.m
    984B
  • d2q4.m
    2.2KB
  • d2q9.m
    4.2KB
  • navier_stokes
  • viz
  • plot_pgram.m
    300B
  • plot_surfels.m
    880B
  • plot_lattice_lines.m
    421B
  • plot_bounding_box.m
    225B
  • visualize_mag.m
    224B
  • basic
  • reconstruct_macro_all.m
    548B
  • reconstruct_macro_column.m
    1.3KB
  • collide_mrt.m
    2KB
  • stream.m
    482B
  • compute_feq.m
    444B
  • collide.m
    480B
  • reconstruct_macro.m
    942B
  • surfels
  • touched_cell.m
    2.3KB
  • scatter.m
    299B
  • apply_advection_scale.m
    282B
  • pgram.m
    7.1KB
  • neutralize_cells.m
    326B
  • fill_touched_cell_info.m
    2.9KB
  • test_oop.m
    0B
  • surfel.m
    2.5KB
  • generate_surfels.m
    348B
  • find_inactive_cells.m
    379B
  • find_cut_cells.m
    2.9KB
  • collect.m
    174B
  • scale_distributions.m
    163B
  • fluid_areas_table.m
    390B
  • zero_cut_cells.m
    653B
  • area_scale_distributions.m
    1019B
  • find_cut_cells2.m
    3KB
  • post
  • streamfunction.m
    398B
  • vc
  • compute_g.m
    719B
  • spatial_difference_x.m
    1KB
  • body_force.m
    511B
  • collide_mrt_vcs.m
    2KB
  • compute_Sij_term.m
    338B
  • spatial_difference_y.m
    1KB
  • refine
  • explode_column_cells.m
    419B
  • coalesce_column_cells.m
    315B
  • overlap
  • vertex_in_pgram.m
    550B
  • relevant_lattice_speeds.m
    617B
  • test.m
    2.1KB
  • surfel_weights.m
    1.6KB
  • bounceback_components.m
    676B
  • pgram_weights.m
    738B
  • point_in_range.m
    190B
  • intersect_segment_cell.m
    1001B
  • cross2d.m
    122B
  • cell_intersections.m
    2.1KB
  • touched_cells.m
    2.8KB
  • overlap_1d.m
    382B
  • overlap_pgram_cell.m
    1.9KB
  • reorder_polygon_points.m
    741B
  • pgram_bounds.m
    919B
  • vertex_in_cell.m
    174B
  • cell_point.m
    327B
  • turbulence
  • turbulent_relaxation.m
    349B
  • update_nut.m
    1.6KB
  • upwind_y.m
    361B
  • spatial_difference_x.m
    444B
  • compute_wall_distances.m
    411B
  • collide_sa.m
    538B
  • upwind_x.m
    352B
  • spatial_difference_y.m
    447B
  • defunct
  • collide_mrt_old.m
    1.8KB
  • coalesce_column.m
    458B
  • channel_refine2.m
    5.8KB
  • channel4_incomplete.m
    7.5KB
  • channel_refine1.m
    5.9KB
  • explode_column.m
    375B
  • freewall
  • scatter.m
    576B
  • load_wall_distributions.m
    348B
  • freewall.m
    146B
  • preload_inactive_cells.m
    344B
  • save_wall_distributions.m
    369B
  • zero_out_of_bounds.m
    293B
  • zero_wall_cells.m
    544B
  • gather.m
    1.1KB
  • bc
  • moving_wall_bc.m
    874B
  • moving_wall_bc_all.m
    436B
内容介绍
# lbm_matlab Lattice Boltzmann Method (LBM) codes in MATLAB for educational purposes. I developed these as a feature-wise precursor to my more serious C++ version. IMPORTANT NOTE: The velocities in the default navier stokes versions are set to 1, which leads to breakdown of the incompressible assumption. You will need to set the velocities to proper values. Please see my c++ version for a more readily validated version. The features I explore here in the Navier-Stokes code are (see the references section for titles and more info): * Arbitrary refinement: (2005 Chen et al.) and (2012 Chen). Multiple levels of refinement in the same grid. * Arbitrary shape wall boundary boundary condition: (2011 Li) and (1998 Chen et al.). A cut-cell volumetric wall boundary condition. As a volumetric BC, MME (mass, momentum and energy) are perfectly conserved, unlike the interpolation approaches. * Viscosity counteraction: (2015 Zhang et al.) and (2011 Cheng et al.). A surprisingly effective and simple way to achieve high numerical stability, allowing for orders-of-magnitude higher Reynolds number stability limits. * Multiple relaxation time (MRT): (2011 Mohamad) and (2015 Zhang et al.). A slightly more computationally expensive but significantly more stable than the commonly-implemented single relaxation time (SRT) method. It is noted that there seems to be inconsistencies between the (2011 Mohamad) code and textbook explanantions, namely the definition of the vector of moments. * RANS Spalart-Allmaras turbulence model: (2015 Pellerin et al.). Simple inclusion of RANS eddy viscosity turbulence into the relaxation time for the assumption of fully-turbulent flow. ## Contents ### navier_stokes The 'navier_stokes' folder contains 2DQ9 codes for various physical configurations. There are several matlab scripts to be run that demonstrate different individual solver features. Below are explanations of each runnable script. #### Lid-Driven Cavity Scripts * cavity_cut: features the arbitrary shape wall BC by clipping the domain of the conventional lid-driven cavity case. * cavity_dim: a modification of the (2011 Mohamad) code port to be more organized with respect to dimensionalization; see (2008 Latt). * cavity_interface: features two levels of grid refinement, with the interface along the vertical center of the cavity. * cavity_mohamad: a port of the code provided by (2011 Mohamad). * cavity_mrt: MRT version. * cavity_mrt_vcs: MRT version with the viscosity-counteracting approach (steady approximation). For details on the steady approximation, see (2015 Zhang et al.). About the force term (which is implicit), they suggest an explicit form good enough for near-steady-state. I use an even simpler formulation that does not use spatially adjacent terms; purely local. Seems to still work okay. * cavity_sa: SRT with Spalart-Allmaras turbulence model. #### Simple Channel Scripts * channel_ext0: simple channel with a zero-gradient outlet condition. It is tehnically low-order accurate (first, I think), but it is personally my favorite due to its stability. * channel_ext2: simple channel with a second-order zero-gradient outlet condition. I have found it to be unstable. * channel_fixedp: simple channel with a zero-gradient pressure outlet condition. It is based on the explanation in (2012 Mohamad). I have found it to be unstable. * channel_fixedv: simple channel with a fixed velocity at the outlet. It is almost trivial, since it is not really a physically sound outlet condition. * channel_interface: simple channel with a zero-gradient outlet condition (as implemented in channel_ext0). It also features an interface where the cell resolution changes midway through the channel. Based on the theory of (2005 Chen et al.) and (2012 Chen). #### Other Scripts * inlet_outlet: an almost trivial code where all boundaries are either an inlet or outlet, faciliatating an inclined freestream flow. ### advection_diffusion and diffusion Based on codes in (2012 Mohamad) for simple 1d and 2d diffusion and advection-diffusion problems. Each script within these folders can be run on its own. ## References * (1998) Hudong Chen, Chris Teixeira, and Kim Molvig. REALIZATION OF FLUID BOUNDARY CONDITIONS VIA DISCRETE BOLTZMANN DYNAMICS. * (2011) Yanbing Li. AN IMPROVED VOLUMETRIC LBM BOUNDARY APPROACH AND ITS EXTENSION FOR SLIDING MESH SIMULATION. * (2005) Hudong Chen, O. Filippova, J. Hoch, Kim Molvig, R. Shock, Chris Teixiera, R. Zhang. GRID REFINEMENT IN LATTICE BOLTZMANN METHODS BASED ON VOLUMETRIC FORMULATION. * (2008) Latt, J. CHOICE OF UNITS IN LATTICE BOLTZMANN SIMULATIONS. * (2011) A. A. Mohamad. LATTICE BOLTZMANN METHOD: FUNDAMENTALS AND ENGINEERING APPLICATIONS WITH COMPUTER CODES. * (2011) Yongguang Cheng and Hui Zhang. A VISCOSITY COUNTERACTING APPROACH IN THE LATTICE BOLTZMANN BGK MODEL FOR LOW VISCOSITY FLOW: PRELIMINARY VERIFICATION. * (2012) Xiao-Peng Chen. APPLICATIONS OF LATTICE BOLTZMANN METHOD TO TURBULENT FLOW AROUND TWO-DIMENSIONAL AIRFOIL. * (2015) Chunze Zhang, Yongguang Cheng, Shan Huang, and Jiayang Wu. IMPROVING THE STABILITY OF THE MULTIPLE-RELAXATION-TIME LATTICE BOLTZMANN METHOD BY A VISCOSITY COUNTERACTING APPROACH. * (2015) Nicolas Pellerin, Sebastien Leclaire, and Marcelo Reggio. AN IMPLEMENTATION OF THE SPALART–ALLMARAS TURBULENCE MODEL IN A MULTI-DOMAIN LATTICE BOLTZMANN METHOD FOR SOLVING TURBULENT AIRFOIL FLOWS.
评论
    相关推荐