From 8a0d57098c2396eca6dff310016b3d362deea1cf Mon Sep 17 00:00:00 2001 From: blaisb Date: Fri, 22 May 2020 01:24:54 -0400 Subject: [PATCH] Added a preliminary version of step-x for particle tracking on analytically defined velocity field --- examples/step-x/CMakeLists.txt | 62 ++++ examples/step-x/doc/builds-on | 0 examples/step-x/doc/intro.dox | 63 ++++ examples/step-x/doc/kind | 1 + examples/step-x/doc/results.dox | 2 + examples/step-x/doc/tooltip | 1 + examples/step-x/step-x.cc | 542 ++++++++++++++++++++++++++++++++ 7 files changed, 671 insertions(+) create mode 100644 examples/step-x/CMakeLists.txt create mode 100644 examples/step-x/doc/builds-on create mode 100644 examples/step-x/doc/intro.dox create mode 100644 examples/step-x/doc/kind create mode 100644 examples/step-x/doc/results.dox create mode 100644 examples/step-x/doc/tooltip create mode 100644 examples/step-x/step-x.cc diff --git a/examples/step-x/CMakeLists.txt b/examples/step-x/CMakeLists.txt new file mode 100644 index 0000000000..c719845020 --- /dev/null +++ b/examples/step-x/CMakeLists.txt @@ -0,0 +1,62 @@ +## +# CMake script +## + +# Set the name of the project and target: +SET(TARGET "step-x") + +# Declare all source files the target consists of. Here, this is only +# the one step-X.cc file, but as you expand your project you may wish +# to add other source files as well. If your project becomes much larger, +# you may want to either replace the following statement by something like +# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") +# FILE(GLOB_RECURSE TARGET_INC "include/*.h") +# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# or switch altogether to the large project CMakeLists.txt file discussed +# in the "CMake in user projects" page accessible from the "User info" +# page of the documentation. +SET(TARGET_SRC + ${TARGET}.cc + ) + +# Usually, you will not need to modify anything beyond this point... + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) + +FIND_PACKAGE(deal.II 9.2.0 QUIET + HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} + ) +IF(NOT ${deal.II_FOUND}) + MESSAGE(FATAL_ERROR "\n" + "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" + "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" + "or set an environment variable \"DEAL_II_DIR\" that contains this path." + ) +ENDIF() + +# +# Are all dependencies fulfilled? +# +IF(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line + MESSAGE(FATAL_ERROR " +Error! This tutorial requires a deal.II library that was configured with the following options: + DEAL_II_WITH_PETSC = ON + DEAL_II_PETSC_WITH_COMPLEX = OFF + DEAL_II_WITH_P4EST = ON +or + DEAL_II_WITH_TRILINOS = ON + DEAL_II_WITH_P4EST = ON +However, the deal.II library found at ${DEAL_II_PATH} was configured with these options + DEAL_II_WITH_PETSC = ${DEAL_II_WITH_PETSC} + DEAL_II_PETSC_WITH_COMPLEX = ${DEAL_II_PETSC_WITH_COMPLEX} + DEAL_II_WITH_P4EST = ${DEAL_II_WITH_P4EST} + DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} +which conflict with the requirements. +One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." + ) +ENDIF() + +DEAL_II_INITIALIZE_CACHED_VARIABLES() +SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) +PROJECT(${TARGET}) +DEAL_II_INVOKE_AUTOPILOT() diff --git a/examples/step-x/doc/builds-on b/examples/step-x/doc/builds-on new file mode 100644 index 0000000000..e69de29bb2 diff --git a/examples/step-x/doc/intro.dox b/examples/step-x/doc/intro.dox new file mode 100644 index 0000000000..913e9555ce --- /dev/null +++ b/examples/step-x/doc/intro.dox @@ -0,0 +1,63 @@ +
+ + + +Bruno Blais (Polytechnique Montréal), +Toni El Geitani Nehme (Polytechnique Montreal), +Rene Gassmöller (University of California Davis), +and Wolfgang Banghert (Colorado State University) + + +@dealiiTutorialDOI{10.5281/zenodo.3829064,https://zenodo.org/badge/DOI/10.5281/zenodo.3829064.svg} + + +

Introduction

+ +

Massively parallel non-matching grid simulations of fluid structure interaction problems

+ + +We are going to solve the following differential problem: given a sufficiently +regular function $g$ on $\Gamma$, find the solution $(\textbf{u},p)$ to + +@f{eqnarray*} + -\Delta \mathbf{u} + \nabla p &=& 0,\\ + -\nabla \cdot \textbf{u} &=& 0,\\ + \textbf{u} &=& \textbf{g} \text{ in } \Gamma,\\ + \textbf{u} &=& 0 \text{ on } \partial\Omega. +@f} + +This equation, which we have normalized by scaling the time units in +such a way that the viscosity has a numerical value of 1, describes +slow, viscous flow such as honey or lava. +The main goal of this tutorial is to show how to impose the velocity field +condition $\mathbf{u} = \mathbf{g}$ on a non-matching $\Gamma$ in a weak way, +using a penalization method. A more extensive discussion of the Stokes +problem including body forces, different boundary conditions, and solution +strategies can be found in step-22. + +Let us start by considering the Stokes problem alone, in the entire domain +$\Omega$. We look for a velocity field $\mathbf{u}$ and a pressure field $p$ +that satisfy the Stokes equations with homogeneous boundary conditions +on $\partial\Omega$. + + +

The testcase

+ +Taylor-Couette flow and dye droplets that revert back to their original shape +after the fluid has been displaced in a periodic manner. + +@htmlonly + + + +@endhtmlonly + +demonstrating the time-reversibility of the flow. + +

References

+ +