|
[Sponsors] |
November 6, 2017, 16:16 |
How to call mixture properties in a UDF
|
#1 |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 58
Rep Power: 11 |
Hello,
I have a simple question. I am writing an UDF to calculate MIXTURE viscosity. But i need to call the MIXTURE DENSITY data somehow. Does anyone know how to include MIXTURE PROPERTIES in a UDF as a macro ? ( such as mixture density, mixture specific heat etc. ) Or, perhaps, does C_R(c,t) do exactly that ? Also is it possible to call species critical properties into an UDF to use in mixture rule combinations ? Thanks in advance. Alper |
|
November 8, 2017, 09:48 |
|
#2 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
Hi,
if you are using Code:
DEFINE_ADJUST Code:
DEFINE_ADJUST(my_adjust,mixture_domain) { cell_t cell; Thread *m_t; /*mixture thread*/ begin_c_loop_all (cell,m_t) { C_R(cell,m_t) = your*expression*for*density*goes*here; /* density of mixture */ } end_c_loop_all (cell,m_t) } |
|
November 19, 2017, 11:50 |
|
#3 | |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 58
Rep Power: 11 |
Quote:
I am using a real-gas model (not UDF, Redlich Kwong in FLUENT) for mixture density. Isn't there a way to simply call the cell mixture density ? Because with DEFINE_ADJUST, i would calculate a mixture property that is already calculated by FLUENT itself each time. Am i wrong ? Same thing also goes for mixture critical temperature, volume and constant volue specific heat too. There is no macro to call them from mixture domain to use directly ? Best Regards. |
||
November 20, 2017, 11:09 |
|
#5 |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 58
Rep Power: 11 |
No, exporting data once the solution is converged is not the problem. Problem is as follows :
* I am trying to simulate a real-gas reacting flow and trying to define a composition-dependent MIXTURE VISCOSITY via a UDF . (Chung et al. method) * In order to do so, i need to obtain MIXTURE DENSITY somehow. Using DEFINE_ADJUST, as you suggested earlier, is an option but FLUENT already calculates the MIXTURE DENSITY by itself when i choose the real-gas model in mixture box. I am simply trying to obtain the mixture density in each cell, that is calculated by FLUENT, to calculate the MIXTURE VISCOSITY. ( Mixture density is a parameter in the formulation ) I hope it is more clear now. Can it be helped ? Best Regards. |
|
November 21, 2017, 04:26 |
|
#6 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
Have you tried something simple like this:
Code:
DEFINE_PROPERTY(myViscosity,c,t) { real viscosity; viscosity = 0.0001*C_R(c,t); return viscosity; } |
|
December 7, 2017, 14:34 |
|
#7 |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 58
Rep Power: 11 |
Hello Sun,
I used C_R(c,t) for mixture density and menage to compile the code successfully after spending a week for editing bugs. I think it will work fine because i double-checked the code with MATLAB to see if the values are in agreement with similar academic papers. I will share the work once i validete it with an combustion case and share the results. By the way, is there list for PROP_ values for mixture species ? PROP_rho, PROP_mu, PROP_ktc and PROP_mwi are provided in the UDF Manual but i think critical properties for mixture species are accessible too. Regards. |
|
December 8, 2017, 04:09 |
|
#8 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
Glad to hear that everything worked out fine.
I am not sure if there is list for that. I usually use UDF manual to find out what macro I need. Looking forward to see the results good luck! |
|
May 6, 2021, 04:49 |
same problem
|
#9 | |
New Member
ashkan
Join Date: Oct 2020
Posts: 17
Rep Power: 6 |
Quote:
Hello dear Refik I have the same problem and i cant find pure and mixture density function for UDF. would you please help me? thank you so much |
||
May 6, 2021, 05:52 |
|
#10 | |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 58
Rep Power: 11 |
Quote:
Well C_R indeed returns the mixture density as explained earlier. I assume by "pure" you mean species-density, for which you'll have to formulate a UDF. But i reckon you have very little use for species-density if you are working with turbulent flow. |
||
May 6, 2021, 09:29 |
Udf
|
#11 | |
New Member
ashkan
Join Date: Oct 2020
Posts: 17
Rep Power: 6 |
Quote:
Would you please let me see your UDF ? Because i want to calculate mixture gas viscosity like you. Best regards |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
variable composition mixture properties | Neser25 | CFX | 6 | August 17, 2020 15:19 |
imposing material properties via UDF and JOURNAL files | mazdak | Fluent UDF and Scheme Programming | 1 | November 9, 2015 07:05 |
how to change particle properties using udf? | ljp | Fluent UDF and Scheme Programming | 0 | April 2, 2010 10:57 |
defining volume properties via UDF | Ralf Schmidt | FLUENT | 0 | July 17, 2006 11:30 |
2D CFD code using SIMPLE algorithm | bfan | Main CFD Forum | 3 | June 22, 2002 23:01 |