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/)
-   -   How to get the gradient of species mass fraction? (https://www.cfd-online.com/Forums/fluent-udf/79318-how-get-gradient-species-mass-fraction.html)

legendyxg August 19, 2010 12:47

How to get the gradient of species mass fraction?
 
Dear my friends.

I want to get access to the gradient of species mass fractions. The manual said that the macro C_YI_G(c,t,i) can be used only in the density-based solver. To use this in the pressure-based solver, you will need to set the rpvar 'species/save-gradients? to #t. What does that means? How can I set the "rpvar"? Since I know nothing about the scheming languages, can someone give me an example of how to set the rpval in my UDFs?

Thanks a lot.

coglione August 23, 2010 03:19

Type
(rpsetvar 'species/save-gradients? #t)
in the text-console of Fluent.
(rpgetvar 'species/save-gradients?) can be used to check the current value of this variable. It should return #t (true) now.
cheers

legendyxg August 23, 2010 21:07

Thank you very much coglione!

Amor92 October 22, 2016 14:35

?
 
Hi,

I'm new to Fluent. Can you show me how to work with these macros?

Yunsung_Park October 2, 2018 04:35

Thank you very much!
 
It was very helpful
I really appreciate your answer

mahdi-united March 9, 2020 17:25

Quote:

Originally Posted by coglione (Post 272323)
Type
(rpsetvar 'species/save-gradients? #t)
in the text-console of Fluent.
(rpgetvar 'species/save-gradients?) can be used to check the current value of this variable. It should return #t (true) now.
cheers

hi i wrote a udf for getting the species mass fraction gradients by define_adjust and using the storing commands as follow:


DEFINE_ADJUST(gradient, domain)
{
Thread *t;
Thread **pt;
cell_t c;
Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE);
real voidx, voidy, voidz=0.0;


mp_thread_loop_c (t,domain,pt)
{
if (FLUID_THREAD_P(t) && n_udm > 0)
{
Thread *tp = pt[P_PHASE];
begin_c_loop (c,t)
{
C_UDMI(c,t,0) = C_YI_G(c,tp,0)[0];
}
end_c_loop (c,t)
}
}

}


this code compile and initialize correctly without any error
but in calculating in 1st iteration appear the message "the f1 process could not be started" and fluent crashes.
Where do you think the problem is?

scorpian August 4, 2020 01:34

how to calculate gradient of species mole fraction in fluent?

scorpian August 4, 2020 01:35

Quote:

Originally Posted by Yunsung_Park (Post 708525)
It was very helpful
I really appreciate your answer

how to calculate gradient of species mole fraction in fluent?

scorpian August 4, 2020 01:36

Quote:

Originally Posted by coglione (Post 272323)
Type
(rpsetvar 'species/save-gradients? #t)
in the text-console of Fluent.
(rpgetvar 'species/save-gradients?) can be used to check the current value of this variable. It should return #t (true) now.
cheers

How to calculate gradient of species mole fraction in fluent?

scorpian August 4, 2020 01:38

Quote:

Originally Posted by mahdi-united (Post 761022)
hi i wrote a udf for getting the species mass fraction gradients by define_adjust and using the storing commands as follow:


DEFINE_ADJUST(gradient, domain)
{
Thread *t;
Thread **pt;
cell_t c;
Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE);
real voidx, voidy, voidz=0.0;


mp_thread_loop_c (t,domain,pt)
{
if (FLUID_THREAD_P(t) && n_udm > 0)
{
Thread *tp = pt[P_PHASE];
begin_c_loop (c,t)
{
C_UDMI(c,t,0) = C_YI_G(c,tp,0)[0];
}
end_c_loop (c,t)
}
}

}


this code compile and initialize correctly without any error
but in calculating in 1st iteration appear the message "the f1 process could not be started" and fluent crashes.
Where do you think the problem is?

How to calculate the gradient of species mole fraction in fluent?

scorpian August 4, 2020 01:39

Quote:

Originally Posted by legendyxg (Post 272050)
Dear my friends.

I want to get access to the gradient of species mass fractions. The manual said that the macro C_YI_G(c,t,i) can be used only in the density-based solver. To use this in the pressure-based solver, you will need to set the rpvar 'species/save-gradients? to #t. What does that means? How can I set the "rpvar"? Since I know nothing about the scheming languages, can someone give me an example of how to set the rpval in my UDFs?

Thanks a lot.

How to calculate the gradient of species mole fraction in fluent?

scorpian August 5, 2020 00:57

How to calculate gradient of species mole fraction in fluent?
 
Quote:

Originally Posted by coglione (Post 272323)
Type
(rpsetvar 'species/save-gradients? #t)
in the text-console of Fluent.
(rpgetvar 'species/save-gradients?) can be used to check the current value of this variable. It should return #t (true) now.
cheers

Hello sir,

I was trying to get calculate the gradients of species mass and mole fraction in fluent. I could find the command for gradient of species mass fraction from your chat in this platform. Could you help me how to get the gradient of species mole fraction in ANSYS-FLUENT?

Thanking you in anticipation,

With warm wishes,
Debojit Sharma


All times are GMT -4. The time now is 08:41.