Thermal Analysis Of a Fluid

About the development of the FEM module/workbench.

Moderator: bernd

tthomas20
Posts: 10
Joined: Thu Jan 16, 2020 1:16 pm

Thermal Analysis Of a Fluid

Postby tthomas20 » Fri Jan 17, 2020 6:48 pm

Hi All,

I am very new to FreeCAD and even newer to python. I have been trying to learn the FEM workbench, mostly for the thermal analysis. I can get it to work with relatively simple, solid objects no problem. However, I have been trying to simulate the expansion of air inside of a container such as a window (where I am having the most trouble). I keep getting a long list of errors after I run CalculiX and I have no idea what to do with them. I have searched google, the forums, uninstalled and reinstalled FC, and nothing seems to really address my problem.

After meshing I get this message but the mesh appears

Code: Select all

Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
And after I run CalculiX I get this message but no result mesh

Code: Select all

Active Task Dialog found! Please close this one before opening  a new one!
FEM preferences working dir setting is empty, the solver working directory is used.
All working Dir settings are empty: ''.
Working directory: '' doesn't exist.
Dir 'C:\Users\tthomas\AppData\Local\Temp' will be used instead.
FemToolsCCx.setup_working_dir()  -->  self.working_dir = C:\Users\tthomas\AppData\Local\Temp
SolidMaterial has Solid reference shapes.
SolidMaterial001 has Solid reference shapes.
FluidMaterial has Solid reference shapes.
FemConstraintFixed has Face reference shapes.
FemConstraintHeatflux has Face reference shapes.
FemConstraintInitialTemperature has empty References.
SolidMaterial has Solid reference shapes.
SolidMaterial001 has Solid reference shapes.
FluidMaterial has Solid reference shapes.
card_path: 
Previously used material card cannot be found in material directories. Add document material.
False
FEM preferences working dir setting is empty, the solver working directory is used.
All working Dir settings are empty: ''.
Working directory: '' doesn't exist.
Dir 'C:\Users\tthomas\AppData\Local\Temp' will be used instead.
FemToolsCCx.setup_working_dir()  -->  self.working_dir = C:\Users\tthomas\AppData\Local\Temp
SolidMaterial has Solid reference shapes.
SolidMaterial001 has Solid reference shapes.
FluidMaterial has Solid reference shapes.
FemConstraintFixed has Face reference shapes.
FemConstraintHeatflux has Face reference shapes.
FemConstraintInitialTemperature has empty References.
SolidMaterial has Solid reference shapes.
SolidMaterial001 has Solid reference shapes.
FluidMaterial has Solid reference shapes.
FemInputWriterCcx --> self.dir_name  -->  C:\Users\tthomas\AppData\Local\Temp\
FemInputWriterCcx --> self.main_file_name  -->  FEMMeshGmsh.inp
FemInputWriterCcx --> self.file_name  -->  C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh.inp
Materials
Constraint: SolidMaterial --> We have mesh groups. We will search for appropriate group data.
  found mesh group for the IDs: SolidMaterial_Volumes, Type: Volume
Constraint: SolidMaterial001 --> We have mesh groups. We will search for appropriate group data.
  found mesh group for the IDs: SolidMaterial001_Volumes, Type: Volume
Constraint: FluidMaterial --> We have mesh groups. We will search for appropriate group data.
  found mesh group for the IDs: FluidMaterial_Volumes, Type: Volume
Count FEM elements as sum of constraints:  19341
Count FEM elements of the FreeCAD FEM mesh:   19341
True
Constraint fixed: FemConstraintFixed
  found mesh group for the IDs: FemConstraintFixed_Nodes, Type: Node
  nodes where retrieved from existent FEM mesh group data
Writing time input file: 2.13 seconds 

runCalculix
run CalculiX at: C:/Users/tthomas/AppData/Local/FreeCAD 0.18/bin/ccx.exe with: C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh
calculixStarted()
PySide2.QtCore.QProcess.ProcessState.Running
calculixFinished() -1
PySide2.QtCore.QProcess.ProcessState.NotRunning
PySide2.QtCore.QRegExp('\*ERROR.*\n\n', 1, 0)
CalculiX done without error!
We will load the ccx frd and dat result file.
Read ccx results from frd file: C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh.frd
FEM: No nodes found in Frd file.
Problem on frd file import. No nodes found in frd file.
FEM: No result object in active Analysis.
Read ccx results from dat file: C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh.dat
Has anyone tried thermal analysis on a fluid in FC before with FEM? Any help will be appreciated.

(Sorry I am having trouble attaching the actual file)

OS: WIndows 10
Word Size of OS: 64-bit
Word Size of FreeCAD: 64-bit
Version: 0.18.4.980bf90
Build type: Release
Branch: Master
Python Version: 3.6.6
Qt Version: 5.6.2
Coin Version: 4.0.0.0
Locale: English/UnitedStates (en_US)
User avatar
Kunda1
Posts: 7028
Joined: Thu Jan 05, 2017 9:03 pm

Re: Thermal Analysis Of a Fluid

Postby Kunda1 » Fri Jan 17, 2020 7:36 pm

Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
bernd
Posts: 9267
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Thermal Analysis Of a Fluid

Postby bernd » Sat Jan 18, 2020 1:45 pm

This meshing error can be ignored. There us a topic about it, but I can not find it ATM.
User avatar
bernd
Posts: 9267
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Thermal Analysis Of a Fluid

Postby bernd » Sat Jan 18, 2020 1:49 pm

Solver input file writing seams to have worked. Calculix, the solver ended with an error. We would need the file.

If the file is > 1 MB, clear (not delete) the mesh.

bernd
User avatar
bernd
Posts: 9267
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Thermal Analysis Of a Fluid

Postby bernd » Sat Jan 18, 2020 1:49 pm

Ahh, welcone to FreeCAD FEM
User avatar
bernd
Posts: 9267
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Thermal Analysis Of a Fluid

Postby bernd » Sun Jan 19, 2020 1:31 pm

there is an example ... but you need 0.19 dev version

- start FreeCAD
- in Python console run

Code: Select all

from femexamples import thermomech_spine as spine
spine.setup()
than activate the analysis and run the analysis ...
Attachments
Screenshot_20200119_143010.png
Screenshot_20200119_143010.png (239.55 KiB) Viewed 410 times
tthomas20
Posts: 10
Joined: Thu Jan 16, 2020 1:16 pm

Re: Thermal Analysis Of a Fluid

Postby tthomas20 » Mon Jan 20, 2020 11:33 am

Thanks for the advice and instructions. The file fits now and I will start installing 0.19
Attachments
Standard Window.FCStd
(183.72 KiB) Downloaded 3 times
User avatar
Kunda1
Posts: 7028
Joined: Thu Jan 05, 2017 9:03 pm

Re: Thermal Analysis Of a Fluid

Postby Kunda1 » Mon Jan 20, 2020 12:43 pm

bernd wrote:
Sun Jan 19, 2020 1:31 pm
there is an example ... but you need 0.19 dev version
@bernd is there a page on the wiki describing this ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
bernd
Posts: 9267
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Thermal Analysis Of a Fluid

Postby bernd » Mon Jan 20, 2020 3:46 pm

no wiki page yet how to start the FEM examples. see in FEM mod in femexamples at the end of each file is a Python command to copy.

On my to do is to add a menue entry for each example.
tthomas20
Posts: 10
Joined: Thu Jan 16, 2020 1:16 pm

Re: Thermal Analysis Of a Fluid

Postby tthomas20 » Mon Feb 03, 2020 4:00 pm

So here is where I'm at...I compiled FC 0.19 and ran the example @bernd gave me and it worked fine. I tried to simplify the problem by just copying the tutorial from https://www.freecadweb.org/wiki/FEM_She ... site_Block (which worked) and replacing the inner material with air and applying the thermal conditions I had before. Although this seems to work a little smoother, I still get the error

Code: Select all

runCalculix
run CalculiX at: C:/Users/tthomas/AppData/Local/FreeCAD 0.18/bin/ccx.exe with: C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh
calculixStarted()
PySide2.QtCore.QProcess.ProcessState.Running
calculixFinished() -1
PySide2.QtCore.QProcess.ProcessState.NotRunning
PySide2.QtCore.QRegExp('\*ERROR.*\n\n', 1, 0)
CalculiX done without error!
We will load the ccx frd and dat result file.
Read ccx results from frd file: C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh.frd
FEM: No nodes found in Frd file.
Problem on frd file import. No nodes found in frd file.
FEM: No result object in active Analysis.
Read ccx results from dat file: C:\Users\tthomas\AppData\Local\Temp\FEMMeshGmsh.dat
where the .frd and .dat files are empty. I have had trouble searching the forums for the exact cause of this error, thus I am back here to you. I attached the "simplified" version of the model
Attachments
thermal analysis fo air in a box.FCStd
(15.6 KiB) Downloaded 1 time