FEM: calculix writer, better information in the regard of units

This commit is contained in:
Bernd Hahnebach
2020-07-13 08:05:49 +02:00
parent be1abcb96b
commit af70ea48d4
18 changed files with 372 additions and 74 deletions

View File

@@ -44,6 +44,37 @@ from femmesh import meshtools
from femtools import geomtools
# Interesting forum topic: https://forum.freecadweb.org/viewtopic.php?&t=48451
# TODO somehow set units at beginning and every time a value is retrieved use this identifier
# this would lead to support of unit system, force might be retrieved in base writer!
# the following text will be at the end of the main calculix input file
units_information = """***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
"""
class FemInputWriterCcx(writerbase.FemInputWriter):
def __init__(
self,
@@ -1307,12 +1338,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
))
f.write("**\n")
f.write("**\n")
f.write("**\n")
f.write("** Units\n")
f.write("**\n")
f.write("** Geometry (mesh data) --> mm\n")
f.write("** Materials (Young's modulus) --> N/mm2 = MPa\n")
f.write("** Loads (nodal loads) --> N\n")
f.write(units_information)
f.write("**\n")
# ********************************************************************************************

View File

@@ -476,10 +476,26 @@ S, E
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -607,10 +607,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -426,10 +426,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -460,10 +460,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -423,10 +423,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -431,10 +431,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -38433,10 +38433,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -5365,10 +5365,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -3479,10 +3479,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -18671,10 +18671,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -29207,10 +29207,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -2718,10 +2718,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -1299,10 +1299,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -20136,10 +20136,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -8268,10 +8268,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -177,10 +177,26 @@ MF, PS
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**

View File

@@ -216,10 +216,26 @@ RF
** analysis name --> Analysis
**
**
***********************************************************
** About units:
** See ccx manual, ccx does not know about any unit.
** Golden rule: The user must make sure that the numbers he provides have consistent units.
** The user is the FreeCAD calculix writer module ;-)
**
** Units
** The unit system which is used at Guido Dhodts company: mm, N, s, K
** Since Length and Mass are connected by Force, if Length is mm the Mass is in t to get N
** The following units are used to write to inp file:
**
** Geometry (mesh data) --> mm
** Materials (Young's modulus) --> N/mm2 = MPa
** Loads (nodal loads) --> N
** Length: mm (this includes the mesh geometry)
** Mass: t
** TimeSpan: s
** Temperature: K
**
** This leads to:
** Force: N
** Pressure: N/mm^2
** Density: t/mm^2
** Gravity: mm/s^2
** Thermal conductivity: t*mm/K*s^3
** Specific Heat: kJ/t/K = mm^2/s^2/K
**