CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Implementing the UDF Barotropic state law of cavitation in ANSYS Fluent 17.1

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 4, 2017, 12:39
Default Implementing the UDF Barotropic state law of cavitation in ANSYS Fluent 17.1
  #1
New Member
 
Ullas P K
Join Date: Jan 2017
Posts: 6
Rep Power: 2
ullaspk1990 is on a distinguished road
Can anybody help to implement the UDF of Barotropic state law of cavitation in ANSYS Fluent 17.1. I had already written the UDF, but I don't Know how to implement. Please guide me.

The UDF for barotropic state law of cavitation written by me is given below,

UDF - Barotropic cavitation model

#include "udf.h"

#define rhoV 0.0173
#define rhoL 998.0
#define pv 2300.
#define a 1.2

DEFINE_PROPERTY(superfluid_density, c, t)
{
real rho, Ab, Bb;
real k, j;
real p;
real p_operating;

Ab = (rhoL+ rhoV)/2;
Bb = (rhoL- rhoV)/2;
k = 1.0/(pow(a,2.0));
j = k*(p- pv)/(Bb)

p_operating = RP_Get_Real ("operating-pressure");
p = C_P(c,t) + p_operating;

rho = Ab + Bb*sin(j);

return rho;
}

Suggest if any corrections are required.

Thanking You
ullaspk1990 is offline   Reply With Quote

Old   January 5, 2017, 04:47
Default
  #2
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 137
Rep Power: 2
KevinZ09 is on a distinguished road
After writing/saving it you need to either interpret or compile it by going to:
Define --> User-Defined --> Functions --> Compiled/Interpreted. There you need to build and load your library. You can find all the details in UDF Manual chapters 4.2 and 5.2. Once you've successfully loaded the library, you just need to set your material's density to your UDF calculated density by selecting "user-defined" when setting the density in the material box. Is this what you actually meant with your question?

Also, regarding your UDF, two things:
1: I'd think you'd want to update "j" after calculating "P".
2: I believe you can simply get the operating pressure by using "op_pres".
KevinZ09 is offline   Reply With Quote

Old   January 5, 2017, 05:33
Default
  #3
New Member
 
Ullas P K
Join Date: Jan 2017
Posts: 6
Rep Power: 2
ullaspk1990 is on a distinguished road
Thank you very much sir.

I had few more doubts sir:

1. Should I need to enable the multiphase mixture model.

2. Should I need to customize a new material for this ?

3. what about water-liquid density and water-vapour density (as my medium is water)
ullaspk1990 is offline   Reply With Quote

Old   January 5, 2017, 06:53
Default
  #4
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 137
Rep Power: 2
KevinZ09 is on a distinguished road
No problem. Just don't call me sir!

1: Yes, you should.
2 +3: You need two materials, water-liquid and water-vapour and set both densities.

If you want more details on cavitation modeling, check out Chapter 21 of Fluent's Tutorial Guide, as there is a tutorial on this topic.
KevinZ09 is offline   Reply With Quote

Old   January 5, 2017, 08:31
Default
  #5
New Member
 
Ullas P K
Join Date: Jan 2017
Posts: 6
Rep Power: 2
ullaspk1990 is on a distinguished road
ok.

Then where will I hook the UDF for density-pressure relation in liquid phase, vapour phase or should I need to customize a mixture phase for hooking the UDF.

I know how to interpret the UDF but I don't know where to hook up the UDF for density-pressure relation and how to specify vapour Pressure.
ullaspk1990 is offline   Reply With Quote

Old   January 5, 2017, 09:00
Default
  #6
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 137
Rep Power: 2
KevinZ09 is on a distinguished road
Sorry, I'm a bit confused. Are you using a homogeneous-flow model or a multi-phase flow model? I suppose the former, since, if I'm not mistaken, that barotropic density model you're using describes the density of the mixture. Right? In that case, you won't use Fluent's cavitation model but just a single-phase model, where the single-phase represents the mixture. You still need to create a "new" material, as you can't use Fluent's standard liquid-water. However, you'll only have one fluid and the density of that fluid is determined by your UDF. So that's where you need to hook the UDF. But again, that's all assuming you're using a homogeneous-flow model.

Perhaps give some more details so I know better.
KevinZ09 is offline   Reply With Quote

Old   January 5, 2017, 15:16
Default
  #7
New Member
 
Ullas P K
Join Date: Jan 2017
Posts: 6
Rep Power: 2
ullaspk1990 is on a distinguished road
Yes, you are right, I am using a homogeneous flow model for cavitation modelling with medium as water. I am modelling cavitation in a 3D venturi device.
Now I understand where to hook the UDF, that is, by creating a new material in materials dialogue box and hook the UDF to determine the density.
Pardon me, I have few more doubts about the viscosity of the new material and how to specify vapour pressure.

Thanking you for your guidance.
ullaspk1990 is offline   Reply With Quote

Old   January 6, 2017, 06:13
Default
  #8
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 137
Rep Power: 2
KevinZ09 is on a distinguished road
I don't really have much experience with cavitation modeling, especially not with a single-phase model, so I'm not really sure how to do it. I'll still try to help you a bit more though:
1: For the viscosity, I suggest checking literature on that. Since you've got only one fluid, you probably need some "mixture" model for the viscosity. I.e., a model where the viscosity depends on your mixing ratio or something. But check the literature for that.
2: Regarding the vapour pressure, doesn't your model sort of solve for that? I mean, you know water's temperature dependent saturation pressure (like a Clausius-Clapeyron relation), you have your barotropic state law, and you've got your mass, momentum and temperature equations. I think you've got a closed set of equations. Your temperature equation is de-coupled from the mass and momentum equations due to your barotropic state law. So when solving for pressure, if p > p_sat you've got a liquid and if p < p_sat you've got a liquid-vapour mixture. You don't really have a "vapour pressure" though, since you've got only one material.

But I could be completely wrong, as I have never done something like that. So perhaps some of the more experience cavitation modelers can chime in.
KevinZ09 is offline   Reply With Quote

Old   January 6, 2017, 06:17
Default
  #9
New Member
 
Ullas P K
Join Date: Jan 2017
Posts: 6
Rep Power: 2
ullaspk1990 is on a distinguished road
Thank you very much for your guidance. I will inform if there is any further updates.
ullaspk1990 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
error message cuteapathy CFX 14 March 20, 2012 07:45
few quesions on ANSYS ICEMCFD and FLUENT Prakash.Paudel ANSYS 0 August 12, 2010 12:07
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07


All times are GMT -4. The time now is 09:33.