dixib
Mechanical
- Dec 1, 2011
- 21
Hi
Is it possible to extract force and moment reactions from contacts using APDL?
First I need to say that I'm new to APDL, and only have basic knowledge of other programming languages. Here's a more descriptive explanation of what I'm trying to achieve and what I've done so far (no final script, so have not tried to run anything).
We have models with bolts that are split and have bonded connections at desired cross sections. Normally we insert force and moment reaction probes for each connection, then make a plot and copy paste from this to Excel to process the data further. If possible we'd like to get these values using a command block to minimize the setup work and hopefully minimize the risk of possible errors in the extraction.
So far I've added a command block at each connection to get a meaningful definition to identify them. The code follows the following definition:
The definition is made up of three parts:
[ul]
[li]BB which indicates that it's a Bottom Bolt[/li]
[li]The first 1 is the bolt number[/li]
[li]The last 1 is the cross section number for that bolt[/li]
[/ul]
Using this definition I intend to make nested loops (*DO) to extract the values in the desired order.
In the extraction command block (placed under solution) I define some parameter:
The I start to make the loops:
This is how far I've come so far. I don't know if this is the best way to make the extraction?
I haven't been able thought to find out how to get the values from the contacts using the *GET command. Reading through the manual hasn't helped me getting the answer.
Finally I'll of course also need a file creation (*CFOPEN) and write command (*VWRITE) to make the file to import the results in Excel, but I'm not quite there yet. I was guessing that I could make the script without and make a readout in the results of the command block to see, if I was getting the right results, before adding more to the script. Still need to figure out how to extract the reactions from the contacts though. Hoping someone can help with this. Preferably with a good explanation, as I'm having a hard time getting to know APDL, as I don't find it very intuitive.
I've got the book: Introduction to the ANSYS Parametric Design Language (APDL) but haven't found it too helpful in learning the language. Are there any good tutorials around for a beginner to start learning APDL?
Thanks in advance!
Is it possible to extract force and moment reactions from contacts using APDL?
First I need to say that I'm new to APDL, and only have basic knowledge of other programming languages. Here's a more descriptive explanation of what I'm trying to achieve and what I've done so far (no final script, so have not tried to run anything).
We have models with bolts that are split and have bonded connections at desired cross sections. Normally we insert force and moment reaction probes for each connection, then make a plot and copy paste from this to Excel to process the data further. If possible we'd like to get these values using a command block to minimize the setup work and hopefully minimize the risk of possible errors in the extraction.
So far I've added a command block at each connection to get a meaningful definition to identify them. The code follows the following definition:
Code:
BB_1_1 = _cid
The definition is made up of three parts:
[ul]
[li]BB which indicates that it's a Bottom Bolt[/li]
[li]The first 1 is the bolt number[/li]
[li]The last 1 is the cross section number for that bolt[/li]
[/ul]
Using this definition I intend to make nested loops (*DO) to extract the values in the desired order.
In the extraction command block (placed under solution) I define some parameter:
Code:
Prefix = 'BB_' ! Prefix used before numbers in command block @ connections
NoB = 3 ! Number of bolts
NoS = 3 ! Number of sections pr. bolt
ExtS = 3 ! Time at which to do first extraction
ExtF = 6 ! Time at which to do last extraction
Increment = 1 ! Time increment between extraction points (will usually be 1)
! NAMING OF EXTRACTED LOAD CASES ! Named based on ExtS, Increment and ExtF with prefix LC.
! If ExtS = 3, Increment = 1 and ExtS = 6, then naming should
LC3 = 'Load case 1' ! be LC3 = '', LC4 = '' ... LC6 = '' (name of load case
LC4 = 'Load case 2' ! between '').
LC5 = 'Load case 3'
LC6 = 'Load case 4'
The I start to make the loops:
Code:
*DO,i,ExtS,ExtF,Increment ! Loop for load cases
SET,NEAR, , , ,i, , , ! Sets the load step to read data from
LCNo = chrval(i) ! Current load step as character
LC = strcat('LC',LCNo) ! Current load case name
*DO,j,1,NoB ! Loop for each bolt
BNo = chrval(j) ! Current bolt number as character
BNoP = strcat(Prefix,BNo) ! Creates prefix for each individual bolt
*DO,k,1,NoS ! Loop for each section of current bolt
SNo = chrval(k) ! Bolt section as character
BS = strcat(BNoP,'_',SNo) ! Full bolt and section definition
*GET,Fx,BS ! Get value from connection
This is how far I've come so far. I don't know if this is the best way to make the extraction?
I haven't been able thought to find out how to get the values from the contacts using the *GET command. Reading through the manual hasn't helped me getting the answer.
Finally I'll of course also need a file creation (*CFOPEN) and write command (*VWRITE) to make the file to import the results in Excel, but I'm not quite there yet. I was guessing that I could make the script without and make a readout in the results of the command block to see, if I was getting the right results, before adding more to the script. Still need to figure out how to extract the reactions from the contacts though. Hoping someone can help with this. Preferably with a good explanation, as I'm having a hard time getting to know APDL, as I don't find it very intuitive.
I've got the book: Introduction to the ANSYS Parametric Design Language (APDL) but haven't found it too helpful in learning the language. Are there any good tutorials around for a beginner to start learning APDL?
Thanks in advance!