Creating Parameters in Mechanical for use in Equations

  • 255 Views
  • Last Post 17 August 2018
  • Topic Is Solved
peteroznewman posted this 07 August 2018

Hello Community,

I understand well how to generate input Parameters in DesignModeler to alter geometry and generate output Parameters in Mechanical in order to setup a Design Study.

I want to know if it is possible to use an input Parameter in an equation for an Acceleration load.

Regards,

Peter

 

  • Liked by
  • Punnag Chatterjee
Order By: Standard | Newest | Votes
Punnag Chatterjee posted this 08 August 2018

@Kremella Any take on this one?

Gary_S posted this 09 August 2018

 

Anytime you have Time Varying loads or multiple load steps, the blue "P" checkbox is not shown. 

Moreover, varying load values cannot be driven by a WB Design Point parameter value.

 

  • Liked by
  • SandeepMedikonda
Punnag Chatterjee posted this 09 August 2018

@Gary_S Could this be done if I do a "write input file" from ANSYS mechanical and interface that with MATLAB?

Punnag Chatterjee posted this 10 August 2018

@peteroznewman I am looking for an alternative way, to automate the process. Let me know if this looks plausible

1. Assume a structural transient problem has been set up in ANSYS Workbench 19.1 and has been solved and deformation probe results are in the tabular data. 

2. From Workbench>Transient module>Mechanical>Tools>Write input file (input.dat).

3. Write a Command snippet to write a text file to HDD of the tabular data (Amplitude vs time) in Transient>Solution (output.dat)

4. Open the "input.dat" in MATLAB, edit the row and change the frequency, write new output.dat, perform data processing in MATLAB, repeat in a loop.

If this sounds plausible, how could I write the command snippet for this, any template or pointers to refer?

 

peteroznewman posted this 10 August 2018

Punnung, your approach is very feasible to get a large number of runs at different frequencies.  The frequency is easily found in the input.dat data file. You could write out a large number of input_nnn.dat files from matlab where nnn is the sequence number of the file, one for each frequency.

There is a Windows batch file command line to start the solver that I can provide that defines the name of the input file and the name of the output file. That Windows batch file can have as many lines in it as the number of frequencies you want results. I did this once on a Linux system with a script, and was pleased that the next line of the script didn't get executed until the previous solve completed. I hope it works the same on Windows.

All you need is the command snippet to write the output of the Probe to a text file. I hope someone on the forum can provide that since I am a beginner at writing APDL code.  They might also put in the lines for a for loop to have APDL loop through the frequencies and write out a unique file for each loop, then you don't need to create the Windows batch file.

I wrote out a ridiculously coarse mesh to get a very short input.dat file so I could block quote that below and also attach in the zip file. I found the frequency of 9.44 on two of the lines that I emphasized with bold text. Not sure why it appears twice. That is the number that you want to loop through a range of values.

/batch

/config,noeldb,1     ! force off writing results to database

*get,_wallstrt,active,,time,wall

! ANSYS input file written by Workbench version 19.1 RELEASE

! File used for geometry attach: E:\ansysdata\studentcommunity\Punnang\Support_ANSYS\Full_transient__Parametric_Peter_files\dp0\SYS\DM\SYS.agdb

/title,Full_transient__Parametric_Peter--Transient (E5)

! ****** Begin Custom Load Command Snippet ******

/COM, ACT Extensions:

/COM,     MechanicalDropTest, 2.0

/COM,     f0fd899f-9d88-4f46-8cf1-36bf5c218d65, wbex

/COM,

! ****** End   Custom Load Command Snippet ******

*DIM,_wb_ProjectScratch_dir,string,248

_wb_ProjectScratch_dir(1) = 'E:\ansysdata\studentcommunity\Punnang\Support_ANSYS\Full_transient__Parametric_Peter_files\dp0\SYS-4\MECH\'

*DIM,_wb_SolverFiles_dir,string,248

_wb_SolverFiles_dir(1) = 'E:\ansysdata\studentcommunity\Punnang\Support_ANSYS\Full_transient__Parametric_Peter_files\dp0\SYS-4\MECH\'

*DIM,_wb_userfiles_dir,string,248

_wb_userfiles_dir(1) = 'E:\ansysdata\studentcommunity\Punnang\Support_ANSYS\Full_transient__Parametric_Peter_files\user_files\'

/com,--- Data in consistent BIN units. See Solving Units in the help system for more information.

/units,BIN

/nopr

/wb,file,start              !  signify a WB generated input file

/prep7

! Turn off shape checking because checks already performed inside WB mesher.

! See help system for more information.

SHPP,OFF,,NOWARN

/nolist

etcon,set             ! allow ANSYS to choose best KEYOP's for 180x elements

/com,*********** Nodes for the whole assembly ***********

nblock,3,,74

(1i9,3e20.9e3)

        1     5.549449106E+00     4.937399556E+00     7.070417328E+00

        2     5.549449106E+00     4.937399556E+00     8.070417328E+00

        3     7.163622334E+00     4.937399556E+00     7.070417328E+00

        4     7.163622334E+00     4.937399556E+00     8.070417328E+00

        5    -2.127716248E+00     4.937399556E+00     7.070417328E+00

        6    -2.127716248E+00     4.937399556E+00     8.070417328E+00

        7    -2.127716248E+00     4.945273572E+00     7.070417328E+00

        8    -2.127716248E+00     4.945273572E+00     8.070417328E+00

        9    -5.135430201E-01     4.945273572E+00     7.070417328E+00

       10    -5.135430201E-01     4.945273572E+00     8.070417328E+00

       11    -1.320629634E+00     4.945273572E+00     7.070417328E+00

       12    -1.320629634E+00     4.945273572E+00     8.070417328E+00

       13     5.549449106E+00     4.945273572E+00     7.070417328E+00

       14     5.549449106E+00     4.945273572E+00     8.070417328E+00

       15     4.969556676E-01     4.945273572E+00     7.070417328E+00

       16     1.507454355E+00     4.945273572E+00     7.070417328E+00

       17     2.517953043E+00     4.945273572E+00     7.070417328E+00

       18     3.528451731E+00     4.945273572E+00     7.070417328E+00

       19     4.538950418E+00     4.945273572E+00     7.070417328E+00

       20     4.969556676E-01     4.945273572E+00     8.070417328E+00

       21     1.507454355E+00     4.945273572E+00     8.070417328E+00

       22     2.517953043E+00     4.945273572E+00     8.070417328E+00

       23     3.528451731E+00     4.945273572E+00     8.070417328E+00

       24     4.538950418E+00     4.945273572E+00     8.070417328E+00

       25     7.163622334E+00     4.945273572E+00     7.070417328E+00

       26     6.356535720E+00     4.945273572E+00     7.070417328E+00

       27     7.163622334E+00     4.945273572E+00     8.070417328E+00

       28     6.356535720E+00     4.945273572E+00     8.070417328E+00

       29    -5.135430201E-01     4.937399556E+00     8.070417328E+00

       30    -5.135430201E-01     4.937399556E+00     7.070417328E+00

       31    -1.320629634E+00     4.937399556E+00     7.070417328E+00

       32    -1.320629634E+00     4.937399556E+00     8.070417328E+00

       33     4.538950418E+00     4.937399556E+00     7.070417328E+00

       34     3.528451731E+00     4.937399556E+00     7.070417328E+00

       35     2.517953043E+00     4.937399556E+00     7.070417328E+00

       36     1.507454355E+00     4.937399556E+00     7.070417328E+00

       37     4.969556676E-01     4.937399556E+00     7.070417328E+00

       38     4.538950418E+00     4.937399556E+00     8.070417328E+00

       39     3.528451731E+00     4.937399556E+00     8.070417328E+00

       40     2.517953043E+00     4.937399556E+00     8.070417328E+00

       41     1.507454355E+00     4.937399556E+00     8.070417328E+00

       42     4.969556676E-01     4.937399556E+00     8.070417328E+00

       43     6.356535720E+00     4.937399556E+00     7.070417328E+00

       44     6.356535720E+00     4.937399556E+00     8.070417328E+00

       45    -2.127716248E+00     4.950273572E+00     7.070417328E+00

       46    -2.127716248E+00     4.950273572E+00     8.070417328E+00

       47    -5.135430201E-01     4.950273572E+00     7.070417328E+00

       48    -5.135430201E-01     4.950273572E+00     8.070417328E+00

       49    -1.320629634E+00     4.950273572E+00     7.070417328E+00

       50    -1.320629634E+00     4.950273572E+00     8.070417328E+00

       51     5.549449106E+00     4.950273572E+00     7.070417328E+00

       52     5.549449106E+00     4.950273572E+00     8.070417328E+00

       53     7.163622334E+00     4.950273572E+00     7.070417328E+00

       54     7.163622334E+00     4.950273572E+00     8.070417328E+00

       55     6.356535720E+00     4.950273572E+00     7.070417328E+00

       56     6.356535720E+00     4.950273572E+00     8.070417328E+00

       57    -2.127716248E+00     4.932399556E+00     7.070417328E+00

       58    -2.127716248E+00     4.932399556E+00     8.070417328E+00

       59    -5.135430201E-01     4.932399556E+00     8.070417328E+00

       60    -5.135430201E-01     4.932399556E+00     7.070417328E+00

       61    -1.320629634E+00     4.932399556E+00     8.070417328E+00

       62    -1.320629634E+00     4.932399556E+00     7.070417328E+00

       63     5.549449106E+00     4.932399556E+00     7.070417328E+00

       64     5.549449106E+00     4.932399556E+00     8.070417328E+00

       65     7.163622334E+00     4.932399556E+00     7.070417328E+00

       66     7.163622334E+00     4.932399556E+00     8.070417328E+00

       67     6.356535720E+00     4.932399556E+00     7.070417328E+00

       68     6.356535720E+00     4.932399556E+00     8.070417328E+00

-1

/wb,elem,start            !  set before creation of elements

/com,*********** Elements for Body 1 "ribbon_236mm" ***********

et,1,190

eblock,19,solid,,10

(19i9)

        1        1        1        1        0        0        0        0        8        0        1        9       10       12       11       30       29       32       31

        1        1        1        1        0        0        0        0        8        0        2        5        6       32       31        7        8       12       11

        1        1        1        1        0        0        0        0        8        0        3        9       15       20       10       30       37       42       29

        1        1        1        1        0        0        0        0        8        0        4       15       16       21       20       37       36       41       42

        1        1        1        1        0        0        0        0        8        0        5       16       17       22       21       36       35       40       41

        1        1        1        1        0        0        0        0        8        0        6       17       18       23       22       35       34       39       40

        1        1        1        1        0        0        0        0        8        0        7       18       19       24       23       34       33       38       39

        1        1        1        1        0        0        0        0        8        0        8        1       33       38        2       13       19       24       14

        1        1        1        1        0        0        0        0        8        0        9        3       43       44        4       25       26       28       27

        1        1        1        1        0        0        0        0        8        0       10        1        2       44       43       13       14       28       26

-1

!Material Id = {225E04D9-2D24-466F-A514-34B26477580B}

sectype,1,shell

secdata,1.0                ! dummy shell thickness so SOLH190 can use a section to handle multiple integration points

/com,*********** Elements for Body 2 "Pzt_41mm" ***********

et,2,190

eblock,19,solid,,2

(19i9)

        2        2        1        2        0        0        0        0        8        0       11        9       11       12       10       47       49       50       48

        2        2        1        2        0        0        0        0        8        0       12        7        8       12       11       45       46       50       49

-1

!Material Id = {7AB436A5-C4E3-4C1A-A69D-527902346398}

sectype,2,shell

secdata,1.0                ! dummy shell thickness so SOLH190 can use a section to handle multiple integration points

/com,*********** Elements for Body 3 "Pzt_41mm" ***********

et,3,190

eblock,19,solid,,2

(19i9)

        3        3        1        3        0        0        0        0        8        0       13       25       26       28       27       53       55       56       54

        3        3        1        3        0        0        0        0        8        0       14       13       14       28       26       51       52       56       55

-1

!Material Id = {3471B5A4-22E5-4BDA-8218-9BD93B5ED02D}

sectype,3,shell

secdata,1.0                ! dummy shell thickness so SOLH190 can use a section to handle multiple integration points

/com,*********** Elements for Body 4 "Pzt_41mm" ***********

et,4,190

eblock,19,solid,,2

(19i9)

        4        4        1        4        0        0        0        0        8        0       15       29       32       31       30       59       61       62       60

        4        4        1        4        0        0        0        0        8        0       16        5       31       32        6       57       62       61       58

-1

!Material Id = {0E822BB1-D61B-41AD-9530-552401CF2871}

sectype,4,shell

secdata,1.0                ! dummy shell thickness so SOLH190 can use a section to handle multiple integration points

/com,*********** Elements for Body 5 "Pzt_41mm" ***********

et,5,190

eblock,19,solid,,2

(19i9)

        5        5        1        5        0        0        0        0        8        0       17        3        4       44       43       65       66       68       67

        5        5        1        5        0        0        0        0        8        0       18        1       43       44        2       63       67       68       64

-1

!Material Id = {EA4BD7A3-7A94-4D77-A3B8-A09F14DDCEF0}

sectype,5,shell

secdata,1.0                ! dummy shell thickness so SOLH190 can use a section to handle multiple integration points

/wb,elem,end               !  done creating elements

/com,*********** Send User Defined Coordinate System(s) ***********

local,12,0,2.51795304289541,4.94527357152971,7.57041732848858,0.,0.,0.

csys,0

toffst,459.67,  ! Temperature offset from absolute zero

/com,*********** Set Reference Temperature ***********

tref,71.6

/wb,mat,start              !  starting to send materials

/com,*********** Send Materials ***********

MP,DENS,1,0.000205859603100009, ! slinch in^-3

MP,EX,1,362594.344285295, ! slinch s^-2 in^-1

MP,NUXY,1,0.25,

 

MP,DENS,2,0.000729865865536395, ! slinch in^-3

MP,EX,2,9717528.4268459, ! slinch s^-2 in^-1

MP,NUXY,2,0.483613817537644,

 

MP,DENS,3,0.000729865865536395, ! slinch in^-3

MP,EX,3,9717528.4268459, ! slinch s^-2 in^-1

MP,NUXY,3,0.483613817537644,

 

MP,DENS,4,0.000729865865536395, ! slinch in^-3

MP,EX,4,9717528.4268459, ! slinch s^-2 in^-1

MP,NUXY,4,0.483613817537644,

 

MP,DENS,5,0.000729865865536395, ! slinch in^-3

MP,EX,5,9717528.4268459, ! slinch s^-2 in^-1

MP,NUXY,5,0.483613817537644,

 

/wb,mat,end                !  done sending materials

!************************* Model Summary ********************

!ribbon_236mm, Punnag powerfilm module, matid, 1

!Pzt_41mm, Mide QP16N - isotropic, matid, 2

!Pzt_41mm, Mide QP16N - isotropic, matid, 3

!Pzt_41mm, Mide QP16N - isotropic, matid, 4

!Pzt_41mm, Mide QP16N - isotropic, matid, 5

!************************* End Model Summary ********************

! get the diagonal of the bounding box. Needed later for other things

*get,_xmin,node,,mnloc,x

*get,_ymin,node,,mnloc,y

*get,_zmin,node,,mnloc,z

*get,_xmax,node,,mxloc,x

*get,_ymax,node,,mxloc,y

*get,_zmax,node,,mxloc,z

_ASMDIAG=(_xmax-_xmin)*(_xmax-_xmin)+(_ymax-_ymin)*(_ymax-_ymin)+(_zmax-_zmin)*(_zmax-_zmin)

_ASMDIAG=SQRT(_ASMDIAG)

/wb,contact,start          !  starting to send contact

/wb,contact,end            !  done creating contacts

/golist

/wb,load,start             !  starting to send loads

/com,*********** Fixed Supports ***********

CMBLOCK,_FIXEDSU,NODE,       16

(8i10)

         3         4         5         6         7         8        25        27

        45        46        53        54        57        58        65        66

 

cmsel,s,_FIXEDSU

d,all,all

nsel,all

/gst,on,on

fini

*get,_numnode,node,0,count

*get,_numelem,elem,0,count

*get, _MAXELEMNUM, elem, 0, NUM, MAX

*get, _MAXNODENUM, node, 0, NUM, MAX

*get, _MAXELEMTYPE, etyp, 0, NUM, MAX

*get, _MAXREALCONST, real, 0, NUM, MAX

/go

/wb,load,end               !  done creating loads

/com,--- Number of total nodes = %_numnode%

/com,--- Number of contact elements = 0

/com,--- Number of spring elements = 0

/com,--- Number of bearing elements = 0

/com,--- Number of solid elements = 18

/com,--- Number of condensed parts = 0

/com,--- Number of total elements = %_numelem%

*get,_wallbsol,active,,time,wall

/com,****************************************************************************

/com,*************************    SOLUTION       ********************************

/com,****************************************************************************

/solu

antype,4                   ! transient analysis

nlgeom,on                  ! Turn on Large Deformation Effects

kbc,1                      ! stepped BC's

eqsl,sparse,,,,,1

cntr,print,1               ! print out contact info and also make no initial contact an error

dmpoption,emat,no             ! Don't combine emat file for DANSYS

dmpoption,esav,no             ! Don't combine esav file for DANSYS

trnopt,full,,,,,hht        ! HHT time integration method

alphad,5.e-003         ! Alpha damping

betad,1.2e-002         ! Beta damping, frequency dependent

tintp,0.1    ! Numerical Damping

nldiag,cont,iter           ! print out contact info each equilibrium iteration

rescontrol,define,last,last,,dele    ! Program Controlled

/com,****************************************************

/com,******************* SOLVE FOR LS 1 OF 1 ****************

/com,*********** Create Acceleration ***********

!

! ANSYS Function Representation

!

*DIM,_acelx,TABLE,6,16,2,,,,0

!

! Begin of equation: time (in/s²

_acelx(0,0,1)= 0, -999

_acelx(2,0,1)= 0.0

_acelx(3,0,1)= 0.0

_acelx(4,0,1)= 0.0

_acelx(5,0,1)= 0.0

_acelx(6,0,1)= 0.0

_acelx(0,1,1)= 1.0, -1, 0, 3.93700787401575E-02, 0, 0, 1

_acelx(0,2,1)= 0.0, -2, 0, 1, 1, 3, -1

_acelx(0,3,1)=   0, 99, 0, 1, -2, 0, 0

_acelx(0,4,1)= 0.0, 

_acelx(0,5,1)= 0.0, 

_acelx(0,6,1)= 0.0, 

_acelx(0,7,1)= 0.0, 

_acelx(0,8,1)= 0.0, 

_acelx(0,9,1)= 0.0, 

_acelx(0,10,1)= 0.0, 

_acelx(0,11,1)= 0.0, 

_acelx(0,12,1)= 0.0, 

_acelx(0,13,1)= 0.0, 

_acelx(0,14,1)= 0.0, 

_acelx(0,15,1)= 0.0, 

_acelx(0,16,1)= 0.0, 

! End of equation: time (in/s²

!

! Begin of equation: (-0.3*9800*sin(2*3.142*9.44*time))*0.0 (in/s²

_acelx(0,0,2)= -999, -999

_acelx(2,0,2)= 0.0

_acelx(3,0,2)= 0.0

_acelx(4,0,2)= 0.0

_acelx(5,0,2)= 0.0

_acelx(6,0,2)= 0.0

_acelx(0,1,2)= 1.0, -1, 0, -0.3, 0, 0, 0

_acelx(0,2,2)= 0.0, -2, 0, 9800, 0, 0, -1

_acelx(0,3,2)=   0, -3, 0, 1, -1, 3, -2

_acelx(0,4,2)= 0.0, -1, 0, 2, 0, 0, 0

_acelx(0,5,2)= 0.0, -2, 0, 3.142, 0, 0, -1

_acelx(0,6,2)= 0.0, -4, 0, 1, -1, 3, -2

_acelx(0,7,2)= 0.0, -1, 0, 9.44, 0, 0, -4

_acelx(0,8,2)= 0.0, -2, 0, 1, -4, 3, -1

_acelx(0,9,2)= 0.0, -1, 0, 1, -2, 3, 1

_acelx(0,10,2)= 0.0, -1, 9, 1, -1, 0, 0

_acelx(0,11,2)= 0.0, -2, 0, 1, -3, 3, -1

_acelx(0,12,2)= 0.0, -1, 0, 0, 0, 0, -2

_acelx(0,13,2)= 0.0, -3, 0, 1, -2, 3, -1

_acelx(0,14,2)= 0.0, -1, 0, 3.93700787401575E-02, 0, 0, -3

_acelx(0,15,2)= 0.0, -2, 0, 1, -3, 3, -1

_acelx(0,16,2)= 0.0, 99, 0, 1, -2, 0, 0

! End of equation: (-0.3*9800*sin(2*3.142*9.44*time))*0.0 (in/s²

 

!

! ANSYS Function Representation

!

*DIM,_acely,TABLE,6,16,2,,,,0

!

! Begin of equation: time (in/s²

_acely(0,0,1)= 0, -999

_acely(2,0,1)= 0.0

_acely(3,0,1)= 0.0

_acely(4,0,1)= 0.0

_acely(5,0,1)= 0.0

_acely(6,0,1)= 0.0

_acely(0,1,1)= 1.0, -1, 0, 3.93700787401575E-02, 0, 0, 1

_acely(0,2,1)= 0.0, -2, 0, 1, 1, 3, -1

_acely(0,3,1)=   0, 99, 0, 1, -2, 0, 0

_acely(0,4,1)= 0.0, 

_acely(0,5,1)= 0.0, 

_acely(0,6,1)= 0.0, 

_acely(0,7,1)= 0.0, 

_acely(0,8,1)= 0.0, 

_acely(0,9,1)= 0.0, 

_acely(0,10,1)= 0.0, 

_acely(0,11,1)= 0.0, 

_acely(0,12,1)= 0.0, 

_acely(0,13,1)= 0.0, 

_acely(0,14,1)= 0.0, 

_acely(0,15,1)= 0.0, 

_acely(0,16,1)= 0.0, 

! End of equation: time (in/s²

!

! Begin of equation: (-0.3*9800*sin(2*3.142*9.44*time))*1 (in/s²

_acely(0,0,2)= -999, -999

_acely(2,0,2)= 0.0

_acely(3,0,2)= 0.0

_acely(4,0,2)= 0.0

_acely(5,0,2)= 0.0

_acely(6,0,2)= 0.0

_acely(0,1,2)= 1.0, -1, 0, -0.3, 0, 0, 0

_acely(0,2,2)= 0.0, -2, 0, 9800, 0, 0, -1

_acely(0,3,2)=   0, -3, 0, 1, -1, 3, -2

_acely(0,4,2)= 0.0, -1, 0, 2, 0, 0, 0

_acely(0,5,2)= 0.0, -2, 0, 3.142, 0, 0, -1

_acely(0,6,2)= 0.0, -4, 0, 1, -1, 3, -2

_acely(0,7,2)= 0.0, -1, 0, 9.44, 0, 0, -4

_acely(0,8,2)= 0.0, -2, 0, 1, -4, 3, -1

_acely(0,9,2)= 0.0, -1, 0, 1, -2, 3, 1

_acely(0,10,2)= 0.0, -1, 9, 1, -1, 0, 0

_acely(0,11,2)= 0.0, -2, 0, 1, -3, 3, -1

_acely(0,12,2)= 0.0, -1, 0, 1, 0, 0, -2

_acely(0,13,2)= 0.0, -3, 0, 1, -2, 3, -1

_acely(0,14,2)= 0.0, -1, 0, 3.93700787401575E-02, 0, 0, -3

_acely(0,15,2)= 0.0, -2, 0, 1, -3, 3, -1

_acely(0,16,2)= 0.0, 99, 0, 1, -2, 0, 0

! End of equation: (-0.3*9800*sin(2*3.142*9.44*time))*1 (in/s²

 

!

! ANSYS Function Representation

!

*DIM,_acelz,TABLE,6,16,2,,,,0

!

! Begin of equation: time (in/s²

_acelz(0,0,1)= 0, -999

_acelz(2,0,1)= 0.0

_acelz(3,0,1)= 0.0

_acelz(4,0,1)= 0.0

_acelz(5,0,1)= 0.0

_acelz(6,0,1)= 0.0

_acelz(0,1,1)= 1.0, -1, 0, 3.93700787401575E-02, 0, 0, 1

_acelz(0,2,1)= 0.0, -2, 0, 1, 1, 3, -1

_acelz(0,3,1)=   0, 99, 0, 1, -2, 0, 0

_acelz(0,4,1)= 0.0, 

_acelz(0,5,1)= 0.0, 

_acelz(0,6,1)= 0.0, 

_acelz(0,7,1)= 0.0, 

_acelz(0,8,1)= 0.0, 

_acelz(0,9,1)= 0.0, 

_acelz(0,10,1)= 0.0, 

_acelz(0,11,1)= 0.0, 

_acelz(0,12,1)= 0.0, 

_acelz(0,13,1)= 0.0, 

_acelz(0,14,1)= 0.0, 

_acelz(0,15,1)= 0.0, 

_acelz(0,16,1)= 0.0, 

! End of equation: time (in/s²

!

! Begin of equation: (-0.3*9800*sin(2*3.142*9.44*time))*0.0 (in/s²

_acelz(0,0,2)= -999, -999

_acelz(2,0,2)= 0.0

_acelz(3,0,2)= 0.0

_acelz(4,0,2)= 0.0

_acelz(5,0,2)= 0.0

_acelz(6,0,2)= 0.0

_acelz(0,1,2)= 1.0, -1, 0, -0.3, 0, 0, 0

_acelz(0,2,2)= 0.0, -2, 0, 9800, 0, 0, -1

_acelz(0,3,2)=   0, -3, 0, 1, -1, 3, -2

_acelz(0,4,2)= 0.0, -1, 0, 2, 0, 0, 0

_acelz(0,5,2)= 0.0, -2, 0, 3.142, 0, 0, -1

_acelz(0,6,2)= 0.0, -4, 0, 1, -1, 3, -2

_acelz(0,7,2)= 0.0, -1, 0, 9.44, 0, 0, -4

_acelz(0,8,2)= 0.0, -2, 0, 1, -4, 3, -1

_acelz(0,9,2)= 0.0, -1, 0, 1, -2, 3, 1

_acelz(0,10,2)= 0.0, -1, 9, 1, -1, 0, 0

_acelz(0,11,2)= 0.0, -2, 0, 1, -3, 3, -1

_acelz(0,12,2)= 0.0, -1, 0, 0, 0, 0, -2

_acelz(0,13,2)= 0.0, -3, 0, 1, -2, 3, -1

_acelz(0,14,2)= 0.0, -1, 0, 3.93700787401575E-02, 0, 0, -3

_acelz(0,15,2)= 0.0, -2, 0, 1, -3, 3, -1

_acelz(0,16,2)= 0.0, 99, 0, 1, -2, 0, 0

! End of equation: (-0.3*9800*sin(2*3.142*9.44*time))*0.0 (in/s²

 

acel,%_acelx%,%_acely%,%_acelz%

/nopr

/gopr

autots,on                   ! User turned on automatic time stepping

deltim,0.001,0.0001,0.005,OFF

time,5.

timint,on                  ! Turn on time integration effects

outres,erase

outres,all,none

outres,nsol,all,

outres,rsol,all

outres,strs,all,

outres,epel,all,

outres,eppl,all,

outres,v,all,

outres,a,all,

stabilize,off                   ! Stabilization turned OFF by user

! *********** WB SOLVE COMMAND ***********

! check interactive state

*get,ANSINTER_,active,,int

*if,ANSINTER_,ne,0,then

/eof

*endif

solve

/com *************** Write FE CONNECTORS ********* 

CEWRITE,file,ce,,INTE

/com,****************************************************

/com,*************** FINISHED SOLVE FOR LS 1 *************

*get,_wallasol,active,,time,wall

/nopr

*get,_numnode,node,0,count

*get,_numelem,elem,0,count

*get, _MAXELEMNUM, elem, 0, NUM, MAX

*get, _MAXNODENUM, node, 0, NUM, MAX,,,INTERNAL

*get, _MAXELEMTYPE, etyp, 0, NUM, MAX

*get, _MAXREALCONST, real, 0, NUM, MAX

/gopr

/post1

xmlo,ENCODING,ISO-8859-1

xmlo,parm

/xml,parm,xml

fini

/gopr

*get,_walldone,active,,time,wall

_preptime=(_wallbsol-_wallstrt)*3600

_solvtime=(_wallasol-_wallbsol)*3600

_posttime=(_walldone-_wallasol)*3600

_totaltim=(_walldone-_wallstrt)*3600

/wb,file,end               ! done with WB generated input

Regards,

Peter

Attached Files

Punnag Chatterjee posted this 17 August 2018

peteroznewman I have found the solution to write the command snippet that would print the table to file. However, it does not print the probe data but it can print a "named selection" nodal point's displacement vs time data. Which also works for my case

 

 

 

Then in the APDL command snippet, the code is this:

!*********************************APDL code snippet*****************************************

set,last

*get, nsets,active,0,set,nset

*dim, data_store,,nsets,2

 

*do,i,1,nsets

set,next

*get,t,active,,set,time

cmsel,s,Probe_pt

*get,node_id,node,0,num,max

*get,displ,node,node_id,U,sum

 

data_store(i,1) = t

data_store(i,2) = displ

*enddo

 

*cfopen,try,txt                                               !filename written is try.txt which is a 2 column table of time and displacements

*vwrite,data_store(1,1), data_store(1,2)

%g %g

*cfclos

!*********************************END of APDL code snippet*****************************************

 

This works and I have verified this.

Now my next question is how do I run "input_nnn.dat" file from MATLAB? Is it possible?

  • Liked by
  • SandeepMedikonda
  • peteroznewman
peteroznewman posted this 17 August 2018

That's great news!  Here is the command line to execute a solve using an input file.

"C:\Program Files\ANSYS Inc\v182\ansys\bin\winx64\ANSYS182.exe" -b -i input_nnn.dat -o solve_nnn.out

There is a flag -np to specify the number of processors if you have more than the default 2 cores you wish to solve on.

 

Close