# Bachelor22

Members

60

1. ## Stress Constraint

Okay, thanks a lot! One last question I got: I run a topology optimization using a stress constraint of 40,000 MPa. I got the message, that all constraints are satisfied but doing a FE-reanalysis the maximum stress is above 40,000 MPa. How can this be explained? Did I put the density threshhold too high?
2. ## Stress Constraint

Thanks a lot for this answer, this really helped me a lot! Do you know if it's possible to set a mesh-independency filter?
3. ## Stress Constraint

Hey guys, I got a question on topology optimization again. I want to set a Stress Constraint for my optimization, how can I estimate a reasonable value for this constraint to avoid getting an infeasible design? Besides, how do I know which of my constraints is hurt when this error is occurring? Kind regards Simon
4. ## SIMP Method

Hello Rahul, thanks for your quick reply and the documents provided. I understand how the penalization is working and that the stiffness matrix of the structure is depending of a pseudo element density. I still don't get how this density is calculated. What is this variable depending on? And when does the density take a value of 0, for void, and when for 1, for solid material? Could you help me out with this question? Kind regards and thanks in advance, Simon
5. ## Mass calculation

Hey guys, I want to calculate the mass of my model using a tcl-script. Is there a simple command to do this? (I haven't found one yet.) If this is not the case, do you know another way how to solve this problem? Kind regards Simon
6. ## SIMP Method

Hey guys, I have a question on the theory of the SIMP Method used in OptiStruct to perform a Topology Optimization. I got that the stiffness matrix of a material is varied depending on its "density" and that using the penalization factor p, we are aiming for design with only 0 and 1 values in the end. For me it's still unclear, how OptiStruct is calculating these density values. How does the solver know where I have an element with density 0, 1 or something in between? Kind regards and thanks in advance Simon
7. ## Marking of Elements Around a Hole

Hey guys, I got a question concerning the following model. I want to move all the elements, which are surrounding the holes, into a component. Do you know a command how to mark them? Thanks in advance, Simon
8. ## Deleting Elements

Thank you, this already helps me a lot! But somehow, the line *createmark elems 2 "less than value" collector.material.\\$E \$Grenzwert﻿ 0 marks all the elements of the model. Is the variable \$E the youngs modulus and does it have to be declared before using the command? And what's the meaning of the 0 at the end of the line? Or in general: What do I have to put in here: collector.material.\\$E The real collector names or can I leave it as it is?
9. ## Deleting Elements

Hey guys, I'm trying to write a script which deletes elements of a model, that have a young's modulus under a certain value ("Grenzwert"). Running the following Code, this is working as it is supposed to for the first 5 iterations. Afterwards the number of elements deleted stays the same all the time. The problem is, that there are still elements with a youngs modulus lower than 100. Do you know what's the problem here? Some annotations which may help to understand the code: lStressValue_1 = list containing the young's modulus of every element delete_id = element id which should be deleted # Suchen aller Werte unter Grenzwert set delete_id "" set delete_index {} set Grenzwert 100 set y -1 set Element "" # y gibt den Index des Felded unter Grenzwert an wird zu einer Liste zusammengefügt foreach Element \$lStressValue_1 { incr y if {[expr \$Element < \$Grenzwert]} { lappend delete_index "\$y" } } # Die Element-Ids aus der Liste der lIDs mit den Elementen unter Grundwert herauslesen foreach Element_C \$delete_index { append delete_id "[lindex \$lID_1 \$Element_C] " } *createmark elements 1 {*}\$delete_id *deletemark elements 1 Kind regards, Simon
10. ## Creating a label in the utility menu

Hey guys, is there a way to create a label in the utility menu? I only find command to create buttons etc., but no command for labels. Can you help me out somehow? Kind regards Simon
11. ## Customizing the output of a loadstep

Hey guys, I'm trying to customize the output of a load step. Trying to run again the relevant parts of the command file, an error is occurring in this line. *startnotehistorystate {Updated string array} *setvalue loadsteps id=1 STATUS=2 4873={ } ROW=0 *endnotehistorystate {Updated string array} I'm pretty sure the empty brackets are the reason for the error, but I don't know how to get around them. Could you help me out with this problem? Kind regards Simon Attached you'll find my code. The relevant part starts after line 254. SKO_2.tcl
12. ## Deleting a .fem-File

Not the answer I was hoping for, but thank you anyway!
13. ## Deleting a .fem-File

Is there some way to get around this problem?
14. ## Deleting a .fem-File

Hey guys, after I have finished my work on a model, I start a new session in HyperMesh and want to delete the .fem-File from the previous model. This is not working, and a message appears saying that the .fem-file is still open in HyperMesh. If the command "file delete" is used, an error is occurring which says "permission denied". Do you know how I can solve this problem and delete the .fem-File without closing HyperMesh totally? Kind regards Simon
15. ## Changing the ID

Hey guys, I want to create several materials, properties and components automatically. The desired IDs of all the materials, properties and components are saved in an external file and then written into a variable. Each of these values should create an own material, an own property and an own component. For creating the first material, everything works fine. But when the second material should be created, an error is occurring. Do you have an idea how this problem can be fixed? Kind regards Simon Attached, you can find the file with the IDs (these are the values in column 1 saved into the variable "field1") and the .tcl-script I'm talking about. SKO_3.tcl SKO.strs
16. ## Export Element Stresses in HyperMesh

I found a way to solve the problem, thanks very much!
17. ## Export Element Stresses in HyperMesh

Hey guys, I want to export the elementstresses calculated in HyperMesh using a .tcl-file. I found a way using a results curve but I can only manage to export nodal stresses. Do you know a way how to export also the element stresses? Kind regards Simon
18. ## Varying the Young's Modulus of elements

Hey guys, I'm trying to implement an algorithm for the Soft Kill Option in HyperMesh. An important step is to vary the Young's Modulus of each element depending on the element stress. As a consequence of the different stresses of every element, do I need to create a new material and a new property for every element? Or do you have another way to solve this problem? Kind regards and thanks in advance Simon
19. ## Catching An Error

Thanks for your help guys, this helped us a lot!
20. ## Catching An Error

Thanks for your efforts! 1. I'm executing a solver at first and load the results afterwards. But sometimes the solver failed because the meshed is too bad, so no result file is written. The command *plotnodelist needs the results file and fails if it's not existing. --> HyperWorks closes 2. meshing problem is non-correctable, because two 2d mesh edges are running into each other during thermal expansion and the mesh overlaps. The solver fails in the next step in a static analysis (--> 1) The overlapping is shown in the picture. The skript is running for many iteration without problems, but after some iteration the described problem occurs and HyperWorks crashes. I want so improve the mesh after it fails and start the programm again. There must be a mistake in the code of catching the problem. For the sake of completeness the part before the command '*plotnodelist # executing the solver exec \$batch -analysis "\$path/\${name}.fem" hm_answernext yes *analysisfileset "\$path/\${name}.res" #make a contour plot *setgeomrefinelevel 1 *drawlistresetstyle *setcuttingplanesbase 0 29.3749355 7.5 *clipboundaryelements 1 *inputsimulation "SUB1 - Statische Analyse " "Von Mises Stress" *contourplot "" 0 0 0 0 1 0 0 0 "magnitude" 1 0 0 #select the component nodes and plot the results *createmark nodes 1 "by comp name" Randschicht *createlist nodes 1 {*}[hm_getmark nodes 1] set NodeList [hm_getlist nodes 1] if { [catch {*plotnodelist 1}] } { puts "analysis failed " break } else { *plotnodelist 1 }
21. ## Catching An Error

The failure information is on the lower left corner. If this failure occurs, HyperMesh shows no reaction and has to be closed and opened every time. I want to catch this failure and stop the loop if the failure occurs. After this i want to correct the mesh in HyperMesh and start another iteration.
22. ## Catching An Error

Hey guys, I want to catch a mistake concerning the mesh. when this mistake is occuring, the user should be able to fix the mesh. During a while loop i have sometimes an error in the command *plotnodelist, because it needs the inputs "results of a analysis" and "nodes id". Sometimes the analysis fails and *plotnodelist leads to a break down of Hyperworks because of the missing results. Here is the relevant part of my code: while {} {...... if { [catch {*plotnodelist 1}] } { puts "analysis failed " break } else { *plotnodelist 1 } ....} Kind regards Simon
23. ## Closing a program

Hey guys, I'm looking for a .tcl-command to completely close a program. The program starts with a messagebox where you can choose yes or no. If you select yes, the program runs as it is planned. If you choose no, the whole program should stop. There for I used the exit 2 command. But instead of closing the whole program it only closes the message box and tries to run the code afterwards. Do you have an idea how to fix that problem? This is the relevant part of the code: set starting [tk_messageBox -message "Möchten Sie eine vorhandenes Modell verwenden?" -type yesno -icon question -title "Einladen des Modells"] switch -- \$starting { yes { set basedir {C:/} set filetypes {{{Text} {*.fem}} {{Alle} {*}}} set par [tk_getOpenFile \ -initialdir [pwd]\ -title "Startdatei wählen..."\ -filetypes \$filetypes ] *feinputwithdata2 "\#optistruct\\optistruct" "\$par" 0 0 0 0 0 1 9 1 0 } no { exit 2 } } *createentity mats cardimage=MAT1 name=material1 ... Kind regards, Simon
24. ## Getting Maximal Stress Value

Hey guys, is there a .tcl-command which shows the maximal node stress of a structure after a simulation? Kind regards and thanks in advance Simon