FEM, Material: Add DENSITY to inp files and basic material files
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
parent
b85c4430bd
commit
d380187ef3
|
@ -133,6 +133,7 @@ class _MechanicalMaterialTaskPanel:
|
|||
QtCore.QObject.connect(self.form.cb_materials, QtCore.SIGNAL("activated(int)"), self.choose_material)
|
||||
QtCore.QObject.connect(self.form.input_fd_young_modulus, QtCore.SIGNAL("valueChanged(double)"), self.ym_changed)
|
||||
QtCore.QObject.connect(self.form.spinBox_poisson_ratio, QtCore.SIGNAL("valueChanged(double)"), self.pr_changed)
|
||||
QtCore.QObject.connect(self.form.input_fd_density, QtCore.SIGNAL("valueChanged(double)"), self.density_changed)
|
||||
self.previous_material = self.obj.Material
|
||||
self.import_materials()
|
||||
previous_mat_path = self.get_material_path(self.previous_material)
|
||||
|
@ -171,6 +172,14 @@ class _MechanicalMaterialTaskPanel:
|
|||
material['YoungsModulus'] = unicode(value) + " kPa"
|
||||
self.obj.Material = material
|
||||
|
||||
def density_changed(self, value):
|
||||
import Units
|
||||
old_density = Units.Quantity(self.obj.Material['Density'])
|
||||
if old_density != value:
|
||||
material = self.obj.Material
|
||||
material['Density'] = unicode(value) + " kg/mm^3"
|
||||
self.obj.Material = material
|
||||
|
||||
def pr_changed(self, value):
|
||||
import Units
|
||||
old_pr = Units.Quantity(self.obj.Material['PoissonRatio'])
|
||||
|
@ -212,6 +221,8 @@ class _MechanicalMaterialTaskPanel:
|
|||
print ' YM = ', matmap['YoungsModulus']
|
||||
if 'PoissonRatio' in matmap:
|
||||
print ' PR = ', matmap['PoissonRatio']
|
||||
if 'Density' in matmap:
|
||||
print ' RO = ', matmap['Density']
|
||||
|
||||
def set_mat_params_in_combo_box(self, matmap):
|
||||
if 'YoungsModulus' in matmap:
|
||||
|
@ -221,6 +232,11 @@ class _MechanicalMaterialTaskPanel:
|
|||
self.form.input_fd_young_modulus.setText("{} {}".format(ym_with_new_unit, ym_new_unit))
|
||||
if 'PoissonRatio' in matmap:
|
||||
self.form.spinBox_poisson_ratio.setValue(float(matmap['PoissonRatio']))
|
||||
if 'Density' in matmap:
|
||||
density_new_unit = "kg/m^3"
|
||||
density = FreeCAD.Units.Quantity(matmap['Density'])
|
||||
density_with_new_unit = density.getValueAs(density_new_unit)
|
||||
self.form.input_fd_density.setText("{} {}".format(density_with_new_unit, density_new_unit))
|
||||
|
||||
def add_transient_material(self, material):
|
||||
material_name = self.get_material_name(material)
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>188</width>
|
||||
<height>124</height>
|
||||
<width>253</width>
|
||||
<height>275</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -36,6 +36,9 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
|
@ -60,18 +63,18 @@
|
|||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>2000000000.000000000000000</double>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">Pa</string>
|
||||
</property>
|
||||
<property name="decimals" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="maximum" stdset="0">
|
||||
<double>2000000000.000000000</double>
|
||||
</property>
|
||||
<property name="singleStep" stdset="0">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
|
@ -115,6 +118,50 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Density</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::InputField" name="input_fd_density">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0 kg/m^3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>2000000000.000000000000000</double>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">kg/m^3</string>
|
||||
</property>
|
||||
<property name="decimals" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
@ -122,8 +122,12 @@ class inp_writer:
|
|||
# write material properties
|
||||
f.write('*MATERIAL, NAME=' + mat_name + '\n')
|
||||
f.write('*ELASTIC \n')
|
||||
f.write('{}, '.format(YM_in_MPa))
|
||||
f.write('{}, \n'.format(YM_in_MPa))
|
||||
f.write('{0:.3f}\n'.format(PR))
|
||||
density = FreeCAD.Units.Quantity(mat_obj.Material['Density'])
|
||||
density_in_kg_per_mm3 = density.getValueAs('t/mm^3')
|
||||
f.write('*DENSITY \n')
|
||||
f.write('{}, \n'.format(density_in_kg_per_mm3))
|
||||
# write element properties
|
||||
if len(self.material_objects) == 1:
|
||||
f.write('*SOLID SECTION, ELSET=' + mat_obj_name + ', MATERIAL=' + mat_name + '\n')
|
||||
|
|
|
@ -24,6 +24,7 @@ SpecificPrice= 3
|
|||
YoungsModulus=2320 MPa
|
||||
; http://en.wikipedia.org/wiki/Ultimate_tensile_strength in
|
||||
UltimateTensileStrength= 38 MPa
|
||||
Density=1070 kg/m^3
|
||||
|
||||
[FEM]
|
||||
PoissonRatio = 0.35
|
||||
|
|
|
@ -9,6 +9,7 @@ Father=Metal
|
|||
[Mechanical]
|
||||
; youngs modulus (or E-Module)
|
||||
YoungsModulus=210000 MPa
|
||||
Density=1000 kg/m^3
|
||||
|
||||
[FEM]
|
||||
PoissonRatio = 0.3
|
||||
|
|
|
@ -19,6 +19,7 @@ CompressiveStrength=25 MPa
|
|||
YoungsModulus=32000 MPa
|
||||
Elasticity=
|
||||
FractureToughness=
|
||||
Density=2000 kg/m^3
|
||||
|
||||
[FEM]
|
||||
PoissonRatio=0.17
|
||||
|
|
|
@ -22,6 +22,7 @@ SpecificPrice = 0.0
|
|||
YoungsModulus=0 MPa
|
||||
; http://en.wikipedia.org/wiki/Ultimate_tensile_strength in
|
||||
UltimateTensileStrength= 0 MPa
|
||||
Density=0 kg/m^3
|
||||
|
||||
[FEM]
|
||||
PoissonRatio = 0.0
|
||||
|
|
|
@ -24,6 +24,7 @@ SpecificPrice= 4
|
|||
YoungsModulus=3640 MPa
|
||||
; http://en.wikipedia.org/wiki/Ultimate_tensile_strength
|
||||
UltimateTensileStrength= 49.6 MPa
|
||||
Density=1300 kg/m^3
|
||||
|
||||
|
||||
[FEM]
|
||||
|
|
|
@ -30,6 +30,7 @@ CompressiveStrength=
|
|||
Elasticity=
|
||||
; http://en.wikipedia.org/wiki/Fracture_toughness
|
||||
FractureToughness:
|
||||
Density=7900 kg/m^3
|
||||
|
||||
[FEM]
|
||||
PoissonRatio = 0.3
|
||||
|
|
|
@ -18,6 +18,7 @@ CompressiveStrength=
|
|||
YoungsModulus=12000 MPa
|
||||
Elasticity=
|
||||
FractureToughness=
|
||||
Density=0.7 kg/m^3
|
||||
|
||||
[FEM]
|
||||
PoissonRatio=0.05
|
||||
|
|
Loading…
Reference in New Issue
Block a user