We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Gas Model Change (Hypersonic)

    • CaptainConvergence
      Subscriber

      Hi all! I´m having issues right with switching the gas-model. I have attached 3 screenshots so you can observe the problem. The first one is my "initialization" which is the ideal-gas solution.


      As soon as I switch the gas model, the residuals jump sudently and the simulation does not diverge because I have set pressure and temperature limits based on the ideal-gas solution (assuming that the flow field will not change dramatically with the real gas model), and the residuals keep almost constant through the iterations, they don´t converge. The Mach number contour after 1 single iteration looks very scattered, I had to clip the contour for Mach number between 0 and 10 because at the inlet the Mach number increased up to Mach 630. I have been trying many solver configurations to continue the calculations from the ideal-gas solution (i.e. explicit/implicit modes, multigrid levels, low Courant and Under-relaxation factors...) but none of them seem to work properly.


      At the inlet I am applying pressure-inlet. Since the temperature is lower than 500 Kelvin, the model is solving the flow using the Ideal-gas formulation which should give the same exact solution in that region. I tried to use a user-defined ideal gas model (the same model that is available at fluent but programmed as an external model) and I had the same issue. Therefore I believe that the problem is how the solver handles the gas-model change.


      Does anyone know any efficient way to perform this sudden gas-model change?


      This is my initial solution with ideal-gas:



      These are my residuals once I switch the gas models:



      And this is the Mach number contour 1 iteration after the change:


    • RK
      Ansys Employee

      Hello, 


      Can you please try with pressure far field for the inlet boundary. 


      Also, what is your inlet Mach number? 


      Regards,


      Rahul 

    • Amine Ben Hadj Ali
      Ansys Employee
      Definitely wrong pressure field. You might far field boundary as alternative. Also share your input on inlet and outlet,? I do not think that you are expecting supersonic flow upstream of the step right.
    • Amine Ben Hadj Ali
      Ansys Employee
      Also check the VMFL045
      Oblique Shock Over an Inclined verification case which I verified it again two years ago.
    • CaptainConvergence
      Subscriber

      Hello


      Since I am using a real-gas model, I cannot use pressure far-field. I am setting 2 symmetries (top and bottom) and I am using pressure inlet and outlet to generate a pressure gradient that drives the flow at Mach 9.6, these are my boundary conditions:



      • Mach 9.6

      • Temperature 47.18 Kelvin

      • Static Pressure 141.36 Pa

      • Total Temperature 922 Kelvin

      • Total Pressure 4103662 Pa

      • Operating Conditions 0 Pa


      As you can obseve, the first contour shows that these BCs work fine, the issue is when I switch to real-gas model.


       


      Kind regards.


       

    • RK
      Ansys Employee

      Hello Cesar, 


      Couple of more questions to get more clarity. 


      1) Are you using a pressure based or density based solver? 


      2) When you say gas model change, you are referring to changing to real gas model right? (Just want to be sure that I got this right) 


      3) There are certain limitations while implementing user defined real gas model. 



      • Pressure-inlets, mass flow-inlets, and pressure-outlets are the only inflow and outflow boundaries available for use with the real gas models

      • Non-reflecting boundary conditions are not compatible with the real gas models when using the density-based solver. If your model requires NRBC and a real gas model, you must use the pressure-based solver.


      There are more limitations, please refer to the following link. 


      https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v201/en/flu_ug/flu_ug_sec_real_gas_udrgm.html


      Just make sure your model agrees with the guidelines provided for the real gas model. 


      Regards, 


      Rahul 


       

    • CaptainConvergence
      Subscriber

      Hello,


      I am using a density based solver with the AUSM flux type, first order momentum equations and inviscid. As initialization I am using an ideal-gas solution (ideal-gas density model available in Fluent and constant Cp), which is the first image that I have attached in my first post and thus the simulation is working perfectly with ideal-gas formulation. I have programmed a User-Defined Real Gas Model (UDRGM) in order to take into account dissociation and ionization effects. Below 500 K it has an ideal gas formulation which is identical to the UDRGM that is presented as example here:


      https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v195/flu_ug/flu_ug_sec_real_gas_udrgm.html?q=User%20defined%20real-gas


      If instead of using my own UDRGM I use the compiled UDRGM Example: Ideal Gas Equation of State (above link) I end up having the same issue, the solver detects a sudden change in the entire flow field and I have the scattered contour that I attached in my first post. This doesn´t make sense to me because the ideal gas formulation implemented in Fluent and the ideal-gas UDRGM available at the aforementioned link should be the same. Therefore I believe that the issue is the sudden gas model change, regardless which UDRGM I am using.

    • RK
      Ansys Employee

      Hello, 


      You can try starting your solution using UDGRM and also verify what the UDF returns. 


      Regards,


      Rahul 

    • CaptainConvergence
      Subscriber

      Hello,


      I have already debugged my UDF (I spent several days for being sure that my UDRGM is not the problem by displaying the variable values at Fluent's console), and it returns the right values. With UDRGM I cannot use the full multi-grid initialization that will help me to save a significant computational time. I would like to know if there is any known issue with switching gas models once one simulation has converged.


      I am suspecting that the UDF might not be properly compiled and this could lead to truncation errors when passing the values to the solver.These days I have been trying different things and I think that I found the source of the problem. I tried to simulate a simple flow channel (see the attached image) with velocity inlet at 0.1 m/s and 300 Kelvin simulated at ambient pressure (101325 Pa). So no flow issues should arise due to this simple flow condition.



      I simulated the case with 1) fluent ideal-gas formulation, with 2) FLUENT UDRGM Example: Ideal Gas Equation of State (I have attached this UDRGM which is available at https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v195/flu_ug/flu_ug_sec_real_gas_udrgm.html) and with 3) my own UDRGM. When using a UDRGM my solver becomes completely unstable and this leads me to think that I might be having compiling issues or truncation errors. I tried to use "double" and "real" variables format but they didn´t seem to work properly. For compiling my UDRGM I am using Visual Studio Community Version 2019 and I am calling Fluent through "Cross Tools Command Prompt for VS 2019".


      Is there any preferred UDF compiler for Fluent?


      Regards.

Viewing 8 reply threads
  • The topic ‘Gas Model Change (Hypersonic)’ is closed to new replies.