cfdOF install

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

ljb
Posts: 43
Joined: Tue Sep 04, 2018 3:56 pm

Re: cfdOF install

Post by ljb »

Hi Oliver,

Thanks for your help.

I’m not sure. The Report view just below might be the one you need. I sent a copy of my project, 'test_elbow_1.FCStd', to thschrader and he sent it back to me as 'test_elbow_1_new_cfmesh.FCStd' and 'test_elbow_1_new_gmesh.FCStd'.

As part of my subsequent fiddling, I loaded my original and at least one of thschrader’s modified project files and did some experimenting.
I now realize I should have paid more attention to which was which. Bookkeeping was not on my mind then, but it is now.

Not all is lost from that time, however. I did copy the Report view from then that produced the relevant (I hope) error.

Report view

Code: Select all

Starting meshing ...

  Part to mesh: Name --> Pad,  Label --> Pad, ShapeType --> Solid
  CharacteristicLengthMax: 800.0
  ElementDimension: 3D
Traceback (most recent call last):
  File "C:\Users\LB17\AppData\Roaming\FreeCAD\Mod\CfdOF\_TaskPanelCfdMesh.py", line 234, in runMeshProcess
    cart_mesh.setup_mesh_case_dir()
  File "C:\Users\LB17\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdMeshTools.py", line 200, in setup_mesh_case_dir
    shutil.rmtree(self.meshCaseDir)
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 261, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 261, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 270, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 268, in rmtree
    os.rmdir(path)
WindowsError: [Error 145] The directory is not empty: 'c:\\users\\lb17\\appdata\\local\\temp\\meshCase\\constant\\polyMesh'

Starting meshing ...

  Part to mesh: Name --> Pad,  Label --> Pad, ShapeType --> Solid
  CharacteristicLengthMax: 800.0
  ElementDimension: 3D
Traceback (most recent call last):
  File "C:\Users\LB17\AppData\Roaming\FreeCAD\Mod\CfdOF\_TaskPanelCfdMesh.py", line 234, in runMeshProcess
    cart_mesh.setup_mesh_case_dir()
  File "C:\Users\LB17\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdMeshTools.py", line 200, in setup_mesh_case_dir
    shutil.rmtree(self.meshCaseDir)
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 261, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 270, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 268, in rmtree
    os.rmdir(path)
WindowsError: [Error 145] The directory is not empty: 'c:\\users\\lb17\\appdata\\local\\temp\\meshCase\\constant'

Starting meshing ...

  Part to mesh: Name --> Pad,  Label --> Pad, ShapeType --> Solid
  CharacteristicLengthMax: 800.0
  ElementDimension: 3D
Traceback (most recent call last):
  File "C:\Users\LB17\AppData\Roaming\FreeCAD\Mod\CfdOF\_TaskPanelCfdMesh.py", line 234, in runMeshProcess
    cart_mesh.setup_mesh_case_dir()
  File "C:\Users\LB17\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdMeshTools.py", line 200, in setup_mesh_case_dir
    shutil.rmtree(self.meshCaseDir)
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 270, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Program Files\FreeCAD 0.17\bin\lib\shutil.py", line 268, in rmtree
    os.rmdir(path)
WindowsError: [Error 145] The directory is not empty: 'c:\\users\\lb17\\appdata\\local\\temp\\meshCase'
Save AutoRecovery file: Needed time: 36ms
My question about the different directories was focused on the default working directory in the Preferences dialog. I now recognize that as the temp directory from Windows, rather than something from freeCAD as I though then.

I used the Input Case Name property with the default value of ‘case’ once, and later with an edited value of ‘case_elbow_1’. At the time I thought I was doing a mesh of my model, but now I see that I was doing a case. At least, I think I see this.

The error msgs in the report above mention a folder named 'meshCase'. This is the mystery folder I was/am wondering about. Where does it come from?

I do not see where the meshing results are saved. Would that be saved as part of the .FCStd file?

And – can a model be meshed more than once? Somewhere in my explorations I got an error message that said only one meshing was allowed. This seems unlikely, so I just chalked it up to something I did wrong.

***

I am in the process of starting over with the elbow tutorial. I will pay a lot more attention to bookkeeping this time.

I will rephrase my other questions as I understand this stuff a little better. Fewer problems this time around, hopefully. One things is already better - My model this time is fully constrained.

Meshing is next.

Thanks again.
ljb
Posts: 43
Joined: Tue Sep 04, 2018 3:56 pm

Re: cfdOF install

Post by ljb »

Meshing went OK
Adding boundaries went OK
Writing the case went OK
Running the case went OK
Post processing looks like it ought to.
For now I'm passing on the 2D option, since I need to stay 3D.

The End

Dang.
Am I done?
Well, of course not. I'm just getting started. :-)

I'm sure I'll have more questions, but they will mostly be more appropriate in a different topic.
For now I'd like to say thank you. All of you.
polymer
Posts: 278
Joined: Fri Sep 12, 2014 8:49 am

Re: cfdOF install

Post by polymer »

Hello,

The following problem appears by the Installation:

Code: Select all

Checking dependencies...
cfMesh not found
HiSA not found
gmsh is not installed

Downloading cfMesh, please wait...
Error downloading cfMesh: module 'urllib' has no attribute 'FancyURLopener'
Download unsuccessful
Downloading HiSA, please wait...
Error downloading HiSA: module 'urllib' has no attribute 'FancyURLopener'
Download unsuccessful
blueCFD Core 2017-2 is installed.

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14709 (Git)
Build type: Release
Branch: master
Hash: faad5ea27301cb7af393a25d317c406d3098bafe
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
What am I doing wrong?
Can I provide some additional Information?

greetings
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: cfdOF install

Post by thschrader »

polymer wrote: Wed Sep 12, 2018 7:57 am What am I doing wrong?
I think nothing.
When you copy the download URL from preferences/cfd into the browser,
a pop-up opens. The install routine cannot reach the zip-file. Download
cfmesh/Hisa manually and use the "choose existing file" option for installing.
For me it works.
cfmesh_download.JPG
cfmesh_download.JPG (101.7 KiB) Viewed 2582 times
polymer
Posts: 278
Joined: Fri Sep 12, 2014 8:49 am

Re: cfdOF install

Post by polymer »

Hmm, no, it does not work, too.

For Download:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 327, in downloadCfMesh
    urllib._urlopener = urllib.FancyURLopener(context=ssl._create_unverified_context())
AttributeError: module 'urllib' has no attribute 'FancyURLopener'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 293, in run
    self.downloadCfMesh()
  File "C:\Users\USERNAME\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 334, in downloadCfMesh
    raise Exception("Error downloading cfMesh: {}".format(str(ex)))
Exception: Error downloading cfMesh: module 'urllib' has no attribute 'FancyURLopener'
When i choose the downloaded *.zip file:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 187, in pickCfMeshFile
    self.form.le_cfmesh_url.setText(urlparse.urljoin('file:', urllib.pathname2url(f)))
AttributeError: module 'urllib' has no attribute 'pathname2url'
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: cfdOF install

Post by oliveroxtoby »

polymer wrote: Wed Sep 12, 2018 7:57 am Hello,

The following problem appears by the Installation:

Code: Select all

Checking dependencies...
cfMesh not found
HiSA not found
gmsh is not installed

Downloading cfMesh, please wait...
Error downloading cfMesh: module 'urllib' has no attribute 'FancyURLopener'
Download unsuccessful
Downloading HiSA, please wait...
Error downloading HiSA: module 'urllib' has no attribute 'FancyURLopener'
Download unsuccessful
blueCFD Core 2017-2 is installed.

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14709 (Git)
Build type: Release
Branch: master
Hash: faad5ea27301cb7af393a25d317c406d3098bafe
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
What am I doing wrong?
Can I provide some additional Information?

greetings
We have just done the update to support Python 3, and this was an issue that slipped through. Should be fixed now.
Please provide all the information requested in this post before reporting problems with CfdOF.
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: cfdOF install

Post by oliveroxtoby »

thschrader wrote: Wed Sep 12, 2018 8:41 pm
polymer wrote: Wed Sep 12, 2018 7:57 am What am I doing wrong?
I think nothing.
When you copy the download URL from preferences/cfd into the browser,
a pop-up opens. The install routine cannot reach the zip-file. Download
cfmesh/Hisa manually and use the "choose existing file" option for installing.
For me it works.
cfmesh_download.JPG
The previous certificate issues that sometimes occurred when downloading were (hopefully) fixed a while ago.
Please provide all the information requested in this post before reporting problems with CfdOF.
polymer
Posts: 278
Joined: Fri Sep 12, 2014 8:49 am

Re: cfdOF install

Post by polymer »

It work's! Thank you! :)

Another Thing...

I have installed gmsh according to the following instructions:
http://bluecfd.github.io/Core/FAQ/how-t ... h-as-gmsh/

gmsh starts in the blueCFD-core Terminal, but the dependeny check says "gmsh is not installed".

greetings
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: cfdOF install

Post by thschrader »

polymer wrote: Thu Sep 13, 2018 6:46 am It work's! Thank you! :)

Another Thing...

I have installed gmsh according to the following instructions:
http://bluecfd.github.io/Core/FAQ/how-t ... h-as-gmsh/

gmsh starts in the blueCFD-core Terminal, but the dependeny check says "gmsh is not installed".

greetings
Why do you have an additional install of gmsh? Thats not necessary, you get gmsh "for free"
in ...freecad/bin folder. I never did an extra installation, gmsh runs fine in cfd-wb.
Forget this extra installation stuff, just follow the preferences dialog. Should work...
gmsh.JPG
gmsh.JPG (24.8 KiB) Viewed 2521 times
check_dependencies.JPG
check_dependencies.JPG (94.92 KiB) Viewed 2521 times
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: cfdOF install

Post by oliveroxtoby »

polymer wrote: Thu Sep 13, 2018 6:46 am It work's! Thank you! :)

Another Thing...

I have installed gmsh according to the following instructions:
http://bluecfd.github.io/Core/FAQ/how-t ... h-as-gmsh/

gmsh starts in the blueCFD-core Terminal, but the dependeny check says "gmsh is not installed".

greetings
It seems that the Python3/Qt5 package doesn't include gmsh at this stage. Ideally we should make the gmsh path configurable so that you can point it to a separate installation, but for now a workaround would be to copy the gmsh executable into the FreeCAD/bin folder.
Please provide all the information requested in this post before reporting problems with CfdOF.
Post Reply