Elmer Static current equation

About the development of the FEM module/workbench.

Moderator: bernd

HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Fri Jul 24, 2020 11:01 am

This would open also the possibility to import existing models into fc!
@Bernd can you please cut and past the last replies concerning this topic and created a new post.
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Sun Jul 26, 2020 9:07 am

HoWil wrote:
Fri Jul 24, 2020 11:01 am
This would open also the possibility to import existing models into fc!
@Bernd can you please cut and past the last replies concerning this topic and created a new post.
bernd wrote: ping
I already implemented a body-force element with free-text-input for the static current equation but the part in the writer.py is still missing but hopefully will be implemented today :shock:

EDIT: free-text-input is now working for the body-force in static current equation see .... https://github.com/HoWilgh/FreeCAD/tree ... etextinput
@Bernd... can you please implement something similar for materials so we can achieve custom/nonlinear material properties or should I try this (see https://forum.freecadweb.org/viewtopic. ... 67#p418370)? I am very unfamiliar with the materials stuff :!:
end EDIT:
Screenshot from 2020-07-26 11-03-26.png
Screenshot from 2020-07-26 11-03-26.png (256.88 KiB) Viewed 618 times
Last edited by HoWil on Sun Jul 26, 2020 2:32 pm, edited 1 time in total.
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Sun Jul 26, 2020 2:25 pm

raback wrote: ping
In the nonGUI tutorial 9 on page 38 in https://www.nic.funet.fi/index/elmer/do ... nonGUI.pdf the command "ElmerGrid 4 2 ExportMesh -order 1.0 0.1 0.001 -o thermal" should be changed to "ElmerGrid 4 2 ExportMesh -order 1.0 0.1 0.001 -out thermal".
All files were taken from here https://www.nic.funet.fi/pub/sci/physics/elmer/doc/ .

Furthermore, If I run than the simulation I get "ERROR:: StatCurrentSolver: Joule Heating does not exist" please see

Code: Select all

$ ~/bin/ElmerFEM_compile/20200625-elmer-dev-coordinate-scaling-revert/elmer-install/bin/ElmerSolver thermal_actuator.sif 
ELMER SOLVER (v 8.4) STARTED AT: 2020/07/26 16:20:04
ParCommInit:  Initialize #PEs:            1
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 8.4 (Rev: 8fa89876, Compiled: 2020-07-20)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN: =============================================================
Model Input: Found local SOLVER.KEYWORDS file, adding keywords to runtime database.
LoadInputFile: Reading only "Run Control" section
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: thermal_actuator.sif
LoadInputFile: Scanning input file: thermal_actuator.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: thermal_actuator.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 2
LoadInputFile: Number of Body Forces: 1
LoadInputFile: Number of Initial Conditions: 1
LoadInputFile: Number of Materials: 1
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 3
LoadInputFile: Number of Bodies: 1
Loading user function library: [StatCurrentSolve]...[StatCurrentSolver_Init0]
LoadMesh: Starting
ElmerAsciiMesh: Performing step: 1
LoadMesh: Base mesh name: ./thermal
LoadMesh: Reading header info from file: ./thermal/mesh.header
InitializeMesh: Number of nodes in mesh: 8498
InitializeMesh: Number of bulk elements in mesh: 3729
InitializeMesh: Number of boundary elements in mesh: 208
InitializeMesh: Initial number of max element nodes: 10
ElmerAsciiMesh: Performing step: 2
LoadMesh: Reading nodes from file: ./thermal/mesh.nodes
SetMeshDimension: Dimension of mesh is: 3
SetMeshDimension: Max dimension of mesh is: 3
ElmerAsciiMesh: Performing step: 3
LoadMesh: Reading bulk elements from file: ./thermal/mesh.elements
ElmerAsciiMesh: Performing step: 4
LoadMesh: Reading boundary elements from file: ./thermal/mesh.boundary
LoadMesh: Performing node mapping
LoadMesh: Skipping remapping of bodies
LoadMesh: Remapping boundaries
LoadMesh: Minimum initial boundary index: 1
LoadMesh: Maximum initial boundary index: 2
ElmerAsciiMesh: Performing step: 5
ElmerAsciiMesh: Performing step: 6
LoadMesh: Loading mesh done
LoadMesh: Preparing mesh done
LoadMesh: Elapsed REAL time:     0.0350 (s)
MeshStabParams: Computing stabilization parameters
MeshStabParams: Elapsed REAL time:     0.0023 (s)
MAIN: -------------------------------------
AddSolvers: Setting up 3 solvers
AddSolvers: Setting up solver 1: stat current solver
AddEquationBasics: Using procedure: StatCurrentSolve StatCurrentSolver
AddEquationBasics: Setting up solver: stat current solver
Loading user function library: [StatCurrentSolve]...[StatCurrentSolver_Init]
Loading user function library: [StatCurrentSolve]...[StatCurrentSolver_bulk]
Loading user function library: [StatCurrentSolve]...[StatCurrentSolver]
AddEquationBasics: Creating standard variable: potential
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: stat current solver...done.
OptimizeBandwidth: Half bandwidth without optimization: 945
OptimizeBandwidth: 
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 353
OptimizeBandwidth: ---------------------------------------------------------
AddSolvers: Setting up solver 2: heat equation
AddEquationBasics: Setting up keywords internally for legacy solver: heat equation
AddEquationBasics: Using procedure: HeatSolve HeatSolver
AddEquationBasics: Setting up solver: heat equation
Loading user function library: [HeatSolve]...[HeatSolver_Init]
Loading user function library: [HeatSolve]...[HeatSolver_bulk]
Loading user function library: [HeatSolve]...[HeatSolver]
AddEquationBasics: Creating standard variable: temperature
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: heat equation...done.
OptimizeBandwidth: Half bandwidth without optimization: 945
OptimizeBandwidth: 
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 353
OptimizeBandwidth: ---------------------------------------------------------
AddSolvers: Setting up solver 3: stress analysis
AddEquationBasics: Setting up keywords internally for legacy solver: stress analysis
AddEquationBasics: Using procedure: StressSolve StressSolver
AddEquationBasics: Setting up solver: stress analysis
Loading user function library: [StressSolve]...[StressSolver_Init]
StressSolve_init: 
StressSolve_init: --------------------------------------------------
StressSolve_init: Solving displacements from linear elasticity model
StressSolve_init: --------------------------------------------------
Loading user function library: [StressSolve]...[StressSolver_bulk]
Loading user function library: [StressSolve]...[StressSolver]
AddEquationBasics: Creating standard variable: displacement
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: stress analysis...done.
OptimizeBandwidth: Half bandwidth without optimization: 945
OptimizeBandwidth: 
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 353
OptimizeBandwidth: ---------------------------------------------------------
AddMeshCoordinatesAndTime: Setting mesh coordinates and time
SetInitialConditions: Setting up initial conditions (if any)
ElmerSolver: Number of timesteps to be saved: 31
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: stat current solver
ERROR:: StatCurrentSolver: Joule Heating does not exist
STOP 1
I could not make the simulation completely work. In the best case is the "Joule Heating" computed but the heat solver does not consider it.
Can you please have a look at this apart from that really nice example which is already working up to "Joule Heating" in FC.
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Fri Jul 31, 2020 4:29 am

The freetextinputs dialogues for bodyforces for all related Elmer equations are implemented and tested.
Please see https://github.com/berndhahnebach/FreeCAD_bhb/pull/83 .
One can use the following model to test the influence of e.g. self-weight body force element in comparison to a free-text-input-element containing the same sif-text.
bernd wrote: ping
Can you please give it a try? Will next work on freetextinputs for:
  • Boundary conditions (EDIT)done
  • Material-definitions (EDIT)done
  • equations
  • initial conditions
  • simulation-section (EDIT)
Attachments
Screenshot from 2020-07-31 06-27-11.png
Screenshot from 2020-07-31 06-27-11.png (394.69 KiB) Viewed 551 times
FemCantilever3D_newSolver_Bodyforce_Freetextinput.FCStd
(177.42 KiB) Downloaded 17 times
Last edited by HoWil on Fri Jul 31, 2020 8:09 pm, edited 2 times in total.
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Fri Jul 31, 2020 12:21 pm

Freetextinput for face/boundary-constraints were also added to the femelmerfreetextinput-branch and can be tested with the following model...
Attachments
Screenshot from 2020-07-31 14-20-28.png
Screenshot from 2020-07-31 14-20-28.png (313.86 KiB) Viewed 524 times
FemCalculixCantilever3D_newSolver_constraintFaceFreetextinput.FCStd
(165.52 KiB) Downloaded 17 times
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Fri Jul 31, 2020 8:09 pm

Freetextinput for materials was added to the femelmerfreetextinput-branch and can be tested with the following model...
See also https://github.com/berndhahnebach/FreeC ... t?expand=1
Attachments
FemCantilever3D_newSolver_Bodyforce_Freetextinput.FCStd
(177.6 KiB) Downloaded 15 times
Screenshot from 2020-07-31 22-02-15.png
Screenshot from 2020-07-31 22-02-15.png (262.88 KiB) Viewed 500 times
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Fri Jul 31, 2020 8:13 pm

With this the original tutorial model should be able to be implemented.... https://forum.freecadweb.org/viewtopic. ... 67#p418345
Will test this in the next days.
raback
Posts: 58
Joined: Fri May 08, 2020 4:02 pm
Location: Finland
Contact:

Re: Elmer Static current equation

Post by raback » Fri Jul 31, 2020 8:32 pm

Great that you have implemented the free text input. This will be appreciated by many advanced users!

Perhaps it would be possible to not use the original Ansys mesh for this test case. This case is quite old and after all you do have nice CAD features in the code. But maybe that's not the highest priority.

I could have a look at the case. However, could you point where the cases are being developed (in github?). Also interested in the Calculix cases for synergy.

I understand that the native format for FreeCAD is .FCStd file and these cases may be swiftly run. From Elmer point of view it would be nice if the resulting (.sif and maybe .vtu) files would be provided for reference. Those would be quick to comment.

-Peter
HoWil
Posts: 1199
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Elmer Static current equation

Post by HoWil » Sat Aug 01, 2020 6:16 am

raback wrote:
Fri Jul 31, 2020 8:32 pm
Great that you have implemented the free text input. This will be appreciated by many advanced users!

Perhaps it would be possible to not use the original Ansys mesh for this test case. This case is quite old and after all you do have nice CAD features in the code. But maybe that's not the highest priority.

I could have a look at the case. However, could you point where the cases are being developed (in github?). Also interested in the Calculix cases for synergy.

I understand that the native format for FreeCAD is .FCStd file and these cases may be swiftly run. From Elmer point of view it would be nice if the resulting (.sif and maybe .vtu) files would be provided for reference. Those would be quick to comment.

-Peter
Hi Peter,
For the comment above (https://forum.freecadweb.org/viewtopic. ... 10#p419362)
I simply used the original mesh and .sif files provided with the tutorials (https://www.nic.funet.fi/pub/sci/physic ... GUI.tar.gz)

So the original example/tutorial is not running :!:
The recreated model in FC only shows the same error when running the solver as with the tutorial while using a gmsh-mesh.
BR
raback
Posts: 58
Joined: Fri May 08, 2020 4:02 pm
Location: Finland
Contact:

Re: Elmer Static current equation

Post by raback » Mon Aug 03, 2020 1:03 pm

Hi HoWil

The non-GUI tutorials are not automatically tested for when developing Elmer. Some of the test cases may be a little outdated being ~10 years old. There are hundreds of test cases that on the other hand are tested frequently.

Not it happens that this "ThermalActuator" also exists as a test case which has been somewhat modernized. I just took the additional step of transfering the original Ansys mesh into Gmsh format. This way the workflow could perhaps more easily be adopted in FreeCAD as the Gmsh format might be better supported there?

For the files see:
https://github.com/ElmerCSC/elmerfem/tr ... alActuator

-Peter
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests