Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

APDL: real constant defined in a table for static analysis

    • Breno Vincenzo de Almeida
      Subscriber

      I would like to perform multiple static analyses changing the stiffness properties of a spring (COMBIN14). According to its documentation, the stiffnesses can be given in a table, setting TIME as the primary variable. But I cannot get the solution to consider all stiffness values in a single session.

      Following is a minimum example that does not work, only showing the solution for the first value of the table. It isn't clear in the documentation how to change the TIME for linear static analyses. I tried changing the TIME manually in a *DO-*ENDDO loop, but that either doesn't work or shows a warning message about non-standard use, which according to the COMBIN14 documentation, should be standard.

      Edit 1: added missing Dirichlet boundary condition to spring nodes. The results still only show one solution (one set, one TIME, one LOAD STEP...), that for a zero stiffness spring.
       
      Edit 2: Fixed code. It should work now, as expected.
       
      FINI
      /CLEAR
      /FILNAME, mwe
      /TITLE, mwe
       
      /PREP7
      ! element types
      ET, 1, PLANE42,,1,2   ! simple elastic plane strain
       
      ET, 2, COMBIN14,,2    ! spring in Y direction
       
      ! properties 
      MP, EX, 1, 200E6
      MP, PRXY, 1, 0.29
       
      max_stiff = 10**9  ! maximum spring stiffness
       
      n_stiff = 5  ! number of stiffness increments
       
      ! table of stiffness values
      *DIM, k_tab, TABLE, n_stiff, , , TIME
      k_tab(0,1) = 1   ! zero-th row, first column
      *VFILL, k_tab(1,0), RAMP, 1, 1  ! zero-th column, 1 to n_stiff
      *DO, i, 2, n_stiff, 1
          k_tab(i) = 10**(LOG10(max_stiff)*i/n_stiff)
      *ENDDO
       
      ! real constants for COMBIN14 using k_tab
      R, 1, %k_tab%  ! I don't know how to use this
       
      ! mesh
      N, 1, 0.0, 0.0
      N, 2, 0.1, 0.0
      N, 3, 0.0, 0.1
      N, 4, 0.1, 0.1
       
      N, 5, 0.0, 0.2
      N, 6, 0.1, 0.2
       
      TYPE, 1
      E, 1, 2, 4, 3
       
      TYPE, 2
      REAL, 1
      E, 3, 5
      E, 4, 6
       
      FINI
       
      /SOLU
       
      SELTOL, 1E-15
       
      NSEL, S, LOC, Y, 0
      D, ALL, ALL, 0
      ALLSEL
       
      ! Edit 1: forgot to clamp upper spring nodes
      NSEL, S, LOC, Y, 0.2
      D, ALL, ALL, 0
      ALLSEL
       
      NSEL, S, LOC, X, 0.1
      NSEL, R, LOC, Y, 0.1
      F, ALL, FX, 1000
      F, ALL, FY, 1000
       
      ALLSEL
       
      ANTYPE, STATIC, NEW
      EQSLV, SPAR, 0,
       
      !SOLVE  ! this was here previously to edit 2
       
      ! Edit 2: now working as intended
      NROPT, FULL  ! THIS IS THE MISSING PIECE
      TM_START = 1               ! start time
      TM_END = n_stiff           ! ending time
      TM_INCR = 1                ! time increment
      *DO, TM, TM_START, TM_END, TM_INCR
          TIME, TM  ! set time
          SOLVE
      *ENDDO
       
      FINI
       
      /POST1
      SET, FIRST
      ESEL, S, TYPE, , 1
      /EFACET, 1
      PLNSOL, U, SUM, 2, 1.0
      /CONTOUR,1,64,AUTO,,
      /REPLOT

       

    • dlooman
      Ansys Employee

      Your approach is OK.  The spring will stiffness will update based on the time specified by the TIME command, even in a static analysis.  The reason you didn't get expected results is because you didn't constrain the end of the combi14 elements.  Commands like nsel,s,loc,y,0.2 and d,all,all are required.

    • Breno Vincenzo de Almeida
      Subscriber

      Thank you Dave. I've added the missing constraints, but I still only obtain the result for the first spring value of the table, not one solution for each of them.

      In Main Menu > General Postproc > Results Summary:

         SET   TIME/FREQ    LOAD STEP   SUBSTEP  CUMULATIVE
           1         1.0000                  1                    1                   1          

    • dlooman
      Ansys Employee

      In my test my solution input was like below.  That seems similar to your do-loop, so I don't know why you only got one solution.  The R command shouldn't be in the loop.  It only needs to be defined once, prior to solution.  When debugging do-loops I put a /gopr command after the *do so I get output for each loop.  Otherwise you only get output for the first time through the loop.  You could try my commands instead of the do-loop as a "sanity test."

      /solu

      time,1

      solve

      time,2

      solve

      time,3

      solve

      time,4

      solve

      time,5

      solve

       

    • Breno Vincenzo de Almeida
      Subscriber

      Ah, I see what you mean. But if I do what you're saying, without explicitly modifying R within the loop (or between explicit time/solve commands), the spring stiffness value does not change throught the TIMEs, staying equal to the initial one. This can be verified by plotting the solution for each SET.

    • dlooman
      Ansys Employee

      I checked the force in the spring for each solution:  esel,s,enam,,14 presol,f  

      The force in the spring changed at each time point.  The displacement didn't change, possibly because the element was still much stiffer than the spring.

    • Breno Vincenzo de Almeida
      Subscriber

      Well that's odd! When I set R,1,max_stiff (where max_stiff=10**9, as in the original post) instead of the k_tab table, and perform only one static analysis, the displacements change significantly (almost no vertical displacements).

    • dlooman
      Ansys Employee

      What's AE/L for the little element?  200e6?  1e9 would be significant compared to that.  Let me check why UY doesn't change with the table tomorrow.

    • dlooman
      Ansys Employee

      The program isn't updating the stiffness matrix after the first solution.  If I add the command nropt,full or nlgeom,on to the solution, then the results start to make sense.

    • Breno Vincenzo de Almeida
      Subscriber

      Whoa. That worked! Odd, shouldn't Newton Raphson options only be relevant to non-linear analyses?

      After running with NROPT, FULL and going to Main Menu > Analysis Type > Sol'n Controls, it seems everything is still linear with Small Displacement Static option.

      I tried seeing if setting NROPT, FULL changes some sort of solver flags under the hood, but couldn't find anything just by reading the docs.

    • dlooman
      Ansys Employee

      I just know from experience that nropt,full will force a new solution at each load step.  nlgeom,on would make more sense to use in your case.  It doesn't necessarily make sense that you have to force it, but if the program doesn't think the model is nonlinear, it doesn't reform the matrices at each load step.  

    • Breno Vincenzo de Almeida
      Subscriber

      I agree that nlgeom,on would make more sense in general. But in this particular case, if a real constant set is changing for each time step according to a give table, even if the model is linear, then the matrices should be reformed at each load step, right?

      It would be nice if this were added to the docs. Maybe even to COMBIN14.

      Anyway, thank you very much for your time Dave! I'm marking the post as answered.

Viewing 11 reply threads
  • The topic ‘APDL: real constant defined in a table for static analysis’ is closed to new replies.
[bingo_chatbox]