
[Sponsors] 
January 23, 2013, 21:22 
How to use UDS solve this problem

#1 
New Member
risk
Join Date: Jan 2010
Posts: 4
Rep Power: 7 
Hi Guys, I have a set of eqs and want to use UDS to solve them. I solved this problem before with my own code and Matlab. I just want to see whether I can get the same results and learn how to use UDS. The following is the set of the eqs. I also attach the UDF I wrote for your information. I still have problem to get the right answer as I got before. I cannot find out the errors.
d^2 C1/dx^2 = PHI^2 * {C1*exp[(1ALPHA)(C2C3)]  C0*exp[ALPHA(C2C3)]} d^2 C2/dx^2 = PHI1^2 * {C1*exp[(1ALPHA)(C2C3)]  C0*exp[ALPHA(C2C3)]} d^2 C3/dx^2 = PHI2^2 * {C1*exp[(1ALPHA)(C2C3)]  C0*exp[ALPHA(C2C3)]} The dependent variables are C1, C2, and C3. The others are constant /************************************************** **************** UDF that adds momentum source term and derivative to duct flow ************************************************** *****************/ #include "udf.h" #define PHI2 0.1406 #define PHI12 0.8277 #define PHI22 0.8277 #define C0 0.5714 #define ALPHA 0.5 enum { C1, C2, C3 }; DEFINE_SOURCE(C1_source, cell, thread, dS, eqn) { real source; dS[eqn] = PHI2 * exp((1ALPHA)*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3))); source = PHI2 * (C_UDSI(cell,thread,C1) * exp((1ALPHA)*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))  C0 * exp(ALPHA*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))); return source; } DEFINE_SOURCE(C2_source, cell, thread, dS, eqn) { real source; dS[eqn] = PHI12 * ((1ALPHA)*C_UDSI(cell,thread,C1) * exp((1ALPHA)*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3))) + ALPHA* C0 * exp(ALPHA*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))); source = PHI12 * (C_UDSI(cell,thread,C1) * exp((1ALPHA)*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))  C0 * exp(ALPHA*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))); return source; } DEFINE_SOURCE(C3_source, cell, thread, dS, eqn) { real source; dS[eqn] = PHI22 * ((ALPHA1)*C_UDSI(cell,thread,C1) * exp((1ALPHA)*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))  ALPHA*C0 * exp(ALPHA*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))); source = PHI22 * (C_UDSI(cell,thread,C1) * exp((1ALPHA)*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))  C0 * exp(ALPHA*(C_UDSI(cell,thread,C2)C_UDSI(cell,thread,C3)))); return source; } Thanks 

January 24, 2013, 02:54 

#2 
Member
Join Date: Nov 2011
Location: Czech Republic
Posts: 95
Rep Power: 6 
I am quite sure that you can't use UDS for this particular case. Because is Fluent is solving partial differential equation (scalar transport equation), however you would like to solve set of ordinary differential equations. In other words your left side of equations is completely different from Fluent ones.


January 24, 2013, 07:54 

#3  
Senior Member
SSL
Join Date: Oct 2012
Posts: 227
Rep Power: 6 
Quote:


January 24, 2013, 07:55 

#4 
Senior Member
SSL
Join Date: Oct 2012
Posts: 227
Rep Power: 6 
I have done like that before. It has so many complicated points that should be cared.


January 24, 2013, 13:55 

#5 
New Member
risk
Join Date: Jan 2010
Posts: 4
Rep Power: 7 
Saeed,
Can you recall any particular tips? Anyone is helpful to me. 

January 25, 2013, 01:21 

#6 
Senior Member
SSL
Join Date: Oct 2012
Posts: 227
Rep Power: 6 
It seems you want to add three new scalar equations. So add three UDS. These equations only have source and diffusion terms. So disable unsteady and convection terms in UDS menu. Now you need to write UDF for defining source and diffusion terms.


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDS problem with wall boundary condition  Alex F.  FLUENT  15  September 21, 2015 09:28 
can you solve this problem?  mehendis  FLUENT  0  August 17, 2010 04:25 
Solve a mass diffusion problem  Roberta  FLUENT  0  November 26, 2008 02:47 
how to solve steadytransient mixed problem?  touchstone  CDadapco  0  September 12, 2005 10:08 
Can CFX solve problem with structured mesh?  Peted  CFX  2  May 31, 2004 23:45 