deepmodeling / deepflame-dev

A deep learning empowered open-source platform for reacting flow simulations
GNU General Public License v3.0
135 stars 60 forks source link

Testing Error from the twoD_detonationH2 case with DNN #316

Open WangS195 opened 1 year ago

WangS195 commented 1 year ago

Thanks to the DeepFlame team for answering my previous questions, please forgive me for asking another question.

I downloaded the DNN models and copied the HE04_Hydrogen_ESH2_GMS_sub_20221101 into /mechanisms.

image

Then I run the following code:

cd deepflame-dev/examples/dfHighSpeedFoam/twoD_detonationH2 ./Allrun

The process will be terminated. the log.mpirun show:

image

whatever I keep the default settings

image

or modify the torchModel

image

This error always happens, and is similar to Issused#175.

However, I have downloaded the DNN, and there is no "inference.py" file in twoD_detonationH2.

Looking forward to your solutions! Thanks a lot!

xiao312 commented 1 year ago

Hi there! Thank you for reaching out and providing the details. To run DeepFlame with DNN, please follow these steps:

Regarding your specific case, please note that the mechanism file named H2_Ja.yaml contains more species than the DNN model HE04_Hydrogen_ESH2_GMS_sub_20221101. To resolve this, try replacing H2_Ja.yaml with ES80_H2-7-16.yaml which can be found in $DF_ROOT/mechanisms/H2. After making this change, you should be able to run the twoD_detonationH2 case successfully.

Feel free to reach out if you have any further questions or need additional assistance. We're here to help!

WangS195 commented 1 year ago

Hi there! Thank you for reaching out and providing the details. To run DeepFlame with DNN, please follow these steps:

  • Ensure you have an inference.py file and a /mechanisms directory in your case directory. The inference.py file is essential as it reads in the DNN models. You can copy this file from the pytorchIntegrator examples available in /examples/df0Foam. No modifications to the file are needed.
  • For the /mechanisms file, it's recommended to create a soft link that points to $DF_ROOT/mechanisms instead of copying the entire directory. You can achieve this by running the following command: ln -nsf /your/path/to/mechanisms/file mechanisms.
  • Download the required DNN models into the $DF_ROOT/mechanisms directory. Make sure you have modified the TorchSettings in /constant/CanteraTorchProperties of your case directory correctly, as you mentioned.

Regarding your specific case, please note that the mechanism file named H2_Ja.yaml contains more species than the DNN model HE04_Hydrogen_ESH2_GMS_sub_20221101. To resolve this, try replacing H2_Ja.yaml with ES80_H2-7-16.yaml which can be found in $DF_ROOT/mechanisms/H2. After making this change, you should be able to run the twoD_detonationH2 case successfully.

Feel free to reach out if you have any further questions or need additional assistance. We're here to help!

Thank you very much for your careful guidance! I followed the above steps and ran the twoD_detonationH2 with DNN successfully! I appreciate you spending the time to help me to solve this problem.

However, I meet a new error😭. The initial phase of calculation is fine, but about Time = 7e-7, the process will be terminated. The log.mpirun as below:

2(}4ATY` ULYGCQU0U3RGGU

I used the ES80_H2-7-16.yaml as the mechanism file. the CanteraTorchProperties as below:

KV@X3E@ @J WLPDLXKOSHRY

I have not found a solution to this problem on the web. Looking forward to your help, thanks again!

xiao312 commented 1 year ago

However, I meet a new error😭. The initial phase of calculation is fine, but about Time = 7e-7, the process will be terminated. The log.mpirun as below:

2(}4ATY` ULYGCQU0U3RGGU

This error message usually means that the computation has diverged, and there can be multiple reasons causing this issue.

WangS195 commented 1 year ago

Thank you for the reply. I will check the settings of each file and hope to solve this problem. Thanks again.🤗

samjustme commented 1 year ago

Hi there! Thank you for reaching out and providing the details. To run DeepFlame with DNN, please follow these steps:

  • Ensure you have an inference.py file and a /mechanisms directory in your case directory. The inference.py file is essential as it reads in the DNN models. You can copy this file from the pytorchIntegrator examples available in /examples/df0Foam. No modifications to the file are needed.
  • For the /mechanisms file, it's recommended to create a soft link that points to $DF_ROOT/mechanisms instead of copying the entire directory. You can achieve this by running the following command: ln -nsf /your/path/to/mechanisms/file mechanisms.
  • Download the required DNN models into the $DF_ROOT/mechanisms directory. Make sure you have modified the TorchSettings in /constant/CanteraTorchProperties of your case directory correctly, as you mentioned.

Regarding your specific case, please note that the mechanism file named H2_Ja.yaml contains more species than the DNN model HE04_Hydrogen_ESH2_GMS_sub_20221101. To resolve this, try replacing H2_Ja.yaml with ES80_H2-7-16.yaml which can be found in $DF_ROOT/mechanisms/H2. After making this change, you should be able to run the twoD_detonationH2 case successfully. Feel free to reach out if you have any further questions or need additional assistance. We're here to help!

Thank you very much for your careful guidance! I followed the above steps and ran the twoD_detonationH2 with DNN successfully! I appreciate you spending the time to help me to solve this problem.

However, I meet a new error😭. The initial phase of calculation is fine, but about Time = 7e-7, the process will be terminated. The log.mpirun as below:

2(}4ATY` ULYGCQU0U3RGGU

I used the ES80_H2-7-16.yaml as the mechanism file. the CanteraTorchProperties as below:

KV@X3E@ @J WLPDLXKOSHRY

I have not found a solution to this problem on the web. Looking forward to your help, thanks again!

Hello, have you solved this issue? I have the same problem when using DNN models to solve the example case. Exactly, the failure occur almost the same time at '7.27e-7 s' and due to the same reason 'cantera calculation diverged'. This failure did not occurr when I just Allrun this example without DNN. 1690282995628

WangS195 commented 1 year ago

Hi there! Thank you for reaching out and providing the details. To run DeepFlame with DNN, please follow these steps:

  • Ensure you have an inference.py file and a /mechanisms directory in your case directory. The inference.py file is essential as it reads in the DNN models. You can copy this file from the pytorchIntegrator examples available in /examples/df0Foam. No modifications to the file are needed.
  • For the /mechanisms file, it's recommended to create a soft link that points to $DF_ROOT/mechanisms instead of copying the entire directory. You can achieve this by running the following command: ln -nsf /your/path/to/mechanisms/file mechanisms.
  • Download the required DNN models into the $DF_ROOT/mechanisms directory. Make sure you have modified the TorchSettings in /constant/CanteraTorchProperties of your case directory correctly, as you mentioned.

Regarding your specific case, please note that the mechanism file named H2_Ja.yaml contains more species than the DNN model HE04_Hydrogen_ESH2_GMS_sub_20221101. To resolve this, try replacing H2_Ja.yaml with ES80_H2-7-16.yaml which can be found in $DF_ROOT/mechanisms/H2. After making this change, you should be able to run the twoD_detonationH2 case successfully. Feel free to reach out if you have any further questions or need additional assistance. We're here to help!

Thank you very much for your careful guidance! I followed the above steps and ran the twoD_detonationH2 with DNN successfully! I appreciate you spending the time to help me to solve this problem. However, I meet a new error😭. The initial phase of calculation is fine, but about Time = 7e-7, the process will be terminated. The log.mpirun as below: 2(}4ATY` ULYGCQU0U3RGGU I used the ES80_H2-7-16.yaml as the mechanism file. the CanteraTorchProperties as below: KV@X3E@ @J WLPDLXKOSHRY I have not found a solution to this problem on the web. Looking forward to your help, thanks again!

Hello, have you solved this issue? I have the same problem when using DNN models to solve the example case. Exactly, the failure occur almost the same time at '7.27e-7 s' and due to the same reason 'cantera calculation diverged'. This failure did not occurr when I just Allrun this example without DNN. 1690282995628

Sorry, I haven't found a solution to the problem.

pkuLmq commented 1 year ago

Sorry for the late response. DNN is curently not available for dfHighSpeedFoam, so variables are not be solved (You can see in the log.mpi that iterations are 0). That's why cantera throw error when calculating chemistry. You can only use cvode when using this solver.