Ansys Products

Ansys Products

get displacements

    • iliasse diaz
      Subscriber
    • Chandra Sekaran
      Ansys Employee

      The OPEN and WRITE commands are not APDL commands. Please use *CFOPEN and *VWRITE (and *CFCLOSE)

      open('frequency_rotation.txt')    
      write(unit, 'Frequency (Hz)  Rotation_X  Rotation_Y  Rotation_Z')

      Also in below do loop I do not see a SET command to change the result set from one mode to another. Use SET command. Also may be you should do *VWRITE inside the DO loop and after *ENDDO use *CFCLOSE

      do i = 1, num_freq
        *get, my_freq, active,,set,freq
         my_rot_x=ROTX(Measure_Pilot)
         my_rot_y=ROTY(Measure_Pilot)
         my_rot_z=ROTZ(Measure_Pilot)
         write(unit, my_freq, my_rot_x, my_rot_y, my_rot_z)
      enddo

    • iliasse diaz
      Subscriber

      /com, *
      /com, *******************************************
      /com, *******************************************
      /com, *******************************************
      /com, *
      /com, Check rotation result
      fini
      /post1
      set,list
      set,1,49,,AMPL ! want amplitude
      *get,num_freq,nlst,nfreq
      *CFOPEN,unit,'frequency_rotation.txt'
      *VWRITE,unit,'Frequency (Hz) Rotation_X Rotation_Y Rotation_Z'
      do i = 1, num_freq
      *get, my_freq, active,,set,freq
      my_rot_x=ROTX(Measure_Pilot)
      my_rot_y=ROTY(Measure_Pilot)
      my_rot_z=ROTZ(Measure_Pilot)
      *VWRITE,unit,my_freq,my_rot_x,my_rot_y,my_rot_z
      enddo
      *CFCLOSE,unit
      /com, *
      /com, *******************************************
      /com, *******************************************
      /com, *******************************************
      /com, *

      this not work either. What should i correct ?

    • Chandra Sekaran
      Ansys Employee

      The *VWRITE command should be followed by format in C or Fortran. For example,

       

      *VWRITE,unit,my_freq,my_rot_x,my_rot_y,my_rot_z

      %i,%e,%e,%e,%e

       

    • iliasse diaz
      Subscriber

       

       

       

      This is the modified code which follows your advices.

       

    • iliasse diaz
      Subscriber

       

       

Viewing 5 reply threads
  • You must be logged in to reply to this topic.