CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   fetal overflow in user defined cavitation model (https://www.cfd-online.com/Forums/cfx/165117-fetal-overflow-user-defined-cavitation-model.html)

unclewallcn January 10, 2016 07:47

fetal overflow in user defined cavitation model
 
3 Attachment(s)
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

ghorrocks January 10, 2016 17:13

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.

unclewallcn January 10, 2016 21:51

2 Attachment(s)
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.
Attachment 44439

Attachment 44440

ghorrocks January 11, 2016 05:38

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.

unclewallcn January 12, 2016 08:37

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 January 14, 2016 00:17

2 Attachment(s)
Simulation was done with the refined structure mesh. However there is the same mistake!!:confused:
Attachment 44502

Attachment 44503

Quote:

user defined cavitation model code

ghorrocks January 14, 2016 01:41

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.

unclewallcn January 18, 2016 07:01

2 Attachment(s)
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

Attachment 44600

Attachment 44601

ghorrocks January 18, 2016 17:20

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.

unclewallcn January 18, 2016 20:36

1 Attachment(s)
OK,I got it. You need the out file shown in solver manager.
Attachment 44611

ghorrocks January 18, 2016 21:12

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.

unclewallcn January 18, 2016 22:00

* 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!!!!

ghorrocks January 18, 2016 22:07

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.

unclewallcn January 20, 2016 21:56

1 Attachment(s)
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?
Attachment 44649

ghorrocks January 20, 2016 22:07

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.

unclewallcn January 20, 2016 22:17

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.


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