thunil / Deep-Flow-Prediction

A framework for fluid flow (Reynolds-averaged Navier Stokes) predictions with deep learning
Apache License 2.0
286 stars 117 forks source link

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

Closed Elfaranne closed 5 years ago

Elfaranne commented 5 years ago

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.

thunil commented 5 years ago

Hi, yes - sorry, at the moment, the code only supports OpenFoam5. With that version it should work!

Hypersonichen commented 5 years ago

Hi, just add the line below each "type freestreamPressure" in the file "OpenFOAM/0/p" freestreamValue uniform $a-value-in-your-case;