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

Uds

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2023, 03:03
Unhappy Uds
  #1
New Member
 
arshia amiri
Join Date: Jul 2023
Posts: 3
Rep Power: 2
Arshia is on a distinguished road
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 is offline   Reply With Quote

Old   July 4, 2023, 03:05
Default
  #2
New Member
 
arshia amiri
Join Date: Jul 2023
Posts: 3
Rep Power: 2
Arshia is on a distinguished road
but i received below error :
the fl process could not be started
Arshia is offline   Reply With Quote

Old   July 4, 2023, 06:14
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
did you defined all 6 scalars before pressing run button?
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   July 4, 2023, 06:16
Default
  #4
New Member
 
arshia amiri
Join Date: Jul 2023
Posts: 3
Rep Power: 2
Arshia is on a distinguished road
how can i define 6 scalars?
Arshia 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
Change UDS Inlet Typ with UDF possible? schwaral Fluent UDF and Scheme Programming 8 September 17, 2020 08:47
Can you explain me how to use UDS? Tleja Fluent UDF and Scheme Programming 0 July 14, 2015 01:52
Set UDS on wall... fivos Fluent UDF and Scheme Programming 2 July 25, 2014 05:57
Calculate UDS flux through the wall ananth_01 FLUENT 0 August 5, 2013 07:33
Doubts UDS Flux, UDS Unsteady for VOF model kel85uk FLUENT 0 March 17, 2010 08:53


All times are GMT -4. The time now is 07:51.