LS Dyna

LS Dyna

Topics related to LS-DYNA, Autodyn, Explicit STR and more.

Autodyn subroutine issue : Ideal gas EOS

    • Myunghyun Shin
      Subscriber

      Hello. I am a mechanical engineering student studying Ansys subroutines.

      I am writing to seek assistance as I am encountering issues while constructing an ideal gas Equation of State (EOS) using the subroutine code provided below.

      The section for updating the internal energy (EE) has been coded based on the reference from the theory manual, as depicted in the image below. Additionally, the pressure (PP) has been calculated using the updated internal energy (EE) in the code.

      The gas density has been set to be the same as air (0.001225 g/cm³), and the initial internal energy has been input as 2.068e5 J/kg, based on atmospheric pressure as the initial condition.

      The analysis conditions were set using the Euler solver, as depicted in the image below. The analysis was conducted using a single cell for a total duration of 1 ms, under constant volume conditions.

      The analysis results are as follows.

      According to the ideal gas EOS equation provided in the theory manual, the expected pressure was calculated to be (1.4-1.0) * 0.001225 [g/cm3] * 2.068e5 [J/kg] = 101.332 kPa. However, the actual analysis result yielded 340.31 kPa.

       

      Even when the gas density was doubled (0.002450 g/cm³), as shown in the image above, the analysis still resulted in 340.31 kPa.

       

      Is there any part in the provided code that is incorrect, or is there a misunderstanding on our part?

       

      Thanks and best regards,
      Myunghyun Shin

    • Chris Quan
      Ansys Employee

      You can use Debug mode to put breakpoints in your user subroutine and make sure EE,PP, and SoundSpeed are calculated correctly.

      If you have entered difference density but they all gave the same pressure, you need to check your user subroutine to make sure the results calculated by the user subroutine have been returned to the main code properly from the user subroutine.

       

      • Myunghyun Shin
        Subscriber

        Thanks for your kind response!

         

        I have set breakpoints and proceeded with debugging as shown in the screenshot as you recommended.

         

        In the first cycle, it has been confirmed that calculations for EE, PP and SOUND have been performed correctly up to line +191.

         However, an issue has been identified in the next cycle where P0 is not being updated to the previous cycle's PP.

        To address the aforementioned issue, how should the code be modified?

         

        Thanks and best regards,

        Myunghyun Shin

Viewing 1 reply thread
  • The topic ‘Autodyn subroutine issue : Ideal gas EOS’ is closed to new replies.