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

Update Docs and test #414

Merged
merged 6 commits into from
Dec 29, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/CPU_inferencce_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
&& wget --content-disposition https://aisquare.oss-us-east-1.aliyuncs.com/data/datasets/14b50df5-dbe9-4f1c-bf58-032b8bc40a20
&& unzip flare_CH4_SandiaD_4D.zip
&& ls $PWD
&& cp -r flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/2DSandiaD_flareFGM/
&& cp -r flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM
&& source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc
&& . configure.sh --use_pytorch&& source ./bashrc && . install.sh
&& cd test && ./Allrun && conda deactivate "
Expand Down
30 changes: 5 additions & 25 deletions docs/source/qs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,9 @@ Finally you can build and install DeepFlame:

Other Options
-------------------------------
DeepFlame also provides users with LibTorch and CVODE (no DNN version) options.
DeepFlame also provides users with full GPU version and CVODE (no DNN version) options.

**1. If you choose to use LibTorch (C++ API for Torch), first create the conda env and install** `LibCantera <https://anaconda.org/conda-forge/libcantera-devel>`_:

.. code-block:: bash

conda create -n df-libtorch python=3.8
conda activate df-libtorch
conda install -c conda-forge libcantera-devel

Then you can pass your own libtorch path to DeepFlame.

.. code-block:: bash

cd deepflame-dev
. configure.sh --libtorch_dir /path/to/libtorch/
source ./bashrc
. install.sh

.. Note:: Some compiling issues may happen due to system compatability. Instead of using conda installed Cantera C++ lib and the downloaded Torch C++ lib, try to compile your own Cantera and Torch C++ libraries.


**2. If you just need DeepFlame's CVODE solver without DNN model, just install LibCantera via** `conda <https://docs.conda.io/en/latest/miniconda.html#linux-installers>`_.
**1. If you just need DeepFlame's CVODE solver without DNN model, just install LibCantera via** `conda <https://docs.conda.io/en/latest/miniconda.html#linux-installers>`_.

.. code-block:: bash

Expand All @@ -199,7 +179,7 @@ If ``df-notorch`` not activated (or you have a self-compiled libcantera), specif
. install.sh


**3. If you wish to employ dfMatrix and the AMGX library for accelerating PDE solving using GPU:**
**2. If you wish to employ dfMatrix and the AMGX library for accelerating PDE solving using GPU:**

.. Note:: This is still under developement.

Expand All @@ -208,7 +188,7 @@ To begin, you will need to install AMGX. You can find the instructions for insta
.. code-block:: bash

cd deepflame-dev
. configure.sh --amgx_dir /your/path/to/AMGX/
. configure.sh --amgx_dir /your/path/to/AMGX/ --libtorch_dir /path/to/libtorch/
source ./bashrc
. install.sh

Expand All @@ -224,7 +204,7 @@ Also, you will need to add configuration files for AMGX for each euqation under
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


**4. If you wish to install DeepFlame with CMake**
**3. If you wish to install DeepFlame with CMake**

.. Note:: This is still under developement.

Expand Down
11 changes: 10 additions & 1 deletion examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/Allrun
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

if [ -e flare_CH4_SandiaD_4D.tbl]
then
echo "flare_CH4_SandiaD_4D.tbl exists. Make sure correct table has been used!"
else
echo "flare_CH4_SandiaD_4D.tbl not exist. Downloading ..."
wget --content-disposition https://aisquare.oss-us-east-1.aliyuncs.com/data/datasets/14b50df5-dbe9-4f1c-bf58-032b8bc40a20
unzip flare_CH4_SandiaD_4D.zip
fi


# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

# Set application name
application=$(getApplication)


runApplication blockMesh

runApplication decomposePar -force
Expand Down
1 change: 0 additions & 1 deletion examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/ReadMe

This file was deleted.

10 changes: 5 additions & 5 deletions src/dfCombustionModels/FGM/baseFGM/baseFGM.C
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Foam::combustionModels::baseFGM<ReactionThermo>::baseFGM
)
:
laminar<ReactionThermo>(modelType, thermo, turb, combustionProperties),
fvOptions(fv::options::New(this->mesh())),
// fvOptions(fv::options::New(this->mesh())),
buffer_(this->coeffs().lookupOrDefault("buffer", false)),
scaledPV_(this->coeffs().lookupOrDefault("scaledPV", false)),
incompPref_(this->coeffs().lookupOrDefault("incompPref", -10.0)),
Expand Down Expand Up @@ -535,11 +535,11 @@ void Foam::combustionModels::baseFGM<ReactionThermo>::transport()
)
-fvm::laplacian( mut/Sct_ + mu/Sc_, c_)
-omega_c_
+ fvOptions(rho_, c_)
// + fvOptions(rho_, c_)
==
c_ * S_c
);
fvOptions.correct(c_);
// fvOptions.correct(c_);

if(relaxation_)
{
Expand Down Expand Up @@ -609,9 +609,9 @@ void Foam::combustionModels::baseFGM<ReactionThermo>::transport()
)
-fvm::laplacian( mut/Sct_ + mu/Sc_, c_)
-omega_c_
+ fvOptions(rho_, c_)
// + fvOptions(rho_, c_)
);
fvOptions.correct(c_);
// fvOptions.correct(c_);

if(relaxation_)
{
Expand Down
4 changes: 2 additions & 2 deletions src/dfCombustionModels/FGM/baseFGM/baseFGM.H
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SourceFiles
#include "../laminar/laminar.H"
#include "uniformDimensionedFields.H"
#include "CanteraMixture.H"
#include "fvOptions.H"
// #include "fvOptions.H"
#include "LESfilter.H"
//#include "basicThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Expand All @@ -63,7 +63,7 @@ class baseFGM
{
// Protected Data
protected:
fv::options& fvOptions;
// fv::options& fvOptions;
//- buffer switch
Switch buffer_;

Expand Down
1 change: 0 additions & 1 deletion src/dfCombustionModels/Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ LIB_LIBS = \
-lturbulenceModels \
-llagrangian \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-L$(DF_LIBBIN) \
-ldfCompressibleTurbulenceModels \
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ file(COPY ./dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/postProcessing/sample/
file(COPY ./dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/postProcessing/sample/0.0002/data_T.xy DESTINATION 2DTGV/2)
file(COPY ./dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/postProcessing/sample/0.0001/data_T.xy DESTINATION 2DTGV/1)

file(COPY ./dfLowMachFoam/2DSandiaD_flareFGM/postProcessing/sample/1.1/data_T.xy DESTINATION 2DSandia)
file(COPY ./dfLowMachFoam/twoD_SandiaD_flareFGM/postProcessing/sample/1.1/data_T.xy DESTINATION 2DSandia)
file(COPY ./Tu500K-Phi1/fs DESTINATION flameSpeed)

enable_testing()
Expand Down
1 change: 0 additions & 1 deletion test/dfLowMachFoam/2DSandiaD_flareFGM

This file was deleted.

1 change: 1 addition & 0 deletions test/dfLowMachFoam/twoD_SandiaD_flareFGM