|
[Sponsors] |
[Other] Multi species mass transport library [update] |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 20, 2012, 04:48 |
|
#21 | |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Quote:
I found a data file with all this info. For those interested, you can find it here: http://diesel.me.berkeley.edu/~gri_m...12/text12.html It has all the data necessary for methane combustion, using the grimech chemical mechanism. It is used for the sandia flame code. Cheers Jose |
||
July 23, 2012, 08:10 |
|
#22 | |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Quote:
So, I found out the code was crashing as it ran lines 65 and 66 in file Wilke.C: Code:
const scalar& W1 = molecularWeights[name1]; const scalar& W2 = molecularWeights[name2]; const scalar& W1 = readScalar(dic.subDict("molarWeight").lookup(name1 )); Code:
const scalar& W2 = readScalar(dic.subDict("molarWeight").lookup(name2)); Code:
molarWeight { C7H16 100; O2 36; CO2 48; H2O 18; N2 38; } I haven't look inside the molecularWeights.C file, where I think the prob is, to find out what is wrong with it and fix it. However, I will had this task to my todo list and, whenever I´ll have the time, I will try to have a look on it. Hope I could help. Cheers Jose |
||
July 23, 2012, 13:53 |
|
#23 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
It seems a shame to have to specify the molecular weights in a dictionary when we should already have the data available through the thermo model. Can we (in general) call
Code:
thermo.composition.W(specI) http://foam.sourceforge.net/docs/cpp...87805d01d0cc28 I'm sure I'm missing something about pointers and casting, but I'm not seeing it. Anyone have ideas? |
|
July 23, 2012, 18:02 |
|
#24 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
Quote:
Now, I haven't checked/looked at the code, but I'm assuming you can't simply use the basic thermo dictionary and will have to use the complex one, namely one of those long ones with the various characteristics for the fluid/gas... Best regards, Bruno
__________________
|
||
July 23, 2012, 18:15 |
|
#25 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Ah, so I need to go deeper in the templatization. Following the inheritance diagram, multiComponentMixture<thermoType> implements the W() function. In createFields for the modified reactingFoam, which I think would be the general purpose type. The modifiedReactingFoam test case uses the thermo model.
Code:
hsPsiMixtureThermo<reactingMixture<gasThermoPhysics>> |
|
July 23, 2012, 18:26 |
|
#26 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Perhaps something similar to:
Code:
hsPsiMixtureThermo<reactingMixture<gasThermoPhysics>>().composition.W(specI) Additionally, the instantiated class might not like the dictionary file if said dictionary is using any other terms from the ones above
__________________
|
|
July 23, 2012, 18:31 |
|
#27 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Bummer. So there isn't a way to call the implemented version of a pure virtual function of a template class without knowing what the implementation will be?
|
|
July 23, 2012, 18:36 |
|
#28 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
It shouldn't be necessary to bother with the details in the solver itself. Other solvers should show that it's as simple as using the correct thermo dictionary options for what you need to solve. What might happen is that some thermo options disregard completely molecular weight and such
__________________
|
|
July 23, 2012, 18:41 |
|
#29 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
For example, buoyantSimpleFoam:
Code:
Info<< "Reading thermophysical properties\n" << endl; autoPtr<basicPsiThermo> pThermo ( basicPsiThermo::New(mesh) ); basicPsiThermo& thermo = pThermo(); //..... volScalarField& p = thermo.p(); volScalarField& h = thermo.h(); const volScalarField& psi = thermo.psi(); Tutorial "heatTransfer/buoyantSimpleFoam/hotRoom": Code:
FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object thermophysicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; pRef 100000; mixture { specie { nMoles 1; molWeight 28.9; } thermodynamics { Cp 1000; Hf 0; } transport { mu 1.8e-05; Pr 0.7; } }
__________________
|
|
July 23, 2012, 19:22 |
|
#30 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Thank you for the explanation. It just seems a bit off to me that a class named basicMultiComponentMixture would have an access function for the molecular weight and not be able to use it.
Doing a quick comparison between versions (as I'm switching between 1.6-ext and 2.1.x until the polyTopoChange/polyTopoChanger mechanisms are fixed), it seems that the function is available in 2.1.x (to accomodate the SLGThermo class I'll bet) but not in 1.6.ext. So if you are using this with 2.1.x, you can get the molecular weights using Code:
composition.W(specI) Last edited by mturcios777; July 23, 2012 at 19:52. Reason: missing statement |
|
November 24, 2012, 16:33 |
|
#31 | |||
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
Quote:
Quote:
Quote:
I tried to compile it using OF2.1.1 but got this error: diffusivityModel/diffusivityModel.C:104:69: error: ‘const class Foam:orousZone’ has no member named ‘zoneId’ It might be because the zoneId is named something else in Of2.1.1! Does anybody have any clue? Thanks |
||||
November 27, 2012, 18:08 |
|
#32 |
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
After looking at the file porousZone.H, I guess I should change "zoneId" to "zoneIds" which I did and now I get the below error:
diffusivityModel/diffusivityModel.C:104:76: error: no match for ‘operator[]’ in ‘(&(& T)->Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::<anonymous>.Foam:imensionedField <Type, GeoMesh>::mesh [with Type = double, GeoMesh = Foam::volMesh, typename GeoMesh::Mesh = Foam::fvMesh]())->Foam::fvMesh::<anonymous>.Foam:olyMesh::cellZon es()[(& pZones)->Foam::PorousZones<Foam:orousZone>::<anonymous>. Foam::IOPtrList<Foam:orousZone>::<anonymous>.Foa m::PtrList<T>:perator[] [with T = Foam:orousZone, Foam::label = int](zoneI).Foam:orousZone::zoneIds]’ The error refers to the part of the code which looks like this: forAll(pZones, zoneI) { const scalar& porosity = pZones[zoneI].porosity(); const labelList& cells = T.mesh().cellZones()[pZones[zoneI].zoneIds()]; forAll(cells, cellI) { eps_[cells[cellI]] = porosity; } } Can anybody help how I can resolve this error? Thanks |
|
November 27, 2012, 18:19 |
|
#33 |
New Member
Join Date: Jul 2010
Posts: 3
Rep Power: 16 |
Hi mhsn,
you have do add a loop over all porosity Zones. forAll(pZones, zoneI) { const labelList& cellZoneIds = pZones[zoneI].zoneIds(); const scalar& porosity = pZones[zoneI].porosity(); forAll(cellZoneIds, zoneJ) { const labelList& cells = T.mesh().cellZones()[cellZoneIds[zoneJ]]; forAll(cells, cellI) { eps_[cells[cellI]] = porosity; } } } BR |
|
November 27, 2012, 18:35 |
|
#34 | |
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
Quote:
|
||
November 27, 2012, 19:30 |
|
#35 |
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
Well, now I'm trying to compile "multiSpeciesTransportModels" and after resolving some errors regarding universal gas constant "R", I see some errors when it tries to read submodels.
Here is what I get: lnInclude/Fick.C:149:19: error: ‘const class Foam::fvMesh’ has no member named ‘relax’ lnInclude/Fick.C:167:19: error: ‘const class Foam::fvMesh’ has no member named ‘relax’ lnInclude/Fick.C:169:28: error: ‘const class Foam::fvMesh’ has no member named ‘relaxationFactor’ and here is what the code looks like at those lines: iline149: f (mesh_.relax("Yi")) { yi.storePrevIter(); } line167: if (mesh_.relax("Yi")) { yi.relax(mesh_.relaxationFactor("Yi")); } I guess from of1.6 to of2.1.1 that relax may be defined differently! IS that right? anyone knows how this can be resolved? Tetraeder, can you help? |
|
November 28, 2012, 15:29 |
|
#36 |
New Member
Join Date: Jul 2010
Posts: 3
Rep Power: 16 |
Hi mhsn,
with if (mesh_.relaxField("Yi")) { yi.storePrevIter(); } ..... if (mesh_.relaxField("Yi")) { yi.relax(mesh_.fieldRelaxationFactor("Yi")); } it should compile in OF 2.1.x BR |
|
November 28, 2012, 16:23 |
|
#37 | |
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
Quote:
Just to learn more for future, how did you find the equivalent member functions in of2.1? I looked into everything and couldn't find them and it was because I didn't know where and what to look for! Another problem, now that I have both libraries compiled, I went to to $FOAM_RUN/../applications and typed wmake modifiedReactingFoam and got this error: modifiedReactingFoam.C:41:40: fatal error: multiSpeciesTransportModel.H: No such file or directory Why can't it find the .H file although I have the my Make/options looks like it addresses that. Here is my Make/options: EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(FOAM_USER_LIBBIN)/../diffusivityModels/lnInclude \ -I$(FOAM_USER_LIBBIN)/../multiSpeciesTransportModels/lnInclude EXE_LIBS = \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lreactionThermophysicalModels \ -lbasicThermophysicalModels \ -lchemistryModel \ -lODE \ -lfiniteVolume \ -llduSolvers \ -L$(FOAM_USER_LIBBIN) \ -lmultiSpeciesTransportModels Will be appreciated if you give me a hint on that too! Thanks again |
||
November 28, 2012, 18:41 |
|
#38 | |
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
Quote:
-I$(FOAM_USER_LIBBIN)/../diffusivityModels/lnInclude \ -I$(FOAM_USER_LIBBIN)/../multiSpeciesTransportModels/lnInclude to: -I$(FOAM_RUN)l/../lib/diffusivityModels/lnInclude \ -I$(FOAM_RUN)/../lib/multiSpeciesTransportModels/lnInclude I had to add some more lines as well, so the error resolved. Now I face this error which I don't understand what it is about: /usr/bin/ld: cannot find -llduSolvers Do you know what it relates to? let me know if you needed more information. Thanks |
||
December 18, 2012, 19:59 |
|
#39 |
New Member
Mhsn
Join Date: Oct 2012
Posts: 24
Rep Power: 14 |
Hey guys, thanks to your help, I could make modifiedReactingFoam work with openFoam2.1.1.
you may have to change some parts to be adapted to your openFoam especially in modifiedReactingFoam/Make/options and modifiedReactingFoam/Make/files let me know if you needed that. I couldn't upload them regarding the maximum limit for the file size. |
|
December 23, 2012, 07:22 |
fixedFlux boundary
|
#40 |
New Member
Join Date: Aug 2010
Posts: 5
Rep Power: 16 |
Dear novyno, dear community,
Great work and thanks for this library! In your publication in Computer Physics Communications, you mention a generic boundary condition for species mass flux, called fixedFlux. Could you please post it here? I would like to use it for part of my bachelor thesis on silicium wafer processing. I am trying to implement a simple surface reaction boundary with a sticking coefficient 0..1 (only valid for Ficks law, similar to the boundary fixedGradient): // Get Species name const word specie_(dimensionedInternalField().name()); // Get p, T, rho, moleFrac, massFrac, Alpha,diffAlpha, molarWeight const fvPatchField<scalar>& p = patch().lookupPatchField<volScalarField, scalar>("p"); const fvPatchField<scalar>& T = patch().lookupPatchField<volScalarField, scalar>("T"); const fvPatchField<scalar>& rho = patch().lookupPatchField<volScalarField, scalar>("rho"); // const fvPatchField<scalar>& massFrac = patch().lookupPatchField<volScalarField, scalar>(specie_); // Mass fraction const fvPatchField<scalar>& moleFrac = patch().lookupPatchField<volScalarField, scalar>("x_"+specie_); // Mole fraction const fvPatchField<scalar>& diffAlpha = patch().lookupPatchField<volScalarField, scalar>("D_"+specie_); // Diffusion constant const scalar molarWeight(molecularWeights[specie_]); // kg/mol // Constants const scalar R(8.3144621); // J/(K*mol) = kg^2*m^2*s^-2*kgmol^-1 const scalar twoPi(6.283185307179586); gradient() = -stickingCoeff_*p*moleFrac / (sqrt(twoPi*molarWeight*R*T) * (rho*diffAlpha)); Unfortunately, in every second iteration, this formula produces a gradient only containing zeros "gradient() 25{-0}" which probably means, moleFrac is exactly zero (unphysical I think). Can somebody help me out please? Thanks a lot, OpenFoamStudent Last edited by openfoamstudents; January 3, 2013 at 07:57. |
|
|
|
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 |