Elmer integration as a solver

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: Elmer integration as a solver

Post by bernd »

Attached the results of CalculiX cantilever analyzed with ElmerFEM. Output format is vtu which is supported by FreeCAD FEM. But FreeCAD only reads the mesh data. A result object is not made.

The result files open fine in Paraview and the displacements could be visualized.

Bernd
Attachments
ccx_canti--elmer_results.vtu.zip
(44.32 KiB) Downloaded 42 times
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer integration as a solver

Post by HoWil »

This means at least that the toolchain FC-Elmer-Paraview does work!?

Did you generate the complete .sif or did you 'just' change adopt/recreate the mesh.

Did you use the boundary names from FC stored in the .unv file? They can be used with 'Use Mesh Names = True' as described here ... http://www.elmerfem.org/forum/viewtopic ... 220#p14925 ?

Is there a problem regarding the result inread? Do you need a special format? Elmer does support many different output formats. Please see also '6.3 Strategies for postprocessing' on page 9 in ftp://lukusali.nic.funet.fi/ftp/index/S ... erview.pdf
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Elmer integration as a solver

Post by vejmarie »

Hi bernd,

I started to have a look to the issue tonight, there are some new features that I didn't know yet from the test I made earlier. First why is there an option while importing the results which is asking you through a popup, if we are importing a mesh or results ? Are we sure that selecting result is realling importing results as as you saied this is a mesh, and the import work fine. If it was focused on results it shouldnt import the mesh no ?

vejmarie
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Elmer integration as a solver

Post by bernd »

HoWil wrote:This means at least that the toolchain FC-Elmer-Paraview does work!?
No not at all. See dvbranch https://github.com/berndhahnebach/FreeC ... olverelmer I just added the solver object and the modules needed. At the moment in any case the calculix cantilver is writen as elmer input. The elmer process handling is not implemented. My idea was to start with the result reading because elmer uses output format supported by FreeCAD FEM. I tried *.vtu but may be I should have tried *.vtk

@HoWil:
since you know elmer you could may be give it a try and import some *.vtu or *.vtk in FreeCAD and give some Feedback.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Elmer integration as a solver

Post by bernd »

vejmarie wrote: there are some new features that I didn't know yet from the test I made earlier. First why is there an option while importing the results which is asking you through a popup, if we are importing a mesh or results ? Are we sure that selecting result is realling importing results as as you saied this is a mesh, and the import work fine. If it was focused on results it shouldnt import the mesh no ?
The new features Have been added by xing feng. I have not been used them. See https://github.com/FreeCAD/FreeCAD/comm ... ingfengxia

With CalculiX it works the following way.
- If a frd output file is imported in an empty an analysis, a FEMmesh and a result object is created.
- If a frd is read from an analysis run just the result object is created in the active analysis. The mesh from the analysis should fit to the result object.


IMHO it should work the same way with the vtk, vtu etc files, but I have never been imported one before.

Bernd
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer integration as a solver

Post by HoWil »

I tested my example from over here ... viewtopic.php?f=18&t=16630&start=20#p146553
as well as some other elmer results which all work fine in Paraview 5.0.1. All were imported into FC as .vtu and the example above also as .vtk but I always get only the mesh, no matter if I select results or mesh import!

Is my version of FC sufficiently up-to-date?

OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9177 (Git)
Build type: Unknown
Branch: femmeshregion
Hash: bba68d007c461ff80b4f72fe82e53b20a8600458
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Elmer integration as a solver

Post by ickby »

actually it should work, and my implementation supported all kind of result data in the vtk files. Most likely this is a bug or something that got lost during the latest changes. I will try to have a look at this over the next days.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Elmer integration as a solver

Post by bernd »

ickby wrote:actually it should work, and my implementation supported all kind of result data in the vtk files. Most likely this is a bug or something that got lost during the latest changes. I will try to have a look at this over the next days.
It might make sense if you would use my current FEM development branch to be sure my branch one does not make problems again. See https://github.com/berndhahnebach/FreeC ... meshregion
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer integration as a solver

Post by HoWil »

ickby wrote:actually it should work, and my implementation supported all kind of result data in the vtk files. Most likely this is a bug or something that got lost during the latest changes. I will try to have a look at this over the next days.
Hallo ickby,
Did you have time to look into this issue?
This is growing interest since almost all new external solver (Elmer, FeniCS, Openfoam) will output some kind of .vtk file or similar.
Thank you in advance,
HoWil
qingfeng.xia
Posts: 227
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford UK/Shenzhen China
Contact:

Re: Elmer integration as a solver

Post by qingfeng.xia »

To solve CFD problem, you may reuse some of the code in CfdWorkbench, which is a split from FemWorkbench
https://github.com/qingfengxia/Cfd
This workbench is designed to fit in more solvers.

CfdSolverElmer.py derived from CfdSolver which defined most of setting for CFD, include elmer specific settings, example are CfdSolverFoam.py
CfdCaseWriterElmer.py expose only a write_case() method. write_mesh (which should be similar as Bernd has done)and write boundary condition
CfdRunnableElmer.py , then call the calculation and retrieve the result and display, CfdSolverControl can be reused with tiny modification

then add _CommandCfdSolverElmer.py _ViewProviderCfdSolverElmer.py, can be adapted from *Foam.py
add into CfdWorkbench via InitGui.py

CfdResultVTKElmer.py is needed to load result. curently this piece of code (CfdResult and taskpanel) is under review, there is no need to

FluidMaterial.py has several implementation, currently needs a unification.
FemConstraintFluidBoundary.cpp can be reused for common CFD boundary types
bernd wrote:
vejmarie wrote: there are some new features that I didn't know yet from the test I made earlier. First why is there an option while importing the results which is asking you through a popup, if we are importing a mesh or results ? Are we sure that selecting result is realling importing results as as you saied this is a mesh, and the import work fine. If it was focused on results it shouldnt import the mesh no ?
The new features Have been added by Qingfeng. I have not been used them. See https://github.com/FreeCAD/FreeCAD/comm ... ingfengxia

With CalculiX it works the following way.
- If a frd output file is imported in an empty an analysis, a FEMmesh and a result object is created.
- If a frd is read from an analysis run just the result object is created in the active analysis. The mesh from the analysis should fit to the result object.


IMHO it should work the same way with the vtk, vtu etc files, but I have never been imported one before.

Bernd
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Post Reply