CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to display dT/dx? (https://www.cfd-online.com/Forums/fluent/38837-how-display-dt-dx.html)

Williams December 5, 2005 11:58

How to display dT/dx?
 
Hello everyone

I want to display dT/dx, dT/dy, and dT/dz in fluent. Could anyone give me some help?

Thanks

Williams

Pospelov December 6, 2005 04:48

Re: How to display dT/dx?
 
I think you can do it by command line. You should write: dis, then enter, then con, then enter, then enter to see the contor of what do you want to display. dT/dx -- must be in this list...

RoM December 6, 2005 05:31

Re: How to display dT/dx?
 
You will need an UDF to access temperature gradients. The following udf will copy dT/dx into a user defined memory so you can postprocess it. To copy dT/dy change C_T_G(c,t)[0] to C_T_G(c,t)[1] and for dT/dz to C_T_G(c,t)[2]. The udf runs in interpreted mode (define->user-defined->functions->interpreted) but you will have to do some additional things to make it work.

1. Allocate one user defined memory. Define->User-defined->memory, set the number to 1.

2. Force the solver to keep gradient values stored. In TUI tpye //solve/set/experts and answer yes to question "Keep temporary solver memory from being freed?"

3. Run your solution for 2 iterations.

4. Run the udf. Define->user-defined->execute on demand

Good Luck, RoM


#include "udf.h"

DEFINE_ON_DEMAND(store_grad)
{
Domain* d;
Thread *t;
cell_t c;

d=Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=C_T_G(c,t)[0];
}
end_c_loop(c,t)
}
}

Williams December 6, 2005 09:47

Re: How to display dT/dx?
 
Thanks a lot.

sosososo1114 May 16, 2010 23:54

By the way, as the udf manual refers: it seems better to use C_T_RG(c,t) macro than the C_T_Gs. it seems that C_T_G fails to return the accurate value you want at the boundary faces.

have a good day.

Josh_Blue May 17, 2010 05:08

Hi Hongjin,

thanks for your comment. Could you please tell me how to use this macro step by step?

Thanks in advance!

Regards

sosososo1114 May 19, 2010 05:58

Quote:

Originally Posted by Josh_Blue (Post 259051)
Hi Hongjin,

thanks for your comment. Could you please tell me how to use this macro step by step?

Thanks in advance!

Regards

Hi, Josh,
"As in the case of gradient variables, you can retain all of the reconstruction
gradient data by issuing the text command solve/set/expert and then answering yes
to the question Keep temporary solver memory from being freed?."(says UDF manual)
as Rom mentioned, u should define a udm first, u can use GUI as follow: Define->user defined->memory. You may need three udfs to get the C_T_RG display in counters. The first one is the udm reserve udf, you can copy an example from udf manual at Page 3-46. The second is udm clearance udf. and the example mentioned above also includes this one. The third is quit alike the one Rom provided above. You just need to chang the C_T_G(c,t)[0] in the 12th line to the C_T_RG(c,t)[0]:D.
Have a good day

nenazarian October 27, 2012 17:44

Hi,

This thread was really useful for me. I just have few questions:

1. Does (dT/dy, dT/dz...) only gets available after doing these steps?

I only put "C_UDMI(c,t,0)=C_T_RG(c,t)[0];" in my udf which is the gradient in x direction but now I also see other terms (dT/dy, dT/dz) available in my case. Why is that?

2. What is the major difference between RG and G and when to use them?

I know that the value obtained by each of them would be different but Im not sure if I understand how to differentiate them.

3. After doing these steps, there is another variable available in my case :
"user defined memory"
what is that?

I appreciate any help.

Cheers
Negin

argenisbnl December 6, 2018 19:57

Quote:

Originally Posted by sosososo1114 (Post 259432)
Hi, Josh,
"As in the case of gradient variables, you can retain all of the reconstruction
gradient data by issuing the text command solve/set/expert and then answering yes
to the question Keep temporary solver memory from being freed?."(says UDF manual)
as Rom mentioned, u should define a udm first, u can use GUI as follow: Define->user defined->memory. You may need three udfs to get the C_T_RG display in counters. The first one is the udm reserve udf, you can copy an example from udf manual at Page 3-46. The second is udm clearance udf. and the example mentioned above also includes this one. The third is quit alike the one Rom provided above. You just need to chang the C_T_G(c,t)[0] in the 12th line to the C_T_RG(c,t)[0]:D.
Have a good day


Hello, I hope it's not too late, I have a question, if I run a number of cases using design points, not doing those steps that were mentioned before will affect my project? I mean, the UDF will not work after first case? Thanks in advance.


All times are GMT -4. The time now is 04:59.