DPM Switching doesn't switch law when I have specified
I have set a DPM switch so that the laws change with a user defined scalar but the laws are not switching when I have specified. Does anyone know why this is
Material *m = TP_MATERIAL(tp); if (TP_USER_REAL(tp,0) > 0.5) { TP_CURRENT_LAW(tp) = DPM_LAW_USER_1; } if (TP_USER_REAL(tp,0) <= 0.5) { TP_CURRENT_LAW(tp) = DPM_LAW_INITIAL_INERT_HEATING; } |
code looks correct (comparing to example from manual)
did you hook your function in fluent GUI? you may try to check your condition (TP_USER_REAL(tp,0) > 0.5) using Message function: Code:
DEFINE_DPM_SWITCH(dpm_switch, tp, coupled) |
Yes I have hooked the function in the GUI.
It moves into the heating law as it displays the message but the law is not doing what I am expecting it to do. That was very helpful thank you I will have to give it some further investigation. |
Hi AlexanderZ,
Is the intention of i and j to get the information messages only once? With your code as suggested, this will not happen, because i and j are initialised to 0 on every visit. To get only one message, you would need to define i and j as static variables outside the UDF: Code:
static int i=0,j=0; Ed |
thank you for comment.
with i and j i wanted to run message function only once. we may put i and j in DEFINE_EXECUTE_AT_END macros to set i and j = 0 after each time step. For that case we should define i and j as global variables. best regards |
All times are GMT -4. The time now is 08:01. |