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

Gradient of species mass fraction

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2011, 06:39
Default Gradient of species mass fraction
  #1
deo
New Member
 
deo
Join Date: Aug 2011
Posts: 2
Rep Power: 0
deo is on a distinguished road
hi guys,

I am solving a combustion problem involving ch4 (2 step model), and need the gradient of the species mass fraction for postprocessing. A simple UDF is used to extract the date with the following macro: C_YI_G(c,t,i). However, FLUENT compiles the UDF only for i = 0. When i is 1, 2, 3, or 4, the UDF does not compile. I get an error message instead. Any suggestions on how to solve this problem?
deo is offline   Reply With Quote

Old   November 21, 2012, 17:26
Default
  #2
New Member
 
Ali Emadi
Join Date: Jan 2011
Posts: 18
Rep Power: 15
aliemadi is on a distinguished road
for 2step CH4 reaction you have 6 species. so for i=0-4 you can access to C_YI_G. for i=5 which refer to N2 you cant access to its gradient because its mass fraction calculated by algebraic equation not transport equation.

type in the console the following commands:
solve>set>expert
reply yes to question keep memory from being freed?
define>models>species
reply yes to question save-gardients?
czhao86 likes this.
aliemadi is offline   Reply With Quote

Old   March 14, 2020, 06:15
Default
  #3
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by aliemadi View Post
for 2step CH4 reaction you have 6 species. so for i=0-4 you can access to C_YI_G. for i=5 which refer to N2 you cant access to its gradient because its mass fraction calculated by algebraic equation not transport equation.

type in the console the following commands:
solve>set>expert
reply yes to question keep memory from being freed?
define>models>species
reply yes to question save-gardients?
hi


i type this command but not work

how to store the species mass fraction gradients in fluent?
what is the its command?
mahdi-united is offline   Reply With Quote

Old   March 14, 2020, 18:25
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,668
Rep Power: 65
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
you don't type solve>set>expert but actually solve/set/expert or solve set expert

if you still have trouble, hit return/enter and all the available commands will pop up. /solve will be one of them. type solve [enter] and then [enter] again to see all the commands at the next level. /set will be one of them. Rinse and repeat.

If that still doesn't work then record a video. Either you don't have a keyboard or you don't have a monitor, or you're not using Fluent.
LuckyTran is offline   Reply With Quote

Old   March 15, 2020, 11:48
Default
  #5
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
you don't type solve>set>expert but actually solve/set/expert or solve set expert

if you still have trouble, hit return/enter and all the available commands will pop up. /solve will be one of them. type solve [enter] and then [enter] again to see all the commands at the next level. /set will be one of them. Rinse and repeat.

If that still doesn't work then record a video. Either you don't have a keyboard or you don't have a monitor, or you're not using Fluent.
no i know how to type this command but actually everything i do , species mass fraction gradients does not store and fluent crashes i'm hanged
mahdi-united is offline   Reply With Quote

Old   March 15, 2020, 13:11
Default Keeping the Memory
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
In a pressure-based solver, the command

solve set expert

to keep memory from being freed will not provide access to species gradient. That command works for other fields but not for species. For species, you have to either use UDF or (rpsetvar 'species/save-gradients? #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   March 15, 2020, 13:18
Default
  #7
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by vinerm View Post
In a pressure-based solver, the command

solve set expert

to keep memory from being freed will not provide access to species gradient. That command works for other fields but not for species. For species, you have to either use UDF or (rpsetvar 'species/save-gradients? #t)
my friend
this command:
(rpsetvar 'species/save-gradients? #t) is equal to define/models/species/save-gradients? (yes)
and i enter this commands and not work
mahdi-united is offline   Reply With Quote

Old   March 15, 2020, 15:20
Default Not working
  #8
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Yes, you can use TUI command as well. But what is implied by command not working? Does the mass fraction gradient not show up under the Derivatives? Or they do show up but the values are always 0? If it is the latter, do check if your cell zone is Fluid and not Solid under Type.
scorpian likes this.
__________________
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   March 15, 2020, 17:11
Default
  #9
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by vinerm View Post
Yes, you can use TUI command as well. But what is implied by command not working? Does the mass fraction gradient not show up under the Derivatives? Or they do show up but the values are always 0? If it is the latter, do check if your cell zone is Fluid and not Solid under Type.
no. the mass fraction gradients (dmassfraction/dx , ...) doesnt show up under the derivatives contour

furthermore !!!! after the entering command

before 1st iteration fluent crashes and does not perform the calculation



one question can i use the C_UDSI_G instead C_YI_G?
C_UDSI(..) = C_YI


and another question, value of C_UDSI=C_YI is correct in output but when i using the C_UDSI_G, values is different and unreasonable!! why???
mahdi-united is offline   Reply With Quote

Old   March 16, 2020, 05:05
Default Species Gradients
  #10
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
If Fluent gets hung after using the command to save species gradient then, as stated earlier, there is problem with the case. It will not help you in any way to proceed further. You may get some results but those will most likely be incorrect.

First of all, what is the objective of fetching the species gradients? There are very few requirements where you need species gradients with spatial coordinates.

Secondly, just by setting value of a scalar equal to mass fraction you will not be able to fetch the gradients. Since you already have values for mass fractions, you can directly determine the gradient using any of the methods, Green-Gauss or least square. However, as mentioned earlier, if Fluent is not showing mass fraction gradient despite issuing the command, there is something wrong with the setup. Even if you do it using the values of mass fractions, the result would most likely be incorrect.
__________________
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   March 16, 2020, 07:41
Default
  #11
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by vinerm View Post
If Fluent gets hung after using the command to save species gradient then, as stated earlier, there is problem with the case. It will not help you in any way to proceed further. You may get some results but those will most likely be incorrect.

First of all, what is the objective of fetching the species gradients? There are very few requirements where you need species gradients with spatial coordinates.

Secondly, just by setting value of a scalar equal to mass fraction you will not be able to fetch the gradients. Since you already have values for mass fractions, you can directly determine the gradient using any of the methods, Green-Gauss or least square. However, as mentioned earlier, if Fluent is not showing mass fraction gradient despite issuing the command, there is something wrong with the setup. Even if you do it using the values of mass fractions, the result would most likely be incorrect.
i want to send my case for you but i don't know how to do it in cfd-online?
please guide me
mahdi-united is offline   Reply With Quote

Old   March 16, 2020, 08:14
Default
  #12
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by vinerm View Post
If Fluent gets hung after using the command to save species gradient then, as stated earlier, there is problem with the case. It will not help you in any way to proceed further. You may get some results but those will most likely be incorrect.

First of all, what is the objective of fetching the species gradients? There are very few requirements where you need species gradients with spatial coordinates.

Secondly, just by setting value of a scalar equal to mass fraction you will not be able to fetch the gradients. Since you already have values for mass fractions, you can directly determine the gradient using any of the methods, Green-Gauss or least square. However, as mentioned earlier, if Fluent is not showing mass fraction gradient despite issuing the command, there is something wrong with the setup. Even if you do it using the values of mass fractions, the result would most likely be incorrect.
i saw your message but i dont know where is knowcfd in gmail
why don't send your email address?
mahdi1372rs@gmail.com
mahdi-united is offline   Reply With Quote

Old   March 17, 2020, 09:09
Default Attachment
  #13
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Look at the attached image.
Attached Images
File Type: png attach.png (2.1 KB, 29 views)
__________________
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   March 17, 2020, 09:45
Default
  #14
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by vinerm View Post
Look at the attached image.
sdfsdfasdfs
mahdi-united is offline   Reply With Quote

Old   March 17, 2020, 12:13
Default The image
  #15
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
The image I shared shows the option to attach files; marked by red rectangle. You have to look for this when you are writing a post. Just above the writing area, you will notice all the options. Look for the one that I marked with rectangle.
__________________
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   March 17, 2020, 12:20
Default
  #16
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
ok found it

this is my fluent case

but size is more than 195kb
mahdi-united is offline   Reply With Quote

Old   March 17, 2020, 12:25
Default Attachment
  #17
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
It appears that you forgot to attach the file. You have to first choose and then click on Upload.
__________________
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   March 17, 2020, 12:30
Default
  #18
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
the message appear: your filesize exceed from 195 kb
mahdi-united is offline   Reply With Quote

Old   March 17, 2020, 14:20
Default
  #19
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by vinerm View Post
It appears that you forgot to attach the file. You have to first choose and then click on Upload.
do you receive my email??
mahdi-united is offline   Reply With Quote

Old   March 17, 2020, 15:44
Default Species Gradients
  #20
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
After initializing the case and issuing the command

(rpsetvar 'species/save-gradients? #t)

I could see that the gradients become available under Contours. Look at the attached image.
Attached Images
File Type: png speGrad.png (38.2 KB, 47 views)
__________________
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

Reply


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 Lilly FLUENT 5 March 13, 2022 17:52
gradient of species mass fraction zhou FLUENT 1 March 14, 2020 07:55
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
UDF for Species Mass Fraction Gradient *IN SPECIFIC ZONE * -- e.g. along axis of sym. ksiegs2 Fluent UDF and Scheme Programming 0 February 27, 2011 12:55
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 21:14


All times are GMT -4. The time now is 16:15.