# problem of "define_property"

• 206 Views
• Last Post 09 December 2018
• Topic Is Solved
AhaBaby posted this 05 December 2018

Can density, viscosity, specific heat capacity and other items of material properties in UDF be defined as functions of position coordinates, and I use C language to call subfunctions, as shown in the following figure. Is there any mistake in using this method?

AhaBaby posted this 05 December 2018

density, viscosity and specific heat capacity is Position Dependent ,as a function of position,Thank  you!!

abenhadj posted this 05 December 2018

Yes, properties might be defined as coordinate dependent. I would not comment on what you shared as it is not easy to check and as ANSYS Stuff we cannot debug UDF's.

Best regards,

Amine

• Liked by
AhaBaby posted this 05 December 2018

Thank you very much for your help，and I want to know how to call a sub-functions , I think that there are something wrong about calling sub-functions.But I have not found any examples about calls function,Looking forward for your reply!

Best regards

abenhadj posted this 05 December 2018

What do you mean with "calling sub-functions"?

Best regards,

Amine

AhaBaby posted this 05 December 2018

#### As I wrote in my program,"step(__,__)"is a function which I want to call in "DEFINE PROPERTY",but I do not know how to do in UDF for a function call and

AhaBaby posted this 05 December 2018

abenhadj posted this 05 December 2018

That is standard C when dealing with functions:

Declaration: real myfunc( real Argument)

{bla;

bla;

bla;

return myreturn;

}

myfunc could be then declared as

abc=myfunc(Argument);

You need to correct your function and the arguments to accept real arguments!

Best regards,

Amine

• Liked by
AhaBaby posted this 06 December 2018

The problem is described in picture below,I want define the density as  coordinate dependent.

According to your suggestion,I have changed the source code to:

and the result should be:

However,the result of Fluent calculation is:

The result show the function “step（real Argument,real Argument）”do not work,so I think that there are something wrong in the function “step（real Argument,real Argument）”,but I don't know how to solve it,looking forward for your help!

abenhadj posted this 06 December 2018

You Need to debug your step function. Alternative using nested if conditions. Much better alternative having three different cell zones assigned to different solid materials.

Best regards,

Amine

AhaBaby posted this 07 December 2018

Thank you. I see this in the help file of Fluent. Does this mean that the "density" can't change too much, and it can only be a function of temperature, not a function of position coordinates?

abenhadj posted this 07 December 2018

Small variations only. For large variations and pressure dependency only UDRGM is possible. You cna use the temperature as variable to change the density but do not solve temperature equation. But why not creating three difrent cell zones? I can however use variable density in DEFINE_PROPERTY but this is not recommended (for solid might be okay..). If conditions are workring for me but I dono recommend them for Fluid zones.

Best regards,

Amine

AhaBaby posted this 07 December 2018

The problem actually is：

A possible numerical approach would be to have a GGI interface between each conductor and insulator, but this would generate an extremely high number of interfaces in the solid domain.Therefore, the chosen method is to develop a mathematical function that makes the physical properties of the disc (r, k and cp) vary in the axial and radial directions simultaneously in order to mimic the presence of a copper or a paper element .
in a word,the way to simply the problem by define the density as coordinate dependent.

AhaBaby posted this 07 December 2018

And there are so many cell zones to create,for this reason,I begin to try to simply the problem by a mathematical function that makes the physical properties of the disc (rand cp) vary in the axial and radial directions simultaneously.

abenhadj posted this 07 December 2018

You can create a conformal mesh where the jump between one material to the other will be through shadow coupled wall. Anyway the other approach also works and worked for me and might be only suitable for solids or small variations.

Best regards,

Amine

AhaBaby posted this 08 December 2018

Okay，thanks for your reply，and the density and the  specific heat of solid could be define as  coordinate dependent?

abenhadj posted this 08 December 2018

Documentation tells theat cp can only temperature dependent otherwise UDRGM. You can try spatial variance for cp. I guess would work like it worked for me with density. Still favorite separate cells zones before having isues with material properties.

Best regards,

Amine

AhaBaby posted this 09 December 2018