neuraloperator / physics_informed

Apache License 2.0
341 stars 82 forks source link

How to include physics constraints for a 2D Darcy problem #15

Open ach14012022 opened 1 year ago

ach14012022 commented 1 year ago

@zongyi-li Hello. Hopefully, everyone is doing well. I have already developed an FNO-based model for a 2D (xy) Darcy flow problem using generated samples. There is potential to further improve the FNO’s performance by including physics constraints in its network configuration. That is why I am going to apply PINO for my case study. It seems that the train_2d (line 78) part of the below is beneficial: https://github.com/neural-operator/PINO/blob/master/train_operator.py I will be highly appreciative if one can help me to clear the points below: As I have my data, there is no need for lines 86-91 anymore. Am I right? Meantime, I do not understand what ‘sub’ and ‘pde_sub’ are. There is nothing about ‘pad_ratio’ in ‘config’. In line 99, what does ‘checkpoint’ refer to? More importantly, there is nothing about including PDE and initial/boundary conditions. I need a comprehensive explanation of how to do so.

devzhk commented 1 year ago

Hey,

  1. If you have your own dataset, 86-91 is not needed. 'sub', 'pde_sub' is the subsampling ratio. If you work with your data, no need to worry about that.
  2. 'pad_ratio' ;check out this yaml to see how to set pad_ratio. https://github.com/neural-operator/PINO/blob/master/configs/operator/Darcy-pretrain.yaml#L17
  3. 'checkpoint' refers to Pytorch checkpoint. Check out this tutorial for more detail https://pytorch.org/tutorials/recipes/recipes/saving_and_loading_a_general_checkpoint.html
  4. PDE loss is defined in https://github.com/neural-operator/PINO/blob/master/train_utils/losses.py#L39