Git Product home page Git Product logo

deep-flow-prediction's People

Contributors

aalksii avatar fedebotu avatar thunil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-flow-prediction's Issues

Issues in generating data

Hello, your code helps me to get closer applying deep learning to N-S flow solver. thank you in advance.

While I was generating the data with OpenFOAM 5, I got the error that "OpenFOAM/postProcessing/internalCloud/500/cloud_p.xy" is missing. I think this is the file contains the point cloud to be used for extracting N-S solution. Will you share this file here?

Key mismatch error in loading given pretrained model

When trying to load the pretrained model (link given in readme), I'm getting the following key mismatch error.
I'm on commit 653b81a (HEAD) added pre-trained model link (previous version of the model)

wget https://ge.in.tum.de/download/2019-deepFlowPred/model_data05_exp50
import torch
from DfpNet import TurbNetG

netG = TurbNetG(channelExponent=5)
netG.load_state_dict(torch.load("model_data05_exp50"))
RuntimeError: Error(s) in loading state_dict for TurbNetG:
	Missing key(s) in state_dict: "layer2b.layer2b_conv.weight", "layer2b.layer2b_conv.bias", "layer2b.layer2b_bn.weight", "layer2b.layer2b_bn.bias", "layer2b.layer2b_bn.running_mean", "layer2b.layer2b_bn.running_var", "dlayer2b.dlayer2b_tconv.weight", "dlayer2b.dlayer2b_tconv.bias", "dlayer2b.dlayer2b_bn.weight", "dlayer2b.dlayer2b_bn.bias", "dlayer2b.dlayer2b_bn.running_mean", "dlayer2b.dlayer2b_bn.running_var". 
	Unexpected key(s) in state_dict: "layer2x.layer2x_conv.weight", "layer2x.layer2x_conv.bias", "layer2x.layer2x_bn.weight", "layer2x.layer2x_bn.bias", "layer2x.layer2x_bn.running_mean", "layer2x.layer2x_bn.running_var", "layer2x.layer2x_bn.num_batches_tracked", "dlayer2x.dlayer2x_tconv.weight", "dlayer2x.dlayer2x_tconv.bias", "dlayer2x.dlayer2x_bn.weight", "dlayer2x.dlayer2x_bn.bias", "dlayer2x.dlayer2x_bn.running_mean", "dlayer2x.dlayer2x_bn.running_var", "dlayer2x.dlayer2x_bn.num_batches_tracked".

gmshToFoam command not found

Submitting this issue to hopefully prevent future headaches for others but this can be closed.

If you receive this error message gmshToFoam command not found and then the subsequent error during conversion to OpenFoam mesh! message, and are able to run commands like simpleFoam and paraFoam, check the case field when running the command simpleFoam.

/---------------------------------------------------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 5.x |
| \ / A nd | Web: www.OpenFOAM.org |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
....
Case : /Deep-Flow-Prediction/data/OpenFOAM/0
...

For some reason, during installation, openFoam defaulted to using ..../data/OpenFOAM/0 rather than ..../data/OpenFOAM/

You can fix this by running
simpleFoam -case

dataGen.py with OpenFOAM version 6.0 error : keyword freestreamValue is undefined in dictionary

Hi, I try to launch dataGen.py with OpenFOAM version 6.0 and the following error occurs :

--> FOAM FATAL IO ERROR:
keyword freestreamValue is undefined in dictionary "/home/pierre/EF/DataSet/data/OpenFOAM/0/p.boundaryField.inlet"

file: /home/pierre/EF/DataSet/data/OpenFOAM/0/p.boundaryField.inlet from line 25 to line 25.

    From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 566.

FOAM exiting

Traceback (most recent call last):
  File "./dataGen.py", line 172, in <module>
    outputProcessing(basename, fsX, fsY, imageIndex=n)
  File "./dataGen.py", line 93, in outputProcessing
    ar = np.loadtxt(pfile)
  File "/home/pierre/.conda/envs/PyTorch-learning/lib/python3.7/site-packages/numpy/lib/npyio.py", line 955, in loadtxt
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "/home/pierre/.conda/envs/PyTorch-learning/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 266, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "/home/pierre/.conda/envs/PyTorch-learning/lib/python3.7/site-packages/numpy/lib/_datasource.py", line 624, in open
    raise IOError("%s not found." % path)

It seems that a freestream value is required for OpenFOAM simulations.

How to load + predict using pretrained models

Hi,

Thanks for sharing your great work! I am trying to use your pretrained models for prediction with the test airfoils. What I have tried so far is to load the model and state dict like this:

import torch
from train.DfpNet import TurbNetG
netG = TurbNetG()
model = netG.load_state_dict(torch.load('model_data05_exp50.pt'))

What I get is an error like this with missing and mismatched layer sizes:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-5-0bda212c0edc> in <module>
----> 1 model = netG.load_state_dict(torch.load('model_data05_exp50.pt'))

~/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
   1222         if len(error_msgs) > 0:
   1223             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
-> 1224                                self.__class__.__name__, "\n\t".join(error_msgs)))
   1225         return _IncompatibleKeys(missing_keys, unexpected_keys)
   1226 

RuntimeError: Error(s) in loading state_dict for TurbNetG:
	Missing key(s) in state_dict: "layer2b.layer2b_conv.weight", "layer2b.layer2b_conv.bias", "layer2b.layer2b_bn.weight", "layer2b.layer2b_bn.bias", "layer2b.layer2b_bn.running_mean", "layer2b.layer2b_bn.running_var", "dlayer2b.dlayer2b_tconv.weight", "dlayer2b.dlayer2b_tconv.bias", "dlayer2b.dlayer2b_bn.weight", "dlayer2b.dlayer2b_bn.bias", "dlayer2b.dlayer2b_bn.running_mean", "dlayer2b.dlayer2b_bn.running_var". 
	Unexpected key(s) in state_dict: "layer2x.layer2x_conv.weight", "layer2x.layer2x_conv.bias", "layer2x.layer2x_bn.weight", "layer2x.layer2x_bn.bias", "layer2x.layer2x_bn.running_mean", "layer2x.layer2x_bn.running_var", "layer2x.layer2x_bn.num_batches_tracked", "dlayer2x.dlayer2x_tconv.weight", "dlayer2x.dlayer2x_tconv.bias", "dlayer2x.dlayer2x_bn.weight", "dlayer2x.dlayer2x_bn.bias", "dlayer2x.dlayer2x_bn.running_mean", "dlayer2x.dlayer2x_bn.running_var", "dlayer2x.dlayer2x_bn.num_batches_tracked". 
	size mismatch for layer1.layer1_conv.weight: copying a param with shape torch.Size([32, 3, 4, 4]) from checkpoint, the shape in current model is torch.Size([64, 3, 4, 4]).
	size mismatch for layer1.layer1_conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
	size mismatch for layer2.layer2_conv.weight: copying a param with shape torch.Size([64, 32, 4, 4]) from checkpoint, the shape in current model is torch.Size([128, 64, 4, 4]).
	size mismatch for layer2.layer2_conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for layer2.layer2_bn.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for layer2.layer2_bn.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for layer2.layer2_bn.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for layer2.layer2_bn.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for layer3.layer3_conv.weight: copying a param with shape torch.Size([128, 64, 4, 4]) from checkpoint, the shape in current model is torch.Size([256, 128, 4, 4]).
	size mismatch for layer3.layer3_conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for layer3.layer3_bn.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for layer3.layer3_bn.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for layer3.layer3_bn.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for layer3.layer3_bn.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for layer4.layer4_conv.weight: copying a param with shape torch.Size([256, 128, 2, 2]) from checkpoint, the shape in current model is torch.Size([512, 256, 4, 4]).
	size mismatch for layer4.layer4_conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer4.layer4_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer4.layer4_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer4.layer4_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer4.layer4_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer5.layer5_conv.weight: copying a param with shape torch.Size([256, 256, 2, 2]) from checkpoint, the shape in current model is torch.Size([512, 512, 2, 2]).
	size mismatch for layer5.layer5_conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer5.layer5_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer5.layer5_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer5.layer5_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer5.layer5_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for layer6.layer6_conv.weight: copying a param with shape torch.Size([256, 256, 2, 2]) from checkpoint, the shape in current model is torch.Size([512, 512, 2, 2]).
	size mismatch for layer6.layer6_conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer6.dlayer6_tconv.weight: copying a param with shape torch.Size([256, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
	size mismatch for dlayer6.dlayer6_tconv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer6.dlayer6_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer6.dlayer6_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer6.dlayer6_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer6.dlayer6_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer5.dlayer5_tconv.weight: copying a param with shape torch.Size([256, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1024, 1, 1]).
	size mismatch for dlayer5.dlayer5_tconv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer5.dlayer5_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer5.dlayer5_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer5.dlayer5_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer5.dlayer5_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
	size mismatch for dlayer4.dlayer4_tconv.weight: copying a param with shape torch.Size([128, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 3]).
	size mismatch for dlayer4.dlayer4_tconv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for dlayer4.dlayer4_bn.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for dlayer4.dlayer4_bn.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for dlayer4.dlayer4_bn.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for dlayer4.dlayer4_bn.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
	size mismatch for dlayer3.dlayer3_tconv.weight: copying a param with shape torch.Size([64, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 512, 3, 3]).
	size mismatch for dlayer3.dlayer3_tconv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for dlayer3.dlayer3_bn.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for dlayer3.dlayer3_bn.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for dlayer3.dlayer3_bn.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for dlayer3.dlayer3_bn.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
	size mismatch for dlayer2.dlayer2_tconv.weight: copying a param with shape torch.Size([32, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 256, 3, 3]).
	size mismatch for dlayer2.dlayer2_tconv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
	size mismatch for dlayer2.dlayer2_bn.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
	size mismatch for dlayer2.dlayer2_bn.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
	size mismatch for dlayer2.dlayer2_bn.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
	size mismatch for dlayer2.dlayer2_bn.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
	size mismatch for dlayer1.dlayer1_tconv.weight: copying a param with shape torch.Size([64, 3, 4, 4]) from checkpoint, the shape in current model is torch.Size([128, 3, 4, 4]).

Issues loading data and loading pre-trained model

Hi, I have 2 questions regarding running the models.

The 1st is do do with training a model from scratch. When setting prop, what effect do the values given in line 38 of dataset.py have? I assume they mix the data in different proportions from the different directories however I'm not sure what the 1000 value does if this is the case.

I'm also trying to implement the given pre-trained models.

I'm trying to input a batch of test data into the model. This is what the models predicting, it doesn't seem to predict any of the flow fields.

I suspect the issue is due to the model not compiling properly but I'm not sure.
To compile the model I had to switch the compiling method to strict when running runTest.py (line 72).
When running the code unedited, I received a Run time error loading state_dict due to missing keys - "layer2b.layer2b_conv.weight", "layer2b.layer2b_conv.bias",... and unexpected keys - "layer2x.layer2x_conv.weight", "layer2x.layer2x_conv.bias",...

Could you advise on how I should resolve these issues?

Warning in airfoil_template.geo

Warning: Extrusion of periodic curves is not supported with the built-in kernel.
...
Warning: Skipping unknown surface 1026 in physical surface 7

I don't quite follow why the last few lines such as Physical Surface("back") = {1027}.

Why is it named 1027? It seems to be a random number, and this 1027 number is not referenced anywhere else...

However it seems that the code still runs? Could somebody explain this section please, thanks.

PS: I am using gmsh2 and openfoam10, so I modified something to get it work (some functions in gmsh2 only works for openfoam5).

`download_airfoil.sh` fails - 404

Attempting to follow the instructions and download the airfoils by running the script ./download_arifoil.sh ends in a 404 error:

--2022-03-16 14:12:50--  http://m-selig.ae.illinois.edu/ads/archives/coord_seligFmt.tar.gz
Resolving m-selig.ae.illinois.edu (m-selig.ae.illinois.edu)... 18.220.149.166
Connecting to m-selig.ae.illinois.edu (m-selig.ae.illinois.edu)|18.220.149.166|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://m-selig.ae.illinois.edu/ads/archives/coord_seligFmt.tar.gz [following]
--2022-03-16 14:12:51--  https://m-selig.ae.illinois.edu/ads/archives/coord_seligFmt.tar.gz
Connecting to m-selig.ae.illinois.edu (m-selig.ae.illinois.edu)|18.220.149.166|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-03-16 14:12:51 ERROR 404: Not Found.

Have these files been upload elsewhere?

Thanks!

Airfoils data base URL not found

Hello,

First of all, thank you for sharing your model!

When I try to download the Airfoils dataset so that I could generate my own data for training I get the following error from the execution of download_airfoils.sh script:

Location: https://m-selig.ae.illinois.edu/ads/archives/coord_seligFmt.tar.gz [following]
--2022-08-01 13:08:12--  https://m-selig.ae.illinois.edu/ads/archives/coord_seligFmt.tar.gz
Connecting to m-selig.ae.illinois.edu (m-selig.ae.illinois.edu)|18.220.149.166|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-08-01 13:08:12 ERROR 404: Not Found.

It seems like the URL is no longer valid?
Is it possible to re-upload the airfoils data for the generator?

Best regards,
Adam

Computation of v_norm wrong?

Hi,
pls correct me if i'm wrong, but I think there is a small error in the data normalisation, where the norm of v is computed with the pressure values instead of v1.

Would be glad if you could verify.
Thanks

v_norm = ( np.max(np.abs(data.inputs[i,0,:,:]))**2 + np.max(np.abs(data.inputs[i,1,:,:]))**2 )**0.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.