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 |
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& W1 = readScalar(dic.subDict("molarWeight").lookup(name1 )); Code:
const scalar& W2 = readScalar(dic.subDict("molarWeight").lookup(name2)); Code:
molarWeight 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 |
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? |
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 |
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>> |
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 :( |
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?
|
Quote:
|
For example, buoyantSimpleFoam:
Code:
Info<< "Reading thermophysical properties\n" << endl; Tutorial "heatTransfer/buoyantSimpleFoam/hotRoom": Code:
FoamFile |
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) |
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::porousZone’ 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 |
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::DimensionedField <Type, GeoMesh>::mesh [with Type = double, GeoMesh = Foam::volMesh, typename GeoMesh::Mesh = Foam::fvMesh]())->Foam::fvMesh::<anonymous>.Foam::polyMesh::cellZon es()[(& pZones)->Foam::PorousZones<Foam::porousZone>::<anonymous>. Foam::IOPtrList<Foam::porousZone>::<anonymous>.Foa m::PtrList<T>::operator[] [with T = Foam::porousZone, Foam::label = int](zoneI).Foam::porousZone::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 |
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 |
Quote:
|
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? |
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 |
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 |
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 |
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. |
fixedFlux boundary
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 |
All times are GMT -4. The time now is 04:17. |