CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Error when creating an expression for a drag coefficient (

CFD_UJI May 1, 2012 10:27

Error when creating an expression for a drag coefficient

I am working with lagrangian particles in a settling tank. The continuous fluid is water.

At the menu: Default Domain> Fluid pair models> Particle Transport DRag coefficient; I have changed the constant value of 0,44 with an empirical expression that depends on a Reynolds Particle number. Previously, I've created an expression for a particle Reynolds number, that is:

Rep=Density*abs(Velocity-floc.Velocity)*floc.Mean Particle Diameter/Dynamic Viscosity

and then, I have defined the empirical expression for the Drag coeffcient:

Drag= 1702.9-1270.9*Rep+49.14*Rep^2

Up here all is ok.

Finally, Ansys v13.0 don't let me introduce this "drag" expression instead of a constant typical value = 0,44.

The Error message from Ansys is: "It must be assigned a numerical value, or an expression that resolves to a constant value".

Why can't I work with a variable instead of a constant value?

Could anyone help me, please?

Thanks and regards everyone

ghorrocks May 1, 2012 19:27

Note that you are setting the drag coefficient, not the drag force. Have you confused the two? Also note your "Rep" function does not use the slip velocity variable (which is preferred).

In section of the documentation it lists the options for particle drag. It clearly states that using a drag coefficient requires a constant value. So you will need to go to one of the other options.

CFD_UJI May 2, 2012 05:38

Thanks for replying,

I have not confused drag force and drag coefficient. I want to modify the drag coefficient depending on Reynolds particle. In the same way, I think in Rep expression is considered slip velocity because the velocity term is a relative one, that is, the difference between fluid velocity and particle velocity (floc.Velocity).

As you explain, I have learnt the guide again and its clearly specified that drag coefficient must be a constant value. Therefore, Im going to try the last option, select the drag coefficient option as None and then, create a Fortran Code in a subroutine.

P.S: Its a pleasure to talk with you, I have read a lot from you in this forum.

CFD_UJI May 8, 2012 02:56

Hello Ghorrocks,

I succed in introducing a subrutine (introduced as Partivle User Subroutine) based on the Fortran code example on the Ansys Guide: "*Particle User Source Example". However, I have problems to introduce the input arguments. The main expression need two: Reynolds particle and particle volume fraction.

Is there a tutorial anywhere that uses this subroutine? It appears as "pt_drag_factor.F" on the guide but I cannot find an example.

Sould I create another subroutine in order to calculate Reynolds particle?


ghorrocks May 8, 2012 06:56

It is preferable to access the existing variable. If you cannot figure out how to do it contact CFX support, they should have some examples of similar things.

CFD_UJI May 8, 2012 08:43


thanks again

All times are GMT -4. The time now is 10:31.