CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Problem setting C_MU_T with DEFINE_ADJUST (https://www.cfd-online.com/Forums/fluent/34365-problem-setting-c_mu_t-define_adjust.html)

Andy August 9, 2004 09:34

Problem setting C_MU_T with DEFINE_ADJUST
 
Hi,

i´m trying to change turbulent viscosity (for an extension of the ke-model; DEFINE_TURBULENT_VISCOSITY is not accessible in Eulerian multiphase) in the Eulerian model using UDF. I'm using a DEFINE_ADJUST , but I get an error message when I compile my code.

The compiler tells me: error C2106: '=' :left operand must be l-value

DEFINE_ADJUST(turb_adjust, d) { Thread *t; cell_t c;

thread_loop_c (t,d)

{

if (FLUID_THREAD_P(t))

{

begin_c_loop_all (c,t)

{

C_MU_T(c,t) = 1; /*C_MU_L works!*/

}

end_c_loop_all (c,t)

}

} }

Same error occurs for C_MU_EFF. But if i use the C_MU_L no problem (or C_R(c,t))! So where´s the problem with the eddy viscosity?

I hope someone can help me out off this! Thanks.

Andy

yuanmengyuan1989 July 30, 2014 04:09

Ask some questions
 
hello. i met the question similar with yours. i used the DEFINE_ADJUST to adjust the viscosity of the material. However, when the "C_MU_L" occurs in my UDF, it will make mistake as followings:


Error [cortex] [time 7/30/14 15:49:6]
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.


No matter how simple the UDF is, if the "C_MU_L= " occur, the error will appear.

do you know the reason why it happens?

lehoanganh07 July 30, 2014 05:05

Quote:

Originally Posted by Andy
;114244
Hi,

i´m trying to change turbulent viscosity (for an extension of the ke-model; DEFINE_TURBULENT_VISCOSITY is not accessible in Eulerian multiphase) in the Eulerian model using UDF. I'm using a DEFINE_ADJUST , but I get an error message when I compile my code.

The compiler tells me: error C2106: '=' :left operand must be l-value

DEFINE_ADJUST(turb_adjust, d) { Thread *t; cell_t c;

thread_loop_c (t,d)

{

if (FLUID_THREAD_P(t))

{

begin_c_loop_all (c,t)

{

C_MU_T(c,t) = 1; /*C_MU_L works!*/

}

end_c_loop_all (c,t)

}

} }

Same error occurs for C_MU_EFF. But if i use the C_MU_L no problem (or C_R(c,t))! So where´s the problem with the eddy viscosity?

I hope someone can help me out off this! Thanks.

Andy

Hi
I think the value of C_MU_T(c,t) should be return real value.

AllenZHANG June 22, 2018 02:53

Did you solve this problem? Thanks


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