March 31, 2020 at 9:40 amCaptainConvergenceSubscriber
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:
April 2, 2020 at 5:30 pmRKAnsys Employee
Can you please try with pressure far field for the inlet boundary.
Also, what is your inlet Mach number?
April 2, 2020 at 5:39 pmDrAmineAnsys EmployeeDefinitely 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.
April 2, 2020 at 5:43 pmDrAmineAnsys EmployeeAlso check the VMFL045
Oblique Shock Over an Inclined verification case which I verified it again two years ago.
April 2, 2020 at 6:28 pmCaptainConvergenceSubscriber
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.
April 2, 2020 at 8:14 pmRKAnsys Employee
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.
Just make sure your model agrees with the guidelines provided for the real gas model.
April 2, 2020 at 10:54 pmCaptainConvergenceSubscriber
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:
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.
April 3, 2020 at 9:00 pmRKAnsys Employee
You can try starting your solution using UDGRM and also verify what the UDF returns.
April 3, 2020 at 11:07 pmCaptainConvergenceSubscriber
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?
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Heat transfer coefficient
- What are the differences between CFX and Fluent?
- Floating point exception in Fluent
- The solver failed with a non-zero exit code of : 2
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
© 2022 Copyright ANSYS, Inc. All rights reserved.