refine material structure for yield strength and get data as entered

This commit is contained in:
2019-02-10 20:45:55 +01:00
parent 9e0ccab871
commit dd8b70334e
3 changed files with 30 additions and 20 deletions

View File

@@ -16,7 +16,9 @@
"T": ["20-25", "°C"], "T": ["20-25", "°C"],
"rho": [2.66, "g/cm³"], "rho": [2.66, "g/cm³"],
"E": [70, "GPa"], "E": [70, "GPa"],
"R_p02": ["110-130", "MPa"], "Yield strength": {
"R_p02": ["110-130", "MPa"]
},
"R_m": ["230-290", "MPa"], "R_m": ["230-290", "MPa"],
"Elongation": { "Elongation": {
"A_5": ["10-15", "%"] "A_5": ["10-15", "%"]

View File

@@ -32,9 +32,13 @@
"T": "Reference temperature", "T": "Reference temperature",
"rho": "Density", "rho": "Density",
"E": "Young modulus, module of elasticity", "E": "Young modulus, module of elasticity",
"R_p": "Yield strength R_p (R_e), R_{p0.2}", "Yield strength": {
"R_p02": "Yield strength R_p (R_e), R_{p0.2}", "R_s": "it is detectable only when the material has the yield phenomenon (it does not exist for the cold drawn and the stainless steels)",
"R_m": "Ultimate tensile strength R_m", "R_p": "it is detectable on cold drawn and stainless steel, in place of R_s",
"R_p02": "load corresponding to a no proportional charge equal to a 0.2% of length L_0",
"R_p10": "load corresponding to a no proportional charge equal to a 1% of length L_0"
},
"R_m": "Ultimate tensile strength; it is the ratio between the maximum applied force and the original cross-sectional area of the specimen",
"Elongation": { "Elongation": {
"A": "permanent elongation of length L_0, expressed in per cent of length L_0", "A": "permanent elongation of length L_0, expressed in per cent of length L_0",
"A_0": "permanent elongation for proportional specimens with length L_0 equal to 100 mm (used for diameter lower than 4 mm)", "A_0": "permanent elongation for proportional specimens with length L_0 equal to 100 mm (used for diameter lower than 4 mm)",
@@ -109,7 +113,9 @@
"T": ["20-25", "°C"], "T": ["20-25", "°C"],
"rho": [2.66, "g/cm³"], "rho": [2.66, "g/cm³"],
"E": [70, "GPa"], "E": [70, "GPa"],
"R_p02": ["110-130", "MPa"], "Yield strength": {
"R_p02": ["110-130", "MPa"]
},
"R_m": ["230-290", "MPa"], "R_m": ["230-290", "MPa"],
"Elongation": { "Elongation": {
"A_5": ["10-15", "%"] "A_5": ["10-15", "%"]

View File

@@ -180,9 +180,9 @@ def main():
parser_get.add_argument('-E', '--E', dest='const_collection', parser_get.add_argument('-E', '--E', dest='const_collection',
action='append_const', const="E", action='append_const', const="E",
help='get Young\'s modulus, module of elasticity') help='get Young\'s modulus, module of elasticity')
parser_get.add_argument('-R', '--R_p02', dest='const_collection', parser_get.add_argument('-R', '--R_p', dest='const_collection',
action='append_const', const="R_p02", action='append_const', const="R_p",
help='get yield strength R_e, R_{p0.2}') help='get yield strength R_p')
parser_get.add_argument('--R_m', dest='const_collection', parser_get.add_argument('--R_m', dest='const_collection',
action='append_const', const="R_m", action='append_const', const="R_m",
help='get ultimate tensile strength R_m') help='get ultimate tensile strength R_m')
@@ -207,18 +207,20 @@ def main():
if args.const_collection: if args.const_collection:
data = load_material(args.materialname) data = load_material(args.materialname)
if args.debug: if args.debug:
print("data: " + data) print("data:")
if "rho" in args.const_collection: print_material(data)
#args.const_collection.append("rho(T)") for element in args.const_collection: # iter the way it is been entered as args
#f args.debug: if element == "rho":
# print(args) print_quantity(data['Mechanical Properties']['rho'])
print_quantity(data['Mechanical Properties']['rho']) elif element == "E":
if "E" in args.const_collection: print_quantity(data['Mechanical Properties']['E'])
print_quantity(data['Mechanical Properties']['E']) elif element == "R_p":
if "R_p02" in args.const_collection: if len(data['Mechanical Properties']['Yield strength']) == 1:
print_quantity(data['Mechanical Properties']['R_p02']) print_quantity(next(iter(data['Mechanical Properties']['Yield strength'].values())))
if "R_m" in args.const_collection: else:
print_quantity(data['Mechanical Properties']['R_m']) print_quantity(data['Mechanical Properties']['Yield strength'])
elif element == "R_m":
print_quantity(data['Mechanical Properties']['R_m'])
elif args.search: elif args.search:
search_list = [element for element in args.search.split(',')] search_list = [element for element in args.search.split(',')]