|
[Sponsors] |
fetal overflow in user defined cavitation model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 10, 2016, 08:47 |
fetal overflow in user defined cavitation model
|
#1 |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
Firstly,There is little information on the CFX documents or tutorials about user defined cavitation model. You may find some details via the website https://www.sharcnet.ca/Software/Ans.../i1305933.html and https://www.sharcnet.ca/Software/Ans...tInteCavi.html. Also, I did the cavitation simulation with default Rayleigh-Plesset, which has a good convergence. In another way the simulation was done with the same boundary conditions via user defined cavitation rate by CEL language based on the same cavitation model, but the convergence is so bad.So, my first question is how to define the cavitation rate by CEL language with a perfect convergence. And where is the difference between the default Rayleigth-Plesset method and user defined cavitation rate method.
Then I modified the cavitation model.My work is to write the cavitation model by CEL language after appropriate cavitation model modification. However, the code is working well at the beginning. And the program is always stopped by the mistake named #004100018 with "fatal overflow in the linear solver". So my second question is how to deal with the overflow problem. More details about my simulation are as follows: 1、I think the mesh quality is enough. 2、I defined the water and vapor material property at 70C without IWAPS. 3、Initial conditions. My simulation is about cavitation, so my initial condition is the result with no cavitation. 4、Double precision is chosen. By the way I read the related documents from CFD Online Forum, which had no the same problem. I would appreciate it if someone could give me some help. Thank you for your time. unclewallcn@gmail.com Last edited by unclewallcn; January 10, 2016 at 08:52. Reason: The second website is wrong |
|
January 10, 2016, 18:13 |
|
#2 | |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Quote:
Overflow: This is an FAQ: http://www.cfd-online.com/Wiki/Ansys...do_about_it.3F Your comments: I think the mesh quality is enough - do you know this or are you just guessing? Multiphase models are MUCH more sensitive to mesh quality than single phase models so a mesh which is OK for a single phase model might not be OK for multiphase. 2、I defined the water and vapor material property at 70C without IWAPS - Constant property models are easier to converge than variable property models. Do model development with simple constant property models before considering more complex models like IWAPS. 3、Initial conditions. My simulation is about cavitation, so my initial condition is the result with no cavitation. OK, that is usually a good starting condition. 4、Double precision is chosen. Yes, you will probably need that. And finally: please do not PM with CFD requests which are duplicates of posts on the forum. |
||
January 10, 2016, 22:51 |
|
#3 | ||
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
Thank you for your reply. I will follow the rules in the next time.
Firstly, my first question is based on hydrofoil from ansys help documents with the default water material at 25C, and I just wrote cavitation model by CEL language. So, the bad convergence should be caused by the methond of CEL defined cavitation model. Quote:
Quote:
I think the problem I faced with has extended my ability. So, I submitted my issues on the Internet for help. I would appreciate it for anybody's attention. 111-Hydrofoil from help documents.png 222-NACA Hydrofoil.png |
|||
January 11, 2016, 06:38 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
The second image shows some wiggles in y+ at the ends of the foil. Is this a 2D simulation? If so you should look at your end boundary condition as it should not have these wiggles.
In my experience of cavitation in real-world flows - it is very difficult to get convergence in cavitation simulations with a steady state solver. It almost always requires a transient simulation to obtain convergence. |
|
January 12, 2016, 09:37 |
|
#5 | |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
they are all the 3D smulation. Velocity inlet and static pressure outlet are chosen. OK, I will follow your advice to refine the mesh and try again. Thank you!!!
Quote:
|
||
January 14, 2016, 01:17 |
|
#6 | |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
Simulation was done with the refined structure mesh. However there is the same mistake!!
Refined mesh.png Same mistake.jpg Quote:
|
||
January 14, 2016, 02:41 |
|
#7 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
This question has been asked many times before. The FAQ I posted previously really does describe the important issues and what to do about them.
But if you still can't work it out please post your output file and I will have a look. |
|
January 18, 2016, 08:01 |
|
#8 |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
OK, there is no output file due to the fetal error!! I tried to post the def file but the file bytes exceeds the forum's limit of 195.3 KB.
So, I will post the code only!!And the geometry is the hydrofoil from help document(Chapter 21: Cavitation Around a Hydrofoil). I think it may takes you some time to check it. So, thank you very much for your time and help. If you need my def file, please contact to me via email. unclewallcn@gmail.com Materials: Water at 50C Code:
LIBRARY: &replace MATERIAL: Water at 50 C Material Description = Water (saturated liquid) at 50 C Material Group = Water Data, Constant Property Liquids, Interphase Mass Transfer Option = Pure Substance Thermodynamic State = Liquid PROPERTIES: Option = General Material ABSORPTION COEFFICIENT: Absorption Coefficient = 1.0 [m^-1] Option = Value END DYNAMIC VISCOSITY: Dynamic Viscosity = 5.494E-4 [kg m^-1 s^-1] Option = Value END EQUATION OF STATE: Density = 988.1 [kg m^-3] Molar Mass = 18.02 [kg kmol^-1] Option = Value END REFERENCE STATE: Option = Automatic END REFRACTIVE INDEX: Option = Value Refractive Index = 1.0 [m m^-1] END SCATTERING COEFFICIENT: Option = Value Scattering Coefficient = 0.0 [m^-1] END SPECIFIC HEAT CAPACITY: Option = Value Specific Heat Capacity = 4174 [J kg^-1 K^-1] Specific Heat Type = Constant Pressure END THERMAL CONDUCTIVITY: Option = Value Thermal Conductivity = 0.6478 [W m^-1 K^-1] END THERMAL EXPANSIVITY: Option = Value Thermal Expansivity = 4.49E-04 [K^-1] END END END END Code:
LIBRARY: &replace MATERIAL: Water Vapour at 50 C Material Description = Water (saturated vapour) at 50 C Material Group = Water Data,Constant Property Gases,Interphase Mass Transfer Option = Pure Substance Thermodynamic State = Gas PROPERTIES: Option = General Material ABSORPTION COEFFICIENT: Absorption Coefficient = 1.0 [m^-1] Option = Value END DYNAMIC VISCOSITY: Dynamic Viscosity = 5.44E-05 [kg m^-1 s^-1] Option = Value END EQUATION OF STATE: Density = 0.08302 [kg m^-3] Molar Mass = 18.02 [kg kmol^-1] Option = Value END REFERENCE STATE: Option = Automatic END REFRACTIVE INDEX: Option = Value Refractive Index = 1.0 [m m^-1] END SCATTERING COEFFICIENT: Option = Value Scattering Coefficient = 0.0 [m^-1] END SPECIFIC HEAT CAPACITY: Option = Value Specific Heat Capacity = 1934.3 [J kg^-1 K^-1] Specific Heat Type = Constant Pressure END THERMAL CONDUCTIVITY: Option = Value Thermal Conductivity = 0.02182 [W m^-1 K^-1] END THERMAL EXPANSIVITY: Option = Value Thermal Expansivity = 3.187e-03 [K^-1] END END END END Code:
LIBRARY: CEL: &replace EXPRESSIONS: Pmodified = 12069[Pa]+0.5*0.39*rho l*max(1e-09[m^2 s^-2],water.ke)+(water.Temperature-323[K])*612.26[kg K^-1 m^-1 s^-2] mass transfer rate = if((pabsnc-Pmodified)<0[Pa], mvap ,mcon) mcon = 3*0.01*vapor.densitync* vapor.Volume Fraction /(1.0e-6[m])* sqrt(2.0/3.0*max((pabsnc-Pmodified)/rho l,0 [m^2 s^-2])) mvap = -3*50*vapor.densitync*(1-vapor.Volume Fraction)*(5*10e-4)/(1.0e-6[m])*sqrt(2.0/3.0*max((Pmodified-pabsnc)/rho l,0 [m^2 s^-2])) rho l = 988.1[kg m^-3] rho v = 0.08302[kg m^-3] END END END materials and expressions.png |
|
January 18, 2016, 18:20 |
|
#9 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
I requested you to post the output file and cannot help you much until you post it. Even though the run crashed with an error there will still be an output file. You posted a screen shot showing a small section of the output file in your post #6.
|
|
January 18, 2016, 21:36 |
|
#10 |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
OK,I got it. You need the out file shown in solver manager.
out file.txt |
|
January 18, 2016, 22:12 |
|
#11 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Thanks, that is what I was looking for.
General comments: * You have the viscous work term on. Turn that off unless viscous work is important (which sounds highly unlikely). * Numerically unstable models like this are very sensitive to mesh quality. Any time spent improving mesh quality will be repaid with faster and better convergence. Try to put a 1:1 aspect ratio hex mesh in the region of cavitation. * I suspect the built in cavitation model is better linearised then when you implement the same thing by CEL (which you cannot linearise to my knowledge). This might mean you cannot make a CEL cavitation model converge as well as the built in model. Specific comments: * Try a smaller time step. * Try using local time scale factor to start the run off, then go back to physical time scale after it has converged for a bit. * In my experience most cavitation models require transient simulations to converge. So you probably need a transient simulation to get this to converge. |
|
January 18, 2016, 23:00 |
|
#12 |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
* I turned off the viscous work term.
* I changed the physical timescale from 0.01 to 0.001. But it occurs the same mistake. *The next step, I will refined the mesh and try transient simulation(Before that ,I need steady simulation results as an initial condition) In a word, thanks a million!!!! |
|
January 18, 2016, 23:07 |
|
#13 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
I would not refine the mesh yet. Refined meshes are harder to converge, not easier. Refine the mesh after the simulation is running well on a coarse mesh.
If a time step of 0.001s is not small enough then try smaller. I would go far smaller than 0.001s before giving up. |
|
January 20, 2016, 22:56 |
|
#14 | |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
Saturation Pressure is defined as the code. Psat donates the initial saturation pressure at 50C.
Code:
Psat= 12069[Pa] Pmodified =Psat+0.5*0.39*rho l*max(1e-09[m^2 s^-2],water.ke)+(water.Temperature-323[K])*612.26[kg K^-1 m^-1 s^-2] Quote:
|
||
January 20, 2016, 23:07 |
|
#15 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Saturation is the saturation pressure of the fluid.
I have no idea what your model is about or where it comes from so I cannot say what is suitable. But from a quick look at it, it appears Pmodified does some modifications to Psat for turbulence and temperature. I have never seen a modification to saturation pressures for turbulence before, but I suppose in some cases it may be appropriate. Saturation pressure is a strong function of temperature, so you should make sure you have the correct saturation pressure for the temperature you are using. |
|
January 20, 2016, 23:17 |
|
#16 |
New Member
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10 |
My model is about the cavitation under the thermodynamic effect!! So,the saturation pressure is modified by myself. And then I'm confused to define the saturation pressure. Pmodified or Psat? As you see, the vaporation condition I used is Pmodified.
|
|
Tags |
cavitation model, cel fortran cfx |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User Defined Turbulence Model | Iaroslav | FLUENT | 1 | July 19, 2017 13:22 |
how to incorporate the temperature of fluid in pressure based cavitation model | arindamsantra7 | Main CFD Forum | 0 | September 23, 2014 11:46 |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 15:32 |
Transient User Defined Function in CFX | Niru | CFX | 0 | November 12, 2013 18:07 |
software new version CAVITATION model! | ROOZBEH | CFX | 1 | October 29, 2005 13:32 |