|
[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: 16 |
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[(1-ALPHA)(C2-C3)] - C0*exp[-ALPHA(C2-C3)]} d^2 C2/dx^2 = PHI1^2 * {C1*exp[(1-ALPHA)(C2-C3)] - C0*exp[-ALPHA(C2-C3)]} d^2 C3/dx^2 = -PHI2^2 * {C1*exp[(1-ALPHA)(C2-C3)] - C0*exp[-ALPHA(C2-C3)]} 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((1-ALPHA)*(C_UDSI(cell,thread,C2)-C_UDSI(cell,thread,C3))); source = -PHI2 * (C_UDSI(cell,thread,C1) * exp((1-ALPHA)*(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 * ((1-ALPHA)*C_UDSI(cell,thread,C1) * exp((1-ALPHA)*(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((1-ALPHA)*(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 * ((ALPHA-1)*C_UDSI(cell,thread,C1) * exp((1-ALPHA)*(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((1-ALPHA)*(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: 97
Rep Power: 14 |
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: 226
Rep Power: 15 |
Quote:
|
||
January 24, 2013, 07:55 |
|
#4 |
Senior Member
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15 |
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: 16 |
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: 226
Rep Power: 15 |
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.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDS problem with wall boundary condition | Alex F. | FLUENT | 15 | September 21, 2015 10:28 |
can you solve this problem? | mehendis | FLUENT | 0 | August 17, 2010 05:25 |
Solve a mass diffusion problem | Roberta | FLUENT | 0 | November 26, 2008 02:47 |
how to solve steady-transient mixed problem? | touchstone | Siemens | 0 | September 12, 2005 11:08 |
Can CFX solve problem with structured mesh? | Peted | CFX | 2 | June 1, 2004 00:45 |