Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 3 additions & 13 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,14 @@ for deep learning assisted reacting flow simulations. It is also has the scope t
.. toctree::
:maxdepth: 3
:numbered:
:caption: Installation
:glob:

installation/index

.. _quikstart:

.. toctree::
:maxdepth: 3
:caption: Quick Start
:glob:

quickstart/index
qs/install
qs/examples
qs/input





.. _solvers:

.. toctree::
Expand Down
108 changes: 0 additions & 108 deletions docs/source/installation/index.rst

This file was deleted.

File renamed without changes
Binary file added docs/source/qs/compile_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions docs/source/qs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Two Examples
===================

DeepFlame with DNN
--------------------------

If you choose to use PyTorch as the integratgor and use the compilation flag `--use_pytorch`, you can run examples stored in `$HOME/deepflame-dev/examples/.../pytorchIntegratgor`. To run an example, you first need to source your OpenFOAM:

.. code-block:: bash

source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc

Then, source your DeepFlame:

.. code-block:: bash

source $HOME/deepflame-dev/bashrc

Next, you can go to the directory of any example case that you want to run. For example:

.. code-block:: bash

cd $HOME/deepflame-dev/examples/zeroD_cubicReactor/H2/pytorchIntegratgor

This is an example for the zero-dimensional hydrogen combustion with PyTorch as the integrator. All files needed by DNN are stored in `pytorchDNN` folder, and the inference file is `inference.py`. Configurations regarding DNN are included in `constant/CanteraTorchProperties`.

The case is run by simply typing:

.. code-block:: bash

./Allrun

.. Note:: Users can go to `constant/CanteraTorchProperties` and check if `torch` is switched on. Switch it `on` to run DNN cases, and switch `off` to run CVODE cases.

If you plot PyTorch's result together with CVODE's result, the graph is expected to look like:

.. figure:: pytorch.png

Visualisation of 0D results from PyTorch and CVODE integrators



DeepFlame without DNN
------------------------------
CVODE Integrator is the one without the application of Deep Neural Network (DNN). Follow the steps below to run an example of CVODE. Examples are stored in the directory:
.. code-block:: bash

$HOME/deepflame-dev/examples

To run these examples, first source your OpenFOAM, depending on your OpenFOAM path:

.. code-block:: bash

source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc

Then, source your DeepFlame:

.. code-block:: bash

source $HOME/deepflame-dev/bashrc

Next, you can go to the directory of any example case that you want to run. For example:

.. code-block:: bash

cd $HOME/deepflame-dev/examples/zeroD_cubicReactor/H2/cvodeIntegrator

This is an example for the zero-dimensional hydrogen combustion with CVODE integrator.

The case is run by simply typing:

.. code-block:: bash

./Allrun

The probe used for post processing is defined in ``/system/probes``. In this case, the probe is located at the coordinates (0.0025 0.0025 0.0025) to measure temperature variation with time.
If the case is successfully run, the result can be found in ``/postProcessing/probes/0/T``, and it can be visualized by running:

.. code-block:: bash

gunplot
plot "/your/path/to/postProcessing/probes/0/T"

You will get a graph:

.. figure:: 0Dcvode.jpg

Visualisation of the zero-dimensional hydrogen combustion result with CVODE integrator
59 changes: 59 additions & 0 deletions docs/source/qs/input.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Brief Introduction to Inputs
======================================
The dictionary ``CanteraTorchProperties`` is the original dictionay of DeepFlame. It read in netowrk realted parameters and configurations. It typically looks like:

.. code-block::

chemistry on;
CanteraMechanismFile "ES80_H2-7-16.yaml";
transportModel "Mix";//"UnityLewis";
odeCoeffs
{
//"relTol" 1e-15;
//"absTol" 1e-24;
}
inertSpecie "N2";

zeroDReactor
{
constantProperty "pressure";
}

torch on;
GPU on;
torchModel1 "ESH2-sub1.pt";
torchModel2 "ESH2-sub2.pt";
torchModel3 "ESH2-sub3.pt";

torchParameters1
{
Tact 700 ;
Qdotact 3e7;
coresPerGPU 4;
}
torchParameters2
{
Tact 2000;
Qdotact 3e7;
}
torchParameters3
{
Tact 2000;
Qdotact 7e8;
}
loadbalancing
{
active false;
//log true;
}


In the above example, the meanings of the parameters are:

* ``CanteraMechanismFile``: the name of the reaction mechanism file
* ``odeCoeffs``: the ode torlerance. 1e-15 and 1e-24 are used for network training, so it should keep the same when comparing results with nd without DNN.
* ``torch``: the switch used to control the on and off of DNN. If users are running CVODE, this needs to be switched off.
* ``GPU``: the switch used to control whether GPU or CPU is used to carry out inference.
* ``torchModel``: name of network.
* ``torchParameters``: thresholds used to decide when to use network.
* ``coresPerGPU``: number of CPU cores on one node.
Loading