-
-
February 7, 2025 at 5:12 pm
salazj27
SubscriberI am attempting to mimmic the environment experienced by a cube satellite in orbit that is prescribed some roll rate about its z-axis. I want to estimate the thermal load it will be subjected to during this CW roll manuever, to do this I have begun by writing a APDL command script, however, I am new to this and Ansys in general so I am dealing within some difficulties. Here is my code before I begin explaining what is going wrong:
! Setting up the time step for the solver
*SET,time_step,20
*AFUN,DEG
*DO,i,0,9,1
  Â
  *SET,time,(i)*time_step ! Time Step
  TIME,time
  Â
  *SET,angle,1*time ! Rotation at this time (degrees)
  *SET,angle,MOD(angle,360)
  Â
  *SET,flux_1,1361*cos(angle)
  *SET,flux_2,1361*cos(90-angle)
  *SET,flux_3,1361*cos(180-angle)
  *SET,flux_4,1361*cos(270-angle)  ! Debugging angles and heat fluxes
  *VWRITE, angle, time, flux_1, flux_2, flux_3, flux_4
  (F10.4, 5F10.4)  ! Apply the flux to the selected surface(s)
  *IF, angle, GE, 0, AND, angle, LT, 90, THEN
    *VWRITE, 'Face1', angle
    (A20, F10.4)
    cmsel,s,Face1
    sf,all,hflux,flux_1
    Â
    ALLSEL
    Â
    cmsel,s,Face2
    sf,all,hflux,flux_2
    Â
    ALLSEL
    Â
    Â
  *ELSEIF, angle, GE, 90, AND, angle, LT, 180, THEN
    *VWRITE, 'Face2', angle
    (A20, F10.4)
    cmsel,s,Face2
    sf,all,hflux,flux_2
    Â
    ALLSEL
    Â
    cmsel,s,Face3
    sf,all,hflux,flux_3
    Â
    ALLSEL  *ELSEIF, angle, GE, 180, AND, angle, LT, 270, THEN
    *VWRITE, 'Face3', angle
    (A20, F10.4)
    cmsel,s,Face3
    sf,all,hflux,flux_3
    Â
    ALLSEL
    Â
    cmsel,s,Face4
    sf,all,hflux,flux_4
    Â
    ALLSEL  *ELSEIF, angle, GE, 270, THEN
    *VWRITE, 'Face4', angle
    (A20, F10.4)
    cmsel,s,Face4
    sf,all,hflux,flux_4
    Â
    ALLSEL
    Â
    cmsel,s,Face1
    sf,all,hflux,flux_1
    Â
    ALLSEL
    Â
  *ENDIF
  Â*ENDDO
ALLSEL
SAVEÂ
I am dealing with applying the heat fluxes to the major faces of a 3U cube satellite. Outside of the script I have defined the four faces as named selections, Face1-Face4, so that the heat flux would traverse around the cube satellite in a ccw manner as the 'angle' value satisfies the If/Elseif conditions. However, the flux seems to only be applied to the last condition that is satisfied. For instance, the image below is the result of this code where you can see that the flux was only applied to the face at 180 degrees (the final condition satisfied).Â
The initial face (@ angle =0) was the X-out face. When running the animation, the initial face does not appear to be heated up at all. Does anyone have any input? Is there a way I can edit the code I have already, or is there an entirely seperate function within this program that allows me to model this case.Â
An extra note is that Ansys Mechanical is all I have access to right now. Thank you in advance for any efforts!
Â
-
February 8, 2025 at 6:29 pm
salazj27
SubscriberÂ
Â
Â
-
Â
-
February 9, 2025 at 2:42 am
salazj27
SubscriberÂ
-
Â
-
February 10, 2025 at 10:36 am
Ashish Khemka
Forum ModeratorThanks a lot for the update! I will mark the post answered.
Regards,
Ashish Khemka
-
- You must be logged in to reply to this topic.
-
5874
-
1906
-
1420
-
1306
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.
