Udf for adaptive time step, error in loop
Could someone, please, help me with this udf code? It's write in the right way but it doesn't work and don't do function in the "else" https://pastebin.com/raw/SMazER3X
Code:
|
The 'else' block starts with a 'DEFINE_ON_DEMAND(calc_distance)', is this intentional?
|
Quote:
Yes, but i saw this is wrong, because i read that it's a function that read value at the end of calculations, anyway i would like to understand how to write a function that in the "else" compute max of the division between velocity and cell dimension, and after calculate the time step as time_step = max (dx/velx) * CFL max (0,8 in my case) |
DEFINE_DELTAT DEFINE_ADJUST and DEFINE_ON_DEMAND
are independent macros, you cant use them inside each other start from this, compile UDF, read logs and fix errors Code:
#include "udf.h" time_step=MAX (time_step, (dy / vel_y) *0.8); are calculated on each face, if you don't want -> fix it best regards |
Quote:
https://ibb.co/mBv9WxF https://ibb.co/mBv9WxF Actual code is this ( i added the definition of domain ) Quote:
https://ibb.co/mBv9WxF |
You've made mistake
best regards |
All times are GMT -4. The time now is 19:32. |