-
-
May 19, 2023 at 8:19 amJohn MillerSubscriber
Hello together,
I wrote a small snippet to save temperature results to a text (txt) file:
LoadStep=1
!
/post1
set,LoadStep
*get,numnode,node,,count !Retrieves a value and stores it as a scalar parameter or part of an array parameter.
*dim,NodeTemp,array,numnode !Defines an array parameter and its dimensions.
*vget,NodeTemp(1),node,,TEMP !Retrieves values and stores them into an array parameter.
*cfopen,'myTempfile','txt'
*vlen,1
*vwrite,'Nodal','Temperature'
(A8,X,A8)
*vwrite,sequ,NodeTemp(1)
(F8.0,X,E13.6,X,E13.6)
*cfclosFor the temperature of every node sorted for nodal number, it’s working quite well.
Nodal Temperat
1. 0.344929E+02
2. 0.419993E+02
3. 0.407717E+02
4. 0.414503E+02
5. 0.416919E+02
6. 0.420074E+02....
....
283051. 0.400000E+02
283052. 0.400000E+02
283053. 0.400000E+02
283054. 0.400000E+02My question is how can I save not the nodal number but the coordinates (x,y,z position of the node and the node temperature? Can I save the Temperature results of one specific node over the time (known ID or x,y,z position)?
What changes are necessary?
With best regards
John M.
-
May 22, 2023 at 12:33 pmChandra SekaranAnsys Employee
To get the node coordinates you can do:
*get,numnode,node,,count !Retrieves a value and stores it as a scalar parameter or part of an array parameter.
*dim,NodeTemp,array,numnode,4 !Defines an array parameter and its dimensions.*vget,nodetemp(1,1),node,1,loc,x
*vget,nodetemp(1,2),node,1,loc,y
*vget,nodetemp(1,3),node,1,loc,z
*vget,NodeTemp(1,4),node,1,TEMP !Retrieves values and stores them into an array parameter.
To get the temperature time history of a node you can use POST26 like below:
/post26
nsol,2,node,nodeid,temp
prvar,2
plvar,2
-
May 24, 2023 at 9:35 amJohn MillerSubscriber
Hello Chandra,
thanks for fast and helpfull answer.
Due to you, the issue with the coordinate data disappeared
I’m struggling a little bit to visualise the time dependant data.
prvar lists the temperature vs. time and plvar displays the time vs. temp in a graph, but where can I see the graph and how is it possible to save the prescribed time vs temperature data in a txt file
nodeid=27844
/post26
nsol,2,node,nodeid,temp !Specifies nodal data to be stored from the results file
prvar,2 !Lists variables vs. time (or frequency).
plvar,2 !Displays up to ten variables in the form of a graph.Do I miss something?
With best regards
John M.
-
-
May 24, 2023 at 12:38 pmChandra SekaranAnsys Employee
prvar lists the temperature vs. time and plvar displays the time vs. temp in a graph, but where can I see the graph and how is it possible to save the prescribed time vs temperature data in a txt file
If you are in MAPDL GUI, then prvar will pop us a list of time vs temp and PLVAR will plot on the screeen. If you are in Mechanical (Workbench) then the PRVAR will be in the SOLVE.OUT file or Solution Information. You can get to solve.out by "Solution>right mouse click> Open solver files directory".
You can also redirect by doing the below. This will redirect PRVAR to the file myprvar.dat in d: drive. The PLVAR will be in a png file that will also show up in Mechanical under the commands.
/out,d:\myprvar.dat
prvar,2
/out
/show,png
plvar,2
/show,close
-
May 25, 2023 at 12:31 pmJohn MillerSubscriber
Hello Chandra,
thank you for the helpfull answer.
When I apply the mentioned lines to my code:
nodeid=27844
/post26
nsol,2,node,nodeid,temp !Specifies nodal data to be stored from the results file
prvar,2 !Lists variables vs. time (or frequency).
plvar,2 !Displays up to ten variables in the form of a graph./out,d:\mypvar.dat
prvar,2
/out
/show,png
plvar,2
/show,closethis is the outcome in the solve.out file:
***** TIME-HISTORY POSTPROCESSOR (POST26) *****
ALL POST26 SPECIFICATIONS ARE RESET TO INITIAL DEFAULTS
*** WARNING *** CP = 418.125 TIME= 13:48:41
The data in field 3 is invalid. The NSOL command is ignored.*** WARNING *** CP = 418.125 TIME= 13:48:41
No data points are saved during this storage step./OUTPUT FILE= d:\mypvar.dat
/SHOW SWITCH PLOTS TO PNG - RASTER MODE.
Set Encoding of XML File to:ISO-8859-1
Set Output of XML File to:
PARM, , , , , , , , , , , ,
, , , , , , ,DATABASE WRITTEN ON FILE parm.xml
***** ROUTINE COMPLETED ***** CP = 419.062PRINTOUT RESUMED BY /GOP
*GET _WALLDONE FROM ACTI ITEM=TIME WALL VALUE= 13.8116667
PARAMETER _PREPTIME = 1.000000000
PARAMETER _SOLVTIME = 150.0000000
PARAMETER _POSTTIME = 4.000000000
PARAMETER _TOTALTIM = 155.0000000
*GET _DLBRATIO FROM ACTI ITEM=SOLU DLBR VALUE= 0.00000000
*GET _COMBTIME FROM ACTI ITEM=SOLU COMB VALUE= 0.00000000
*GET _SSMODE FROM ACTI ITEM=SOLU SSMM VALUE= 2.00000000
*GET _NDOFS FROM ACTI ITEM=SOLU NDOF VALUE= 122196.000
--- Total number of nodes = 283054
--- Total number of elements = 84182
--- Element load balance ratio = 0
--- Time to combine distributed files = 0
--- Sparse memory mode = 2
--- Number of DOF = 122196EXIT ANSYS WITHOUT SAVING DATABASE
NUMBER OF WARNING MESSAGES ENCOUNTERED= 30
NUMBER OF ERROR MESSAGES ENCOUNTERED= 0Obviously, the nodal data isn't stored at all.
With best regards
John M.
-
-
May 25, 2023 at 2:22 pmChandra SekaranAnsys Employee
It is the NSOL command format. just use 'nsol,2,nodeid,temp'
-
May 26, 2023 at 9:36 amJohn MillerSubscriber
Dear Chandra,
I finally debugged my script. Now it’s working as expected.
There were a few errors regarding the correct syntax.
Thanks for the support.
With best regards
John M.
-
-
May 26, 2023 at 9:35 amJohn MillerSubscriber
Dear Chandra,
I finally debugged my script. Now it’s working as expected.
There were a few errors regarding the correct syntax.
Thanks for the support.
With best regards
John M.
-
- The topic ‘Save thermal results in txt file via /post1 snippet’ is closed to new replies.
- Ayuda con Error: “Unable to access the source: EngineeringData”
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- How to apply Compression-only Support?
- Geometric stiffness matrix for solid elements
- How to select the interface delamination surface of a laminate?
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- Frictional No separation contact
- Elastic limit load, Elastic-plastic limit load
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.