CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[Other] Multi species mass transport library [update]

Register Blogs Community New Posts Updated Threads Search

Like Tree38Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2012, 06:34
Default Multi species mass transport library [update]
  #1
New Member
 
Valerio Novaresio
Join Date: Mar 2009
Location: Polonghera, Cuneo, Italy
Posts: 27
Rep Power: 17
novyno is on a distinguished road
Dear all,

I'm happy to release an updated version of multi species mass transport library based on "Novaresio V., Garcìa-Camprubì M., Izquierdo S., Asinari P., Fueyo N., An Open-Source Library for the Numerical Modeling of Mass-Transfer in Solid-Oxide Fuel Cells, Computer Physics Communications, Elsevier B.V., pp. 22, 2011, Vol. 183, pag. 125-146, ISSN: 0010-4655, DOI: 10.1016/j.cpc.2011.08.003". I'd like to underline that the contribution of all the authors was fundamental (let me say indispensable...) for the theoretical background of this library.

The library is fully integrated with OpenFOAM-1.6-ext (succesfully tested with "clean" version obtained using git clone git://openfoam-extend.git.sourceforge.net/gitroot/openfoam-extend/OpenFOAM-1.6-ext). The diffusivityModels library contains a series of classes to compute binary diffusion coefficients (ChapmanEnskog, Wilke, Fuller, Constant) and Knudsen diffusion coefficien for porous media. The multiSpeciesTransportModels library contains a series of models to compute diffusive fluxes (SchmidtNumber, LewisNumber, FickDilutedMixture, Fick, MaxwellStefan).

There are few differences between this library and the paper. In attached one can find a short documentation that also describes this differences. The library comes with a solver (a modified version of reactingFoam that can use the multi species mass library) and with a simple test case for methane laminar combustion (special thanks to Silvano Pautasso). The ./install script copies and compiles all files respectively in $FOAM_USER/lib, $FOAM_USER/applications and $FOAM_USER/run.

Probably the code still has some bugs. Any suggestion, feedback. correction or further improvement will be appreciated.

Best regards

Valerio
Attached Files
File Type: zip multiSpeciesMassTransportLibrary.zip (90.7 KB, 1129 views)
File Type: pdf multiSpeciesTransportModels.pdf (34.4 KB, 2032 views)
__________________
...The best way to acquire new knowledge is to share it...
novyno is offline   Reply With Quote

Old   June 14, 2012, 07:56
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
I suggest also putting a link on the wiki: http://openfoamwiki.net/index.php/Main_ContribOther
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   June 14, 2012, 09:24
Default
  #3
New Member
 
Valerio Novaresio
Join Date: Mar 2009
Location: Polonghera, Cuneo, Italy
Posts: 27
Rep Power: 17
novyno is on a distinguished road
Dear Anton,

I will follow your suggestion soon.

Many thanks

Valerio
__________________
...The best way to acquire new knowledge is to share it...
novyno is offline   Reply With Quote

Old   June 14, 2012, 15:11
Default Library conversion to be compatible with OF-12.1.1
  #4
New Member
 
Elhaddad
Join Date: Jun 2012
Posts: 7
Rep Power: 14
AhmedSamy is on a distinguished road
Hi All,
that are really good news, but that will be also nice getting able to run the library under OF-2.1.1.

Many will be happy to read the programmer's suggestions regarding this.

BR
AhmedSamy is offline   Reply With Quote

Old   June 15, 2012, 09:08
Default
  #5
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Im in the process of updating your library to 2.1.x and I have a small question.

For instance, the correct routine in Fick.C show that there is a slight chance of
making an easy mistake, (without knowing probably)

the inert species mass fraction is grabbed from thermo like this.
// Calculate inert species
volScalarField& yInert = thermo_.composition().Y()[inertIndex_];

which is set to 1 - sum of the first N-1 species, like this
yInert = 1 - yt;

since yt is just calculated in the loop
forAll(this->D_, i)

where D is
D_.setSize(species().size()-1);

and it gets the name
"D_" + species()[i],

so D is 1 less than the number of species

Now...if the inert specie is not placed in the last position in the species list,
the inertIndex will point to the wrong specie and it will use the inertspecie to calculate yt...
so basically everything will be a mess.

why dont you do it like in the YEqn.H where you check the name of the species to see if its the same as
the inert specie name
if (Y[i].name() != inertSpecie)
or
if (i != inertIndex_)

to prevent people from making this mistake and allow the inert specie to be placed anywhere in the species list.

just a thought,
N
zhernadi likes this.
niklas is offline   Reply With Quote

Old   June 15, 2012, 10:51
Default
  #6
New Member
 
Valerio Novaresio
Join Date: Mar 2009
Location: Polonghera, Cuneo, Italy
Posts: 27
Rep Power: 17
novyno is on a distinguished road
Dear Niklas,

you are completely right! Actually the library works only if the inert species occupies the last position. But (and I'm sorry for this) I forgot to mention it.

This implementation is a kind of "misprint" of the firsts code versions . This bug fix was on to my to-do list, but I completely forgot it. I will add it again in my new to-do list!

Many thanks to have discovered (and shared) this problem. Surely it will be useful for all people that want to experiment the library.

Thanks again

Valerio
__________________
...The best way to acquire new knowledge is to share it...
novyno is offline   Reply With Quote

Old   June 19, 2012, 23:55
Default
  #7
Member
 
chenxizhong
Join Date: Feb 2012
Posts: 30
Rep Power: 14
chenxizh is on a distinguished road
Dear Niklas, I canot open the pdf file after downloaded , can you check the file or send me a copy, many thanks!
my email is suningchen@gmail.com

Quote:
Originally Posted by novyno View Post
Dear all,

I'm happy to release an updated version of multi species mass transport library based on "Novaresio V., Garcìa-Camprubì M., Izquierdo S., Asinari P., Fueyo N., An Open-Source Library for the Numerical Modeling of Mass-Transfer in Solid-Oxide Fuel Cells, Computer Physics Communications, Elsevier B.V., pp. 22, 2011, Vol. 183, pag. 125-146, ISSN: 0010-4655, DOI: 10.1016/j.cpc.2011.08.003". I'd like to underline that the contribution of all the authors was fundamental (let me say indispensable...) for the theoretical background of this library.

The library is fully integrated with OpenFOAM-1.6-ext (succesfully tested with "clean" version obtained using git clone git://openfoam-extend.git.sourceforge.net/gitroot/openfoam-extend/OpenFOAM-1.6-ext). The diffusivityModels library contains a series of classes to compute binary diffusion coefficients (ChapmanEnskog, Wilke, Fuller, Constant) and Knudsen diffusion coefficien for porous media. The multiSpeciesTransportModels library contains a series of models to compute diffusive fluxes (SchmidtNumber, LewisNumber, FickDilutedMixture, Fick, MaxwellStefan).

There are few differences between this library and the paper. In attached one can find a short documentation that also describes this differences. The library comes with a solver (a modified version of reactingFoam that can use the multi species mass library) and with a simple test case for methane laminar combustion (special thanks to Silvano Pautasso). The ./install script copies and compiles all files respectively in $FOAM_USER/lib, $FOAM_USER/applications and $FOAM_USER/run.

Probably the code still has some bugs. Any suggestion, feedback. correction or further improvement will be appreciated.

Best regards

Valerio
chenxizh is offline   Reply With Quote

Old   June 20, 2012, 09:27
Default
  #8
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Sorry, but I cannot read the pdf either. It says its damaged.
niklas is offline   Reply With Quote

Old   July 17, 2012, 07:18
Default
  #9
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Dear Niklas,
Did you manage to update Novaresio's library into OF 2.1.x? I'd be really interested on it. Does it use cantera for the transport properties?
Regards
Jose
jose_rodrig is offline   Reply With Quote

Old   July 17, 2012, 07:21
Default
  #10
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Quote:
Originally Posted by novyno View Post
Dear all,

I'm happy to release an updated version of multi species mass transport library based on "Novaresio V., Garcìa-Camprubì M., Izquierdo S., Asinari P., Fueyo N., An Open-Source Library for the Numerical Modeling of Mass-Transfer in Solid-Oxide Fuel Cells, Computer Physics Communications, Elsevier B.V., pp. 22, 2011, Vol. 183, pag. 125-146, ISSN: 0010-4655, DOI: 10.1016/j.cpc.2011.08.003". I'd like to underline that the contribution of all the authors was fundamental (let me say indispensable...) for the theoretical background of this library.

The library is fully integrated with OpenFOAM-1.6-ext (succesfully tested with "clean" version obtained using git clone git://openfoam-extend.git.sourceforge.net/gitroot/openfoam-extend/OpenFOAM-1.6-ext). The diffusivityModels library contains a series of classes to compute binary diffusion coefficients (ChapmanEnskog, Wilke, Fuller, Constant) and Knudsen diffusion coefficien for porous media. The multiSpeciesTransportModels library contains a series of models to compute diffusive fluxes (SchmidtNumber, LewisNumber, FickDilutedMixture, Fick, MaxwellStefan).

There are few differences between this library and the paper. In attached one can find a short documentation that also describes this differences. The library comes with a solver (a modified version of reactingFoam that can use the multi species mass library) and with a simple test case for methane laminar combustion (special thanks to Silvano Pautasso). The ./install script copies and compiles all files respectively in $FOAM_USER/lib, $FOAM_USER/applications and $FOAM_USER/run.

Probably the code still has some bugs. Any suggestion, feedback. correction or further improvement will be appreciated.

Best regards

Valerio
Dear Valerio,
Could you kindly re-upload the pdf file you posted on the 1st post to this thread? The original seems to be corrupt.
Thank you!
Regards
Jose
jose_rodrig is offline   Reply With Quote

Old   July 17, 2012, 17:18
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

Well, this was funny... guess what: the 1st PDF file is in fact a DVI file!!!

I opened it easily with Ubuntu's default "Document Viewer" from the Evince authors and was finding it strange that everyone wasn't able to open it. So I then tried with Gimp and it did complain about the bad PDF file.
Tried with pdfedit to open it, same problem. pdf2ps, same deal.

So I then did what I usually do: open the file with a text editor (or hex editor, if necessary) and saw several bytes then something about "TeX" and more bytes... so I then tried dvipdf et voilà, there you have it, the real PDF

Have fun!
Bruno
Attached Files
File Type: pdf multiSpeciesTransportModels_real.pdf (86.8 KB, 1188 views)
kalle, arvindpj, zhangyan and 2 others like this.
__________________
wyldckat is offline   Reply With Quote

Old   July 17, 2012, 17:52
Default
  #12
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
LOL... funny

Thanks Bruno! Looks much better now!
jose_rodrig is offline   Reply With Quote

Old   July 19, 2012, 08:20
Default
  #13
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Hi Again everyone!
I managed to compile Novaresio's library and the modifiedReactingFoam solver.
Now I want to set up a new simulation with Smooke's chemistry scheme but the library needs addtional info in the transportDictionary, namely the collision diameter and the characteristic Lennard-Jones energy of each involving species, to compute the binary diffusion coefficient.

I found in Novaresio's paper the some of these data is tabulated in "Hirshfelder et al., Molecular Theory of Gases and Liquids". However, neither the values he has in example case (supplied with the library) correspond to the ones in the former reference (despeite units), nor I am able to find data for all the species, namely, OH, H2O2, H, O, HCO, etc.

Does anybody have any idea where can I find this data?
Novaresio, could you enlighten me on this? Where did you get your data?

Regards everyone!
jose_rodrig is offline   Reply With Quote

Old   July 19, 2012, 12:55
Default
  #14
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I've been monitoring this thread and am quite interested in experimenting with it. Jose, other than Niklas' comment about the inert species, were there any other fixes required to get it running in 2.1.x? From your earlier comments it appears you were gunning for that.

Thanks!
mturcios777 is offline   Reply With Quote

Old   July 19, 2012, 13:02
Default
  #15
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
I've been monitoring this thread and am quite interested in experimenting with it. Jose, other than Niklas' comment about the inert species, were there any other fixes required to get it running in 2.1.x? From your earlier comments it appears you were gunning for that.

Thanks!
Well, I actually managed to compile it under OF-1.6-ext and not OF-2.1.x. My bad!

If you have any news on this please report them. I am very much interested on it. Anyways, if I have the time and patience, I will try to do it myself.

Regards
jose_rodrig is offline   Reply With Quote

Old   July 19, 2012, 13:08
Default
  #16
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
No worries. I'm sure Niklas would have mentioned something else had he come across it. I've done work with both versions and have some experience adapting between the two, so maybe I'll also tackle it if I find the time (been working on polyTopoChangers in 21x and that's been taking a LOT of time).

Cheers
mturcios777 is offline   Reply With Quote

Old   July 19, 2012, 13:36
Default
  #17
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Hi Again

I am getting a strange error with modifiedReactingFoam solver:

If I try to use a Chemkin file as input for chemical scheme I get this error:

Quote:
Create time

Create mesh for time = 0

Reading chemistry properties


Reading g

Reading thermophysicalProperties
Selecting psiChemistryModel ODEChemistryModel<gasThermoPhysics>
Selecting thermodynamics package hsPsiMixtureThermo<reactingMixture<gasThermoPhysic s>>
Selecting chemistryReader chemkinReader
Selecting chemistrySolver ode
ODEChemistryModel: Number of species = 5 and reactions = 1
Reading field U

Reading/calculating face flux field phi

Creating turbulence model.

Selecting turbulence model type laminar
Creating field DpDt



--> FOAM FATAL ERROR:
C7H16 not found in table. Valid entries:
12
(
OH
N2
CO2
H2O2
O2
H2
CH4
HO2
O
H2O

H
)


From function HashTable<T, Key, Hash>:perator[](const Key&)
in file /data/CFD/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/HashTableI.H at line 111.

FOAM exiting
I wonder what this is...
You can replicate this (i guess) by simply replacing the chemkin file (chem.inp) used in the dieselFoam tutorial distributed with OF by the chemistry used in the modifiedReactingFoam test case. Everything else is untouched.

Cheers
jose_rodrig is offline   Reply With Quote

Old   July 19, 2012, 13:38
Default
  #18
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I think you also need the therm.dat file to get the thermophysical data for C7H16. chem.inp and therm.dat are tied closely together. Check to see if C7H16 is missing from your therm.dat.
mturcios777 is offline   Reply With Quote

Old   July 19, 2012, 14:48
Default
  #19
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Nop, C7H16 is there.
That's why it's really strange. I have no idea why that table has those species loaded. H2, CH4, OH, H2O2 are not even in the reaction file. So it makes no sense that they are in the table. Did you try to replicate the set up?
jose_rodrig is offline   Reply With Quote

Old   July 20, 2012, 04:44
Default
  #20
Member
 
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16
jose_rodrig is on a distinguished road
Quote:
Originally Posted by jose_rodrig View Post
Nop, C7H16 is there.
That's why it's really strange. I have no idea why that table has those species loaded. H2, CH4, OH, H2O2 are not even in the reaction file. So it makes no sense that they are in the table. Did you try to replicate the set up?
I tried to use reactingFoam instead of modifiedReactingFoam and I didnt got the error. So I guess the problem is with the multispecies mass diffusion library. Maybe this table is hardcoded with this species. I will try to investigate the code.

cheers
jose_rodrig 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
Species Mole and Mass Fraction Macro combustion FLUENT 18 February 5, 2024 13:23
UDS and fluent internal species transport model jinsong FLUENT 0 May 3, 2018 12:37
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 23:29
Surface instabilities with 2-phase species transport richard222 Fluent Multiphase 0 May 4, 2016 05:06
Questions for a species transport problems (snapshots attached) aleisia FLUENT 2 October 9, 2011 05:40


All times are GMT -4. The time now is 19:44.