In a Harmonic analysis, I have some nodes that are coupled together using the CP command. How can I extract the forces / moments at those nodes?
Extracting the forces / moments of CP nodes in a Harmonic analysis is possible in two ways:
1. /POST1 environment
The forces / moments for the CP nodes are a result of an FSUM process and are not considered "reaction forces" as they are not part of any boundary. You can get the results by using the *GET command with the appropriate FSUM fields, like in the example below:
/POST1 SET, no_freq, , , 3 ! Define dataset for no_freq loadstep with amplitude results NSEL, S, NODE, , nodeID ! Select nodeID node for which to get the results SPOINT, nodeID ! Define summation point FSUM, RSYS ! Sum all nodal forces in the currently active RSYS CS *GET, fx_res, FSUM, 0, ITEM, FX ! Get FSUM result for FX, or FY, FZ, MX, MY, MZ
You can include the above section in a *DO-loop (with the appropriate modifications) to loop over all loadsteps and extract the results to an array. In this case, due to the multiple execution of the *GET command and the iteration over the loop, the computation time may increase. As an alternative, if your goal is to extract the results for multiple frequencies, you can post-process in the /POST26 environment.
2. /POST26 environment
In the /POST26 environment you can use the ESOL and VGET commands to generate the results that you need:
/POST26 ! Select node and linked element NSEL,S,,,nodeID ESLN elem = ELNEXT(0) ALLSEL, ALL ! Variables definition FORCE,TOTAL ESOL,2,elem,nodeID,F,X,FX_%nodeID% ESOL,3,elem,nodeID,F,Y,FY_%nodeID% ESOL,4,elem,nodeID,F,Z,FZ_%nodeID% ESOL,5,elem,nodeID,M,X,MX_%nodeID% ESOL,6,elem,nodeID,M,Y,MY_%nodeID% ESOL,7,elem,nodeID,M,Z,MZ_%nodeID% ! Amplitude vs Frequency PRCPLX,1 !Amplitude and phase angle PRVAR,2,3,4,5,6,7 *DIM, results_real_%nodeID%, array, no_freq, 7 VGET, results_real_%nodeID%(1,1),1,, 0 !Write freq VGET, results_real_%nodeID%(1,2),2,, 0 !Write FX VGET, results_real_%nodeID%(1,3),3,, 0 !Write FY VGET, results_real_%nodeID%(1,4),4,, 0 !Write FZ VGET, results_real_%nodeID%(1,5),5,, 0 !Write MX VGET, results_real_%nodeID%(1,6),6,, 0 !Write MY VGET, results_real_%nodeID%(1,7),7,, 0 !Write MZ *DIM, results_imag_%nodeID%, array, no_freq, 7 VGET, results_imag_%nodeID%(1,1),1,, 1 !Write freq VGET, results_imag_%nodeID%(1,2),2,, 1 !Write FX VGET, results_imag_%nodeID%(1,3),3,, 1 !Write FY VGET, results_imag_%nodeID%(1,4),4,, 1 !Write FZ VGET, results_imag_%nodeID%(1,5),5,, 1 !Write MX VGET, results_imag_%nodeID%(1,6),6,, 1 !Write MY VGET, results_imag_%nodeID%(1,7),7,, 1 !Write MZ
In the above script, both the node and the associated element need to be selected. In this case, it’s assumed that the node has one element linked to it. The ESOL commands are used to store the results as variables, while the PRVAR command prints the results (amplitude and phase angle) in the form of a report in MAPDL.
If the intention is to get the results in the form of an array, then the VGET command can be used to extract the data from the defined variables. In this case, however, the real and imaginary parts of the results are stored separately. To get the amplitude, the real and imaginary arrays need to be post-processed / combined mathematically.