Skip to content

Commit 91909c2

Browse files
authored
Introduce modifications and optimizations for the Kunpeng platform (#579)
1 parent 028bc05 commit 91909c2

995 files changed

Lines changed: 45410 additions & 2878129 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Allwclean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ wclean ./applications/solvers/dfSprayFoam
2121
wclean ./applications/solvers/df0DFoam
2222
wclean ./applications/solvers/dfLowMachFoam
2323
wclean ./applications/solvers/dfHighSpeedFoam
24-
wclean ./applications/solvers/dfBuoyancyFoam
2524

2625
rm -rf src_orig/
2726
rm -rf bin/

Allwmake

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ src/lagrangian/Allwmake $targetType $*
1717
wmake src/dfCombustionModels
1818
wmake src/dynamicMesh
1919
wmake src/dynamicFvMesh
20-
wmake src/fluxSchemes
21-
wmake src/radiationModels
2220

23-
wmake applications/solvers/df0DFoam
21+
wmake src/dfUtils
22+
wmake src/dfRenumber
23+
wmake src/dfSchedule
24+
wmake src/dfMatrices
25+
wmake src/dfGenMatrix
26+
27+
# wmake applications/solvers/df0DFoam
2428
wmake applications/solvers/dfLowMachFoam
25-
wmake applications/solvers/dfHighSpeedFoam
26-
wmake applications/solvers/dfSprayFoam
27-
wmake applications/solvers/dfBuoyancyFoam
28-
wmake applications/solvers/dfSteadyFoam
29+
# wmake applications/solvers/dfHighSpeedFoam
30+
# wmake applications/solvers/dfSprayFoam
2931

30-
wmake applications/utilities/flameSpeed
32+
# wmake applications/utilities/flameSpeed

README.md

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,13 @@
2121

2222
DeepFlame is a deep learning empowered computational fluid dynamics package for single or multiphase, laminar or turbulent, reacting flows at all speeds. It aims to provide an open-source platform to combine the individual strengths of [OpenFOAM](https://openfoam.org), [Cantera](https://cantera.org), and [PyTorch](https://pytorch.org/) libraries for deep learning assisted reacting flow simulations. It also has the scope to leverage the next-generation heterogenous supercomputing and AI acceleration infrastructures such as GPU and FPGA.
2323

24-
The neural network models used in the tutorial examples can be found at– [AIS Square](https://www.aissquare.com/). To run DeepFlame with DNN, download the DNN model [DFODE](https://www.aissquare.com/models/detail?pageType=models&name=DF-ODENet_DNNmodel&id=197) into the case folder you would like to run.
24+
The neural network models used in the tutorial examples can be found at– [AIS Square](https://www.aissquare.com/). To run DeepFlame with DNN, download the DNN model [DF-ODENet](https://www.aissquare.com/models/detail?pageType=models&name=DF-ODENet_DNNmodel&id=197) into the case folder you would like to run.
2525

2626
## Documentation
2727
Detailed guide for installation and tutorials is available on [our documentation website](https://deepflame.deepmodeling.com).
2828

2929
## Features
30-
New in v1.6 (2025/5/30):
31-
- Add a new solver, dfSteadyFoam, a steady-state compressible flow solver. It supports turbulence and uses the SIMPLE algorithm to efficiently compute steady solutions
32-
- Extend energy model to support sensible enthalpy (hs) in addition to absolute enthalpy (ha) and internal energy (ea). Furthermore, T, h and cp can now be computed independently of Cantera, improving flexibility and removing external dependencies. `CANTERA_THERMO` is added in bashrc to control method to calculate h, cp and update T. `CANTERA_THERMO=1`(current default) means using Cantera and `CANTERA_THERMO=0` means using deepflame.
33-
- Improve install.sh by displaying system architecture (e.g., x86_64) after build for clearer platform information
34-
- Switch to sphinx-book-theme and update documentation build environment (Ubuntu 24.04, Python 3.12) for better appearance and compatibility
35-
- Add 2D Riemann problem example case
36-
37-
New in v1.5 (2025/1/8):
38-
- Provide a new boundary condition, totalFlowRateAdvectiveDiffusion (adopted from OpenFOAM v7), which accounts for diffusion effects at the boundary
39-
- Develop a new solver, `dfBuoyancyFoam`(adopted from fireFoam in OpenFOAM v7), a transient, compressible solver designed to model turbulent reacting flows incorporating buoyancy effects
40-
- Add radiation models, which are integrated into the current `dfBuoyancyFoam` solver, and can be incorporated into other solvers if needed
41-
- Add new combustion models (including infinitelyFastChemistry and eddyDissipationModel) to the `dfBuoyancyFoam` solver
42-
- Imply DeepFlame on Arm architecture platforms
43-
44-
New in v1.4 (2024/8/22):
45-
- Reorganize the update order of mass, velocity and temperature for Lagrangian particles and introduce the liquidEvaporationSpalding model as new evaporation model.
46-
- Add source terms for liquid phase in the `dfLowMachFoam` solver
47-
- Incorporate Euler-Lagrangian source terms into the `dfHighSpeedFoam` solver to facilitate numerical simulations of two-phase supersonic reactive flows
48-
- Provide new flux schemes (including HLLC and HLLCP) for `dfHighSpeedFoam` solver (adopted from detonationFoam ) and do some modifications
49-
- Add lagrangianExtraFunctionObjects function (adopted from lagrangianExtraFunctionObjects ) in submodules to write to disk in the old positions file format
50-
- Introduce new cases to evaluate the accuracy of `dfHighSpeedFoam` solver and provide two-phase 1D/2D detonation cases
51-
- Add AUSMDV scheme as new flux scheme for `dfHighSpeedFoam`
52-
- add compatibility of neural network inference for chemical source terms with the Baidu PaddlePaddle framework
53-
- Adjust original examples referring to the modification of solvers
54-
- Add 2D aachenBomb case in test
55-
- Update PaddlePaddle options for DNN model development and inference in document homepage
56-
57-
New in v1.3 (2023/12/30):
30+
New in v1.3.0 (2023/12/30):
5831
- Complete the full-loop GPU implementation of the `dfLowMachFoam` solver, enabling efficient execution of all computations on GPU
5932
- Introduce `DF-ODENet` model, which utilizes sampling from canonical combustion simulation configurations to reduce training costs and improve computational efficiency
6033
- Support Large Eddy Simulation (LES) and two-phase combustion simulation capabilities
@@ -63,7 +36,7 @@ New in v1.3 (2023/12/30):
6336
- Modify Cantera's approach to transport property calculations to support real fluid thermophysical property calculation of multi-component reactive flows and integrate neural networks for updating real fluid thermophysical properties
6437
- Add new example cases and update the documentation homepage to provide more comprehensive installation and usage instructions
6538

66-
New in v1.2 (2023/06/30):
39+
New in v1.2.0 (2023/06/30):
6740
- Enable GPU acceleration for fast and efficient discrete matrix construction for solving partial differential equations
6841
- Introduce `DeePFGM` model: a neural network-based approach to replace the flamelet database of the FGM model and reduce memory requirement
6942
- Support real fluid density calculation with Cantera's PR/RK equation of state and updated the calculation of isentropic compression coefficient (psi)
@@ -75,7 +48,7 @@ New in v1.2 (2023/06/30):
7548
- Implement mechanism file detection function to verify the validity of the mechanism file input
7649
- Capture and report Cantera errors for better error handling and user experience
7750

78-
New in v1.1 (2023/03/31):
51+
New in v1.1.0 (2023/03/31):
7952
- Add FGM model
8053
- Add GPU-compatible linear solver [AmgX](https://github.com/NVIDIA/AMGX) (adopted from [petsc4Foam](https://develop.openfoam.com/modules/external-solver) and [FOAM2CSR](https://gitlab.hpc.cineca.it/openfoam/foam2csr))
8154
- Add new load balancing algorithm
@@ -85,28 +58,28 @@ New in v1.1 (2023/03/31):
8558
- Reconstruct `dfChemistryModel`
8659
- Update chemical and mixing time scale models in PaSR combustion model
8760

88-
New in v1.0 (2022/11/15):
61+
New in v1.0.0 (2022/11/15):
8962
- Add support for the parallel computation of DNN using libtorch on multiple GPUs
9063
- Add TCI model
9164

92-
New in v0.5 (2022/10/15):
65+
New in v0.5.0 (2022/10/15):
9366
- Add support for the parallel computation of DNN via single and multiple GPUs
9467
- Add access for utilising PyTorch
9568

96-
New in v0.4 (2022/09/26):
69+
New in v0.4.0 (2022/09/26):
9770
- Adapt combustion library from OpenFOAM into DeepFlame
9871
- `laminar`; `EDC`; `PaSR` combustion models
9972

100-
New in v0.3 (2022/08/29):
73+
New in v0.3.0 (2022/08/29):
10174
- 1/2/3D adaptive mesh refinement (2/3D adopted from [SOFTX_2018_143](https://github.com/ElsevierSoftwareX/SOFTX_2018_143) and [multiDimAMR](https://github.com/HenningScheufler/multiDimAMR))
10275
- Add Sigma/dynSmag LES turbulence models
10376
- Add functionObjects/field library
10477
- New example reactiveShockTube for `dfHighSpeedFoam`
10578

106-
New in v0.2 (2022/07/25):
79+
New in v0.2.0 (2022/07/25):
10780
- Dynamic load balancing for chemistry solver (adopted from [DLBFoam](https://github.com/blttkgl/DLBFoam-1.0))
10881

109-
From v0.1 (2022/06/15):
82+
From v0.1.0 (2022/06/15):
11083
- Native Cantera reader for chemical mechanisms in `.cti`, `.xml` or `.yaml` formats
11184
- Full compatiblity with Cantera's `UnityLewis`, `Mix` and `Multi` transport models
11285
- Zero-dimensional constant pressure or constant volume reactor solver `df0DFoam`

applications/solvers/df0DFoam/EEqn.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
start = std::clock();
55
chemistry.correctThermo();
66
end = std::clock();
7-
time_monitor_corrThermo += double(end - start) / double(CLOCKS_PER_SEC);
7+
time_monitor_corrThermo += double(end - start);
88

99
}

applications/solvers/df0DFoam/Make/options

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ EXE_INC = -std=c++14 \
55
-Wno-unused-but-set-variable \
66
-Wno-old-style-cast \
77
$(PFLAGS) $(PINC) \
8-
$(if $(CANTERA_THERMO),-DCANTERA_THERMO,) \
98
$(if $(LIBTORCH_ROOT),-DUSE_LIBTORCH,) \
109
$(if $(PYTHON_INC_DIR),-DUSE_PYTORCH,) \
10+
$(if $(USE_BLASDNN),-DUSE_BLASDNN,) \
1111
-I$(CANTERA_ROOT)/include \
1212
-I$(DF_SRC)/dfCanteraMixture/lnInclude \
1313
-I$(DF_SRC)/dfChemistryModel/lnInclude \
@@ -25,11 +25,15 @@ EXE_INC = -std=c++14 \
2525
$(if $(LIBTORCH_ROOT),-I$(LIBTORCH_ROOT)/include/torch/csrc/api/include,) \
2626
$(if $(BOOST_ARCH_PATH),-I$(BOOST_ARCH_PATH),) \
2727
$(if $(BOOST_ARCH_PATH),-DBOOST_ARCH_PATH_FOUNDD,) \
28-
$(PYTHON_INC_DIR)
28+
$(PYTHON_INC_DIR) \
29+
-I/vol0001/hp230257/guozhuoqiang/DeepFlame/software/yaml-cpp-0.7.0/include
2930

3031

3132

3233
EXE_LIBS = \
34+
-L$(DF_ROOT)/lib/ \
35+
-L/vol0001/hp230257/guozhuoqiang/DeepFlame/deepflame-dev-blasdnn/src/dfChemistryModel/DNNInferencer_blas/build -lDNNInferencer_blas \
36+
-lfjlapackexsve \
3337
-lcompressibleTransportModels \
3438
-lturbulenceModels \
3539
-lfiniteVolume \
@@ -42,7 +46,7 @@ EXE_LIBS = \
4246
-ldfCompressibleTurbulenceModels \
4347
-ldfCanteraMixture \
4448
-ldfChemistryModel \
45-
$(CANTERA_ROOT)/lib/libcantera.so \
49+
$(CANTERA_ROOT)/lib/libcantera.so -lstdc++fs \
4650
$(if $(LIBTORCH_ROOT),$(LIBTORCH_ROOT)/lib/libtorch.so,) \
4751
$(if $(LIBTORCH_ROOT),$(LIBTORCH_ROOT)/lib/libc10.so,) \
4852
$(if $(LIBTORCH_ROOT),-rdynamic,) \

applications/solvers/df0DFoam/YEqn.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
1313
{
1414
std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();
1515
chemistry.solve(mesh.time().deltaTValue());
16-
label flag_mpi_init;
16+
int flag_mpi_init;
1717
MPI_Initialized(&flag_mpi_init);
1818
if(flag_mpi_init) MPI_Barrier(PstreamGlobals::MPI_COMM_FOAM);
1919
std::chrono::steady_clock::time_point stop = std::chrono::steady_clock::now();
@@ -55,5 +55,5 @@ tmp<fv::convectionScheme<scalar>> mvConvection
5555
Y[inertIndex].max(0.0);
5656

5757
end = std::clock();
58-
time_monitor_Y += double(end - start) / double(CLOCKS_PER_SEC);
58+
time_monitor_Y += double(end - start);
5959
}

applications/solvers/df0DFoam/createFields.H

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
Info<< "Reading thermophysical properties\n" << endl;
44

5-
CanteraMixture::setEnergyName("ha");
65
// fluidThermo* pThermo = new hePsiThermo<psiThermo, CanteraMixture>(mesh, word::null);
76
fluidThermo* pThermo = new heRhoThermo<rhoThermo, CanteraMixture>(mesh, word::null);
87
fluidThermo& thermo = *pThermo;
98

9+
// thermo.validate(args.executable(), "ha");
10+
1011
volScalarField& p = thermo.p();
1112

1213
IOdictionary CanteraTorchProperties
@@ -93,6 +94,7 @@ dfChemistryModel<basicThermo> chemistry(thermo);
9394
PtrList<volScalarField>& Y = chemistry.Y();
9495
const word inertSpecie(chemistry.lookup("inertSpecie"));
9596
const label inertIndex(chemistry.species()[inertSpecie]);
97+
chemistry.setEnergyName("ha");
9698
chemistry.updateEnergy();
9799

98100
forAll(Y, i)
@@ -126,4 +128,4 @@ scalar u0 = he[0] - p[0]/rho[0];
126128
#ifdef USE_LIBTORCH
127129
const Switch log_ = CanteraTorchProperties.subDict("TorchSettings").lookupOrDefault("log", false);
128130
const Switch torch_ = CanteraTorchProperties.subDict("TorchSettings").lookupOrDefault("torch", false);
129-
#endif
131+
#endif

applications/solvers/dfBuoyancyFoam/Make/files

Lines changed: 0 additions & 3 deletions
This file was deleted.

applications/solvers/dfBuoyancyFoam/Make/options

Lines changed: 0 additions & 78 deletions
This file was deleted.

applications/solvers/dfBuoyancyFoam/UEqn.H

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)