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 to update Operating pressure (https://www.cfd-online.com/Forums/fluent-udf/32680-udf-update-operating-pressure.html)

Rahul December 9, 2003 01:56

UDF to update Operating pressure
 
Hi All, I am performing a analysis which require to update operating pressure based on other parameters. Can someone suggest me how to tackle this problem? As operating pressure doesn't have hook it may need some other way like adjust function to take care of this. Thanks in advance, Rahul


Mahboobe365 June 19, 2013 15:53

could you find the solution for this problem?

arunraj June 26, 2020 02:01

Is there a solution to the problem?

AlexanderZ June 26, 2020 03:11

you can use TUI command to set operating pressure.
If you need to make it under criteria you can use scheme + TUI.
It is possible to transfer data from UDF to scheme using rpvariables

Look for rpvar in Ansys FLuent Customization manual

arunraj June 26, 2020 03:17

Dear Alexander,

Thank you for the reply.

I want to apply corrected operating pressure as UDF.

Is this what you mean? Can I add this at the end of DEFINE_ADJUST after calculating new operating pressure.


Abs_Pres = 0;
DEFINE_ADJUST(PRESSURE, domain)
{
;;;;
;;;
;;
p_op_new =mass_vap_old*(TIME_STEP*AAA*DDD);

{
RP_Set_Real("operating-pressure", p_op_new);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
Abs_Pres = ABS_P(C_P(c,t), p_op_new);
}
end_c_loop(c,t)
return Abs_Pres;
}
}

(or)

{
RP_Set_Real("operating-pressure", p_op_new);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
return p_op_new;
}
end_c_loop(c,t)
}

AlexanderZ June 26, 2020 04:39

it could be something like this, however, I'm not sure if it works or not, you should test first. Make few timesteps and check operating pressure

In your code Abs_Pres is calculated each time during cell/thread loop.
So you will get Abs_Pres only from last cell.

What exactly you want? If you want to get the field of recalulated pressure you may use UDMIs

Code:

Abs_Pres = 0;
DEFINE_ADJUST(PRESSURE, domain)
{
;;;;
;;;
;;
p_op_new =mass_vap_old*(TIME_STEP*AAA*DDD);

{
RP_Set_Real("operating-pressure", p_op_new);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
Abs_Pres = ABS_P(C_P(c,t), p_op_new);
C_UDMI(c,t,0) = Abs_Pres;
}
end_c_loop(c,t)

}
}


arunraj June 26, 2020 04:54

Thank you so much for your reply.

I solved with the following command. I hope it is correct. Can you please confirm?

(rp-var-define 'p_op_new 0.0 'real #f)
/define/operating-conditions/operating-pressure (rpgetvar 'p_op_new)


All times are GMT -4. The time now is 18:13.