Commit 5fff4546 authored by Mark Meredith's avatar Mark Meredith
Browse files

Merge branch 'master' into mr/cmake-fetch

parents 11647c5d 37ce33b5
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
dist: xenial

language: generic

python:
  - 3.6

install:
  - pip install --user sphinx  # sphinx_rtd_theme
    # pypi's sphinx_rtd_theme is outdated. Internet recommends using current
    # master. Note: at some point, it will be OK to add `sphinx_rtd_theme` to
    # the `pip install` above => remove line below:
  - python -m pip install --user https://github.com/rtfd/sphinx_rtd_theme/archive/master.zip -U
  - python -m pip install --user sphinx sphinx-rtd-theme

script: bash ./build_and_deploy.sh

@@ -24,7 +22,7 @@ addons:
deploy:
  provider: pages
  target-branch: gh-pages
  local-dir: docs/build
  local-dir: docs/webroot
  skip-cleanup: true
  github-token: $GITHUB_TOKEN  # Set in travis-ci.org dashboard, marked secure
  keep-history: true
+3 −41
Original line number Diff line number Diff line
#!/bin/bash
#!/bin/bash -ex
set -e # Exit with nonzero exit code if anything fails

# Then we build and deploy the sphinx / doxygen documentation
@@ -16,43 +16,5 @@ fi
#SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
#SHA=`git rev-parse --verify HEAD`

# Change working directory to /docs
cd docs    # ..................................... now we're in /docs 


############################# DOXYGEN  ########################################


cd doxygen # ..................................... now we're in /docs/doxygen

# create temporary clone of MFiX-Exa SOURCE_BRANCH
git clone https://gitlab-ci-token:$GITLAB_TOKEN@mfix.netl.doe.gov/gitlab/exa/mfix.git

# build the Doxygen documentation
doxygen doxygen.conf

cd ..      # ..................................... now we're in /docs

# move it to the deploy directory: /docs/build
mkdir build
mv doxygen/html build/doxygen


############################# SPHINX   ########################################


# now do sphinx
make html
cd build   # ..................................... now we're in /docs/build
mv html docs_html


############################# WEB SERVER STUFF ################################


# Sphinx is set up to treat build/html (and by mv, build/docs_html) as the
# webroot. Hence the .nojekyll file is in the wrong place
mv docs_html/.nojekyll .

# PWD is currently /docs/build, we want to move /docs/webroot into /docs/build
mv ../webroot/* .
# build Doxygen docs and Sphinx docs
make -C docs
+12 −6
Original line number Diff line number Diff line
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = python -msphinx
SPHINXPROJ    = amrex
SOURCEDIR     = source
BUILDDIR      = build
BUILDDIR      = webroot

all: html webroot/doxygen
	mv webroot/html webroot/docs_html
# Sphinx is set up to treat its build directory as the webroot, hence the
# .nojekyll file is in the wrong place
	mv webroot/docs_html/.nojekyll webroot

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

@@ -18,3 +19,8 @@ help:
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

webroot/doxygen:
	git clone "https://gitlab-ci-token:$(GITLAB_TOKEN)@mfix.netl.doe.gov/gitlab/exa/mfix.git" doxygen/mfix
	cd doxygen && doxygen doxygen.conf
	mv doxygen/html $@
+62 −0
Original line number Diff line number Diff line
Creating the MAC velocities
~~~~~~~~~~~~~~~~~~~~~~~~~~~

To create the normal velocities on faces, we first extrapolate from the cell centers on each side using the
slopes as computed earlier, and upwind the face value to define  :math:`U^{pred}`

.  To compute the x-velocity on the x-faces of regular (ie not cut) cells, we call

   .. code:: shell

            AMREX_CUDA_HOST_DEVICE_FOR_3D(ubx, i, j, k,
             {
                 // X-faces
                 Real upls     = ccvel_fab(i  ,j,k,0) - 0.5 * xslopes_fab(i  ,j,k,0);
                 Real umns     = ccvel_fab(i-1,j,k,0) + 0.5 * xslopes_fab(i-1,j,k,0);
                 if ( umns < 0.0 && upls > 0.0 ) {
                    umac_fab(i,j,k) = 0.0;
                 } else {
                    Real avg = 0.5 * ( upls + umns );
                    if ( std::abs(avg) <  small_vel) { umac_fab(i,j,k) = 0.0;
                    } else if (avg >= 0)             { umac_fab(i,j,k) = umns;
                    } else                           { umac_fab(i,j,k) = upls;
                    }
                 }
             });

For cut cells we test on whether the area fraction is non-zero: 
       
   .. code:: shell

             AMREX_CUDA_HOST_DEVICE_FOR_3D(ubx, i, j, k,
             {
                 // X-faces
                 if (ax_fab(i,j,k) > 0.0)
                 {
                    Real upls     = ccvel_fab(i  ,j,k,0) - 0.5 * xslopes_fab(i  ,j,k,0);
                    Real umns     = ccvel_fab(i-1,j,k,0) + 0.5 * xslopes_fab(i-1,j,k,0);
                    if ( umns < 0.0 && upls > 0.0 ) {
                       umac_fab(i,j,k) = 0.0;
                    } else {
                       Real avg = 0.5 * ( upls + umns );
                       if ( std::abs(avg) <  small_vel) { umac_fab(i,j,k) = 0.0;
                       } else if (avg >= 0)             { umac_fab(i,j,k) = umns;
                       } else                           { umac_fab(i,j,k) = upls;
                       }
                    }
                 } else {
                       umac_fab(i,j,k) = huge_vel;
                 }
             });

We then perform a MAC projection on the face-centered velocities to enforce that they satisfy 

.. math:: \nabla \cdot (\varepsilon_g  U^{MAC})  = 0

We do this by solving 

.. math:: \nabla \cdot \frac{\varepsilon_g}{\rho_g} \nabla \phi^{MAC} = \nabla \cdot \left( \varepsilon_g  U^{pred} \right)

then defining

.. math:: U^{MAC} = U^{pred} - \frac{1}{\rho_g} \nabla \phi^{MAC}
+107 −0
Original line number Diff line number Diff line
.. _Chap:CITesting :

Continuous Integration
======================

The following regression tests are run every time a commit is pushed to the main
MFiX-Exa repository on the NETL gitlab.

For each of the tests in the chart below, there are
three directional variations; these are identified in the repository as, 
for example, FLD01-x, FLD01-y, and FLD01-z.  

For each direction, where appropriate, there are multiple versions, with the following notations:

  * SGS: single grid serial

  * MGS: multiple grid serial

  * TGS: tiled grid serial

  * MGP: multiple grid parallel

Below Ng = number of grids, Npa = number of particles, Np = number of MPI ranks.

All the FLD cases are fluid-only and steady state.
All the DEM cases are particle-only except for DEM06 and DEM07 which are fluid and particles;
these both use the "BVK2" drag type.
In all cases the particle data were read in from "particle_input.dat"

None of these tests have non-rectangular geometry.

"NSW" means "No Slip Wall" and "Per" is "periodic."
"MI/PO" refers to Mass     Inflow at the low end of the domain and Pressure Outflow at the high end.
"PI/PO" refers to Pressure Inflow at the low end of the domain and Pressure Outflow at the high end.

Additional detail about these problems is given in tests/README.md

Single-grid, single-process (SGS) particle-only tests:

+-------+----+----+----+------+------+-------+-----+--------------------+
| Test  | nx | ny | nz | bc_x | bc_y | bc_z  | Npa | Description        |
+=======+====+====+====+======+======+=======+=====+====================+
| DEM01 | 2  | 5  | 5  | NSW  | Per  | Per   | 1   | Freely falling     |
|       |    |    |    |      |      |       |     | particle with      |
|       |    |    |    |      |      |       |     | wall collision     |
+-------+----+----+----+------+------+-------+-----+--------------------+
| DEM02 | 2  | 5  | 5  | NSW  | Per  | Per   | 1   | Multiple bounces   |
|       |    |    |    |      |      |       |     | with bounce height |
|       |    |    |    |      |      |       |     | measured           |
+-------+----+----+----+------+------+-------+-----+--------------------+
| DEM03 | 2  | 5  | 5  | NSW  | Per  | Per   | 2   | Two stacked        |
|       |    |    |    |      |      |       |     | compressed         |
|       |    |    |    |      |      |       |     | particles          |
+-------+----+----+----+------+------+-------+-----+--------------------+
| DEM04 | 4  | 4  | 4  | NSW  | Per  | Per   | 1   | Single particle    |
|       |    |    |    |      |      |       |     | slipping on a      |
|       |    |    |    |      |      |       |     | rough surface      |
+-------+----+----+----+------+------+-------+-----+--------------------+
| DEM05 | 5  |  2 |  5 | Per  | Per  | Per   | 93  | Oblique particle   |
|       |    |    |    |      |      |       |     | collisions         |
|       |    |    |    |      |      |       |     |                    |
+-------+----+----+----+------+------+-------+-----+--------------------+


Steady-state fluid-only tests:

+-------+-----+----+----+----+-------+------+------+-----+----------------------+
| Test  |     | nx | ny | nz | bc_x  | bc_y | bc_z | Ng  | Np                   |
+=======+=====+====+====+====+=======+======+======+=====+======================+
| FLD01 |     | 8  | 8  | 4  | Per   | NSW  | Per  | Poiseuille flow            |
+-------+-----+----+----+----+-------+------+------+-----+----+-----------------+
|       | SGS |    |    |    |       |      |      | 1   | 1  |                 |
|       | MGS |    |    |    |       |      |      | 4   | 1  |                 |
|       | MGP |    |    |    |       |      |      | 4   | 8  |                 |
+-------+-----+----+----+----+-------+------+------+-----+----+-----------------+
| FLD02 |     | 80 |16  | 16 | MI/PO | NSW  | NSW  | Couette flow               |
+-------+-----+----+----+----+-------+------+------+-----+----+-----------------+
|       | SGS |    |    |    |       |      |      | 1   | 1  |                 |
|       | MGS |    |    |    |       |      |      | 40  | 1  |                 | 
|       | MGP |    |    |    |       |      |      | 40  | 8  |                 |
+-------+-----+----+----+----+-------+------+------+-----+----+-----------------+
| FLD03 |     | 8  | 8  | 4  | PI/PO | NSW  | Per  | Poiseuille flow            |
+-------+-----+----+----+----+-------+------+------+-----+----+-----------------+
|       | SGS |    |    |    |       |      |      | 1   | 1  |                 |
|       | MGS |    |    |    |       |      |      | 4   | 1  |                 |
|       | MGP |    |    |    |       |      |      | 4   | 8  |                 |
+-------+-----+----+----+----+-------+------+------+-----+----+-----------------+

Coupled particle/fluid tests:

+-------+-----+----+----+----+------+------+------+------+----+--------------------+
| Test  |     | nx | ny | nz | bc_x | bc_y | bc_z | Npa  | Ng | Np                 |
+=======+=====+====+====+====+======+======+======+======+====+====================+
| DEM06 |     | 50 | 5  | 5  |  NSW | NSW  | NSW  | 1    | Single particle falling | 
|       |     |    |    |    |      |      |      |      | under gravity           |
+-------+-----+----+----+----+------+------+------+------+----+----+---------------+
|       | SGS |    |    |    |      |      |      |      | 1  | 1  |               |
|       | MGS |    |    |    |      |      |      |      | 10 | 1  |               |
|       | MGP |    |    |    |      |      |      |      | 10 | 8  |               |
+-------+-----+----+----+----+------+------+------+------+----+----+---------------+
| DEM07 |     | 20 | 20 | 20 | Per  | Per  | Per  | 1222 | Homogeneous cooling     |
|       |     |    |    |    |      |      |      |      | system                  |
+-------+-----+----+----+----+------+------+------+------+----+----+---------------+
|       | SGS |    |    |    |      |      |      |      | 1  | 1  |               |
|       | MGS |    |    |    |      |      |      |      | 8  | 1  |               |
|       | MGP |    |    |    |      |      |      |      | 8  | 8  |               |
+-------+-----+----+----+----+------+------+------+------+----+----+---------------+
Loading