diff --git a/docs/source_docs/_static/animations/unsteady-flow-around-sphere-384x256x256.mp4 b/docs/source_docs/_static/animations/unsteady-flow-around-sphere-384x256x256.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9c927de3da035f143d54925db3de152c80b644dd Binary files /dev/null and b/docs/source_docs/_static/animations/unsteady-flow-around-sphere-384x256x256.mp4 differ diff --git a/docs/source_docs/refs.bib b/docs/source_docs/refs.bib index 6fa2b3d9b9ff4e568e7353eefa35307e30818e65..b75b794970d4cb1d90c78cec428f40011c808b8b 100644 --- a/docs/source_docs/refs.bib +++ b/docs/source_docs/refs.bib @@ -214,6 +214,17 @@ doi="10.1007/978-1-4613-8643-8_2" } +@article{devahldavis83, + author = {de Vahl Davis, G.}, + title = {Natural convection of air in a square cavity: a bench mark numerical solution}, + journal = {International Journal for Numerical Methods in Fluids}, + volume = {3}, + number = {3}, + pages = {249--264}, + year = {1983}, + doi = {10.1002/fld.1650030305} +} + @article{ding90, author = {Ding, Jianmin and Gidaspow, Dimitri}, title = {A bubbling fluidization model using kinetic theory of granular flow}, @@ -364,6 +375,16 @@ doi = {https://doi.org/10.1016/j.jcp.2022.111305}, DOI={10.1017/S0022112094000996}, } +@article{hortmann90, + author = {Hortmann, M. and Peri\'{c}, M. and Scheuerer, G.}, + title = {Finite volume multigrid prediction of laminar natural convection: Bench-mark solutions}, + journal = {International Journal for Numerical Methods in Fluids}, + volume = {11}, + number = {2}, + pages = {189--207}, + year = {1990}, + doi = {10.1002/fld.1650110206} +} @article{Ish79, author = {Ishii, M. and Zuber, N. }, @@ -391,6 +412,16 @@ doi = {https://doi.org/10.1016/j.jcp.2022.111305}, pages = {137--152} } +@article{lari11, +author = {K. Lari and M. Baneshi and S.A. {Gandjalikhan Nassab} and A. Komiya and S. Maruyama}, +title = {Combined heat transfer of radiation and natural convection in a square cavity containing participating gases}, +journal = {International Journal of Heat and Mass Transfer}, +volume = {54}, +number = {23}, +pages = {5087-5099}, +year = {2011} +} + @article{Lat011, author = {Lathouwers, D. and Bellan, J. }, title = {Modeling of dense gas-solid reative mixtures applied to biomass pyrolysis in a fluidized bed}, @@ -421,6 +452,15 @@ doi = {https://doi.org/10.1016/j.jcp.2022.111305}, pages = {2297-2304} } +@article{lequere2005, + author = {Le Quere, P. and Weisman, C. and Paillere, H. and Vierendeels, J. and Dick, E. and Becker, R. and Braack, M. and Locke, J.}, + title = {Modelling of natural convection flows with large temperature differences: a benchmark problem for low Mach number solvers. Part 1. Reference solution}, + journal = {ESAIM: Mathematical Modelling and Numerical Analysis}, + volume = {39}, + pages = {609--616}, + year = {2005}, + doi = {10.1051/m2an:2005027} +} @techreport{Lilly66, author={Lilly, D.K.}, @@ -551,6 +591,17 @@ doi = {https://doi.org/10.1016/j.jcp.2022.111305}, pages={385–400} } +@article{sakamoto90, + author = {Sakamoto, H. and Haniu, H.}, + title = {A Study on Vortex Shedding From Spheres in a Uniform Flow}, + journal = {Journal of Fluids Engineering}, + volume = {112}, + number = {4}, + pages = {386-392}, + year = {1990}, + month = {12}, +} + @article{sato81, author = {Sato, Y. and Sadatomi, M.}, title = {Momentum and heat transfer in two-phase bubble flow - I. Theory}, diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-richardson_L1.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-richardson_L1.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-richardson_L1.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-richardson_L1.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-richardson_Lu.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-richardson_Lu.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-richardson_Lu.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-richardson_Lu.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-streamfunction_contours-no-fill.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-streamfunction_contours-no-fill.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-streamfunction_contours-no-fill.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-streamfunction_contours-no-fill.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-streamfunction_contours.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-streamfunction_contours.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-streamfunction_contours.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-streamfunction_contours.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-u_velocity_all_cases.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-u_velocity_all_cases.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-u_velocity_all_cases.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-u_velocity_all_cases.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-v_velocity_all_cases.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-v_velocity_all_cases.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-v_velocity_all_cases.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-v_velocity_all_cases.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-vorticity_contours-no-fill.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-vorticity_contours-no-fill.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-vorticity_contours-no-fill.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-vorticity_contours-no-fill.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-vorticity_contours.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-vorticity_contours.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-vorticity_contours.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-vorticity_contours.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-wall_pressure_profiles.png b/docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-wall_pressure_profiles.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-backward-facing-step-wall_pressure_profiles.png rename to docs/source_docs/tutorials/fluid/images/steady-backward-facing-step-wall_pressure_profiles.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-around-cylinder-drag-coeff.png b/docs/source_docs/tutorials/fluid/images/steady-flow-around-cylinder-drag-coeff.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-around-cylinder-drag-coeff.png rename to docs/source_docs/tutorials/fluid/images/steady-flow-around-cylinder-drag-coeff.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-around-cylinder-lift-coeff.png b/docs/source_docs/tutorials/fluid/images/steady-flow-around-cylinder-lift-coeff.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-around-cylinder-lift-coeff.png rename to docs/source_docs/tutorials/fluid/images/steady-flow-around-cylinder-lift-coeff.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-around-cylinder.png b/docs/source_docs/tutorials/fluid/images/steady-flow-around-cylinder.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-around-cylinder.png rename to docs/source_docs/tutorials/fluid/images/steady-flow-around-cylinder.png diff --git a/docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-past-sphere-midplane_contour.png b/docs/source_docs/tutorials/fluid/images/steady-flow-around-sphere-midplane_contour.png similarity index 100% rename from docs/source_docs/tutorials/incompressible-fluid/images/steady-flow-past-sphere-midplane_contour.png rename to docs/source_docs/tutorials/fluid/images/steady-flow-around-sphere-midplane_contour.png diff --git a/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-nu_convergence_history.png b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-nu_convergence_history.png new file mode 100644 index 0000000000000000000000000000000000000000..7a5d07ec1105eb6e403769af510a3977f24c287c Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-nu_convergence_history.png differ diff --git a/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-richardson_Nu_xmax.png b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-richardson_Nu_xmax.png new file mode 100644 index 0000000000000000000000000000000000000000..5260b72c33f4324db88f8546817d75a20bf72a31 Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-richardson_Nu_xmax.png differ diff --git a/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-richardson_Nu_xmin.png b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-richardson_Nu_xmin.png new file mode 100644 index 0000000000000000000000000000000000000000..87a1574fa1f61b3f27e9fd696bf4d53d3b07f6fa Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-richardson_Nu_xmin.png differ diff --git a/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-temperature-field.png b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-temperature-field.png new file mode 100644 index 0000000000000000000000000000000000000000..7441cf82a2ed204ed0de2f3b98612e45a1d1237c Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/steady-natural-convection-cavity-temperature-field.png differ diff --git a/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-force_history.png b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-force_history.png new file mode 100644 index 0000000000000000000000000000000000000000..b6e593981d55148bb56b0554d149c738ce9fe8eb Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-force_history.png differ diff --git a/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-midplane_snapshot.png b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-midplane_snapshot.png new file mode 100644 index 0000000000000000000000000000000000000000..d100ea49f19c548e6942ac1ac15a7af095968c61 Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-midplane_snapshot.png differ diff --git a/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-strouhal_spectrum.png b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-strouhal_spectrum.png new file mode 100644 index 0000000000000000000000000000000000000000..7705823af2fc92bf6fe9399e72cbafe770917dcf Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-strouhal_spectrum.png differ diff --git a/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-windowed_stats.png b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-windowed_stats.png new file mode 100644 index 0000000000000000000000000000000000000000..d69a83e6b8c362c68ccf2d4ef10b00362143145b Binary files /dev/null and b/docs/source_docs/tutorials/fluid/images/unsteady-flow-around-sphere-windowed_stats.png differ diff --git a/docs/source_docs/tutorials/fluid/index.rst b/docs/source_docs/tutorials/fluid/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..b89e2ecf207c77f4e141580a5490c8d9c0a0616e --- /dev/null +++ b/docs/source_docs/tutorials/fluid/index.rst @@ -0,0 +1,28 @@ +.. _TutorialsFluid: + +Fluid +======= + +Tutorials in this category use MFIX-Exa's fluid solver with no particle +phase present (``dem.solve = none``, ``pic.solve = none``). This includes +ordinary single-fluid flow as well as any case that tracks two immiscible +fluids by density within the same solver, such as a Rayleigh-Taylor case. + +.. toctree:: + :maxdepth: 1 + + steady-flow-around-cylinder + steady-backward-facing-step + steady-flow-around-sphere + unsteady-flow-around-sphere + steady-natural-convection-cavity + +Planned +--------- + +The following tutorials are on the roadmap but not yet published: + +- Natural convection cavity -- introduces the energy equation and buoyancy. +- Species mixing -- introduces species transport. +- Taylor-Couette flow -- introduces a rotating reference frame. +- Rayleigh-Taylor instability -- two immiscible fluids tracked by density. diff --git a/docs/source_docs/tutorials/incompressible-fluid/steady-backward-facing-step.rst b/docs/source_docs/tutorials/fluid/steady-backward-facing-step.rst similarity index 98% rename from docs/source_docs/tutorials/incompressible-fluid/steady-backward-facing-step.rst rename to docs/source_docs/tutorials/fluid/steady-backward-facing-step.rst index 503571f9fac1531bd751d0ba27a084d264335f06..3feeafc4cef19866aaf415888a253bf75f74b565 100644 --- a/docs/source_docs/tutorials/incompressible-fluid/steady-backward-facing-step.rst +++ b/docs/source_docs/tutorials/fluid/steady-backward-facing-step.rst @@ -11,8 +11,8 @@ a sudden expansion and the effect of the pressure-outlet boundary condition. Features -------- -* Incompressible fluid with no particles. -* Steady-state advance. +* Incompressible fluid flow. +* Steady-state pseudo-time advance. * Backward-facing step represented by the inlet velocity profile. * Parabolic velocity inlet, pressure outlet, no-slip walls, and a periodic spanwise direction. @@ -167,7 +167,7 @@ and the maximum iterations is increased to 500,000. .. note:: The complete input file is located in the MFIX-Exa source directory as - ``tutorials/incompressible-fluid/inputs.steady-backward-facing-step`` + ``tutorials/fluid/inputs.steady-backward-facing-step`` Post-Processing diff --git a/docs/source_docs/tutorials/incompressible-fluid/steady-flow-around-cylinder.rst b/docs/source_docs/tutorials/fluid/steady-flow-around-cylinder.rst similarity index 97% rename from docs/source_docs/tutorials/incompressible-fluid/steady-flow-around-cylinder.rst rename to docs/source_docs/tutorials/fluid/steady-flow-around-cylinder.rst index 389a71131131544cebc516e0c928a79c29f20359..840871573f2326a6f902d905e5e710dd15970097 100644 --- a/docs/source_docs/tutorials/incompressible-fluid/steady-flow-around-cylinder.rst +++ b/docs/source_docs/tutorials/fluid/steady-flow-around-cylinder.rst @@ -10,8 +10,8 @@ cylinder-flow example that uses MFIX-Exa's embedded-boundary geometry. Features -------- -* Incompressible fluid with no particles. -* Steady-state advance +* Incompressible fluid flow. +* Steady-state pseudo-time advance * Quasi-2D domain using a thin, periodic spanwise direction. * Cylinder represented by a predefined embedded boundary. * Velocity inlet, pressure outlet, no-slip walls, and a periodic spanwise direction. @@ -113,7 +113,7 @@ is set to ensure :math:`\Delta t \sim (\Delta x)^2`. .. note:: The complete input file is located in the MFIX-Exa source directory as - ``tutorials/incompressible-fluid/inputs.steady-around-cylinder`` + ``tutorials/fluid/inputs.steady-flow-around-cylinder`` Post-Processing diff --git a/docs/source_docs/tutorials/incompressible-fluid/steady-flow-around-sphere.rst b/docs/source_docs/tutorials/fluid/steady-flow-around-sphere.rst similarity index 97% rename from docs/source_docs/tutorials/incompressible-fluid/steady-flow-around-sphere.rst rename to docs/source_docs/tutorials/fluid/steady-flow-around-sphere.rst index 1e766db1cf14629c77e64f0c5a704f0ddba509ac..a48f26b57b454eb80ce7fc9b94293be99477fc0c 100644 --- a/docs/source_docs/tutorials/incompressible-fluid/steady-flow-around-sphere.rst +++ b/docs/source_docs/tutorials/fluid/steady-flow-around-sphere.rst @@ -16,8 +16,8 @@ length are computed as part of the analysis. Features -------- -* Incompressible fluid with no particles. -* Steady-state advance. +* Incompressible fluid flow. +* Steady-state pseudo-time advance. * Fully three-dimensional embedded-boundary sphere geometry. * Uniform freestream mass inflow, pressure outlet, and free-slip lateral boundaries approximating an unconfined far field. @@ -130,7 +130,7 @@ time advance: .. note:: The complete input file is located in the MFIX-Exa source directory as - ``tutorials/incompressible-fluid/inputs.steady-flow-past-sphere`` + ``tutorials/fluid/inputs.steady-flow-around-sphere`` Post-processing ----------------- @@ -153,7 +153,7 @@ bubble immediately behind the sphere: .. _fig_steady_flow_past_sphere_midplane: -.. figure:: ./images/steady-flow-past-sphere-midplane_contour.png +.. figure:: ./images/steady-flow-around-sphere-midplane_contour.png :width: 80% :align: center :alt: Streamwise velocity and recirculation bubble behind a sphere at Reynolds number 100. diff --git a/docs/source_docs/tutorials/fluid/steady-natural-convection-cavity.rst b/docs/source_docs/tutorials/fluid/steady-natural-convection-cavity.rst new file mode 100644 index 0000000000000000000000000000000000000000..57755b9125e89ed97855aa66d305fa70f8f7bd6d --- /dev/null +++ b/docs/source_docs/tutorials/fluid/steady-natural-convection-cavity.rst @@ -0,0 +1,328 @@ +.. _TutorialSteadyNaturalConvectionCavity: + +Steady natural convection in a differentially heated cavity +============================================================== + +This tutorial sets up buoyancy-driven flow in a closed, differentially +heated square cavity -- the classical de Vahl Davis benchmark +:cite:p:`devahldavis83`. Unlike the earlier :ref:`sphere +` tutorials, this case exercises MFIX-Exa's +energy equation and ideal-gas equation of state: buoyancy comes directly +from a real density variation with temperature, not a linearized +Boussinesq source term (MFIX-Exa has no Boussinesq mode). A grid-refinement +study validates the computed Nusselt number against the benchmark. + +Features +-------- + +* Buoyancy-driven fluid flow. +* Ideal-gas equation of state in a sealed (closed) domain -- + ``mfix.constraint = IdealGasClosedSystem``. +* Steady-state pseudo-time advance. +* Vertical hot/cold walls represented as an embedded boundary; adiabatic + top/bottom walls handled as plain domain boundary conditions. +* Quasi-2D domain using a thin, periodic spanwise (:math:`z`) direction. +* Grid-refinement study (:math:`64^2`, :math:`128^2`, :math:`256^2`) with + Richardson extrapolation of the wall Nusselt number, compared against + de Vahl Davis :cite:p:`devahldavis83` and Hortmann et al. + :cite:p:`hortmann90`. + +Case description +----------------- + +The cavity is a unit cube in :math:`x`-:math:`y` with characteristic length +:math:`L=1\text{ m}`, thin and periodic in :math:`z`. The left +(:math:`x=-0.5`) and right (:math:`x=+0.5`) walls are held at fixed +temperatures :math:`T_h=310\text{ K}` and :math:`T_l=290\text{ K}`. The top +and bottom walls are adiabatic and no-slip. Gravity points in the :math:`-y` +direction. This case is characterized by the Rayleigh number (:math:`Ra`) +and Prandtl number (:math:`Pr`): + +.. math:: + + Ra = \frac{g\,\beta\,\Delta T\,L^3}{\nu\,\alpha} = 1\times10^6, + \qquad Pr = \frac{\mu c_p}{\kappa} = 0.717 + +where :math:`\beta=1/T_{ref}` for an ideal gas fluid. + +This setup is a near-Boussinesq validation case; therefore, the temperature +difference is kept small relative to the reference temperature +:math:`T_{ref} = 300\text{ K}`: + +.. math:: + + \frac{\Delta T}{T_{ref}} = \frac{20}{300} = 6.7\% + +This approach keeps the ideal-gas solve close to the Boussinesq limit that +the classical benchmark assumes. (A companion case at +:math:`\Delta T/T_{ref}=120\%`, validating against the compressible +benchmark of Le Quéré :cite:p:`lequere2005` instead, is a natural +extension -- see below.) + +The viscosity (:math:`\mu`) and thermal conductivity (:math:`\kappa`) are +solved for from the target :math:`Ra`, :math:`Pr`, :math:`\Delta T`, and +:math:`L`. + +.. math:: + + \mu = 8.061\times10^{-4}\text{ Pa}\cdot\text{s}, \qquad + \kappa = 1.1292\text{ W/(m}\cdot\text{K)} + +The specific heat and molecular weight are prescribed constants, +:math:`C_p=1004.5\text{ J/(kg}\cdot\text{K)}` and :math:`M=0.028970\text{ kg/mol}`, +respectively. The values are checked for a physically valid ideal gas before use: + +.. math:: + + C_v = C_p - \frac{R}{M} = 1004.5 - \frac{8.31446}{0.028970} + = 717.5\text{ J/(kg}\cdot\text{K)} > 0, \qquad \gamma = C_p/C_v \approx 1.400 + + +.. warning:: + + When choosing fluid properties to satisfy specific dimensionless groups + (like :math:`Ra` and :math:`Pr`), always verify that the resulting + thermodynamic properties remain physical. Arbitrarily adjusting + :math:`C_p` or molecular weight without this check can accidentally + yield a negative constant-volume specific heat (:math:`C_v \le 0`), + leading to an unphysical ideal gas state and solver divergence. + + +Important input sections +-------------------------- + +The domain is a unit cube, periodic in :math:`z`: + +.. code-block:: text + + geometry.is_periodic = 0 0 1 + geometry.prob_lo = -0.5 -0.5 0.0 + geometry.prob_hi = 0.5 0.5 0.125 + + amr.n_cell = 64 64 8 + +The hot/cold walls are represented as an embedded boundary covering the +:math:`x` faces of the domain; :math:`y` (top/bottom) are defined as +no-slip walls and handled by ordinary domain boundary conditions, and +:math:`z` is periodic: + +.. code-block:: text + + mfix.geometry = box + + box.Lo = -0.5 -1.0 -1.0 + box.Hi = 0.5 1.0 1.0 + + box.internal_flow = true + box.offset = 1.e-8 + + ... + + bc.left = eb + bc.left.eb.normal = 1. 0. 0. + bc.left.eb.temperature = constant + bc.left.eb.temperature.constant = 310. # Th + + bc.right = eb + bc.right.eb.normal = -1. 0. 0. + bc.right.eb.temperature = constant + bc.right.eb.temperature.constant = 290. # Tl + + bc.top = no-slip # adiabatic (no temperature spec) + bc.bottom = no-slip + + +The energy equation and the ideal-gas equation of state are enabled +together in a sealed domain: + +.. code-block:: text + + mfix.advect_density = 1 + mfix.advect_enthalpy = 1 + mfix.constraint = IdealGasClosedSystem + +The calculated viscosity (:math:`\mu`), thermal conductivity (:math:`\kappa`), +and prescribed specific heat (\(:math:`C_p`\)) are set as constant fluid +properties in the configuration deck: + +.. code-block:: text + + fluid.specific_heat.model = constant + fluid.specific_heat.constant = 1004.5 + + fluid.viscosity.molecular.model = constant + fluid.viscosity.molecular.constant = 8.061e-4 + + fluid.thermal_conductivity.model = constant + fluid.thermal_conductivity.constant = 1.1292 + +The case runs to a pseudo steady state: + +.. code-block:: text + + mfix.steady_state = 1 + mfix.steady_state_tol = 1.e-6 + mfix.steady_state_maxiter = 100000 + + mfix.dt_max = 1.0e-2 + + +.. note:: + + The complete input file is located in the MFIX-Exa source directory as + ``tutorials/fluid/inputs.steady-natural-convection-cavity`` + +Post-processing +--------------- + +Nusselt number +~~~~~~~~~~~~~~ + +The local Nusselt number at each vertical wall is + +.. math:: + + Nu = \frac{L}{T_h-T_l}\left.\frac{\partial T}{\partial x}\right|_{wall} + +computed with a second-order, one-sided finite-difference stencil on the first +three cell-center planes off the wall and averaged over :math:`y`. At the left (hot) +wall, this is evaluated as: + +.. math:: + + \left.\frac{\partial T}{\partial x}\right|_{wall} = \frac{-2T_1+3T_2-T_3}{\Delta x} + +.. _fig_steady_natural_convection_cavity_temperature_field: + +.. figure:: ./images/steady-natural-convection-cavity-temperature-field.png + :width: 60% + :align: center + :alt: Dimensionless temperature field in the differentially heated cavity, no radiation, Ra=1e6. + + Dimensionless temperature field :math:`\tilde{T}=(T-T_l)/(T_h-T_l)`, :math:`128^2` grid. + +The field shows the expected structure for :math:`Ra=10^6`: thin thermal +boundary layers along the hot and cold walls, a stably stratified core, +and a single large recirculating cell—consistent with de Vahl Davis's +description at this Rayleigh number. + +Grid convergence +~~~~~~~~~~~~~~~~ + +.. list-table:: Wall Nusselt number vs. grid, Ra=1e6 + :header-rows: 1 + + * - Mesh + - :math:`Nu_{xmin}` (hot wall) + - :math:`Nu_{xmax}` (cold wall) + * - :math:`64\times64` + - 9.7986 + - 9.8098 + * - :math:`128\times128` + - 9.0170 + - 9.0240 + * - :math:`256\times256` + - 8.8572 + - 8.8584 + * - :math:`512\times512` + - 8.8331 + - 8.8331 + * - de Vahl Davis / Hortmann et al. + - 8.80 - 8.83 + - 8.80 - 8.83 + +Richardson extrapolation across the three finest grids gives an observed order of +accuracy of :math:`p\approx2.74` (hot wall) / :math:`2.72` (cold wall). The +extrapolated value at the continuum limit (:math:`\Delta x\to0`) lands at +the benchmark values from de Vahl Davis :cite:p:`devahldavis83` and +Hortmann et al. :cite:p:`hortmann90`: + +.. list-table:: Richardson extrapolation vs. benchmark literature + :header-rows: 1 + + * - Quantity + - Observed order :math:`p` + - Extrapolated (:math:`\Delta x\to0`) + - Reference + * - :math:`Nu_{xmin}` + - 2.741 + - 8.8289 + - 8.82 + * - :math:`Nu_{xmax}` + - 2.717 + - 8.8287 + - 8.82 + +.. _fig_steady_natural_convection_cavity_richardson: + +.. figure:: ./images/steady-natural-convection-cavity-richardson_Nu_xmin.png + :width: 90% + :align: center + :alt: Richardson extrapolation of the hot-wall Nusselt number across three grid levels. + + Richardson extrapolation, :math:`Nu_{xmin}` (hot wall). + +Both walls agree with each other in :math:`Nu` at every grid level, as expected +from overall energy balance at steady state, and both converge cleanly toward +the classical benchmark as the mesh is refined. + +Steady-state convergence check +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``mfix.steady_state_tol`` being satisfied confirms the residual dropped +below tolerance, not that the converged state is the physically correct +one Tracking :math:`Nu` and the mean thermodynamic pressure over the +last several plotfiles confirms a genuine plateau rather than a +false-positive stop: + +.. figure:: ./images/steady-natural-convection-cavity-nu_convergence_history.png + :width: 80% + :align: center + :alt: Nusselt number history over the run, 512x512 grid, showing a fast initial transient followed by a flat plateau. + + :math:`Nu` convergence history, :math:`512\times512` grid. + +Excluding the initial transient (first output only), a block-bootstrap +estimate over the last 28 plotfiles gives +:math:`Nu_{xmin}=8.83289\pm0.00032` and :math:`Nu_{xmax}=8.83290\pm0.00035` +(95% CI)—a tight, flat plateau consistent with the point value used in +the grid-convergence table above, not a still-drifting solution. + +Thermodynamic pressure check +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As a second, independent and mesh-cheap validation check, mass conservation +in the closed ideal-gas domain fixes the domain-mean thermodynamic +pressure relative to the wall temperatures. For a purely conductive +profile, the pressure ratio evaluates to the ratio of the logarithmic +mean wall temperature to the reference temperature: + +.. math:: + + \frac{P_{mean}}{P_o} = \frac{T_{lm}}{T_{ref}}, \qquad + T_{lm} = \frac{T_h-T_l}{\ln(T_h/T_l)} + +where :math:`P_o` is the initial operating pressure of the closed system. + +For this case, :math:`T_{lm}/T_{ref}=0.99963`, matching the computed +:math:`P_{mean}/P_o=0.99960` to within 0.004%—and essentially +unchanged across all grids (0.999592 / 0.999599 / 0.999600 / 0.999600). Since +this is a domain-integral quantity dominated by the fixed wall temperatures +rather than a locally resolved wall gradient, it serves as a highly effective, +computationally cheap sanity check that is already converged on the coarsest mesh, +well before :math:`Nu` itself finishes converging. + + +Extensions +----------- + +* A companion case at :math:`\Delta T/T_{ref}=120\%` + (:math:`T_h=960\text{ K}`, :math:`T_l=240\text{ K}`, + :math:`T_{ref}=600\text{ K}`, same :math:`Ra`, :math:`Pr`) tests how far + the ideal-gas solve departs from the Boussinesq benchmark as the + temperature difference grows, validated instead against Le Quere + :cite:p:`lequere2005`. The thermodynamic-pressure check above is + expected to show a much larger, and more convection-sensitive, + departure from its pure-conduction prediction at that :math:`\Delta T`. +* Radiative coupling between the walls (not covered here) is a further + extension of the pure-convection case :cite:p:`lari11`. diff --git a/docs/source_docs/tutorials/fluid/unsteady-flow-around-sphere.rst b/docs/source_docs/tutorials/fluid/unsteady-flow-around-sphere.rst new file mode 100644 index 0000000000000000000000000000000000000000..3241a1736c9403a7d5d964b2d4e7b33e4af3dde7 --- /dev/null +++ b/docs/source_docs/tutorials/fluid/unsteady-flow-around-sphere.rst @@ -0,0 +1,234 @@ +.. _TutorialUnsteadyFlowAroundSphere: + +Unsteady flow around a sphere +================================ + +This tutorial extends the :ref:`steady flow around a sphere +` case to :math:`Re=300`, where the wake +sheds periodically as a chain of hairpin vortices rather than settling into +a fixed recirculation bubble. The geometry, domain, and mesh are unchanged +from the steady case; only the Reynolds number and the time-advance scheme +differ. The drag coefficient and vortex-shedding frequency are computed as +part of the analysis. + +Features +-------- + +* Incompressible fluid flow. +* Unsteady (transient) time advance using the Godunov scheme. +* The same fully three-dimensional embedded-boundary sphere geometry as the + steady tutorial. +* A transient, space-and-time-dependent inflow velocity used to seed the + wake instability. +* Surface-force (drag and side-force) reporting on the embedded boundary. +* Statistical (batch-means) analysis of the drag coefficient and Strouhal + number, with comparison against Johnson & Patel (1999) :cite:p:`johnson99`. + +Case description +----------------- + +The sphere, domain, and mesh are identical to the steady tutorial: diameter +:math:`D=1`, centered at the origin, with the domain extending 8 diameters +upstream, 16 diameters downstream, and 8 diameters radially in :math:`y` +and :math:`z`, resolved at 16 cells/diameter (384x256x256). + +The Reynolds number is raised to + +.. math:: + + Re = \frac{\rho\, U_\infty\, D}{\mu} = 300, \qquad \mu = 0.0033333, + +with :math:`\rho=1` and :math:`U_\infty=1` unchanged. At this Reynolds +number the wake sheds periodically as a chain of hairpin vortices with +planar (not axisymmetric) symmetry (Sakamoto & Haniu :cite:p:`sakamoto90`); +the transition from the steady axisymmetric wake used in the :math:`Re=100` +tutorial passes through an intermediate steady-but-non-axisymmetric regime +around :math:`Re\approx210`-:math:`270` before periodic shedding begins +around :math:`Re\approx270`-:math:`300`. + +Seeding the instability +~~~~~~~~~~~~~~~~~~~~~~~~ + +The steady axisymmetric solution remains a mathematically valid, though +unstable, equilibrium at :math:`Re=300`. A solver that preserves the +problem's symmetry exactly can sit near that equilibrium indefinitely +without something to break the symmetry. Rather than rely on numerical +noise to trigger the transition, the inflow velocity is given a small, +transient, spatially localized perturbation, antisymmetric in :math:`y`, +that decays away after roughly the first ten time units: + +.. code-block:: text + + bc.inflow.fluid.velocity = "1.0 + 0.05*exp(-t/2.0)*y*exp(-(y*y+z*z))" + +This has the side effect of fixing the shedding plane to the :math:`x`- +:math:`y` plane, rather than leaving the orientation to arbitrary numerical +noise -- a deliberate choice for a reproducible tutorial result. The +:math:`z`-force on the sphere stays at floating-point roundoff throughout +the run, confirming the wake organizes into the intended plane. + +Important input sections +-------------------------- + +The fluid viscosity sets the Reynolds number: + +.. code-block:: text + + fluid.viscosity.molecular.model = constant + fluid.viscosity.molecular.constant = 0.0033333 + +Genuine unsteady time advance is used in place of the steady tutorial's +pseudo steady-state iteration, with the Godunov advection scheme and a +raised CFL number: + +.. code-block:: text + + mfix.advection_type = Godunov + mfix.cfl = 0.9 + + mfix.dt_min = 1.0e-6 + mfix.dt_max = 0.1 + + mfix.stop_time = 1000.0 + +Explicit, CFL-limited unsteady time advance is more sensitive to severely +cut EB cells than the steady tutorial's pseudo-time advance was -- a very +small cut cell can otherwise force either an unphysically small timestep or +outright instability. State redistribution addresses this by redistributing +the update from small cut cells into their larger neighbors: + +.. code-block:: text + + mfix.redistribution_type = StateRedist + mfix.correction_small_volfrac = 1.e-4 + +The ``eb_drag`` report is sampled far more frequently than in the steady +tutorial, to adequately resolve the shedding frequency: + +.. code-block:: text + + mfix.reports.eb_drag.regions = eb_sphere + mfix.reports.eb_drag.eb_sphere.int = 3 + +.. note:: + + The complete input file is located in the MFIX-Exa source directory as + ``tutorials/fluid/inputs.unsteady-flow-around-sphere`` + +Post-processing +----------------- + +The ``eb_drag`` report gives the drag coefficient :math:`C_d` and the +lateral force coefficients :math:`C_y`, :math:`C_z` over the full run: + +.. _fig_unsteady_flow_around_sphere_force_history: + +.. figure:: ./images/unsteady-flow-around-sphere-force_history.png + :width: 80% + :align: center + :alt: Drag and side-force coefficient history for unsteady flow around a sphere at Reynolds number 300. + + Force coefficient history, :math:`Re=300`. + +:math:`C_z` sits at floating-point roundoff throughout, confirming the wake +sheds in the intended plane. :math:`C_y` carries a persistent negative +mean rather than oscillating about zero -- consistent with the "planar" +wake character described in the literature for this Reynolds-number range, +where the wake settles into a steady deflection with periodic shedding +superimposed, rather than a simple side-to-side oscillation. + +A windowed mean/standard-deviation view of :math:`C_y` shows a slow +amplitude modulation, with a period of roughly 34 time units, superimposed +on the underlying shedding oscillation: + +.. figure:: ./images/unsteady-flow-around-sphere-windowed_stats.png + :width: 80% + :align: center + :alt: Windowed mean and standard deviation of the side-force coefficient, showing a persistent amplitude modulation. + + Windowed mean and standard deviation of :math:`C_y`. + +This modulation does not decay over the roughly 970 time units recorded +after the initial transient, indicating it is a persistent secondary +feature of the flow at this resolution rather than an artifact of +insufficient run time. It is directly visible in the frequency spectrum of +:math:`C_y` as sidebands evenly spaced around the true shedding frequency +by the modulation frequency -- amplitude modulation of a single carrier, +not several independent shedding modes: + +.. figure:: ./images/unsteady-flow-around-sphere-strouhal_spectrum.png + :width: 80% + :align: center + :alt: Frequency spectrum of the side-force coefficient, showing the dominant shedding frequency and its sidebands. + + Spectrum of :math:`C_y`, settled window. + +Statistical analysis +~~~~~~~~~~~~~~~~~~~~~ + +The drag coefficient and shedding (Strouhal) frequency were each estimated +using the batch-means method: the settled portion of the record +(:math:`t\ge250`) was split into seven non-overlapping 100-time-unit +windows, each window's quantity was estimated independently, and a +t-distribution interval was computed on the resulting sample. Because these +windows are consecutive segments of one continuous run rather than +independent repeated experiments, this interval should be read as the +spread of the estimate within this run, not a formal confidence interval +over repeated realizations. + +.. list-table:: Batch-means results vs. Johnson & Patel (1999), :math:`Re=300` + :header-rows: 1 + + * - Quantity + - Mean + - 95% interval + - Reference + - % difference + * - :math:`C_d` + - 0.6765 + - (0.6760, 0.6770) + - 0.656 + - +3.1% + * - :math:`St` + - 0.1191 + - (0.1186, 0.1195) + - 0.137 + - -13.1% + +Both intervals are narrow enough that the reference value falls clearly +outside each one -- these are small but real, well-resolved discrepancies +rather than run-to-run noise. The drag coefficient is close to the +reference; the shedding frequency is not. No dedicated grid-refinement +study was performed for this unsteady case (unlike the steady tutorial), +so mesh resolution is a plausible, though unconfirmed, contributor to both +gaps. + +Flow visualization +~~~~~~~~~~~~~~~~~~~ + +A single mid-plane slice, colored by out-of-plane vorticity, shows the +meandering wake: + +.. figure:: ./images/unsteady-flow-around-sphere-midplane_snapshot.png + :width: 80% + :align: center + :alt: Mid-plane out-of-plane vorticity contour showing the meandering wake behind the sphere at Reynolds number 300. + + Out-of-plane vorticity, mid-plane slice, :math:`Re=300`. + +A 2D slice cannot show the shedding process itself, since the shed +structures are inherently three-dimensional. An animation of Q-criterion +isosurfaces, colored by velocity magnitude and generated in ParaView, +shows the wake organizing into a pair of counter-rotating streamwise +vortex legs that periodically pinch off into discrete hairpin loops and +convect downstream. + +.. raw:: html + +
+ +
+
diff --git a/docs/source_docs/tutorials/index.rst b/docs/source_docs/tutorials/index.rst index 2b616fe2c053adc637be63fdfb25e4a5315e53ee..b41e870e2716dbdc76aa73f462052a07920e454b 100644 --- a/docs/source_docs/tutorials/index.rst +++ b/docs/source_docs/tutorials/index.rst @@ -1,12 +1,67 @@ -Incompressible Fluid -==================== +.. _Tutorials: -These tutorials describe complete MFIX-Exa cases and the main input choices -used to build them. +Overview +======== + +These tutorials walk through setting up, running, and analyzing MFIX-Exa +cases, starting from simple, well-characterized flows and building toward +more complex setups. Each tutorial includes the complete a description of +the important input sections, and an analysis of the results. + +Tutorials are grouped by the physical model they use. Within each category, +tutorials vary in which additional physical capabilities they exercise -- for +example, the energy equation, species transport, reactions, or a rotating +reference frame. The table below summarizes this across all tutorials. + +.. |check| unicode:: U+2713 + + +Fluid +----- + +.. list-table:: Tutorial capability overview + :header-rows: 1 + :widths: 28 14 14 10 12 12 + + * - Tutorial + - Time advance + - Reference Frame + - Energy + - Species + - Multi-Fluid + * - :ref:`Flow around a cylinder ` + - Steady + - Inertial + - + - + - + * - :ref:`Backward-facing step ` + - Steady + - Inertial + - + - + - + * - :ref:`Flow around a sphere ` + - Steady + - Inertial + - + - + - + * - :ref:`Flow around a sphere ` + - Unsteady + - Inertial + - + - + - + * - :ref:`Natural convection in square cavity` + - Steady + - Inertial + - |check| + - + - .. toctree:: - :maxdepth: 1 + :maxdepth: 2 + :caption: Tutorials - incompressible-fluid/steady-backward-facing-step - incompressible-fluid/steady-flow-around-cylinder - incompressible-fluid/steady-flow-around-sphere + fluid/index