Can't install cfMesh and HiSA

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

shIxx
Posts: 52
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Can't install cfMesh and HiSA

Postby shIxx » Mon Jul 20, 2020 6:32 pm

Hello everyone,

I have problems installing cfMesh and HiSA.

What I've done so far:
- I updated the cfdOF workbench and the dependency checker told me that my cfMesh and HiSA could not be found.
- I installed both in the preference until "installation complet" was shown, but the dependency chack didn't find them. So I came up with the idea to reinstall the whole blueCFD (apparently I had an outdated version)
- Then the download of cfMesh and Hisa did not work. The message "download unsuccessful" was shown and the report view said "maybe the docker daemon is not started"
- I started the "Docker Quickstart Terminal" that was installed with blueCFD, and something was "outdated", this was then downloaded (it took a few minutes).
- Now both cfMesh and HiSA are downloading but shortly after the download is finished, it ends with this error:

Code: Select all

Downloading cfMesh, please wait...
cfMesh downloaded to C:\Users\thoma\AppData\Local\Temp\tmp4povktov.zip
Command 'echo $WM_PROJECT_USER_DIR' returned non-zero exit status 1.
Download unsuccessful

Downloading HiSA, please wait...
HiSA downloaded to C:\Users\thoma\AppData\Local\Temp\tmp85wegxop.zip
Command 'echo $WM_PROJECT_USER_DIR' returned non-zero exit status 1.
Download unsuccessful
And the report view says for both:

Code: Select all

20:00:30  Running  echo $WM_PROJECT_USER_DIR
20:00:30  Raw command:  ['C:/Program Files/FreeCAD/bin\\python.exe', '-u', 'C:\\Users\\thoma\\AppData\\Roaming\\FreeCAD\\Mod\\CfdOF\\WindowsRunWrapper.py', 'powershell.exe', 'docker-machine.exe start default; docker-machine.exe env --shell powershell default | Invoke-Expression; docker start of_1912; docker exec --privileged of_1912 bash -c "su -c \'echo `$WM_PROJECT_USER_DIR\' -l ofuser"']
20:00:31  Starting "default"...
20:00:31  Machine "default" is already running.
20:00:32  Error response from daemon: No such container: of_1912
Error: failed to start containers: of_1912
Error: No such container: of_1912
20:00:32  Traceback (most recent call last):
20:00:32    File "C:\Users\thoma\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 352, in run
20:00:32      self.downloadHisa()
20:00:32    File "C:\Users\thoma\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 434, in downloadHisa
20:00:32      self.user_dir = CfdTools.runFoamCommand("echo $WM_PROJECT_USER_DIR").rstrip().split('\n')[-1]
20:00:32    File "C:\Users\thoma\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdTools.py", line 634, in runFoamCommand
20:00:32      raise subprocess.CalledProcessError(exit_code, cmdline)
20:00:32  subprocess.CalledProcessError: Command 'echo $WM_PROJECT_USER_DIR' returned non-zero exit status 1.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22039 (Git)
Build type: Release
Branch: master
Hash: 2bfc6301bc80c0344cbf13dbfe041fbd78cac93d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
User avatar
oliveroxtoby
Posts: 445
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install cfMesh and HiSA

Postby oliveroxtoby » Mon Jul 20, 2020 8:18 pm

shIxx wrote:
Mon Jul 20, 2020 6:32 pm
Hello everyone,

I have problems installing cfMesh and HiSA.

What I've done so far:
- I updated the cfdOF workbench and the dependency checker told me that my cfMesh and HiSA could not be found.
- I installed both in the preference until "installation complet" was shown, but the dependency chack didn't find them. So I came up with the idea to reinstall the whole blueCFD (apparently I had an outdated version)
- Then the download of cfMesh and Hisa did not work. The message "download unsuccessful" was shown and the report view said "maybe the docker daemon is not started"
- I started the "Docker Quickstart Terminal" that was installed with blueCFD, and something was "outdated", this was then downloaded (it took a few minutes).
- Now both cfMesh and HiSA are downloading but shortly after the download is finished, it ends with this error:
We have switched from BlueCFD to the ESI-OpenCFD Docker installation as the default install option on Windows. I think this is what you have installed. (Note that you can still install and use BlueCFD if you wish, but it has not been updated for quite some time.)

You should see two icons installed on your desktop, one of which is called "OF_Env_Create". Please could you try running this and then attempt the installation of cfMesh/hisa again. Please let me know if this solves the problem.
shIxx
Posts: 52
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Can't install cfMesh and HiSA

Postby shIxx » Tue Jul 21, 2020 12:21 pm

You are absolutely right it was not blueCFD but ESI-openFOAM
Tried it but the problem is still there.

Powershell:

Code: Select all

Set-ExecutionPolicy : Der Zugriff auf den Registrierungsschlüssel
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" wurde verweigert. Starten Sie zum
Ändern der Ausführungsrichtlinie für den Standardbereich (LocalMachine) Windows PowerShell mit der Option "Als
Administrator ausführen". Führen Sie zum Ändern der Ausführungsrichtlinie für den aktuellen Benutzer
"Set-ExecutionPolicy -Scope CurrentUser" aus.
In C:\Program Files (x86)\ESI\OpenFOAM\v1912\Windows\Scripts\of_create_container.ps1:33 Zeichen:1
+ Set-ExecutionPolicy bypass
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyComma
   nd
Num Args: 2
of_v1912_centos73_win
C:\Program Files\Docker Toolbox\;C:\Program Files\Git\bin
C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Python38-32\Scripts\;C:\Program Files (x86)\Python38-32\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Elmer 8.4-Release\bin;C:\Program Files\Git\cmd;C:\Users\thoma\AppData\Local\Microsoft\WindowsApps;;C:\Users\thoma\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Docker Toolbox;C:\Program Files\Docker Toolbox\;C:\Program Files\Git\bin
 *****************************************************************************.
Welcome to the OpenFOAM Containerized Windows Version (v1906)
Please do not close the windows.. Creating a working container.. Please wait
 *****************************************************************************.
Starting "default"...
Machine "default" is already running.
/root/../c/Users/thoma:/root/../home/ofuser/workingDir
Unable to find image 'of_v1912_centos73_win:latest' locally
docker: Error response from daemon: pull access denied for of_v1912_centos73_win, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
exit status 125
 *****************************************************************************.
Please Close the windows and Click on OpenFOAM_Start shortcut to start working
 *****************************************************************************.
PS C:\Program Files (x86)\ESI\OpenFOAM\v1912>
cfdOF preference:

Code: Select all

Downloading cfMesh, please wait...
cfMesh downloaded to C:\Users\thoma\AppData\Local\Temp\tmpdgkk0x6e.zip
Command 'echo $WM_PROJECT_USER_DIR' returned non-zero exit status 1.
Download unsuccessful
Report view:

Code: Select all

14:12:36  Running  echo $WM_PROJECT_USER_DIR
14:12:36  Raw command:  ['C:/Program Files/FreeCAD/bin\\python.exe', '-u', 'C:\\Users\\thoma\\AppData\\Roaming\\FreeCAD\\Mod\\CfdOF\\WindowsRunWrapper.py', 'powershell.exe', 'docker-machine.exe start default; docker-machine.exe env --shell powershell default | Invoke-Expression; docker start of_1912; docker exec --privileged of_1912 bash -c "su -c \'echo `$WM_PROJECT_USER_DIR\' -l ofuser"']
14:12:36  Starting "default"...
14:12:36  Machine "default" is already running.
14:12:37  Error response from daemon: No such container: of_1912
Error: failed to start containers: of_1912
14:12:38  Error: No such container: of_1912
14:12:38  Traceback (most recent call last):
14:12:38    File "C:\Users\thoma\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 350, in run
14:12:38      self.downloadCfMesh()
14:12:38    File "C:\Users\thoma\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdPreferencePage.py", line 412, in downloadCfMesh
14:12:38      self.user_dir = CfdTools.runFoamCommand("echo $WM_PROJECT_USER_DIR").rstrip().split('\n')[-1]
14:12:38    File "C:\Users\thoma\AppData\Roaming\FreeCAD\Mod\CfdOF\CfdTools.py", line 634, in runFoamCommand
14:12:38      raise subprocess.CalledProcessError(exit_code, cmdline)
14:12:38  subprocess.CalledProcessError: Command 'echo $WM_PROJECT_USER_DIR' returned non-zero exit status 1.
Thank you for your help.
User avatar
oliveroxtoby
Posts: 445
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install cfMesh and HiSA

Postby oliveroxtoby » Tue Jul 21, 2020 8:12 pm

shIxx wrote:
Tue Jul 21, 2020 12:21 pm
You are absolutely right it was not blueCFD but ESI-openFOAM
Tried it but the problem is still there.

Powershell:

Code: Select all

Set-ExecutionPolicy : Der Zugriff auf den Registrierungsschlüssel
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" wurde verweigert. Starten Sie zum
Ändern der Ausführungsrichtlinie für den Standardbereich (LocalMachine) Windows PowerShell mit der Option "Als
Administrator ausführen". Führen Sie zum Ändern der Ausführungsrichtlinie für den aktuellen Benutzer
"Set-ExecutionPolicy -Scope CurrentUser" aus.
In C:\Program Files (x86)\ESI\OpenFOAM\v1912\Windows\Scripts\of_create_container.ps1:33 Zeichen:1
+ Set-ExecutionPolicy bypass
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyComma
   nd
Num Args: 2
of_v1912_centos73_win
C:\Program Files\Docker Toolbox\;C:\Program Files\Git\bin
C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Python38-32\Scripts\;C:\Program Files (x86)\Python38-32\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Elmer 8.4-Release\bin;C:\Program Files\Git\cmd;C:\Users\thoma\AppData\Local\Microsoft\WindowsApps;;C:\Users\thoma\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Docker Toolbox;C:\Program Files\Docker Toolbox\;C:\Program Files\Git\bin
 *****************************************************************************.
Welcome to the OpenFOAM Containerized Windows Version (v1906)
Please do not close the windows.. Creating a working container.. Please wait
 *****************************************************************************.
Starting "default"...
Machine "default" is already running.
/root/../c/Users/thoma:/root/../home/ofuser/workingDir
Unable to find image 'of_v1912_centos73_win:latest' locally
docker: Error response from daemon: pull access denied for of_v1912_centos73_win, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
exit status 125
 *****************************************************************************.
Please Close the windows and Click on OpenFOAM_Start shortcut to start working
 *****************************************************************************.
PS C:\Program Files (x86)\ESI\OpenFOAM\v1912>
It looks like some sort of permissions issue. Please could you try to run the "Start_OF" shortcut that was created on the desktop. If that does not work it is an issue with the OpenFOAM installation rather than with CfdOF per se.
shIxx
Posts: 52
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Can't install cfMesh and HiSA

Postby shIxx » Fri Jul 24, 2020 6:21 am

I can start openFOAM, this is what I see in the terminal after clicking on OpenFOAM_Start:

Code: Select all

Starting "default"...
Machine "default" is already running.
Error response from daemon: No such container: of_1912
Error: failed to start containers: of_1912
Error: No such container: of_1912
Stopping "default"...
Machine "default" was stopped.
PS C:\Program Files (x86)\ESI\OpenFOAM\v1912>
User avatar
oliveroxtoby
Posts: 445
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Can't install cfMesh and HiSA

Postby oliveroxtoby » Fri Jul 24, 2020 7:35 am

shIxx wrote:
Fri Jul 24, 2020 6:21 am
I can start openFOAM, this is what I see in the terminal after clicking on OpenFOAM_Start:

Code: Select all

Starting "default"...
Machine "default" is already running.
Error response from daemon: No such container: of_1912
Error: failed to start containers: of_1912
Error: No such container: of_1912
Stopping "default"...
Machine "default" was stopped.
PS C:\Program Files (x86)\ESI\OpenFOAM\v1912>
This is giving errors and not working correctly. Something must have gone wrong with your OpenFOAM installation. Please could you try to re-do the installation directly. This is accessible at https://www.openfoam.com/download/insta ... indows.php. Once you have verified it is installed correctly, then please try again using CfdOF.

Note: This link will install the latest 2006 version, so I suggest you first uninstall the 1912 version you have to avoid confusion.
shIxx
Posts: 52
Joined: Wed Mar 28, 2018 10:13 am
Location: Bavaria (Germany)

Re: Can't install cfMesh and HiSA

Postby shIxx » Tue Aug 04, 2020 2:55 pm

I think there is a conflict between BlueCFD and ESI openFOAM. So I uninstalled BlueCFD and reinstalled ESI and set the path in the cfdOF preference (C: \ Program Files (x86) \ ESI \ OpenFOAM \ v2006)

The terminal shows me this when I start openFOAM

Code: Select all

Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
of_2006
[ofuser@default ~]$
No errors,so everything seems to be okay.

Then I installed HiSA and cfMesh and the dependency checker seys "HiSA not found".
Looks like cfMesh was successfully installed.
I don't really need HiSA either, because I don't want to simulate incompressible fluids.

I have been considering changing my system and switching to Manjaro Linux for a long time. Maybe I'll do the next weekend and then everything will run well.
Last edited by shIxx on Wed Jan 13, 2021 11:08 am, edited 1 time in total.
poontitming
Posts: 6
Joined: Wed Nov 28, 2018 3:57 pm
Location: Hong Kong / Minneapolis

Re: Can't install cfMesh and HiSA

Postby poontitming » Wed Jan 13, 2021 7:44 am

I got the same problem. Successfully installed by running freecad.exe as administrator.

You need to run OpenFOAM_Start batch file installed on your desktop to start the VirtualBox VM. Make sure the VM started without error in the terminal. Right click freecad.exe and run it as administrator. Then you can install cfMesh and HISA in FreeCAD Preferences.

I also enabled Windows Linux Subsystem in control panel program features but I don't know if this is also required.