CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

fetal overflow in user defined cavitation model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2016, 07:47
Question fetal overflow in user defined cavitation model
  #1
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
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 07:52. Reason: The second website is wrong
unclewallcn is offline   Reply With Quote

Old   January 10, 2016, 17:13
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
how to define the cavitation rate by CEL language with a perfect convergence
Cavitation modelling is challenging for convergence as you have such massive change is properties. You are always going to have convergence problems with cavitation models.

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.
ghorrocks is offline   Reply With Quote

Old   January 10, 2016, 21:51
Default
  #3
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
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:
Is it right to define cavitation model by CEL?
Secondly, the domain is NACA 0015 Hydrofoil.Also, I changed the material and modified cavitation model. At the same time, I wrote new cavitation model into CFX. Then the more problems appeared named fetal overflow in the linear solver.
Quote:
Fetal overflow in the linear solver
Finally,the mesh pictures are attached. I have read the FAQs about problems about convergence a long time ago. And I tried to do the simulation again and again.But you know...My heart is shattered many times...

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
unclewallcn is offline   Reply With Quote

Old   January 11, 2016, 05:38
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 12, 2016, 08:37
Default
  #5
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
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:
user CEL code about cavitation model
unclewallcn is offline   Reply With Quote

Old   January 14, 2016, 00:17
Default
  #6
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
Simulation was done with the refined structure mesh. However there is the same mistake!!
Refined mesh.png

Same mistake.jpg

Quote:
user defined cavitation model code
unclewallcn is offline   Reply With Quote

Old   January 14, 2016, 01:41
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 18, 2016, 07:01
Default
  #8
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
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
Water Vapor at 50C
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
Expressions:
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
user defined cavitation model.jpg

materials and expressions.png
unclewallcn is offline   Reply With Quote

Old   January 18, 2016, 17:20
Default
  #9
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 18, 2016, 20:36
Default
  #10
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
OK,I got it. You need the out file shown in solver manager.
out file.txt
unclewallcn is offline   Reply With Quote

Old   January 18, 2016, 21:12
Default
  #11
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 18, 2016, 22:00
Default
  #12
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
* 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!!!!
unclewallcn is offline   Reply With Quote

Old   January 18, 2016, 22:07
Default
  #13
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 20, 2016, 21:56
Default
  #14
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
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]
if ((pabsnc<Pmodified), vaporation,consideration) . This is the vaporation condition. And my question is:
Quote:
How to define the saturation in the cavitation fluids pairs?( Shown in the figure) Pmodified or Psat?? And whats the meaning of saturation in the CFX?
cavitation saturation pressure.png
unclewallcn is offline   Reply With Quote

Old   January 20, 2016, 22:07
Default
  #15
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is offline   Reply With Quote

Old   January 20, 2016, 22:17
Default
  #16
New Member
 
Frank
Join Date: Jan 2016
Posts: 16
Rep Power: 10
unclewallcn is on a distinguished road
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.
unclewallcn is offline   Reply With Quote

Reply

Tags
cavitation model, cel fortran cfx


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Defined Turbulence Model Iaroslav FLUENT 1 July 19, 2017 12:22
how to incorporate the temperature of fluid in pressure based cavitation model arindamsantra7 Main CFD Forum 0 September 23, 2014 10:46
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
Transient User Defined Function in CFX Niru CFX 0 November 12, 2013 17:07
software new version CAVITATION model! ROOZBEH CFX 1 October 29, 2005 12:32


All times are GMT -4. The time now is 16:22.