TAGGED: output, Output files and saving, output-variables
-
-
February 28, 2024 at 1:01 pm
Jesus Alierta
SubscriberI want to include the results of my simulation within an iterative optimization scheme within a Python framework. For that, I need to export the values of a variable (say y-velocity) at a specific set of nodes (say my_set_of_nodes) in a txt format at the end of the simulation. I've been messing with the output options but cannot find the good one. Is this even possible? Thanks
-
March 1, 2024 at 2:24 pm
mjmiddle
Ansys EmployeeÂ
Â
-
March 1, 2024 at 2:29 pm
-
March 1, 2024 at 3:09 pm
Jesus Alierta
SubscriberHi Alex,
No, unfortunatelly that does not solve my problem. I want to do it automatically (i.e. setting an option to export it within the .k file), as I'm running the simulation within a loop (in a python program) and I need to read those results from a txt (or other format) (depending on those results, I want to change the input .k file for the next iteration). Another option would be to read the results in python via the d3plot binary file, but I would need to know the exact format of the stored data in that file. Hope it is clearer now
-
March 1, 2024 at 3:29 pm
Alex Rycman
Ansys EmployeeÂ
Hi,
1. You can put extraction of the nodal quantities in one command file (cfile). https://lsdyna.ansys.com/command/ .Â
2. Inside your optimization loop use the subprocess library to call LSPPÂ with the cfile as an argument, and post-process the d3plots.Â
3. Read the output filesÂI think that would be the easiest way to extract the data without looking inside D3PLOTS. However, if you are interested in the structure of the d3plot file please look at the https://ftp.lstc.com/user/manuals/ls-dyna_database.pdf
Username: userÂ
Password: computerThanks,
AlexÂÂ
-
March 1, 2024 at 3:38 pm
Alex Rycman
Ansys EmployeeHi,Â
Here is extra information how to execute LSPP command file. /knowledge/forums/topic/how-execute-an-ls-prepost-command-file/
Thanks,
AlexÂ
Â
-
March 2, 2024 at 1:09 pm
Jesus Alierta
SubscriberHi Alex, that is really helpful and I follow the idea, but I'm not grasping some specific actions. If I'm understanding you correctly, I should follow the steps of your first reply to manually export the velocities to a file. That should generate a lspost.cfile, is that right? Then I should call LS-PrePost c=commandfile -nographics to automatically do what I did manually. I'm very new to LS-dyna so I'm not familiar with the commands, could you please help me narrowing down the correct command I would need to use? I wrote this pseudocode
for i in range(N):
  ansys_inc/v241/ansys/bin/lsdyna -b i=my_file_i.k  # 1) run simulation ls-dyna
  ansys_inc/v241/ansys/bin/lsdyna -b c=lspost.cfile -nographics                  # 2) post-process outputs, is this correct?
  prepare_next_k_file(args)                    # 3) do stuff depending on previous results
Thanks in advance -
March 6, 2024 at 9:33 am
Jesus Alierta
SubscriberHi Alex,Â
I've been trying to export the nodal velocities using the ls-prepost interface as you told me, but it is not working as I expected. It actually works with the shell parts of the model, but not with the Fluid (ALE) parts (it creates a file with the headers but empty values). How do I export the velocity values of the Fluid (ALE) part in which I'm interested? (see attached image). Thankw -
March 6, 2024 at 5:17 pm
Ian Do
Ansys EmployeeHello Jesus,
There is not a way to output "nodal vel" for an AMMG, if that is what you are asking.Â
I do not understand your ultimate and precise objective. If you can describe that in details, maybe I can suggest an approach(?).
By definition, an AMMG or ALE mat/part flows through an ALE computational domain. The nodes are eulerian nodes (fixed ref. frame). As the ALE mat passes through a node, its vel is record at that node as an instantaneous vel. As the AMMG passes by and away from that node, it no longer belong to the AMMG. For LAG part it is very easy to follow the mat because the node is fixed to the mat. For ALE/Eulerian mat, the concept is different. We may not be able to always have the node collection that belongs to an AMMG. So we cannot output that nodeset's nodal vel at every time step.
Ian DoÂ
-
March 7, 2024 at 8:41 am
Jesus Alierta
SubscriberHi Ian,Â
I'm sorry I was not clearer before, english is not my main language. I understand the concepts of the fixed eulerian nodes and the ALE part that flows over them, but I was hoping that somehow the software could still output the velocities of eulerian nodes that are "overlapping" with the ALE part at any specific time step. In fact, the software lets you visualize what I want when you hide everything but the ALE part and plot the nodal velocities.Â
Let me explain what I am trying to do so you may suggest me a different approach:
1- I'm simulating an explosively formed penetrator (EFP). One of the ALE parts is the formed projectile (the blue mesh in my previous screenshot), and I'm interested in its peak velocity because I have measured experimentaly the value that it should achieve.Â
2- I'm trying to optimize the parameters of one of the involved EOS equations to achieve the experimental velocity.3- I have heard about Optislang, but have never used it (and I'm not familiar with Workbench either), so I was trying to use my own optimization approach using specialized Python libraries. To calculate the "error" or how far from the objective the results are, I need to know the peak velocity of the projectile. This is the reason I was trying to extract the velocities of that specific part programatically.
Hope everything is clear now and thank you very much for your help.
-
- The topic ‘Export a variable value at a specific node set at the end of the simulation’ is closed to new replies.
- LS-DYNA Installation Issues with Student Workbench 2024 R2
- Initial Velocity Generation
- Cross-coupled stiffness elements in LS-DYNA
- Johnson-Cook material strength model and the Johnson-Cook fracture model.
- LS-Dyna, Negative volume problem.
- Location of results when using python or cmd to call ls-run to calculate k files
- Can’t start LS-DYNA License Manager
-
2337
-
925
-
599
-
591
-
527
© 2025 Copyright ANSYS, Inc. All rights reserved.