CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   How to get a second derivative in udf? (http://www.cfd-online.com/Forums/fluent-udf/37451-how-get-second-derivative-udf.html)

demigod August 2, 2005 06:09

How to get a second derivative in udf?
 
How to get a second derivative ( diff(T,z,2), where T is temperature, z is one dimensionality, 2 refers to the second derivative) in udf?

Thanks.

Laika August 3, 2005 16:13

Re: How to get a second derivative in udf?
 
you must copy for each cell the first derivative of T in a UDM-location (at the end or after each iteration when needed). In postprocessing you can ask for the first derivative of this UDM, which is actually the desired second derivative.

As far as I know there is no other way.

good luck,

Laika, still orbiting

demigod August 3, 2005 22:44

Re: How to get a second derivative in udf?
 
Thanks.

How can I get the first derivative of the defined UDM? by C_UDSI_G(c,t,i)?

Can I define an UDS to refer to first derivative of temperature [C_UDSI(c,t,0)=C_T_G(c,t)[2]] and use C_UDSI_G(c,t,0) to give the second derivative?

Thanks a lot.

the second derivative appears in the source term, so I must update its value by each iteration.

Laika August 9, 2005 18:01

Re: How to get a second derivative in udf?
 
almost UDS --->c_UDSI(... UDM --->C_UDMI(...

the difference is that Fluent solves a transport equation for a UDS and not for a UDM. A UDM is just a memory location, but you can ask for the first derivatives. Hence the procedure:ask to calculate the first derivative of your quantity. Store it through the use of a UDF in a UDM, and ask for the first derivative of your UDM.

good luck,

Laika, still orbiting

Raymond.Leoi February 26, 2013 12:41

Well, it seems C_UDMI_G(cell, thread, n) isn't accessible, but we can get C_UDSI_G(cell, thread, n). The problem I met is that those values of C_UDSI_G at cells attached with boundaries are wrong. Any idea to properly get it fixed or any other approach we can employ?

Quote:

Originally Posted by Laika
;123159
almost UDS --->c_UDSI(... UDM --->C_UDMI(...

the difference is that Fluent solves a transport equation for a UDS and not for a UDM. A UDM is just a memory location, but you can ask for the first derivatives. Hence the procedure:ask to calculate the first derivative of your quantity. Store it through the use of a UDF in a UDM, and ask for the first derivative of your UDM.

good luck,

Laika, still orbiting



All times are GMT -4. The time now is 23:20.