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

Testing Error from the twoD_detonationH2 case with DNN #316

Open
WangS195 opened this issue Jul 7, 2023 · 7 comments
Open

Testing Error from the twoD_detonationH2 case with DNN #316

WangS195 opened this issue Jul 7, 2023 · 7 comments

Comments

@WangS195
Copy link

WangS195 commented Jul 7, 2023

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
Copy link
Collaborator

xiao312 commented Jul 9, 2023

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!

@WangS195
Copy link
Author

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
Copy link
Collaborator

xiao312 commented Jul 12, 2023

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
Copy link
Author

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

@samjustme
Copy link

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
Copy link
Author

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(}4ATYULYGCQU0U3RGGU](https://user-images.githubusercontent.com/94104367/252332804-c9bdccab-a688-4bc1-990d-35f04436b983.png) I used theES80_H2-7-16.yamlas the mechanism file. theCanteraTorchProperties` 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
Copy link
Collaborator

pkuLmq commented Aug 18, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants