|
[Sponsors] |
trying to write a UDF for viscoelastic in fluent |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 27, 2014, 21:35 |
trying to write a UDF for viscoelastic in fluent
|
#1 |
New Member
|
Hey,
I have been trying to write a UDF for viscoelastic in fluent for which I need to solve for the conformation tensor simultaneously with the momentum conservation... for which I need to new scalars... I have written the code but I am having a horrible time to compile it.. Please look at the code and let me know, what is it that I am doing wrong! ... real x[ND_ND]; face_t f; real diff; real source, lamda ,fn, L , R; lamda = 0.01; L = 10; DEFINE_ON_DEMAND(rename_UDvars) { Set_User_Scalar_Name(0,"UDS0: C11"); Set_User_Scalar_Name(1,"UDS1: C12"); Set_User_Scalar_Name(2,"UDS2: C13"); Set_User_Scalar_Name(3,"UDS3: C22"); Set_User_Scalar_Name(4,"UDS4: C23"); Set_User_Scalar_Name(5,"UDS5: C33"); Set_User_Scalar_Name(6,"UDS6: C21"); Set_User_Scalar_Name(7,"UDS7: C31"); Set_User_Scalar_Name(8,"UDS8: C32"); Set_User_Scalar_Name(9,"UDS9: tau11"); Set_User_Scalar_Name(10,"UDS10: tau12"); Set_User_Scalar_Name(11,"UDS11: tau13"); Set_User_Scalar_Name(12,"UDS12: tau22"); Set_User_Scalar_Name(13,"UDS13: tau23"); Set_User_Scalar_Name(14,"UDS14: tau33"); Set_User_Scalar_Name(15,"UDS15: tau21"); Set_User_Scalar_Name(16,"UDS16: tau31"); Set_User_Scalar_Name(17,"UDS17: tau32"); } .... I follow that up with the governing equations DEFINE_SOURCE(C11_source,c,t,dS,eqn)//source term of uds equation { C_CENTROID(x,c,t) R = sqrt(C11(c,t)+ C22(c,t)+ C33(c,t)); fn = (L*L-3)/(L*L-R*R); Source = C11(c,t)*C_U_G(c,t)[0]+ C12(c,t)*C_U_G(c,t)[1]+ C13(c,t)*C_U_G(c,t)[2]+ C11(c,t)*C_U_G(c,t)[0]+ C21(c,t)*C_U_G(c,t)[1]+ C31(c,t)*C_U_G(c,t)[2]- 1/lamda*(f*(C11(c,t)); dS[eqn]=2*C_U_G(c,t)[0]-1/lamda*(-f^2/(L^2-3)*(2*C11(c,t))*(C11(c,t)-1)+f); tau11(c,t) = myu_P/lamda*(f*C11(c,t)-1); return source; } Thankyou for you time ... tejasvi |
|
October 28, 2014, 04:46 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
It would help if you would give the error message that you get when compiling.
Nevertheless, the problem could simply be that you use "Source" where you should use "source". |
|
November 3, 2014, 18:01 |
|
#3 |
New Member
|
Thank you for your reply.... thankyou for pointing out that mistake... I corrected it and when I try running it ... it still says error in line 2 ... and would not tell me any more specifics
|
|
November 4, 2014, 09:16 |
|
#4 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
If you are looking to make a new viscosity model then you need to use DEFINE_PROPERTY macro.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
looking for a smart interface matlab fluent | chary | FLUENT | 24 | June 18, 2021 10:07 |
Fluent UDF for thermal NOx | larsschwarzer | Fluent UDF and Scheme Programming | 1 | July 18, 2014 09:39 |
The fluent stopped and errors with "Emergency: received SIGHUP signal" | yuyuxuan | FLUENT | 0 | December 3, 2013 23:56 |
Fluent write UDF for calculating My, Mz and Fz | davesmith_01 | FLUENT | 1 | November 20, 2011 22:20 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 11:16 |