|
[Sponsors] |
March 30, 2020, 16:14 |
Gas Model Change (Hypersonic)
|
#1 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
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. Does anyone know any efficient way to perform this sudden gas-model change? |
|
March 31, 2020, 15:21 |
Density Difference
|
#2 |
Senior Member
|
Did you observe density difference when changed from Ideal to Real? If this is significant, use a very very low, around 0.01, URF for density.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 1, 2020, 05:03 |
|
#3 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
Hello Vinerm
|
|
April 1, 2020, 05:06 |
|
#4 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
Hello Vinerm
I am having the same issue with the UDRGM with ideal-gas formulation available at ANSYS Fluent help guide (https://ansyshelp.ansys.com/account/...ned%20real-gas), so there shouldnīt be any significant changes in density (I have attached the ideal UDRGM so you donīt have to look for it). Therefore I believe that there is an issue when I switch the gas formulation that I donīt know how to solve. I have attached a screenshot of my resiuduals and the final contour with this ideal gas formulation. When I switch the formulation, the residuals jump and they remain constant through all the iterations. |
|
April 1, 2020, 05:20 |
Udrgm
|
#5 |
Senior Member
|
If ideal gas is replicated truly by this UDRGM, then you should be able to start from initialization and get convergence. Is that doable?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 1, 2020, 06:10 |
|
#6 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
I tried to perform a FMG initialization with the Ideal UDRGM but I had the error that I have attached as screenshot. If I am using the same density function as Fluent's ideal gas funtion (rho = press / (RGAS * Temp)) I cannot understand why the user-defined ideal-gas model is giving me these issues. I will try to create UDF for density and see what happens.
Another thing that worries me, why is Fluent working so slow with such simple UDRGM? Almost all the fields are constant but it takes ages to iterate. |
|
April 1, 2020, 06:20 |
Initialization
|
#7 |
Senior Member
|
Do not use FMG initialization with UDRGM. Use standard or hybrid. UDRGM is slow because it has to calculate a lot of UDFs for each cell in the domain.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 4, 2020, 06:30 |
|
#8 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
My intention is to reach an ideal-gas solution using fmg-initialization and then switch to real-gas model and continue iterating.
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 the flow condition. I simulated the case with 1) fluent ideal-gas formulation, with 2) FLUENT UDRGM Example: Ideal Gas Equation of State (https://ansyshelp.ansys.com/account/...ned%20real-gas) 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". The aforementioned try was with a density-based solver but when I try a pressure-based solver, it directly diverges and I get the "floating point exception" which means that there is an impossible calculation attempt (i.e. dividing by zero). This reinforces even more my theory that there is something wrong with passing information between my UDRGM and the Fluent solver. Is there any preferred UDF compiler for Fluent? Last edited by Captain Convergence; April 4, 2020 at 12:44. |
|
April 6, 2020, 04:47 |
Setup
|
#9 |
Senior Member
|
There must be something wrong with your case setup. I used the same UDF and simulated a case with standard initialization. It works as expected. Mach number was slightly more than 4 for this case. Domain, pressure, and density contours are attached.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 6, 2020, 06:42 |
|
#10 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
Hello Vinern,
Are you using Visual Studio for compiling the UDRGM? Or have you integrated a C compiler in Fluent? I will try to do the case again from scratch and see if something was wrong in my set up, I really doubt it since I have checked everything a thousand times. Thank you again! |
|
April 6, 2020, 06:47 |
Compiler
|
#11 |
Senior Member
|
Yes, I used VS.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 6, 2020, 10:35 |
|
#12 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
So I did again my case and depending on which gas model (ideal or ideal UDRGM) I use for the simulation the solution looks completely different. Does Fluent change the way the flow variables (like temperature and pressure) are calculated in a density-based loop when using a UDRGM?
I am pointing this because I set a total temperature of 922 K (which at Mach 9.6 it should lead to a static temperature of 47 Kelvin assuming ideal gas) but the solution tends to 808 Kelvin in the flow field and a Mach of less than 1.5. Both models provide the same density, Cp and enthalpy values but they donīt seem to work in the same way with the same boundary conditions. |
|
April 6, 2020, 10:37 |
Boundary Condition
|
#13 |
Senior Member
|
Which boundary condition are you using?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 6, 2020, 10:57 |
|
#14 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
I have attached a scheme with my computational domain and BCs
Pressure-intlet, Total Pressure = 4,10E+06 Pa, Supersonic/Initial Gauge Pressure = 127 (the same as the outlet static pressure) and Total Temperature = 922 Kelvin. Pressure-outlet, Gauge Pressure/Static Pressure = 127 Pa and Total Temperature = 922 Kelvin. Operating Pressure, 0 Pa. When I apply them with the ideal-gas density formulation available in Fluent I get the inviscid ideal-gas solution that I want (see the attached images). However It doesnīt seem to work in the same way when using a UDRGM |
|
April 6, 2020, 11:02 |
Udrgm
|
#15 |
Senior Member
|
What do you get with UDRGM?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 6, 2020, 12:37 |
|
#16 |
Member
Cpt. Convergence
Join Date: Feb 2020
Posts: 98
Rep Power: 8 |
For that case I didnīt make it with the UDRGM.
For testing my gas models I am simulating an empty channel with the same BCs. I can make the Fluent ideal-gas model (see "Fluent_air_model.PNG") and the ideal UDRGM work when I initialize the case with standard initialization (it diverges when I use the hybrid initialization because it predicts a too low initial velocity), the final solution looks as image "ideal-gas-channel.jpg" for both models. However for my UDRGM that takes into account ionization and dissociation, the calculation of properties within the solver loop is unstable because unphysical values appear (see image "Limits.PNG ") and they cause the solver to stall after 1 single iteration. I guess that this unphysical values appear because the properties are obtained through interpolation so if the solver goes out of the range, the resulting value has a terrific error, I will try to set limits within the UDRGM because it seems that the limits declared in solution controls are not working inside the UDRGM. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting the height of the stream in the free channel | kevinmccartin | CFX | 12 | October 13, 2022 21:43 |
Transient Phase Change Model: Explodes at low vapor quality | evcelica | CFX | 0 | August 28, 2018 10:55 |
How to run perfect gas model for r134a from refprop | NozzleNoobie | FLUENT | 1 | October 12, 2017 02:16 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 06:20 |
Ideal vs constant gas model | chris12345 | STAR-CCM+ | 1 | January 2, 2013 06:49 |