## Fluids

Topics relate to Fluent, CFX, Turbogrid and more

#### Fluent UDF for finding the right design point.

• jimi000
Subscriber

Hello,

I am kind of new at FLUENT and i have been trying to simulate the oil flow in a journal bearing as part of my master thesis. One task i have been given is finding the correct values of the attitude angle (ψ) and eccentricity (e), using a Newton-Raphson method UDF that is then compiled in FLUENT. So basically the whole thing goes like this: I know the load applied on the journal which i use to find the Sommerfeld number S, which i then use to find the eccentricity using boyd diagrams (eyeballing it). Now by running a simulation on Fluent using a pair (ψ0,e0) i can find the total force applied on the journal bearing, which for the correct pair should be equal to the load, which is known. Now i have been able to manually use ψ and e as input parameters and Ftot=W as output as design point but what would i like to do is create a UDF that implements the 2 variable N-R method to change (Ψn,en) with each iteration untill we get proper convergence (Ftot-W=min).

The problem is that while i have looked for similar solution methods i haven't been able to find anything that even remotely suggests that i can change geometry parameters like that using a UDF. I have also been reading the UDF ansys manual but haven't been able to find what i need. Does anyone have an idea? Thank you in advance!

• YasserSelima
Subscriber
Hello,nMy understanding is you are trying to find the steady state location of the shaft. Is this correct?nIf yes, you need to use Defing_CG_MOTION . The shaft will move under the fluid forces, load and inertia. Your function should apply force balance on the shaft and provide the solver with x and y velocities, and the rotational speed as well. nAnother option is to use SDOF. You can still do the job with it. nMy questions are, Where is your inlet? Where is your outlet? nCan you simplify the problem into 2D problem? This would save lots of simulation timenGood Luck!n
• jimi000
Subscriber
Hello YasserSelima,nthank you for getting to me so quickly! I think that what you're describing is the dynamic solution... basically we have a dynamic mesh and by apllying the load W, and the movement of the fluid we get the steady state location of the shaft. Am i getting this right? This is what im going to do after this experiment so thank you in advance, i am definitely going to use that! In this case what i'm trying to do is create a UDF based on NR method to start with an ititial pair (ψ0,e0) and perform the simulation, which get's me Ftot (i've written the expression). After that, the UDF is supposed to compare this value with W and find the error. The udf inroduces the new pair (ψ1,e1) and repeates the process until the error (Ftot-W) is close to zero. nThe model i use contains only the fluid, it is not an FSI. The inlet is one side of the cylinder and outlet is the other side. The inner wall represents the journal and is modelled as a moving wall with a rotational speed of 2500rpm. The outer wall represents the bearing and is a stationary wall. Unfortunately, 2D will not work! I'm quite skeptic about whether such a thing can be done with a udf on fluent. This looks more like something one would do on Matlab or on C++ (code in general), after writing the proper FDM equations. Still, i'm a novice at Fluent and i can't be sure unless i hear it from someone more experienced. It can be done, but i don't know if it can be done the way i was asked to do it.nn
• YasserSelima
Subscriber
So, you want to move the journal in a steady state solution? I don't think this is possible in Fluent.nBut you can use unsteady and move the journal according to the function you want. nCode your UDF to measure the fluid forces on the journal every time stepnMonitor the change in the forces ... Make your own criteria to decide this is steady state or not. nOnce the change is almost zero, Record the forces and the error ... nMake your own criteria to select the new positionnApply a velocity to move to the new location in few time steps ... nWait for steady state ... and repeat nnMatlab is Awesome, but not for CFD. Solution will take longer time and if the code is not written the right way, you will run out of memory. C++ and Fortran are definitely the best and the fastest .. and the most difficult options. n
• Rob
Ansys Employee
A slight alteration on 's suggestion. Run steady state to find the fluid force. Switch to transient and use the UDF to move the centre piece, re-run the flow steady. Repeat as necessary. It's the same principle we use for the erosion moving mesh model. n