Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create theory section and update tutorials #233

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ae501a8
Update basic inner products theory
dccowan Nov 18, 2020
794db2b
Final draft of basic inner products theory
dccowan Nov 18, 2020
d13ed21
preliminary add of isotropic and anisotropic inner products. Fix some…
dccowan Nov 19, 2020
39a8b1c
Update tutorials and theory to have consistent vector notation
dccowan Nov 19, 2020
9bde7c8
Merge branch 'master' into update_theory
dccowan Nov 19, 2020
05ba1f6
Add link to theory and update tutorials for latest difinition of orig…
dccowan Nov 19, 2020
306bef5
Clean up some typos and improvements to formulations
dccowan Nov 20, 2020
ddaec41
Draft of differential operators
dccowan Nov 21, 2020
7a58a64
Final draft of discrete operators
dccowan Nov 21, 2020
826232a
Improve finite volume theory title page
dccowan Nov 21, 2020
2fac6e8
small edit
dccowan Nov 22, 2020
29ce0c7
Create mesh theory section
dccowan Nov 23, 2020
009eb50
Organization, links and structure of theory section
dccowan Nov 24, 2020
0e891b2
Adding interpolation matrix theory
dccowan Nov 24, 2020
be8fc0f
Draft for averaging matrices
dccowan Nov 25, 2020
8c4e7ab
Finish averaging operators section small edits to notation
dccowan Nov 26, 2020
7db23bd
Preliminary draft of inner products with differential operators
dccowan Nov 26, 2020
b561555
Edits to inner products with differential operators
dccowan Nov 26, 2020
a0b2b40
Add captions, links and labels
dccowan Nov 27, 2020
d762067
Finalize Poisson with zero neumann condition example and theory
dccowan Nov 30, 2020
b178367
Update finalized theory and tutorial for poisson and advection-diffusion
dccowan Dec 1, 2020
d0c95f5
Add reciprocal properties theory
dccowan Dec 1, 2020
117ff04
Add boundary conditions for divergence. Edits to gradient
dccowan Dec 5, 2020
dc3b5e6
Boundary conditions on the curl
dccowan Dec 8, 2020
2564c84
Add interpolation matrix tutorial
dccowan Dec 8, 2020
34dcc66
Update interpolation tutorial to match variable definition in theory
dccowan Dec 8, 2020
b2e7d55
Merge branch 'master' into update_theory
dccowan Dec 8, 2020
ad3d5c5
small edits
dccowan Dec 9, 2020
0f1a966
Add a few hyperlinks
dccowan Dec 9, 2020
4873308
Add references
dccowan Dec 10, 2020
105f36c
update suggestions to interpolation tutorial
dccowan Dec 31, 2020
3b7f1de
Fix typos and test new organization of theory and tutorials.
dccowan Jan 8, 2021
df7007b
Update meshes and operators tutorials (amalgamation)
dccowan Jan 19, 2021
02efc33
Restructure inner products tutorials section
dccowan Jan 20, 2021
0c6b980
Update tutorials
dccowan Jan 21, 2021
0985a8f
Small edits
dccowan Jan 22, 2021
49b8657
configure bibtex
dccowan Jan 27, 2021
f1fe3ba
Merge branch 'master' into update_theory
dccowan Mar 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"numpydoc",
"nbsphinx",
"sphinx_gallery.gen_gallery",
"sphinxcontrib.bibtex"
]

# Autosummary pages will be generated by sphinx-autogen instead of sphinx-build
Expand Down
19 changes: 0 additions & 19 deletions docs/content/finite_volume.rst

This file was deleted.

125 changes: 125 additions & 0 deletions docs/content/finite_volume_index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
.. _finite_volume_index:

Intoduction to Finite Volume
****************************

What is Finite Volume?
----------------------

The finite volume method is a method for numerically approximating the solution to partial differential equations.
Implementation of the finite volume method requires the discretization of continuous functions and variables.
Discrete representations of functions and variables are organized on a numerical grid (or mesh).
The final product of the approach is a linear system of equations :math:`\boldsymbol{A \phi=q}`
that can be solved to compute the discrete approximation of a desired quantity.

.. figure:: ../images/finitevolumeschematic.png
:width: 700
:align: center

Conceptual illustrating for solving PDEs with the finite volume method.

In *discretize*, we use a staggered mimetic finite volume approach (:cite:`haber2014,HymanShashkov1999`).
This approach requires the definitions of variables at either cell-centers, nodes, faces, or edges.
This method is different from finite difference methods,
as the final linear system is constructed by approximating the inner products between
test functions and partial differential equations.

**Contents:**

- :ref:`Meshes <meshes_index>`
- :ref:`Interpolation, Averaging and Differential Operators <operators_index>`
- :ref:`Inner Products <inner_products_index>`
- :ref:`Discretizing PDEs Derivation Examples <derivation_examples_index>`

**Tutorials and Examples Gallery:**

- :ref:`Mesh Generation <sphx_glr_tutorials_mesh_generation>`
- :ref:`Interpolation, Averaging and Differential Operators <sphx_glr_tutorials_operators>`
- :ref:`Inner Products <sphx_glr_tutorials_inner_products>`
- :ref:`Discretizing PDEs Derivation Examples <sphx_glr_tutorials_pde>`
- :ref:`Examples Gallery <sphx_glr_examples>`


Examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be made one level lower? E.g. a subheading of the page, which is "Finite Volume", and then DC resistivity and FDEM under that. This way, there is only one top-level heading on the page

image

--------

Below are several examples of the final linear system obtained using the finite volume approach.
A comprehensive derivation of the final result is not provided here. The full derivations are
provide in the :ref:`discretizing PDEs derivation examples <derivation_examples_index>` theory section.

Direct Current Resistivity
^^^^^^^^^^^^^^^^^^^^^^^^^^

The governing equation for the direct current resistivity problem is given by:

.. math::
\nabla \cdot \sigma \nabla \phi = -q_s

where

- :math:`\phi` is the electric potential
- :math:`\sigma` is the electrical conductivity within the domain
- :math:`q_s` is a general representation of the source term
- :math:`\nabla` is the gradient operator
- :math:`\nabla \cdot` is the divergence operator

If we choose to define the discrete representation of the electric potential on the nodes,
the solution for the electric potentials after applying the finite volume approach is given by:

.. math::
\boldsymbol{[G^T \! M_{\sigma e} G ]} \boldsymbol{\phi} = \mathbf{q_s}

where :math:`\boldsymbol{G^T \! M_{\sigma e} G }` is a sparse matrix and

- :math:`\boldsymbol{\phi}` is the discrete approximation to the electric potentials on the nodes
- :math:`\boldsymbol{G}` is the :ref:`discrete gradient operator <operators_differential_gradient>`
- :math:`\boldsymbol{M_{\sigma e}}` is the :ref:`mass matrix for electrical conductivity <inner_products_isotropic_edges>`
- :math:`\boldsymbol{q_s}` is the discrete representation of the source term on the nodes


Frequency Domain Electromagnetics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The governing equations for the frequency domain electromagnetic problems,
for a source current, can be expressed using Maxwell's equations:

.. math::
\begin{align}
&\nabla \times \mu^{-1} \vec{B} - \sigma \vec{E} = \vec{J}_s \\
&\nabla \times \vec{E} = - i\omega \vec{B}
\end{align}

where

- :math:`\vec{E}` is the electric field
- :math:`\vec{B}` is the magnetic flux density
- :math:`\vec{J}_s` is a general representation of the source term
- :math:`\sigma` is the electrical conductivity within the domain
- :math:`\mu` is the magnetic permeability within the domain
- :math:`\omega` is the angular frequency
- :math:`\nabla \times` is the curl operator

Here we choose to define the discrete representation of the electric field on edges
and the discrete representation of the magnetic flux density on faces.
The solution for the electric potentials after applying the finite volume approach is given by:

.. math::
\begin{align}
\boldsymbol{C^T \! M_{\mu f} \, b } - \boldsymbol{M_{\sigma e} \, e} = \mathbf{j_s} \\
\mathbf{C \, e} = -i \omega \mathbf{b}
\end{align}

which can be combined to form a single linear system:

.. math::
\boldsymbol{[C^T \! M_{\mu f} C } + i\omega \boldsymbol{M_{\sigma e}]} \mathbf{e} = -i \omega \mathbf{j_s}

where :math:`\boldsymbol{C^T \! M_{\mu f} C } + i\omega \boldsymbol{M_{\sigma e}}` is a sparse matrix and

- :math:`\boldsymbol{e}` is the discrete approximation to the electric field on edges
- :math:`\boldsymbol{b}` is the discrete approximation to the magnetic flux density on faces
- :math:`\boldsymbol{C}` is the :ref:`discrete curl operator <operators_differential_curl>`
- :math:`\boldsymbol{M_{\sigma e}}` is the :ref:`mass matrix for electrical conductivity <inner_products_isotropic_edges>`
- :math:`\boldsymbol{M_{\mu f}}` is the :ref:`mass matrix for the inverse of the magnetic permeability <inner_products_isotropic_reciprocal>`
- :math:`\boldsymbol{j_s}` is the discrete representation of the source current density on the edges

Loading