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/)
-   -   UDF macro to get relative humidity of air? (https://www.cfd-online.com/Forums/fluent-udf/144580-udf-macro-get-relative-humidity-air.html)

mali28 November 17, 2014 04:40

UDF macro to get relative humidity of air?
 
Hi

Does any one know what is the UDF macro to get the relative humidity of air (%) in a certain cell?

Thnak you.

m zahid June 6, 2015 12:41

Relative humidity
 
hi, have you find the answer ? if yes please share the answer.i am modeling a spray in the air using Fluent . I want to get the relative humidity at a various points at different temperature within the domain. if u know the UDF or any other way please share your experience.

thanks

Jaskull July 9, 2015 04:34

Hi,
there is a macro to get RH in cell:
relative_humidity(cell, thread)

I found it by checking the fluent files one by one.

m zahid July 9, 2015 06:10

thanks
 
thanks Jaskull, i will try it and reply you as soon as possible.
thanks

jacek July 30, 2015 05:20

Can you give some details of this macro?
 
How to use it, and where did you find some description?

Quote:

Originally Posted by Jaskull (Post 554615)
Hi,
there is a macro to get RH in cell:
relative_humidity(cell, thread)

I found it by checking the fluent files one by one.


Jaskull July 30, 2015 05:44

I didn't find any description. I fount it in one of the fluent files. To use it you need to find the particle cell and thread:
cell_t cc = P_CELL(p);
Thread *t0 = P_CELL_THREAD(p);

then you can find RH in cell where the particle is e.q.:
humidity = relative_humidity(cc, t0);

I'm using it in calculation of equilibrium moisture content of drying particles and it works well.

jacek July 30, 2015 06:00

Hi, Jaskull
 
That is not all indispensable to run this macro.
Ii is yet necessary to declare a suitable file in the header:

#include "udf.h"
#include " ???"

What a file one should include?

Jaskull July 30, 2015 06:08

Im using this function in macro:
DEFINE_DPM_HEAT_MASS(multivap,p,Cp,hgas,hvap,cvap_ surf,Z,dydt,dzdt)
and read those files:
#include "udf.h"
#include "math.h"

In my opinion "math" is not necessary.

jacek July 30, 2015 06:27

so, there is a problem
 
I tried using it as a trial in EXECUTE_ON_DEMAND macro whith:

#include "udf.h"
#include "math.h" // not neccessary in this case
#include "species.h" // I foundin this file a string ".. real relative_humidity..."

But I receive a compilation error "...unresolved external symbol RELATIVE_HUMIDITY... "

I think you are more lucky whith this issue...

jacek July 30, 2015 06:51

Solution:
 
#include "udf.h"
#include "species.h"

// your code, for instance:

DEFINE_ON_DEMAND(NaZadanie)
{
Domain *dom = Get_Domain(Dzie);
Thread *th_flu = Lookup_Thread(dom, ID_flu); //
cell_t ce_flu;

relative_humidity(ce_flu, th_flu) // lower case only !!! uppercase - you get error!

}

jacek July 30, 2015 07:16

Final remark
 
relative_humidity() works on node values, so if your calculation is cell-based be carefull...


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