FEM SolverMystran: Difference between revisions

From FreeCAD Documentation
m (Added install hfcMystran)
m (marked code)
Line 46: Line 46:


key in:
key in:
{{Code|code=

python -m pip install pyNastran
python -m pip install pyNastran
}}

It will be installed under FreeCAD\bin\site-pakages folder.
It will be installed under FreeCAD\bin\site-pakages folder.


hfcMystran can be downloaded from its github site as a zip file. Unzip it under FreeCAD\Mod. It will be FreeCAD\Mod\hfcMystran.
hfcMystran can be downloaded from its github site as a zip file. Unzip it under FreeCAD\Mod. It will be FreeCAD\Mod\hfcMystran.


==QuickTest== <!--T:3-->
==QuickTest== <!--T:3-->

Revision as of 23:23, 27 July 2023

Other languages:

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

FEM SolverMystran

Menu location
Solve → Solver Mystran
Workbenches
FEM
Default shortcut
S M
Introduced in version
0.20
See also
FEM tutorial

Description

The SolverMystran command enables usage of the MYSTRAN solver. It may be used for:

  1. Setting analysis parameters
  2. Selecting working directory
  3. Running the MYSTRAN solver

Installation

You can get Mystran Windows exe from here Download Mystran.exe and put that folder where you save it into Windows's PATH.

The SolverMystran also needs two other packages:

  1. pyNastran - to write out case file.
  2. hfcMystran - to read in Mystran's NEU result file.

pyNastran can be installed through pip.

Open a Command terminal under your FreeCAD\bin folder.

key in:

python -m pip install pyNastran

It will be installed under FreeCAD\bin\site-pakages folder.

hfcMystran can be downloaded from its github site as a zip file. Unzip it under FreeCAD\Mod. It will be FreeCAD\Mod\hfcMystran.

QuickTest

After installation, in FEM workbench, you can select Utilities\Open FEM examples to open the FEM examples window. Under Solver\Mystran, you can find some working Mystran examples.

Usage

ToDo

File function

Under Mod\Fem\femsolver\mystran, there are these files:

add_con_displacement.py
add_con_fixed.py
add_con_force.py
add_femelement_geometry.py
add_femelement_material.py
add_mesh.py
add_solver_control.py
writer.py
solver.py
tasks.py

The function of each file are:

writer.py - main control file

model = BDF()
model = add_solver_control.add_solver_control(pynasf, model, self)
model = add_femelement_geometry.add_femelement_geometry(pynasf, model, self)
model = add_mesh.add_mesh(pynasf, model, self)
model = add_femelement_material.add_femelement_material(pynasf, model, self)
model = add_con_fixed.add_con_fixed(pynasf, model, self)
model = add_con_displacement.add_con_displacement(pynasf, model, self)
model = add_con_force.add_con_force(pynasf, model, self)

BDF() - Create empty case file.

$pyNastran: version=msc
$pyNastran: punch=False
$pyNastran: encoding=utf-8
$pyNastran: nnodes=0
$pyNastran: nelements=0
ENDDATA

add_solver_control.py - Adding EXECUTIVE CONTROL DECK and CASE CONTROL DECK.

$EXECUTIVE CONTROL DECK
SOL 101
CEND
$CASE CONTROL DECK
ECHO = NONE
TITLE = pyNastran for generating solverinput for for Mystran
SUBCASE 1
    DISPLACEMENT(SORT1,REAL) = ALL
    LOAD = 1
    SPC = 1
    SPCFORCES(SORT1,REAL) = ALL
    STRESS(SORT1,REAL,VONMISES,BILIN) = ALL
    SUBTITLE = Default
BEGIN BULK
$PARAMS
PARAM       POST      -1

add_femelement_geometry.py - Adding GRID cards

add_mesh.py - Adding element cards

add_femelement_material.py - Adding MAT1 card

add_con_fixed.py - Adding SPCADD and SPC1 cards

add_con_displacement.py - Adding SPCADD and SPC1 cards

add_con_force.py - Adding FORCE cards