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

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 4, 2017, 11: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, 03:47 #2 Senior Member   Kevin Join Date: Dec 2016 Posts: 138 Rep Power: 9 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, 04: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, 05:53 #4 Senior Member   Kevin Join Date: Dec 2016 Posts: 138 Rep Power: 9 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, 07: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, 08:00 #6 Senior Member   Kevin Join Date: Dec 2016 Posts: 138 Rep Power: 9 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, 14: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, 05:13 #8 Senior Member   Kevin Join Date: Dec 2016 Posts: 138 Rep Power: 9 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, 05: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.

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post saii CFX 12 March 19, 2018 05:21 Mihail CFX 7 September 7, 2014 06:27 cuteapathy CFX 14 March 20, 2012 06:45 Prakash.Paudel ANSYS 0 August 12, 2010 12:07 Sas CFX 15 July 13, 2010 08:56

All times are GMT -4. The time now is 18:05.

 Contact Us - CFD Online - Privacy Statement - Top