CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Electrical conductivity (https://www.cfd-online.com/Forums/fluent-udf/166721-electrical-conductivity.html)

walied123 February 15, 2016 17:44

Electrical conductivity
 
Hi every body :

Hoping that every thing is going well.

i need urgent help please.

-the electrical conductivity and the specific heat in my case is not constant and they are a function of coordinates.

-the problem that the electrical conductivity in the material panel doesn't contains the udf option so how can i define it.

- for the specific heat, is there any way to define it? i know that it can be defined as a function of temperature but is there any way to define it as a function of coordinates?

thanks

Bruno Machado February 16, 2016 04:50

Quote:

Originally Posted by walied123 (Post 585321)
-the electrical conductivity and the specific heat in my case is not constant and they are a function of coordinates.

You need to create an UDS for the electrical conductivity and define the domains it will be computed.

Quote:

Originally Posted by walied123 (Post 585321)
-the problem that the electrical conductivity in the material panel doesn't contains the udf option so how can i define it.

The electrical conductivity should be defined in a DEFINE_DIFFUSIVITY macro and hooked to your UDS in the material panel.

Quote:

Originally Posted by walied123 (Post 585321)
- for the specific heat, is there any way to define it? i know that it can be defined as a function of temperature but is there any way to define it as a function of coordinates?

I am not sure about it. Once speaking with a Ansys worker, he said the Cp should be only dependent on temperature, because fluent solver is based on density and need a well established Cp.

If you have a look at here, you will see that neither cell or thread are given to the macro DEFINE_SPECIFIC_HEAT.

https://www.sharcnet.ca/Software/Ans...e_sp_heat.html

walied123 February 20, 2016 20:26

thank you Bruno Machado for your kind replay.

but it still not clear.can you please clear more?

if the electrical conductivity is Lamd=constant_1*x+constant_2*y what should i do to define it?

please can you step your kind reply?

thanks
M.Eid

Bruno Machado February 21, 2016 14:21

Quote:

Originally Posted by walied123 (Post 586117)
thank you Bruno Machado for your kind replay.

but it still not clear.can you please clear more?

if the electrical conductivity is Lamd=constant_1*x+constant_2*y what should i do to define it?

please can you step your kind reply?

thanks
M.Eid

Hi

the electrical conductivity must be defined as something like this (I am assuming it changes with x and y position):

DEFINE_DIFFUSIVITY(elec_diff,c,t,i)
{
real Lamd, constant_1, constant_2, x, y;
C_CENTROID(x,c,t);

constant_1 = XXXXXXX;
constant_2 = XXXXXXX;

x = C_CENTROID(x,c,t)[0];
y = C_CENTROID(x,c,t)[1];

Lamd=constant_1*x+constant_2*y;

return Lamd;
}


Change XXXXX for the values of your constant. After that, once you create an UDS, you can define this as your diffusivity for the new scalar.

walied123 February 21, 2016 16:32

thank you Bruno Machado for your kind reply

but still there are some questions.

1- does i compile the function as the same way of the UDF compilations?

2- from where can i assign the function to a domain....from the material panel like the UDF or what?


2- there are uds_0,uds_1 and so on............ at which uds can i define the function or i should define a new uds?

THANKS

Bruno Machado February 21, 2016 16:50

Quote:

Originally Posted by walied123 (Post 586193)
thank you Bruno Machado for your kind reply

but still there are some questions.

1- does i compile the function as the same way of the UDF compilations?

Yes, this is an UDF as any other. you can add the one I provided in your current UDF.

Quote:

2- from where can i assign the function to a domain....from the material panel like the UDF or what?
The diffusivity itself is defined in the material panel. But before define it, you gotta define your UDS (Define -> User Defined Function -> Scalars) and the domains you want it to be solved.

Quote:

2- there are uds_0,uds_1 and so on............ at which uds can i define the function or i should define a new ads?

THANKS
I did not get your question, but if you have more than 1 UDS, you can define an if statement in the diffusivity for different integers (i=1,2,3...)


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