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/)
-   -   Uds (https://www.cfd-online.com/Forums/fluent-udf/250685-uds.html)

Arshia July 4, 2023 03:03

Uds
 
hello everyone i want to write a UDS function for viscoelastic fluid and this is my code for source term of transport equations for this case :

DEFINE_SOURCE(my_UDS_source1,c,t,dS,eqn)
{
real rho;
real lambda;
real C11 , C22 , C33 , C12 , C13 , C23 ;
real fr=1;
real d_d[3][3];
lambda = 0.1;
rho = C_R(c,t);
C11 = C_UDSI(c,t,0);
C12 = C_UDSI(c,t,1);
C13 = C_UDSI(c,t,2);
C22 = C_UDSI(c,t,3);
C23 = C_UDSI(c,t,4);
C33 = C_UDSI(c,t,5);
d_d[0][0]=C_DUDX(c,t);
d_d[0][1]=C_DUDY(c,t);
d_d[0][2]=C_DUDZ(c,t);
d_d[1][0]=C_DVDX(c,t);
d_d[1][1]=C_DVDY(c,t);
d_d[1][2]=C_DVDZ(c,t);
d_d[2][0]=C_DWDX(c,t);
d_d[2][1]=C_DWDY(c,t);
d_d[2][2]=C_DWDZ(c,t);

//i=1 , j=1
dS[eqn]=0;
return C11*d_d[0][0]+2*C12*d_d[0][1]+2*C13*d_d[0][2]+C11*d_d[0][2]-(1/lambda)*(fr*(C11)-1);
}

DEFINE_SOURCE(my_UDS_source2,c,t,dS,eqn)
{
real rho;
real lambda;
real C11 , C22 , C33 , C12 , C13 , C23 ;
real fr=1;
real d_d[3][3];
lambda = 0.1;
rho = C_R(c,t);
C11 = C_UDSI(c,t,0);
C12 = C_UDSI(c,t,1);
C13 = C_UDSI(c,t,2);
C22 = C_UDSI(c,t,3);
C23 = C_UDSI(c,t,4);
C33 = C_UDSI(c,t,5);
d_d[0][0]=C_DUDX(c,t);
d_d[0][1]=C_DUDY(c,t);
d_d[0][2]=C_DUDZ(c,t);
d_d[1][0]=C_DVDX(c,t);
d_d[1][1]=C_DVDY(c,t);
d_d[1][2]=C_DVDZ(c,t);
d_d[2][0]=C_DWDX(c,t);
d_d[2][1]=C_DWDY(c,t);
d_d[2][2]=C_DWDZ(c,t);


dS[eqn]=0;
//i=1 , j=2
return C11*d_d[1][0]+C12*(d_d[1][1]+d_d[1][0])+C13*d_d[1][2]+C22*d_d[0][1]+C23*d_d[0][2]-(1/lambda)*(fr*C12);
}

Arshia July 4, 2023 03:05

but i received below error :
the fl process could not be started

AlexanderZ July 4, 2023 06:14

did you defined all 6 scalars before pressing run button?

Arshia July 4, 2023 06:16

how can i define 6 scalars?


All times are GMT -4. The time now is 01:15.