From 89479fd74d01b735fe7625cdd7e681c82e2fa86a Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Sun, 22 Mar 2020 08:59:32 +0100 Subject: [PATCH] FEM: examples, new lines --- src/Mod/Fem/femexamples/boxanalysis.py | 1 - src/Mod/Fem/femexamples/ccx_cantilever_std.py | 1 - .../constraint_contact_shell_shell.py | 6 ++-- .../constraint_contact_solid_solid.py | 4 +-- src/Mod/Fem/femexamples/constraint_tie.py | 4 +-- .../femexamples/material_nl_platewithhole.py | 32 +++++++++---------- src/Mod/Fem/femexamples/rc_wall_2d.py | 2 ++ .../Fem/femexamples/thermomech_bimetall.py | 11 ++++--- src/Mod/Fem/femexamples/thermomech_flow1d.py | 2 ++ 9 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/Mod/Fem/femexamples/boxanalysis.py b/src/Mod/Fem/femexamples/boxanalysis.py index 4124ba9e1a..3edaef65c8 100644 --- a/src/Mod/Fem/femexamples/boxanalysis.py +++ b/src/Mod/Fem/femexamples/boxanalysis.py @@ -31,7 +31,6 @@ box.setup_frequency() """ - import FreeCAD import Fem diff --git a/src/Mod/Fem/femexamples/ccx_cantilever_std.py b/src/Mod/Fem/femexamples/ccx_cantilever_std.py index a6d4439589..94936f068c 100644 --- a/src/Mod/Fem/femexamples/ccx_cantilever_std.py +++ b/src/Mod/Fem/femexamples/ccx_cantilever_std.py @@ -33,7 +33,6 @@ canti.setup_cantileverhexa20faceload() """ - import FreeCAD import Fem diff --git a/src/Mod/Fem/femexamples/constraint_contact_shell_shell.py b/src/Mod/Fem/femexamples/constraint_contact_shell_shell.py index 56e797b6a5..b8e321bb91 100644 --- a/src/Mod/Fem/femexamples/constraint_contact_shell_shell.py +++ b/src/Mod/Fem/femexamples/constraint_contact_shell_shell.py @@ -21,9 +21,6 @@ # * * # *************************************************************************** -# contact example shell to shell elements -# https://forum.freecadweb.org/viewtopic.php?f=18&t=42228 -# based on https://forum.freecadweb.org/viewtopic.php?f=18&t=42228#p359488 # to run the example use: """ from femexamples.constraint_contact_shell_shell import setup @@ -31,6 +28,9 @@ setup() """ +# contact example shell to shell elements +# https://forum.freecadweb.org/viewtopic.php?f=18&t=42228 +# based on https://forum.freecadweb.org/viewtopic.php?f=18&t=42228#p359488 import FreeCAD diff --git a/src/Mod/Fem/femexamples/constraint_contact_solid_solid.py b/src/Mod/Fem/femexamples/constraint_contact_solid_solid.py index 5cbd468f4e..40bd603921 100644 --- a/src/Mod/Fem/femexamples/constraint_contact_solid_solid.py +++ b/src/Mod/Fem/femexamples/constraint_contact_solid_solid.py @@ -21,8 +21,6 @@ # * * # *************************************************************************** -# constraint contact for solid to solid mesh -# https://forum.freecadweb.org/viewtopic.php?f=18&t=20276 # to run the example use: """ from femexamples.constraint_contact_solid_solid import setup @@ -30,6 +28,8 @@ setup() """ +# constraint contact for solid to solid mesh +# https://forum.freecadweb.org/viewtopic.php?f=18&t=20276 import FreeCAD from FreeCAD import Rotation diff --git a/src/Mod/Fem/femexamples/constraint_tie.py b/src/Mod/Fem/femexamples/constraint_tie.py index b93b0dfa4c..4bf3d0a4b0 100644 --- a/src/Mod/Fem/femexamples/constraint_tie.py +++ b/src/Mod/Fem/femexamples/constraint_tie.py @@ -21,8 +21,6 @@ # * * # *************************************************************************** -# constraint tie, bond two surfaces together (solid mesh only) -# https://forum.freecadweb.org/viewtopic.php?f=18&t=42783 # to run the example use: """ from femexamples.constraint_tie import setup @@ -30,6 +28,8 @@ setup() """ +# constraint tie, bond two surfaces together (solid mesh only) +# https://forum.freecadweb.org/viewtopic.php?f=18&t=42783 import FreeCAD from FreeCAD import Vector diff --git a/src/Mod/Fem/femexamples/material_nl_platewithhole.py b/src/Mod/Fem/femexamples/material_nl_platewithhole.py index a9258e842b..787bdebc95 100644 --- a/src/Mod/Fem/femexamples/material_nl_platewithhole.py +++ b/src/Mod/Fem/femexamples/material_nl_platewithhole.py @@ -28,6 +28,21 @@ setup() """ +""" +Nonlinear material example, plate with hole. + +https://forum.freecadweb.org/viewtopic.php?f=24&t=31997&start=30 +https://forum.freecadweb.org/viewtopic.php?t=33974&start=90 +https://forum.freecadweb.org/viewtopic.php?t=35893 + +plate: 400x200x10 mm +hole: diameter 100 mm (half cross section) +load: 130 MPa tension +linear material: Steel, E = 210000 MPa, my = 0.3 +nonlinear material: '240.0, 0.0' to '270.0, 0.025' +TODO nonlinear material: give more information, use values from harry +TODO compare results with example from HarryvL +""" import FreeCAD from FreeCAD import Vector as vec @@ -48,27 +63,12 @@ def init_doc(doc=None): def setup(doc=None, solvertype="ccxtools"): - """ Nonlinear material example, plate with hole. - - https://forum.freecadweb.org/viewtopic.php?f=24&t=31997&start=30 - https://forum.freecadweb.org/viewtopic.php?t=33974&start=90 - https://forum.freecadweb.org/viewtopic.php?t=35893 - - plate: 400x200x10 mm - hole: diameter 100 mm (half cross section) - load: 130 MPa tension - linear material: Steel, E = 210000 MPa, my = 0.3 - nonlinear material: '240.0, 0.0' to '270.0, 0.025' - TODO nonlinear material: give more information, use values from harry - TODO compare results with example from HarryvL - - """ + # setup model if doc is None: doc = init_doc() # geometry objects - v1 = vec(-200, -100, 0) v2 = vec(200, -100, 0) v3 = vec(200, 100, 0) diff --git a/src/Mod/Fem/femexamples/rc_wall_2d.py b/src/Mod/Fem/femexamples/rc_wall_2d.py index b24040c3fa..b3a6a90460 100644 --- a/src/Mod/Fem/femexamples/rc_wall_2d.py +++ b/src/Mod/Fem/femexamples/rc_wall_2d.py @@ -28,6 +28,8 @@ setup() """ +# example from Harry's epic topic: Concrete branch ready for testing +# https://forum.freecadweb.org/viewtopic.php?f=18&t=33106&start=80#p296469 import FreeCAD from FreeCAD import Vector as vec diff --git a/src/Mod/Fem/femexamples/thermomech_bimetall.py b/src/Mod/Fem/femexamples/thermomech_bimetall.py index fa68f90cbe..b2fe504ff8 100644 --- a/src/Mod/Fem/femexamples/thermomech_bimetall.py +++ b/src/Mod/Fem/femexamples/thermomech_bimetall.py @@ -21,17 +21,18 @@ # * * # *************************************************************************** +""" +from femexamples.thermomech_bimetall import setup +setup() + +""" + # thermomechanical bimetall # https://forum.freecadweb.org/viewtopic.php?f=18&t=43040&start=10#p366664 # analytical solution 7.05 mm deflection in the invar material direction # see post in the forum link # this file has 7.15 mm max deflection # to run the example use: -""" -from femexamples.thermomech_bimetall import setup -setup() - -""" import FreeCAD from FreeCAD import Rotation diff --git a/src/Mod/Fem/femexamples/thermomech_flow1d.py b/src/Mod/Fem/femexamples/thermomech_flow1d.py index 9af1b871ec..02c3f43cb0 100644 --- a/src/Mod/Fem/femexamples/thermomech_flow1d.py +++ b/src/Mod/Fem/femexamples/thermomech_flow1d.py @@ -28,6 +28,8 @@ setup() """ +# topic about the 1D flow analysis +# https://forum.freecadweb.org/viewtopic.php?f=18&t=20076 import FreeCAD from FreeCAD import Vector as vec