
[Sponsors] 
June 7, 2006, 08:50 
Source term in energy equation

#1 
Guest
Posts: n/a

Hello I'm modelling heat transfer between fluid domain and solid. I've to add a souce term in energy equation of solid, This term depend on temperature, time and other variable. I do it using fortran subroutine. But I've this error message in Pre:
The variable 'T' referenced in parameter 'Source' in object '/FLOW/DOMAIN:Product/SUBDOMAIN:Subdomain 1/SOURCES/EQUATION SOURCE:energy' does not have one of the required prefixes: phase or particle. PS: I define my solid as CHT 

June 7, 2006, 09:00 
Re: Source term in energy equation

#2 
Guest
Posts: n/a

Dear macdidi,
The preprocessor is being "picky" that it should.. Just add the prefix to the variable T.. For example, if your solid list includes Copper, just pass the Copper.T variable to your User Fortran. If that works, please let everyone here knows. Good luck, Opaque.. 

June 7, 2006, 09:02 
Re: Source term in energy equation

#3 
Guest
Posts: n/a

You need to disambiguate which phase the T refers too. I cant remember the exact syntax offhand but its something equivalent to: phase1.T rather than just T.


June 7, 2006, 10:58 
Re: Source term in energy equation

#4 
Guest
Posts: n/a

Thanks I try youre sugestion and now it's working Thanks a lot


April 15, 2017, 06:33 

#5 
New Member
Mariem
Join Date: May 2016
Posts: 8
Rep Power: 3 
hi could tell me what is the expression of term source in the equation of energy please ? i am modeling temperature in fortran too but i can't find the right form of term source


April 15, 2017, 18:53 

#6 
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 13,874
Rep Power: 107 
Digging up an 11 year old thread.... You are lucky some of us old timers are still around.
If you want to set a source term from fortran then use your fortran to set a CEL variable and set the source term to that variable in CFXPre. 

April 17, 2017, 18:13 

#7 
New Member
Mariem
Join Date: May 2016
Posts: 8
Rep Power: 3 
thanks for replying Ghorroks.. Actually i don't use CFXPre. is there any way to write that subroutine in Fortran without using CFXPre?


April 17, 2017, 18:38 

#8 
Senior Member
Join Date: Jun 2009
Posts: 699
Rep Power: 15 
ANSYS CFX User Fortran is the last resource when it comes to custom models like a source term.
How complex is your source that requires UserFortran ? Does it require control logic ? Usage of internal variables, or not readily available functionality ? CEL is the most common form to customize ANSYS CFX. 

April 18, 2017, 12:27 

#9 
New Member
Mariem
Join Date: May 2016
Posts: 8
Rep Power: 3 
i am looking for a simple expression of the source term due to chemical reaction.Normally it is dependant of the variables that I calculated in the same code like temperature,the reaction rate; the enthalpy of formation. it's like the expression above but it must depend of reaction rate not of mass flow


April 19, 2017, 08:18 

#10 
Senior Member
Join Date: Jun 2009
Posts: 699
Rep Power: 15 
Say, you have a mixture named Mixture compose of 4 materials: Mat1, Mat2, Mat3 and Mat4, you can write the source term as
MySource = (Mat1.Static Enthalpy * Mat1.Molar Mass + Mat2.Static Enthalpy * Mat2.Molar Mass + Mat3.Static Enthalpy * Mat3.Molar Mass + Mat4.Static Enthalpy * Mat4.Molar Mass) / (Mixture.Density * Mixture.Cp) No UserFortran needed. 

April 19, 2017, 11:58 

#11 
New Member
Mariem
Join Date: May 2016
Posts: 8
Rep Power: 3 
i am calculating the temperature in reactive medium of the methan combustion so i have to use the source term of the species conservation equation (that i already calculated) to calculate the source term in energy equation. but i don't find big change in the temperature profile when it's supposed to climb from 300 K to 1600 K.


April 19, 2017, 15:53 

#12 
Senior Member
Join Date: Jun 2009
Posts: 699
Rep Power: 15 
If you are using ANSYS CFX for combustion, why do you need to reimplement the reaction mechanism ?
Are you solving a separate energy equation yourself ? ANSYS CFX does not solve for Temperature, but for Static Enthalpy and there is no need for reaction source terms whatsoever. You are also trying to reimplement the Eddy Dissipation model which requires careful linearization.. As per writing the CEL you want, you need Mixture.Density, Mat1.Mass Fraction, Mat2.Mass Fraction.. A careful look at the ANSYS CFX documentation for CEL variables will list the available variables and how to prefix them for multicomponent flows. 

April 20, 2017, 04:46 

#13 
New Member
Mariem
Join Date: May 2016
Posts: 8
Rep Power: 3 
Indeed, I'm writing a code in fortran i don't use ansys CFX So, the better way is to look at the Ansys CFX documenetation to check all variables.
If there any recommandation to a specific manual or link that demonstrate the Eddy Dissipation Model linearisation? 

April 22, 2017, 04:52 

#14 
New Member
Mariem
Join Date: May 2016
Posts: 8
Rep Power: 3 
Finally, i find the solution i didn't multiply the source term by the volume . Thanks for your instructions Opaque that give a result


May 8, 2017, 23:47 
decomposition reaction

#15 
New Member
Shuai Wang
Join Date: May 2017
Location: TaiYuan.China
Posts: 20
Rep Power: 2 
I am modeling a decomposition reaction of methane hydrate in CFX.But I donot find a relevant model in CFX .What can I do let me achieve this reaction.


May 9, 2017, 20:23 
decomposition reaction

#16 
New Member
Shuai Wang
Join Date: May 2017
Location: TaiYuan.China
Posts: 20
Rep Power: 2 
I am modeling a decomposition reaction of methane hydrate in CFX.But I donot find a relevant model in CFX .What can I do let me achieve this reaction.
I am trying to use interphase mass transfer to simulate chemical reaction.But I have no sucesse. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
swak4foam building problem  GGerber  OpenFOAM Installation  54  April 24, 2015 16:02 
A source term in a vector equation  CpCaniggia  OpenFOAM Running, Solving & CFD  0  September 15, 2010 05:35 
Bouyancy term in Energy equation  CFDtoy  Main CFD Forum  2  August 4, 2008 11:04 
Mass transfer Term in Mixture Energy Equation  CFDtoy  Main CFD Forum  0  July 3, 2008 16:14 
question about energy equation  zhou  FLUENT  0  February 24, 2004 00:55 