CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   can user define a location dependent density in Define_property udf macro? (https://www.cfd-online.com/Forums/fluent-udf/214085-can-user-define-location-dependent-density-define_property-udf-macro.html)

 Pmaroul January 18, 2019 16:11

can user define a location dependent density in Define_property udf macro?

Hello all;

Can anyone describe me if the user is able to define the viscosity or density as a function of location by UDf writing in Define_proprties macro?

For example :

suppose :

How can the user implement this function in FLUENT?

Thanks a lot for any answer.

P.Maroul

 pakk January 21, 2019 08:23

The Fluent manual shows how to make it depend on temperature. The example reads temperature as
Code:

real T = C_T(c,t);
If instead of temperature you want the coordinates, then just use the coordinate:
Code:

real xc[ND_ND]; C_CENTROID(xc,c,t);
Now, the x-coordinate is stored as xc[0], and the y-coordinate as xc[1]. So your equation would become
Code:

1000+0.00001*cx[0]+0.00001*cx[1]

 Pmaroul January 21, 2019 16:34

Thank you Sir for your kind help.

That worked excellent.

Good Luck and best wishes.

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