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 for ANSYS Fluent and Runge Kutta Method (https://www.cfd-online.com/Forums/fluent-udf/144594-udf-ansys-fluent-runge-kutta-method.html)

cagri.metin.ege November 17, 2014 09:27

UDF for ANSYS Fluent and Runge Kutta Method
 
Hello everybody,
I need to manage a boundary conditiıon that pressure change with time. On the other hand I have to solve a differential equation for this boundary condition. Solving the diffrential equation decided Runge-Kutta Method. Am I write another code to solve this equation or write Runge Kutta Method inside UDF. What is your idea ?, thank you all attention.

mprinkey November 20, 2014 18:23

This is not too hard do. Declare a global variable to hold your pressure boundary condition. Use a DEFINE_BOUNDARY to set it where needed using that variable. Then use a DEFINE_ADJUST to do the RK. Declare the variables in the DEFINE_ADJUST as static so the values remain. You will need to check the simulation time (CURRENT_TIME) at the beginning of the define adjust. Store the old value in a static variable. At the beginning of the DEFINE_ADJUST if the current solution time is different from the old value, then update the old and do your RK step(s) to get to the new time and update the global pressure variable.

aroma December 8, 2016 02:18

Quote:

Originally Posted by mprinkey (Post 520286)
This is not too hard do. Declare a global variable to hold your pressure boundary condition. Use a DEFINE_BOUNDARY to set it where needed using that variable. Then use a DEFINE_ADJUST to do the RK. Declare the variables in the DEFINE_ADJUST as static so the values remain. You will need to check the simulation time (CURRENT_TIME) at the beginning of the define adjust. Store the old value in a static variable. At the beginning of the DEFINE_ADJUST if the current solution time is different from the old value, then update the old and do your RK step(s) to get to the new time and update the global pressure variable.

Do you have any template for that? Tnx

FDE January 24, 2020 03:46

Runge kutta
 
Quote:

Originally Posted by aroma (Post 628745)
Do you have any template for that? Tnx

Hi,
I need a UDF code to solve the ODE equation (for example: y'=y(y-1), y(0)=...) in FLUENT.
I know that the ADJUST macro must be used. But, I have some problems in writing this code.
Thanks.


All times are GMT -4. The time now is 19:14.