Error when running solver

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

Post Reply
mikew
Posts: 6
Joined: Sat Oct 24, 2020 12:28 pm

Error when running solver

Post by mikew »

Hello! I've just installed FreeCAD0.19, OpenFOAM8, Plot, CfdOF, dependency check is ok, all on Ubuntu 20.04LTS. Then, i've created a simple model for simulation of wind load on building, but there's an error when running the solver:

08:23:43 Start to write case to folder /home/user/Documentos/cfdofoutput
08:23:43 Matching boundary conditions ...
08:23:43 Populating createPatchDict to update BC names
08:23:43 Successfully wrote case to folder /home/user/Documentos/cfdofoutput
08:24:18 Traceback (most recent call last):
08:24:18 File "/home/user/.FreeCAD/Mod/CfdOF/_TaskPanelCfdSolverControl.py", line 152, in runSolverProcess
08:24:18 cmd = self.solver_runner.get_solver_cmd(solverDirectory)
08:24:18 File "/home/user/.FreeCAD/Mod/CfdOF/CfdRunnableFoam.py", line 92, in get_solver_cmd
08:24:18 self.residualPlot = ResidualPlot()
08:24:18 File "/home/user/.FreeCAD/Mod/CfdOF/CfdResidualPlot.py", line 34, in __init__
08:24:18 self.fig = Plot.figure(FreeCAD.ActiveDocument.Name + "Residuals")
08:24:18 File "/home/user/.FreeCAD/Mod/Plot/freecad/plot/Plot.py", line 110, in figure
08:24:18 win = Plot(winTitle)
08:24:18 File "/home/user/.FreeCAD/Mod/Plot/freecad/plot/Plot.py", line 423, in __init__
08:24:18 self.canvas.setParent(self)
08:24:18 TypeError: arguments did not match any overloaded call:
setParent(self, QWidget): argument 1 has unexpected type 'Plot'
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]): argument 1 has unexpected type 'Plot'

The problem seems to be with the Plot workbench dependency, but i've already reinstalled it and nothing changed. Any ideas of how to solve this problem?
Attachments
CfdOFpreferences.png
CfdOFpreferences.png (135.9 KiB) Viewed 1788 times
Galpao simples.FCStd
(21.33 KiB) Downloaded 48 times
thschrader
Veteran
Posts: 3155
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Error when running solver

Post by thschrader »

For me your model runs without error.
BTW:
Define the house as a separate wall to compute forces with paraview.
Use the mesh-refinement option for the house, use bigger cells in the outer regions
(you use more than 5 mio cells...).
For a turbulent case, use cfmesh with boundary-layers at the house.
I am running on bluecfd-core 2017-2 with
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

EDIT:
example
Galpao_ts.FCStd
(24.01 KiB) Downloaded 47 times
house.JPG
house.JPG (59.09 KiB) Viewed 1716 times
HSig
Posts: 6
Joined: Mon Oct 12, 2015 1:26 pm

Re: Error when running solver

Post by HSig »

I get the same error as mikew.

Tested with simple test case and in addition downloaded hschrader model for testing.

Code: Select all

Traceback (most recent call last):
  File "/home/x/.FreeCAD/Mod/CfdOF/_TaskPanelCfdSolverControl.py", line 152, in runSolverProcess
    cmd = self.solver_runner.get_solver_cmd(solverDirectory)
  File "/home/x/.FreeCAD/Mod/CfdOF/CfdRunnableFoam.py", line 92, in get_solver_cmd
    self.residualPlot = ResidualPlot()
  File "/home/x/.FreeCAD/Mod/CfdOF/CfdResidualPlot.py", line 34, in __init__
    self.fig = Plot.figure(FreeCAD.ActiveDocument.Name + "Residuals")
  File "/home/x/.FreeCAD/Mod/Plot/freecad/plot/Plot.py", line 110, in figure
    win = Plot(winTitle)
  File "/home/x/.FreeCAD/Mod/Plot/freecad/plot/Plot.py", line 423, in __init__
    self.canvas.setParent(self)
TypeError: arguments did not match any overloaded call:
  setParent(self, QWidget): argument 1 has unexpected type 'Plot'
  setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]): argument 1 has unexpected type 'Plot'
Running on:
OS: Linux Mint 20 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22475 (Git)
Build type: Unknown
Branch: master
Hash: f5710fb5cf551b026617f6248afd5cc2c48a3750
Python version: 3.8.2
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Error when running solver

Post by oliveroxtoby »

mikew wrote: Sat Oct 24, 2020 12:55 pm Hello! I've just installed FreeCAD0.19, OpenFOAM8, Plot, CfdOF, dependency check is ok, all on Ubuntu 20.04LTS. Then, i've created a simple model for simulation of wind load on building, but there's an error when running the solver:

08:23:43 Start to write case to folder /home/user/Documentos/cfdofoutput
08:23:43 Matching boundary conditions ...
08:23:43 Populating createPatchDict to update BC names
08:23:43 Successfully wrote case to folder /home/user/Documentos/cfdofoutput
08:24:18 Traceback (most recent call last):
08:24:18 File "/home/user/.FreeCAD/Mod/CfdOF/_TaskPanelCfdSolverControl.py", line 152, in runSolverProcess
08:24:18 cmd = self.solver_runner.get_solver_cmd(solverDirectory)
08:24:18 File "/home/user/.FreeCAD/Mod/CfdOF/CfdRunnableFoam.py", line 92, in get_solver_cmd
08:24:18 self.residualPlot = ResidualPlot()
08:24:18 File "/home/user/.FreeCAD/Mod/CfdOF/CfdResidualPlot.py", line 34, in __init__
08:24:18 self.fig = Plot.figure(FreeCAD.ActiveDocument.Name + "Residuals")
08:24:18 File "/home/user/.FreeCAD/Mod/Plot/freecad/plot/Plot.py", line 110, in figure
08:24:18 win = Plot(winTitle)
08:24:18 File "/home/user/.FreeCAD/Mod/Plot/freecad/plot/Plot.py", line 423, in __init__
08:24:18 self.canvas.setParent(self)
08:24:18 TypeError: arguments did not match any overloaded call:
setParent(self, QWidget): argument 1 has unexpected type 'Plot'
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]): argument 1 has unexpected type 'Plot'

The problem seems to be with the Plot workbench dependency, but i've already reinstalled it and nothing changed. Any ideas of how to solve this problem?
I have seen the same thing with the Ubuntu 20.04 package. The AppImage worked ok for me, so I presume it is a packaging issue that needs to be investigated. I'd suggest using the AppImage for now.
mikew
Posts: 6
Joined: Sat Oct 24, 2020 12:28 pm

Re: Error when running solver

Post by mikew »

oliveroxtoby wrote: Sun Oct 25, 2020 2:58 pm I have seen the same thing with the Ubuntu 20.04 package. The AppImage worked ok for me, so I presume it is a packaging issue that needs to be investigated. I'd suggest using the AppImage for now.
Thanks! I've tried with AppImage, but then had some other new problems. Since I do not have much experience with Ubuntu, I've decided to run on Windows 10, and, after installing everything, it seems to work fine!
thschrader wrote: Sun Oct 25, 2020 8:43 am For me your model runs without error.
BTW:
Define the house as a separate wall to compute forces with paraview.
Use the mesh-refinement option for the house, use bigger cells in the outer regions
(you use more than 5 mio cells...).
For a turbulent case, use cfmesh with boundary-layers at the house.
I am running on bluecfd-core 2017-2 with
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

EDIT:
example
Galpao_ts.FCStd
house.JPG
Thank you for the info! I was having trouble trying to use cfmesh, it always returned an error, but now (on Windows 10) it worked normally, so I'm gonna try the refinement as you suggested.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Error when running solver

Post by Kunda1 »

thschrader wrote: Sun Oct 25, 2020 8:43 am Version: 0.19.22284 (Git)
@thschrader do you realize you're running an older v0.19? Current is r22846, FYI
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
thschrader
Veteran
Posts: 3155
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Error when running solver

Post by thschrader »

Kunda1 wrote: Tue Oct 27, 2020 1:34 am @thschrader do you realize you're running an older v0.19? Current is r22846, FYI
Updated FC and cfdof-wb.
Dependency-check gives "HiSA 1.2.1. required"
Installed HiSA 1.2.1., dependency-check ok. But when running the G7-test case,
openfoam gives error "solver Hisa not found". Reinstalled my previous HiSA 1.1.4,
dependency-check negativ, but solver runs (?).
G7_2_2D_case.FCStd
(41.09 KiB) Downloaded 41 times
See also
https://forum.freecadweb.org/viewtopic.php?f=37&t=48134

OF-version: bluecfdcore 2017-2
on
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22846 (Git)
Build type: Release
Branch: master
Hash: 1f46b72491a0008384a6db4f2615a656249f6f08
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
oliveroxtoby
Posts: 837
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: Error when running solver

Post by oliveroxtoby »

thschrader wrote: Tue Oct 27, 2020 9:55 am
Kunda1 wrote: Tue Oct 27, 2020 1:34 am @thschrader do you realize you're running an older v0.19? Current is r22846, FYI
Updated FC and cfdof-wb.
Dependency-check gives "HiSA 1.2.1. required"
Installed HiSA 1.2.1., dependency-check ok. But when running the G7-test case,
openfoam gives error "solver Hisa not found". Reinstalled my previous HiSA 1.1.4,
dependency-check negativ, but solver runs (?).
G7_2_2D_case.FCStd
See also
https://forum.freecadweb.org/viewtopic.php?f=37&t=48134
Should be fixed
thschrader
Veteran
Posts: 3155
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Error when running solver

Post by thschrader »

oliveroxtoby wrote: Tue Oct 27, 2020 7:35 pm ...
Should be fixed
Installed HiSA 1.2.2, dependency-check ok, solver runs.
Thanks.
Post Reply