TAGGED: density, equation-of-state, ideal-gas, udf-fluent
-
-
October 18, 2021 at 2:33 pmAvedistchamitchianSubscriber
My current goal is for the sake of practicing “UDF Define properties”, is to mimic Fluent ideal gas law by writing my own ideal gas UDF and comparing it with fluent Ideal gas version.
For the UDF and non-UDF ideal gas, the energy equation is on. I am using the same Mesh, case model, and boundary condition for both! (inlet velocity=50m/s, k-e Standart Model, I am using CO2 as a gas, pressure based) The only difference is how the density and speed of sound are defined for the 1st case I choose the ideal gas for density which is provided from Fluent there (in the Material property window) you don't need to define the speed of sound.
For my 2nd case, I wrote my own ideal gas equation and ideal gas speed of sound calculation which are set in fluent for the density and speed of sound (UDF) in the same material property window. (you need to compile the code....)
Now we should expect to get similar results for both simulations right! But not so fast! Please check the unexpected results I had below!
My 2d tunnel has a circle inside ( so we have a flow over a sphere in 2D), at stagnation I expect the static temperature to increase which was true for Fluent ideal gas but not my UDF ideal gas, my cell temperature contour I should expect to get similar results which wasn’t the case for the temperature. (static and Total). Specifically, the static temperature remained constant everywhere unlike the fluent version which varies which is the right behavior/result.
So why is this happening?? is the energy equation not computed? although it is on?
I am pretty sure that my ideal gas written UDF equation is right since I monitored the numbers of T and P and got the same answer with my calculator. For me at first sight it looks like the energy equation is not computed?
I expet Fluent is caling my Defined properties after he solves the momentum, energy, transport equation, like the below skematic table that I retrieved from the UDF manual of Fluent.
October 18, 2021 at 3:15 pmRobForum ModeratorOctober 18, 2021 at 3:22 pmAvedistchamitchianSubscriberHi Mr.Rob, I have read this page but am not sure if it answers my above issue. I have usedDEFINE_PROPERTYto define my own density with the ideal gas equation but yet got different results when comparing Fluent ideal gas results.
October 18, 2021 at 4:06 pmRobForum ModeratorThe key part is the "temperature dependent". Using pressure messes with the core numerics so is restricted to the pre-set options.
October 18, 2021 at 4:31 pmAvedistchamitchianSubscriberThey write the following in the manual.
density (as a function of temperature)
But it wasn't clear enough for me that writing it a function of pressure is not possible.
So by your reply, I can disclose this topic that writing my own ideal gas is not possible and that is a sort of a limitation? (since i need to use the pressure of a cell)
Is there a way to bypass this issue or its embedded?
Thank you Mr.Rob for this comment!
Best!
October 19, 2021 at 10:27 amRobForum ModeratorIt's a limitation, so you're a little stuck. There are user defined routines for real gases so you may be able to work around it that way. What are you trying to do?
October 19, 2021 at 12:12 pmAvedistchamitchianSubscriberHi Mr.Rob Yes, I see what you mean, it was for me actually experimenting with UDF especially with Define Properties.
Maybe implementing my own real gas model or Soave-Redlich-Kwong Equation of State later on...
I found another way to do this, which is by defining the principle set of functions by which my thermodynamic property data including the returned density are transferred to the ANSYS Fluentsolver.
I was too optimistic with DEFINE_PROPERTY macro. Greatfull for your previous answer it at least made me realize the limitation of DEFINE_PROPERTY.
Greetings from Munich!
Avedis
July 9, 2023 at 11:04 amsanjay22bharaniSubscriberGreetings,
I have been trying to define the ideal gas equation using UDF similar to your case and I find that I face a similar issue. Could you please share the other way which you have mentioned?
Thank you in advanceJuly 10, 2023 at 10:53 amRobForum ModeratorYou need to decide if you need to use a UDF for a real gas; otherwise if you want a function of pressure you need to review the Real Gas models. I would think very carefully before deciding to do that.
Viewing 8 reply threads- The topic ‘UDF Ideal Gas Law for Density’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script error Code: 800a000d
- Cyclone (Stairmand) simulation using RSM
- Fluent fails with Intel MPI protocol on 2 nodes
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
Top Contributors-
1241
-
543
-
523
-
225
-
209
Top Rated Tags© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-