General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

How to carry out harmonic analysis using APDL commands under modal analysis

    • Md_Salem
      Subscriber

      HI everyone,

      I am doing a MOGA optimization where some information from modal analysis is required in harmonic analysis, and hence the objective parameter ( energy) is maximized (which is obtained from harmonic analysis). To enforce the optimizer tool to go through the modal analysis first, then the harmonic analysis, I had to Preserve Design Points After DX Run and Retain Data for Each Preserved Design Point, otherwise each new design point will  run only the harmonic analysis based on the old data from the modal analysis (not updated) to avoid what is shown in pic1.

      1.

      This resulted in a huge amount of data. How do I reduce this data knowing that I set the optimization properties (as said previously) to Preserve Design Points After DX Run and Retain Data for Each Preserved Design Point ?

      I tried to write the next code in the solution block  of Modal analysis as shown in pic 2.

       

      in order to avoid using harmonic analysis and hence enfoce the optimizer to update the Modal analysis and choose no to Preserve Design Points After DX Run , so the preserved data volume is reduced :

      *GET,Fd,MODE,2,FREQ  !extract the needed information from modal analysis
      *SET,x1,Fd-0.01 ! set target harmonic analysis frequency range
      *SET,x2,Fd+0.01
      /PREP7
      ESEL,S,ENAME,,185
      D,ALL,UZ,10    ! set the loads for harmonic analysis
      ALLSEL
      HROPT,FULL   !start harmonic analysis
      HROUT,ON
      LUMPM,0
      EQSLV, ,0,
      PSTRES,0
      HARFRQ,x1,x2
      NSUBST,20
      KBC,1
      *DIM,energy_array,ARRAY,20
      /POST1
      i=1
      my_energy = 0
      *DO, step, 1,39, 2 
         set,,,,,,,step         ! store results for set step
         ESEL,S,ENAME,,185
         etable,energy,sene
         ssum
         
         *get,ST_energy,ssum,,ITEM,energy
         energy_array(i)= ST_energy
         *IF, ST_energy, GT, my_energy, THEN
           my_energy = ST_energy   ! set the objective
         *ENDIF
         ETABLE,CLEAR
         ALLSEL
         i=i+1
      *ENDDO
       
      I recived an error that harmonic analysis cannot be operated in with modal analysis. 
       
      What do you think I sholud do to reduce the amount of induced data without any deviation form the optimizer from the correct sequence ? And is there any way to use the approach I have shown ?
       
      Regards
       
    • Chandra Sekaran
      Ansys Employee

      So every time you want to run the modal analysis and then follow up with a FULL harmonic solution? May be you can  try the below change to your commands.

       

      solve   ! solve the modal analysis
      finish
       
      /post1
      set,first
      *GET,Fd,MODE,2,FREQ  !extract the needed information from modal analysis
      *SET,x1,Fd-0.01 ! set target harmonic analysis frequency range
      *SET,x2,Fd+0.01
      finish
       
      /SOLUTION
      antype,harmonic
      HROPT,FULL   !start harmonic analysis
      HROUT,ON
      LUMPM,0
      ESEL,S,ENAME,,185
      D,ALL,UZ,10    ! set the loads for harmonic analysis
      ALLSEL
      EQSLV, ,0,
      PSTRES,0
      HARFRQ,x1,x2
      NSUBST,20
      KBC,1
      ! damping ??
      solve           ! solve harmonic analysis
      finish
       
      *DIM,energy_array,ARRAY,20
      /POST1
      i=1
      my_energy = 0
      *DO, step, 1,39, 2 
         set,,,,,,,step         ! store results for set step (only real part?)
         ESEL,S,ENAME,,185
         etable,energy,sene
         ssum
         
         *get,ST_energy,ssum,,ITEM,energy
         energy_array(i)= ST_energy
         *IF, ST_energy, GT, my_energy, THEN
           my_energy = ST_energy   ! set the objective
         *ENDIF
         ETABLE,CLEAR
         ALLSEL
         i=i+1
      *ENDDO
      • Md_Salem
        Subscriber

         

         

        Dear Chandra,

        Ya, I do need to make the modal analysis followed by harmonic analysis for each design point, so I thought in this methodology to avoid making special settings in the optimizer that lead to huge unnecessary data storage.

        The code you provide is syntactically right; the harmonic analysis is done directly after the modal analysis, and the *DO loop is done as planned. Unfortunately, the parameter “my_energy” returns 0. When I checked the solution information, I found the next warning:

        *** WARNING ***                      
         Item SENE has not been stored in the database.  The ETABLE command is  
         ignored.                                                               

         *** ERROR ***                          
         Unknown label in field 6 ( ENERGY ) of *GET command.                   
          Line= *get,ST_energy,ssum,,ITEM,energy                                
          The *GET command is ignored.

        Taking in consideration that this warning wasn’t present when given code is run under “harmonic analysis” block.

        i.e I defined    DMPRAT,8e-5

         

         

         

        Regards

         

         

Viewing 1 reply thread
  • You must be logged in to reply to this topic.