|
[Sponsors] |
What the macro of concentration in species model? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2019, 09:12 |
What the macro of concentration in species model?
|
#1 |
Senior Member
Khalid Baker
Join Date: Mar 2009
Location: IRAQ
Posts: 168
Rep Power: 17 |
Hello I am using the transport species model and I want to define the density of mixture as a UDF in terms of temperature and concentration as the definition on the picture, but I do not know how I can write the macro of concentrations may somebody help with it I am so grateful for that?
Khalid |
|
October 9, 2019, 22:25 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
|
||
October 10, 2019, 04:49 |
|
#3 |
Senior Member
Khalid Baker
Join Date: Mar 2009
Location: IRAQ
Posts: 168
Rep Power: 17 |
Thanks a lot gearboy for the reply. Actually I am little confused about your answer, the UDF I want to use is for the mixture density (i.e. C_R(c,t)? so how I can use it again as C_R(c,t)*C_YI(c,t,iSpecies) inside the definition?
Khalid |
|
October 10, 2019, 06:41 |
|
#4 |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
I mean the value of C_R(c,t) is the mixture density (kg/m3). C_YI(c,t,i) is the mass fraction of species index i in the mixture (kg/kg mixture).
|
|
October 10, 2019, 07:20 |
|
#5 |
Senior Member
Khalid Baker
Join Date: Mar 2009
Location: IRAQ
Posts: 168
Rep Power: 17 |
Yes I aware that but I cannot imagine how to define the density of mixture as C_R(c,t) then used the same macro inside the same definition? Can you please write to me the definition I sent and send me it here? I am so grateful for that?
Khalid |
|
October 10, 2019, 21:53 |
|
#6 |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
C_R(c,t) is a read-only value that gets the mixture density in Fluent, not defined by yourself.
|
|
October 11, 2019, 04:57 |
|
#7 | |
Senior Member
Khalid Baker
Join Date: Mar 2009
Location: IRAQ
Posts: 168
Rep Power: 17 |
Quote:
D:\\Kolsi\\den.C:15: macro `C_YI' used with only 2 args temp definition shadows previous definition Error: D:\\Kolsi\\den.C: line 11: parse error. Error: D:\\Kolsi\\den.C: line 12: parse error. Error: D:\\Kolsi\\den.C: line 13: m_t: undeclared variable Here is the UDF #include "udf.h" DEFINE_PROPERTY(cell_density, cell, thread) { real rhm,rho,To,Co,betaT,betaC; real temp = C_T(cell, thread); rho= 1.16; Co=0.35; To=300; betaT=3.33e-3; betaC=-0.34; cell_t cell; Thread *m_t; /*mixture thread*/ begin_c_loop_all (cell,m_t) { rhm = rho*(betaT*(temp-To)-betaC*(C(R,T)*C_YI(c,m_t)-Co)); /* density of mixture */ } end_c_loop_all (cell,m_t) return rhm; } Last edited by kbaker; October 11, 2019 at 11:24. |
||
October 12, 2019, 02:49 |
|
#8 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
|
||
October 12, 2019, 03:31 |
|
#9 |
Senior Member
Khalid Baker
Join Date: Mar 2009
Location: IRAQ
Posts: 168
Rep Power: 17 |
I did that and also correct the mass fraction macro to C_R(c,t) it mentioned incorrectly but there is still error sticky with me:
Error: D:\Kolsi\\density.txt: line 14: t: undeclared variable Here is the UDF #include "udf.h" DEFINE_PROPERTY(cell_density, cell, thread) { Thread *m_t; /*mixture thread*/ real rhm,rho,To,Co,betaT,betaC; real T= C_T(cell, thread); rho= 1.16; Co=0.35; To=300; betaT=3.33e-3; betaC=-0.34; begin_c_loop_all (cell,m_t) { rhm = rho*(betaT*(T-To)-betaC*(C_R(c,t)*C_YI(c,t,0)-Co)); /* density of mixture */ } end_c_loop_all (cell,m_t) return rhm; } |
|
October 14, 2019, 06:42 |
|
#10 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
"m_t" and "t" has no value in your code. Use "thread" from FLUENT instead.
Please read UDF manual carefully. Your basic concepts are not clear. Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to simulate the entire cooling system at a single run in Macro model ? | nareshzeeda1994 | FLUENT | 0 | March 14, 2018 03:39 |
Species transport model of platelets and other activating factors | Nadun19 | FLUENT | 0 | April 21, 2017 22:18 |
Inlet gas species concentration | Deependra | FLUENT | 0 | August 13, 2015 13:22 |
Concentration of species | aalansari | FLUENT | 0 | August 23, 2014 10:18 |
negative species concentration again | Andrew Garrard | FLUENT | 0 | March 22, 2005 12:36 |