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

Volume weighted average species mass fraction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2020, 22:57
Default Volume weighted average species mass fraction
  #1
Member
 
Join Date: Oct 2019
Posts: 35
Rep Power: 7
Morice is on a distinguished road
Hey guys,

I have been unable to find the right syntax to use in calculating the volume-weighted average species mass fraction as tavg is used in the calculation of the volume-weighted average of temperature. Using s0 gives a compiling error C2086: 'real S0avg' redefinition.

Calculation of volume-weighted average of temperature is as the code.

Thank you, much appreciated.

Last edited by Morice; May 31, 2020 at 23:19. Reason: Improper Code and used in a wrong number
Morice is offline   Reply With Quote

Old   May 26, 2020, 06:31
Default Volume Averaged Species
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
The code that you attached is improper and used in wrong manner. DEFINE_PROFILE is hooked to a zone, therefore, Domain is not required. It always returns the Thread of the zone it is hooked to. So, no need to compare against anything. However, it is supposed to assign the values to the zone, which is not being done in the code. In a way, the code is serving its purpose.

So, if the objective is to determine volume averaged temperature for a zone, DEFINE_ADJUST or DEFINE_EXECUTE_AT_END makes more sense. For species, you have to use C_YI instead of C_T.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 26, 2020, 21:23
Default Volume Averaged Species
  #3
Member
 
Join Date: Oct 2019
Posts: 35
Rep Power: 7
Morice is on a distinguished road
Quote:
Originally Posted by vinerm View Post
The code that you attached is improper and used in wrong manner. DEFINE_PROFILE is hooked to a zone, therefore, Domain is not required. It always returns the Thread of the zone it is hooked to. So, no need to compare against anything. However, it is supposed to assign the values to the zone, which is not being done in the code. In a way, the code is serving its purpose.

So, if the objective is to determine the volume-averaged temperature for a zone, DEFINE_ADJUST or DEFINE_EXECUTE_AT_END makes more sense. For species, you have to use C_YI instead of C_T.
Yes yes, you are very right, this is a code I just found on the forum and posted to show how tavg has been applied. I did not check to see if it was right. I apologize for that. I used DEFINE_ADJUST in my actual code which is in the other thread that you helped me debug. Yes C_YI is used to define species.
Morice is offline   Reply With Quote

Old   May 27, 2020, 04:58
Default UDF Issue
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Then, what is the current issue? Does the UDF not compile or does it give run-time error?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 28, 2020, 11:28
Default UDF Compiled and the simulation ran
  #5
Member
 
Join Date: Oct 2019
Posts: 35
Rep Power: 7
Morice is on a distinguished road
Quote:
Originally Posted by vinerm View Post
Then, what is the current issue? Does the UDF not compile or does it give run-time error?
Hey Vinerm, sorry for the late response. I have been busy with trying to rectify my geometry and I wasn't able to respond promptly. According to what you suggested, I dismantled the entire UDF and coded and compiled each line. The UDF compiled and I ran the simulation.

Thank you for your assistance, much appreciated.
Morice is offline   Reply With Quote

Reply

Tags
species mass fraction


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
Mass fraction of species (Y) in reacting solvers mike.franky OpenFOAM Running, Solving & CFD 9 February 9, 2023 07:49
mass fraction of species Lilly FLUENT 5 March 13, 2022 18:52
alphaEqn.H in twoPhaseEulerFoam cheng1988sjtu OpenFOAM Bugs 15 May 1, 2016 17:12
Difference between Volume Fraction and Mass Fraction in CEL foo7 CFX 0 September 21, 2011 09:45
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 23:45.