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

How to get partial pressure of oxygen?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree7Likes
  • 5 Post By gearboy
  • 2 Post By hossein65

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2010, 08:49
Default How to get partial pressure of oxygen?
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Hello World.

Can anybody tell me how I can access the partial pressure of a species / componente?
In my case I need the partial pressure of oxgen!

Cheers. S.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 2, 2010, 18:52
Default
  #2
New Member
 
Jan
Join Date: Nov 2009
Posts: 21
Rep Power: 16
vinaynitrkl is on a distinguished road
i too need the same!
vinaynitrkl is offline   Reply With Quote

Old   March 3, 2010, 02:51
Default
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by sega View Post
Hello World.

Can anybody tell me how I can access the partial pressure of a species / componente?
In my case I need the partial pressure of oxgen!

Cheers. S.
You can use the following equation
pi=C_P(c,t)*gas_molar_fraction
where, pi is the partial pressure, C_P(c,t) gets the mixed gas pressure.
gas_molar_fraction is the mole fraction of a species in the mixture, which can be calculated by
- first summing up [mass fraction / molecular weight] of all species and
- then dividing the same quotient for the individual species by the calculated sum.
This is done automatically by the following function call (including variables and preparation):
Material *mix_mat = mixture_material(Get_Domain(1));
Material *spe_mat = NULL;
real all_mass_fracts[MAX_SPE_EQNS];
real all_mole_fracts[MAX_SPE_EQNS];
int i = -1;
mixture_species_loop(mix_mat, spe_mat, i)
{
all_mass_fracts[i] = C_YI(c,t,i);
}
Mole_Fraction(mix_mat, all_mass_fracts, all_mole_fracts)
After this, the mole fractions of all species can be found in the array "all_mole_fracts".
gearboy is offline   Reply With Quote

Old   March 4, 2010, 11:31
Default
  #4
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Great, Thank you.

This leads me to the question to determine which position in the array corresponds to which species?

Any idea how I can know this?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 4, 2010, 11:59
Default
  #5
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by sega View Post
Great, Thank you.

This leads me to the question to determine which position in the array corresponds to which species?

Any idea how I can know this?
The index of the first species in the list of the Fluent interface is 0.
If the list in the Fluent is : O2, CO, CO2......, then
all_mass_fracts[0] means the mass fraction of O2, all_mass_fracts[1] means that of CO , and so on.
gearboy is offline   Reply With Quote

Old   March 4, 2010, 12:07
Default
  #6
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by gearboy View Post
The index of the first species in the list of the Fluent interface is 0.
If the list in the Fluent is : O2, CO, CO2......, then
all_mass_fracts[0] means the mass fraction of O2, all_mass_fracts[1] means that of CO , and so on.
Ok. I got this.
And how do I know the actual list?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 4, 2010, 12:29
Default
  #7
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Ok. I put this so far into my code

Code:
    Material *mixtureMaterial = mixture_material(Get_Domain(1));
    Material *speciesMaterial = NULL;
    real massFractions[MAX_SPE_EQNS];
    real moleFractions[MAX_SPE_EQNS];
    real partialPressures[MAX_SPE_EQNS];
          
    int i = -1;
    mixture_species_loop(mixtureMaterial, speciesMaterial, i)
    {
        massFractions[i] = C_YI(cell,thread,i);
    }
    
    Mole_Fraction(mixtureMaterial, massFractions, moleFractions);
    
    int i = -1;
    mixture_species_loop(mixtureMaterial, speciesMaterial, i)
    {
        partialPressures[i] = C_P(cell,thread) * moleFractions[i];       
    }
Now the code is killing me. It want's a ; bevor the second int i = -1.
But there is one - right after Mole_Fraction( ... ).

So what may be wrong?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 7, 2010, 05:55
Default How to get partial pressure of oxygen?
  #8
New Member
 
Jamshid Montazer
Join Date: Mar 2010
Location: Norway
Posts: 1
Rep Power: 0
Dr.Montazer is on a distinguished road
Send a message via Skype™ to Dr.Montazer
Hi,

Well, as new member in OpenFoam (days of experience in OpenFoam) I would say using dsmcFoam (Direct simulation Monte Carlo (DSMC) solver for 3D, transient, multi- species flows) might help

Back in my Fluent experience, you have to use the Multiphase model and depends to the nature of component (mixture, Eulerian or VOF) will works fine. Looks the same approach is working in OpenFoam:

-compressibleInterFoam: Solver for 2 compressible, isothermal immiscible fluids using a VOF (volume of fluid) phase-fraction based interface capturing approach, )

More could be find at Standard solvers: http://www.openfoam.com/features/standard-solvers.php
__________________
Dr.Montazer
Norway
Dr.Montazer is offline   Reply With Quote

Old   March 7, 2010, 06:02
Default
  #9
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by Dr.Montazer View Post
Hi,

Well, as new member in OpenFoam (days of experience in OpenFoam) I would say using dsmcFoam (Direct simulation Monte Carlo (DSMC) solver for 3D, transient, multi- species flows) might help

Back in my Fluent experience, you have to use the Multiphase model and depends to the nature of component (mixture, Eulerian or VOF) will works fine. Looks the same approach is working in OpenFoam:

-compressibleInterFoam: Solver for 2 compressible, isothermal immiscible fluids using a VOF (volume of fluid) phase-fraction based interface capturing approach, )

More could be find at Standard solvers: http://www.openfoam.com/features/standard-solvers.php
I'm not sure this is related to the topic.
Maybe you have mixed up your answers ...
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   August 8, 2011, 05:12
Default
  #10
New Member
 
Join Date: Nov 2010
Posts: 19
Rep Power: 15
m.beh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
You can use the following equation
pi=C_P(c,t)*gas_molar_fraction
where, pi is the partial pressure, C_P(c,t) gets the mixed gas pressure.
gas_molar_fraction is the mole fraction of a species in the mixture, which can be calculated by
- first summing up [mass fraction / molecular weight] of all species and
- then dividing the same quotient for the individual species by the calculated sum.
This is done automatically by the following function call (including variables and preparation):
Material *mix_mat = mixture_material(Get_Domain(1));
Material *spe_mat = NULL;
real all_mass_fracts[MAX_SPE_EQNS];
real all_mole_fracts[MAX_SPE_EQNS];
int i = -1;
mixture_species_loop(mix_mat, spe_mat, i)
{
all_mass_fracts[i] = C_YI(c,t,i);
}
Mole_Fraction(mix_mat, all_mass_fracts, all_mole_fracts)
After this, the mole fractions of all species can be found in the array "all_mole_fracts".
Hi every body

I want to have my species' partial pressure but the problem is that I have back flow in my simulating.(I simulate a 2D bubble column). so the static pressure that I recive from (c_P()) is negetive in some cells.
do you think using the absolute of static pressure is ok? my codeis becom:
Po2= abs(C_P(c,t))*mol_fraction_o2
m.beh is offline   Reply With Quote

Old   April 10, 2017, 11:21
Default
  #11
Member
 
Hossein
Join Date: Oct 2010
Location: Greensboro, NC, USA
Posts: 30
Rep Power: 15
hossein65 is on a distinguished road
You can also calculate the molar concentration first:
Code:
mol_conc = yi[0] * C_R(c, t) / mw[0];
where:

mol_conc: molar concentration
yi[PHASE_INDEX]: mass fraction of species i in the phase you are working on
C_R(c, t): MACRO for Gas constan
mw_i [0]: Molecular weight of species i

Then, with the ideas gas law you can convert the molar concentration to partial pressure:

PV=nRT ---> P=\frac{nRT}{V}
P_{i}=(\frac{n}{V})_{i}RT

where (\frac{n}{V})_{i} is the molar concentration calculated above.
Gomaa and souza.emer like this.
__________________
Hossein Amini
PhD student in Biochemical Engineering; Computational Science and Engineering department;
North Carolina Agricultural and Technical State University
hossein65 is offline   Reply With Quote

Old   June 13, 2019, 08:04
Default
  #12
Member
 
Abdullah Arslan
Join Date: Apr 2019
Posts: 94
Rep Power: 6
Goenitz is on a distinguished road
Quote:
Originally Posted by hossein65 View Post
You can also calculate the molar concentration first:
Code:
mol_conc = yi[0] * C_R(c, t) / mw[0];
where:

mol_conc: molar concentration
yi[PHASE_INDEX]: mass fraction of species i in the phase you are working on
C_R(c, t): MACRO for Gas constan
mw_i [0]: Molecular weight of species i

Then, with the ideas gas law you can convert the molar concentration to partial pressure:

PV=nRT ---> P=\frac{nRT}{V}
P_{i}=(\frac{n}{V})_{i}RT

where (\frac{n}{V})_{i} is the molar concentration calculated above.
How to use partial pressure in rate equation? For example As CFX is saying prefix to 'p' is not recognised
LIBRARY:
CEL:
EXPRESSIONS:
kconst=Arr*((CH4.p)^0.47)*((H2O.p)^0.01)
END
END
END

LIBRARY:
CEL:
EXPRESSIONS:
Arr= 0.390 [mol s^-1 Pa^-0.46]
END
END
END

LIBRARY:
CEL:
EXPRESSIONS:
Eact = 43200 [J mol^-1]
END
END
END


LIBRARY:
CEL:
EXPRESSIONS:
Rate= kconst* e^(-Eact/R/T)
END
END
Goenitz is offline   Reply With Quote

Reply

Tags
oxygen, partial pressure

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
Boundary Conditions : Total Pressure or Velocity Gearb0x OpenFOAM Running, Solving & CFD 2 February 28, 2011 22:18
difference between st. pressure and tot pressure jai CFX 7 December 12, 2008 04:11
Pressure Boundary Problems Chris Siemens 2 June 21, 2005 09:20
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


All times are GMT -4. The time now is 01:49.