Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Stop simulation after given conditions are met.

    • Jason Moss
      Subscriber

      How do I stop a transient simulation once a certain condition is met?   ex:  Inlet pressure has reached a target value.

      Thanks in advance!

    • Rahul Kumar
      Ansys Employee

      Hello, 

      You could use the execute commands to set the conditions. Please see the users guide. 

    • Jason Moss
      Subscriber

      The command shown below isn't working.  I want the calculation to stop once the inlet pressure decays below 0 bar at the inlet.

      Is this the correct way to write the command?  (Inlet zone ID = 6)

      (if ( < 0 (pick-a-real "/rep/volume/volume-avg 6 , pressure n")) (set! mstop? #t))

      Users guide does not explain how to write scheme programming.

      Thanks for your help!

    • Rob
      Forum Moderator

      I don't think there is any public Scheme documentation. My approach is to monitor the value of interest and manually stop the model once that point is reached. Otherwise you need a monitor linked to a trigger to cause the convergence criterion to be met. 

    • tony.karam2
      Subscriber

      Hello,

      I am trying to stop the transient simulation when any of the below-described liquid fraction definitions becomes less than 0.1:

      • volume-average liquid fraction (I named it "liquid_fraction_va_pcm_all")
      • mass-average liquid fraction (I named it "liquid_fraction_ma_pcm_all")

      How can I modify the below command to achive my target:

      (if ( < 0 (pick-a-real "/rep/volume/volume-avg 6 , pressure n")) (set! mstop? #t))

    • tony.karam2
      Subscriber

      I guess it can be done using the following commands:

      (if ( < 0.8 (pick-a-real "/rep/volume/volume-avg liquid_fraction_va_pcm_all,liquid fraction n")) (set! mstop? #t))

      (if ( < 0.8 (pick-a-real "/rep/volume/mass-avg liquid_fraction_ma_pcm_all,liquid fraction n")) (set! mstop? #t))

       

    • tony.karam2
      Subscriber

      Hello,

      I am using the below command which is supposed to stop the transient simulation when air_temp_outlet becomes greater than or equal to 926.5 K. but duing the simulation, Ansys is giving an error message statiting "invalid function". I inserted a "?" after mstop (based on what I saw on some ansys yout tube videos) but I was still getting the same error. Any help would be highly appreciated.

      (if((>= (string->number (pick "/solve/report-definitions/compute air_temp_outlet")) 926.5)) (set! mstop #t))

    • Rob
      Forum Moderator

      I (and other Ansys staff) can't comment here as the Scheme options aren't covered in documentation and must rely on the wider community for a response. 

Viewing 7 reply threads
  • The topic ‘Stop simulation after given conditions are met.’ is closed to new replies.