CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

trying to write a UDF for viscoelastic in fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2014, 20:35
Default trying to write a UDF for viscoelastic in fluent
  #1
New Member
 
Tejasvi Krishna
Join Date: Sep 2010
Location: College station,Tx, USA
Posts: 12
Rep Power: 15
tejasvikrishna is on a distinguished road
Send a message via Skype™ to tejasvikrishna
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
tejasvikrishna is offline   Reply With Quote

Old   October 28, 2014, 03:46
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   November 3, 2014, 17:01
Default
  #3
New Member
 
Tejasvi Krishna
Join Date: Sep 2010
Location: College station,Tx, USA
Posts: 12
Rep Power: 15
tejasvikrishna is on a distinguished road
Send a message via Skype™ to tejasvikrishna
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
tejasvikrishna is offline   Reply With Quote

Old   November 4, 2014, 08:16
Default
  #4
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22
vasava will become famous soon enough
If you are looking to make a new viscosity model then you need to use DEFINE_PROPERTY macro.
vasava is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a smart interface matlab fluent chary FLUENT 24 June 18, 2021 09:07
Fluent UDF for thermal NOx larsschwarzer Fluent UDF and Scheme Programming 1 July 18, 2014 08:39
The fluent stopped and errors with "Emergency: received SIGHUP signal" yuyuxuan FLUENT 0 December 3, 2013 22:56
Fluent write UDF for calculating My, Mz and Fz davesmith_01 FLUENT 1 November 20, 2011 21:20
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10:16


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