|
[Sponsors] |
Implementing the UDF Barotropic state law of cavitation in ANSYS Fluent 17.1 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 4, 2017, 12:39 |
Implementing the UDF Barotropic state law of cavitation in ANSYS Fluent 17.1
|
#1 |
New Member
Ullas P K
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
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 |
|
January 5, 2017, 04:47 |
|
#2 |
Senior Member
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10 |
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". |
|
January 5, 2017, 05:33 |
|
#3 |
New Member
Ullas P K
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
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) |
|
January 5, 2017, 06:53 |
|
#4 |
Senior Member
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10 |
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. |
|
January 5, 2017, 08:31 |
|
#5 |
New Member
Ullas P K
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
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. |
|
January 5, 2017, 09:00 |
|
#6 |
Senior Member
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10 |
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. |
|
January 5, 2017, 15:16 |
|
#7 |
New Member
Ullas P K
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
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. |
|
January 6, 2017, 06:13 |
|
#8 |
Senior Member
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10 |
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. |
|
January 6, 2017, 06:17 |
|
#9 |
New Member
Ullas P K
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
Thank you very much for your guidance. I will inform if there is any further updates.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 07: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 13:07 |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 09:56 |